@ -23,6 +23,8 @@
# include "utils/Logger.h"
# include "utils/Retranslator.h"
# include <QAbstractButton>
# include <KPackage/Package>
# include <KPackage/PackageLoader>
@ -55,13 +57,18 @@ static ThemeInfoList plasma_themes()
PlasmaLnfPage : : PlasmaLnfPage ( QWidget * parent )
: QWidget ( parent )
, ui ( new Ui : : PlasmaLnfPage )
, m_showAll ( false )
, m_buttonGroup ( nullptr )
{
ui - > setupUi ( this ) ;
CALAMARES_RETRANSLATE (
{
ui - > retranslateUi ( this ) ;
ui - > generalExplanation - > setText ( tr ( " Please choose a look-and-feel for the KDE Plasma Desktop. You can also skip this step and configure the look-and-feel once the system is installed. " ) ) ;
ui - > generalExplanation - > setText ( tr (
" Please choose a look-and-feel for the KDE Plasma Desktop. "
" You can also skip this step and configure the look-and-feel "
" once the system is installed. Clicking on a look-and-feel "
" selection will give you a live preview of that look-and-feel. " ) ) ;
updateThemeNames ( ) ;
fillUi ( ) ;
}
@ -75,10 +82,18 @@ PlasmaLnfPage::setLnfPath( const QString& path )
}
void
PlasmaLnfPage : : setEnabledThemes ( const ThemeInfoList & themes )
PlasmaLnfPage : : setEnabledThemes ( const ThemeInfoList & themes , bool showAll )
{
m_enabledThemes = themes ;
if ( showAll )
{
auto plasmaThemes = plasma_themes ( ) ;
for ( auto & installed_theme : plasmaThemes )
if ( ! m_enabledThemes . findById ( installed_theme . id ) )
m_enabledThemes . append ( installed_theme ) ;
}
updateThemeNames ( ) ;
winnowThemes ( ) ;
fillUi ( ) ;
@ -87,9 +102,18 @@ PlasmaLnfPage::setEnabledThemes(const ThemeInfoList& themes)
void
PlasmaLnfPage : : setEnabledThemesAll ( )
{
setEnabledThemes ( plasma_themes ( ) ) ;
// Don't need to set showAll=true, because we're already passing in
// the complete list of installed themes.
setEnabledThemes ( plasma_themes ( ) , false ) ;
}
void
PlasmaLnfPage : : setPreselect ( const QString & id )
{
m_preselect = id ;
if ( ! m_enabledThemes . isEmpty ( ) )
fillUi ( ) ;
}
void PlasmaLnfPage : : updateThemeNames ( )
{
@ -162,6 +186,11 @@ void PlasmaLnfPage::fillUi()
{
theme . widget - > updateThemeName ( theme ) ;
}
if ( theme . id = = m_preselect )
{
const QSignalBlocker b ( theme . widget - > button ( ) ) ;
theme . widget - > button ( ) - > setChecked ( true ) ;
}
+ + c ;
}
}