Changeset View
Changeset View
Standalone View
Standalone View
src/gtkconfigkcmodule.cpp
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 53 | { | |||
---|---|---|---|---|---|
88 | } | 88 | } | ||
89 | 89 | | |||
90 | ui->gtk2Preview->setVisible(!gtk2Preview.isEmpty()); | 90 | ui->gtk2Preview->setVisible(!gtk2Preview.isEmpty()); | ||
91 | ui->gtk3Preview->setVisible(!gtk3Preview.isEmpty()); | 91 | ui->gtk3Preview->setVisible(!gtk3Preview.isEmpty()); | ||
92 | 92 | | |||
93 | // UI changes | 93 | // UI changes | ||
94 | connect(ui->cb_theme, SIGNAL(currentIndexChanged(int)), this, SLOT(appChanged())); | 94 | connect(ui->cb_theme, SIGNAL(currentIndexChanged(int)), this, SLOT(appChanged())); | ||
95 | connect(ui->cb_theme_gtk3, SIGNAL(currentIndexChanged(int)), this, SLOT(appChanged())); | 95 | connect(ui->cb_theme_gtk3, SIGNAL(currentIndexChanged(int)), this, SLOT(appChanged())); | ||
96 | connect(ui->checkBox_theme_gtk3_prefer_dark, &QAbstractButton::clicked, this, >KConfigKCModule::appChanged); | | |||
97 | 96 | | |||
98 | // Preview updates | 97 | // Preview updates | ||
99 | connect(ui->gtk2Preview, &QAbstractButton::clicked, this, >KConfigKCModule::runGtk2IfNecessary); | 98 | connect(ui->gtk2Preview, &QAbstractButton::clicked, this, >KConfigKCModule::runGtk2IfNecessary); | ||
100 | connect(ui->gtk3Preview, &QAbstractButton::clicked, this, >KConfigKCModule::runGtk3IfNecessary); | 99 | connect(ui->gtk3Preview, &QAbstractButton::clicked, this, >KConfigKCModule::runGtk3IfNecessary); | ||
101 | 100 | | |||
102 | QMenu *m = new QMenu(this); | 101 | QMenu *m = new QMenu(this); | ||
103 | m->addAction(QIcon::fromTheme("get-hot-new-stuff"), i18n("Download GTK2 themes..."), this, >KConfigKCModule::showThemeGHNS); | 102 | m->addAction(QIcon::fromTheme("get-hot-new-stuff"), i18n("Download GTK2 themes..."), this, >KConfigKCModule::showThemeGHNS); | ||
104 | m->addAction(QIcon::fromTheme("get-hot-new-stuff"), i18n("Download GTK3 themes..."), this, >KConfigKCModule::installThemeGTK3GHNS); | 103 | m->addAction(QIcon::fromTheme("get-hot-new-stuff"), i18n("Download GTK3 themes..."), this, >KConfigKCModule::installThemeGTK3GHNS); | ||
Show All 16 Lines | 111 | { | |||
121 | m_p3->waitForFinished(); | 120 | m_p3->waitForFinished(); | ||
122 | delete ui; | 121 | delete ui; | ||
123 | } | 122 | } | ||
124 | 123 | | |||
125 | void GTKConfigKCModule::syncUI() | 124 | void GTKConfigKCModule::syncUI() | ||
126 | { | 125 | { | ||
127 | appareance->setThemeGtk3(ui->cb_theme_gtk3->currentText()); | 126 | appareance->setThemeGtk3(ui->cb_theme_gtk3->currentText()); | ||
128 | appareance->setTheme(ui->cb_theme->currentText()); | 127 | appareance->setTheme(ui->cb_theme->currentText()); | ||
129 | appareance->setApplicationPreferDarkTheme(ui->checkBox_theme_gtk3_prefer_dark->isChecked()); | | |||
130 | } | 128 | } | ||
131 | 129 | | |||
132 | void GTKConfigKCModule::showThemeGHNS() | 130 | void GTKConfigKCModule::showThemeGHNS() | ||
133 | { | 131 | { | ||
134 | KNS3::DownloadDialog d("cgctheme.knsrc", this); | 132 | KNS3::DownloadDialog d("cgctheme.knsrc", this); | ||
135 | if(d.exec()) { | 133 | if(d.exec()) { | ||
136 | refreshLists(); | 134 | refreshLists(); | ||
137 | } | 135 | } | ||
▲ Show 20 Lines • Show All 205 Lines • ▼ Show 20 Line(s) | 340 | refreshComboSameCurrentValue(ui->cb_theme, | |||
343 | useConfig ? appareance->getTheme() : ui->cb_theme->currentText(), | 341 | useConfig ? appareance->getTheme() : ui->cb_theme->currentText(), | ||
344 | appareance->gtk2Appearance()->installedThemesNames()); | 342 | appareance->gtk2Appearance()->installedThemesNames()); | ||
345 | 343 | | |||
346 | // Theme gtk3 | 344 | // Theme gtk3 | ||
347 | refreshComboSameCurrentValue(ui->cb_theme_gtk3, | 345 | refreshComboSameCurrentValue(ui->cb_theme_gtk3, | ||
348 | useConfig ? appareance->getThemeGtk3() : ui->cb_theme_gtk3->currentText(), | 346 | useConfig ? appareance->getThemeGtk3() : ui->cb_theme_gtk3->currentText(), | ||
349 | appareance->gtk3Appearance()->installedThemesNames()); | 347 | appareance->gtk3Appearance()->installedThemesNames()); | ||
350 | 348 | | |||
351 | // Dark theme for gtk3 | | |||
352 | ui->checkBox_theme_gtk3_prefer_dark->setChecked(appareance->getApplicationPreferDarkTheme()); | | |||
353 | | ||||
354 | | ||||
355 | m_saveEnabled = wasenabled; | 349 | m_saveEnabled = wasenabled; | ||
356 | emit changed(true); | 350 | emit changed(true); | ||
357 | } | 351 | } | ||
358 | 352 | | |||
359 | void GTKConfigKCModule::showDialogForInstall() | 353 | void GTKConfigKCModule::showDialogForInstall() | ||
360 | { | 354 | { | ||
361 | if(!installer) { | 355 | if(!installer) { | ||
362 | installer = new DialogInstaller(this); | 356 | installer = new DialogInstaller(this); | ||
Show All 30 Lines |