return false;
}
+ // Checking if settings Icon Theme is valid
+ QString savedIcontheme = QtUiSettings().value("IconTheme", QVariant("")).toString();
+#ifndef WITH_OXYGEN
+ if (savedIcontheme == "oxygen")
+ QtUiSettings().remove("IconTheme");
+#endif
+#ifndef WITH_BREEZE
+ if (savedIcontheme == "breeze")
+ QtUiSettings().remove("IconTheme");
+#endif
+#ifndef WITH_BREEZE_DARK
+ if (savedIcontheme == "breezedark")
+ QtUiSettings().remove("IconTheme");
+#endif
+
// Set the icon theme
if (Quassel::isOptionSet("icontheme"))
QIcon::setThemeName(Quassel::optionValue("icontheme"));
+ else if (QtUiSettings().value("IconTheme", QVariant("")).toString() != "")
+ QIcon::setThemeName(QtUiSettings().value("IconTheme").toString());
else if (QIcon::themeName().isEmpty())
// Some platforms don't set a default icon theme; chances are we can find our bundled Oxygen theme though
QIcon::setThemeName("oxygen");
initAutoWidgets();
initStyleComboBox();
initLanguageComboBox();
+ initIconThemeComboBox();
foreach(QComboBox *comboBox, findChildren<QComboBox *>()) {
connect(comboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(widgetHasChanged()));
}
}
+void AppearanceSettingsPage::initIconThemeComboBox()
+{
+#if defined WITH_OXYGEN || defined WITH_BREEZE || defined WITH_BREEZE_DARK
+# if defined WITH_OXYGEN
+ ui.iconthemeComboBox->addItem(tr("Oxygen"), QVariant("oxygen"));
+# endif
+# if defined WITH_BREEZE
+ ui.iconthemeComboBox->addItem(tr("Breeze Light"), QVariant("breeze"));
+# endif
+# if defined WITH_BREEZE_DARK
+ ui.iconthemeComboBox->addItem(tr("Breeze Dark"), QVariant("breezedark"));
+# endif
+#else
+ ui.iconthemeComboBox->hide();
+#endif
+}
+
void AppearanceSettingsPage::defaults()
{
ui.languageComboBox->setProperty("storedValue", ui.languageComboBox->currentIndex());
Quassel::loadTranslation(selectedLocale());
+ // IconTheme
+ QString icontheme = uiSettings.value("IconTheme", QVariant("")).toString();
+ if (icontheme == "")
+ ui.iconthemeComboBox->setCurrentIndex(0);
+ else
+ ui.iconthemeComboBox->setCurrentIndex(ui.iconthemeComboBox->findData(icontheme));
+ ui.iconthemeComboBox->setProperty("storedValue", ui.iconthemeComboBox->currentIndex());
+
// bufferSettings:
BufferSettings bufferSettings;
int redirectTarget = bufferSettings.userNoticesTarget();
}
ui.languageComboBox->setProperty("storedValue", ui.languageComboBox->currentIndex());
+ if (selectedIconTheme()=="") {
+ uiSettings.remove("IconTheme");
+ }
+ else {
+ uiSettings.setValue("IconTheme", selectedIconTheme());
+ QIcon::setThemeName(selectedIconTheme());
+ }
+ ui.iconthemeComboBox->setProperty("storedValue", ui.iconthemeComboBox->currentIndex());
+
bool needsStyleReload =
ui.useCustomStyleSheet->isChecked() != ui.useCustomStyleSheet->property("storedValue").toBool()
|| (ui.useCustomStyleSheet->isChecked() && ui.customStyleSheetPath->text() != ui.customStyleSheetPath->property("storedValue").toString());
return locale;
}
+QString AppearanceSettingsPage::selectedIconTheme() const
+{
+ return ui.iconthemeComboBox->itemData(ui.iconthemeComboBox->currentIndex()).toString();
+}
void AppearanceSettingsPage::chooseStyleSheet()
{
{
if (ui.styleComboBox->currentIndex() != ui.styleComboBox->property("storedValue").toInt()) return true;
if (ui.languageComboBox->currentIndex() != ui.languageComboBox->property("storedValue").toInt()) return true;
+ if (ui.iconthemeComboBox->currentIndex() != ui.iconthemeComboBox->property("storedValue").toInt()) return true;
if (SettingsPage::hasChanged(ui.userNoticesInStatusBuffer)) return true;
if (SettingsPage::hasChanged(ui.userNoticesInDefaultBuffer)) return true;