mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-26 08:58:22 -04:00
[plasmalnf] Allow filtering the selectable lnf themes
- empty list allows all of them - always suppress hidden, invalid themes, and those named
This commit is contained in:
parent
ad69eda337
commit
6bd8c67ca9
4 changed files with 49 additions and 10 deletions
|
@ -34,11 +34,11 @@ static PlasmaLnfList plasma_themes()
|
||||||
|
|
||||||
for ( const KPluginMetaData& data : pkgs )
|
for ( const KPluginMetaData& data : pkgs )
|
||||||
{
|
{
|
||||||
packages << PlasmaLnfDescriptor{ data.pluginId(), data.name() };
|
if ( data.isValid() && !data.isHidden() && !data.name().isEmpty() )
|
||||||
cDebug() << "LNF Package" << data.pluginId();
|
{
|
||||||
cDebug() << " .." << data.name();
|
packages << PlasmaLnfDescriptor{ data.pluginId(), data.name() };
|
||||||
cDebug() << " .." << data.description();
|
cDebug() << "LNF Package" << data.pluginId();
|
||||||
cDebug() << " .." << 'V' << data.isValid() << 'H' << data.isHidden() << 'D' << data.isEnabledByDefault();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return packages;
|
return packages;
|
||||||
|
@ -55,9 +55,7 @@ PlasmaLnfPage::PlasmaLnfPage( QWidget* parent )
|
||||||
ui->retranslateUi( this );
|
ui->retranslateUi( this );
|
||||||
ui->generalExplanation->setText( tr( "Please choose a look-and-feel for the KDE Plasma Desktop, below." ) );
|
ui->generalExplanation->setText( tr( "Please choose a look-and-feel for the KDE Plasma Desktop, below." ) );
|
||||||
m_availableLnf = plasma_themes();
|
m_availableLnf = plasma_themes();
|
||||||
ui->lnfCombo->clear();
|
winnowThemes();
|
||||||
for ( const auto& p : m_availableLnf )
|
|
||||||
ui->lnfCombo->addItem( p.name );
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -83,3 +81,18 @@ PlasmaLnfPage::setLnfPath( const QString& path )
|
||||||
{
|
{
|
||||||
m_lnfPath = path;
|
m_lnfPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PlasmaLnfPage::setEnabledThemes(const QStringList& themes)
|
||||||
|
{
|
||||||
|
m_enabledThemes = themes;
|
||||||
|
winnowThemes();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlasmaLnfPage::winnowThemes()
|
||||||
|
{
|
||||||
|
ui->lnfCombo->clear();
|
||||||
|
for ( const auto& p : m_availableLnf )
|
||||||
|
if ( m_enabledThemes.isEmpty() || m_enabledThemes.contains( p.id ) )
|
||||||
|
ui->lnfCombo->addItem( p.name );
|
||||||
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
|
@ -43,6 +44,7 @@ public:
|
||||||
explicit PlasmaLnfPage( QWidget* parent = nullptr );
|
explicit PlasmaLnfPage( QWidget* parent = nullptr );
|
||||||
|
|
||||||
void setLnfPath( const QString& path );
|
void setLnfPath( const QString& path );
|
||||||
|
void setEnabledThemes( const QStringList& themes );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void activated( int index );
|
void activated( int index );
|
||||||
|
@ -51,8 +53,11 @@ signals:
|
||||||
void plasmaThemeSelected( const QString& id );
|
void plasmaThemeSelected( const QString& id );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void winnowThemes();
|
||||||
|
|
||||||
Ui::PlasmaLnfPage* ui;
|
Ui::PlasmaLnfPage* ui;
|
||||||
QString m_lnfPath;
|
QString m_lnfPath;
|
||||||
|
QStringList m_enabledThemes;
|
||||||
PlasmaLnfList m_availableLnf;
|
PlasmaLnfList m_availableLnf;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,15 @@ PlasmaLnfViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
if ( configurationMap.contains( "liveuser" ) && configurationMap.value( "liveuser" ).type() == QVariant::String )
|
if ( configurationMap.contains( "liveuser" ) && configurationMap.value( "liveuser" ).type() == QVariant::String )
|
||||||
liveUser = configurationMap.value( "liveuser" ).toString();
|
liveUser = configurationMap.value( "liveuser" ).toString();
|
||||||
m_liveUser = liveUser;
|
m_liveUser = liveUser;
|
||||||
|
|
||||||
|
if ( configurationMap.contains( "themes" ) &&
|
||||||
|
configurationMap.value( "themes" ).type() == QVariant::List )
|
||||||
|
{
|
||||||
|
QStringList enabledThemes( configurationMap.value( "themes" ).toStringList() );
|
||||||
|
if ( enabledThemes.length() == 1 )
|
||||||
|
cDebug() << "WARNING: only one theme enabled in plasmalnf";
|
||||||
|
m_widget->setEnabledThemes( enabledThemes );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1,10 +1,22 @@
|
||||||
---
|
---
|
||||||
# Full path to the Plasma look-and-feel tool (CLI program
|
# Full path to the Plasma look-and-feel tool (CLI program
|
||||||
# for querying and applying Plasma themes).
|
# for querying and applying Plasma themes). If this is not
|
||||||
|
# set, no LNF setting will happen.
|
||||||
lnftool: "/usr/bin/lookandfeeltool"
|
lnftool: "/usr/bin/lookandfeeltool"
|
||||||
|
|
||||||
# For systems where the user Calamares runs as (usually root,
|
# For systems where the user Calamares runs as (usually root,
|
||||||
# via either sudo or pkexec) has a clean environment, set this
|
# via either sudo or pkexec) has a clean environment, set this
|
||||||
# to the originating username; the lnftool will be run through
|
# to the originating username; the lnftool will be run through
|
||||||
# "sudo -H -u <liveuser>" instead of directly.
|
# "sudo -H -u <liveuser>" instead of directly.
|
||||||
liveuser: "live"
|
#
|
||||||
|
# liveuser: "live"
|
||||||
|
|
||||||
|
# You can limit the list of Plasma look-and-feel themes by listing ids
|
||||||
|
# here. If this key is not present, or the list is empty, all of the
|
||||||
|
# installed themes are listed. If only one theme is listed, why are
|
||||||
|
# you using this module at all?
|
||||||
|
#
|
||||||
|
themes:
|
||||||
|
- org.kde.breeze.desktop
|
||||||
|
# - org.kde.breezedark.desktop
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue