X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fappearancesettingspage.cpp;h=ab39344aa43dd46a2f8d39a6975cbaefadc70db2;hp=e33381696877bf2405b941892e71b445e7b98a6f;hb=3f354bcce2cecfe88a46de90cbf94ffd1bc7c506;hpb=9fb25d34cfc4dee02159b112c72e018c6e26e63f diff --git a/src/qtui/settingspages/appearancesettingspage.cpp b/src/qtui/settingspages/appearancesettingspage.cpp index e3338169..ab39344a 100644 --- a/src/qtui/settingspages/appearancesettingspage.cpp +++ b/src/qtui/settingspages/appearancesettingspage.cpp @@ -27,6 +27,7 @@ #include "qtuistyle.h" #include "util.h" +#include #include #include #include @@ -34,7 +35,7 @@ #include AppearanceSettingsPage::AppearanceSettingsPage(QWidget *parent) - : SettingsPage(tr("Appearance"), QString(), parent), + : SettingsPage(tr("Interface"), QString(), parent), _fontsChanged(false) { ui.setupUi(this); @@ -42,11 +43,6 @@ AppearanceSettingsPage::AppearanceSettingsPage(QWidget *parent) initStyleComboBox(); initLanguageComboBox(); -#ifndef HAVE_WEBKIT - ui.showWebPreview->hide(); - ui.showWebPreview->setEnabled(false); -#endif - foreach(QComboBox *comboBox, findChildren()) { connect(comboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(widgetHasChanged())); } @@ -57,10 +53,8 @@ AppearanceSettingsPage::AppearanceSettingsPage(QWidget *parent) mapper = new QSignalMapper(this); connect(mapper, SIGNAL(mapped(QWidget *)), this, SLOT(chooseFont(QWidget *))); - connect(ui.chooseBufferView, SIGNAL(clicked()), mapper, SLOT(map())); connect(ui.chooseInputLine, SIGNAL(clicked()), mapper, SLOT(map())); - mapper->setMapping(ui.chooseBufferView, ui.demoBufferView); mapper->setMapping(ui.chooseInputLine, ui.demoInputLine); connect(ui.chooseStyleSheet, SIGNAL(clicked()), SLOT(chooseStyleSheet())); @@ -92,8 +86,6 @@ void AppearanceSettingsPage::defaults() { loadFonts(Settings::Default); _fontsChanged = true; - ui.showUserStateIcons->setChecked(true); - SettingsPage::defaults(); widgetHasChanged(); } @@ -122,9 +114,6 @@ void AppearanceSettingsPage::load() { ui.languageComboBox->setProperty("storedValue", ui.languageComboBox->currentIndex()); Quassel::loadTranslation(selectedLocale()); - BufferSettings bufferSettings; - SettingsPage::load(ui.showUserStateIcons, bufferSettings.showUserStateIcons()); - loadFonts(Settings::Custom); SettingsPage::load(); @@ -139,14 +128,6 @@ void AppearanceSettingsPage::loadFonts(Settings::Mode mode) { inputLineFont = s.value("InputLine", QFont()).value(); setFont(ui.demoInputLine, inputLineFont); - QFont bufferViewFont; - if(mode == Settings::Custom) - bufferViewFont = s.value("BufferView", QFont()).value(); - setFont(ui.demoBufferView, bufferViewFont); - - //QTextCharFormat chatFormat = QtUi::style()->cachedFormat(UiStyle::None, 0); // FIXME - //setFont(ui.demoChatView, chatFormat.font()); - _fontsChanged = false; } @@ -165,9 +146,6 @@ void AppearanceSettingsPage::save() { uiSettings.setValue("Locale", selectedLocale()); } - BufferSettings bufferSettings; - bufferSettings.enableUserStateIcons(ui.showUserStateIcons->isChecked()); - // Fonts QtUiStyleSettings fontSettings("Fonts"); if(ui.demoInputLine->font() != QApplication::font()) @@ -175,19 +153,16 @@ void AppearanceSettingsPage::save() { else fontSettings.setValue("InputLine", ""); - if(ui.demoBufferView->font() != QApplication::font()) - fontSettings.setValue("BufferView", ui.demoBufferView->font()); - else - fontSettings.setValue("BufferView", ""); - - //QTextCharFormat chatFormat = QtUi::style()->format(UiStyle::None); - //chatFormat.setFont(ui.demoChatView->font()); - //QtUi::style()->setFormat(UiStyle::None, chatFormat, Settings::Custom); - _fontsChanged = false; + bool needsStyleReload = + ui.useCustomStyleSheet->isChecked() != ui.useCustomStyleSheet->property("storedValue").toBool() + || (ui.useCustomStyleSheet->isChecked() && ui.customStyleSheetPath->text() != ui.customStyleSheetPath->property("storedValue").toString()); + SettingsPage::save(); setChangedState(false); + if(needsStyleReload) + QtUi::style()->reload(); } QLocale AppearanceSettingsPage::selectedLocale() const { @@ -240,7 +215,5 @@ bool AppearanceSettingsPage::testHasChanged() { if(selectedLocale() != QLocale()) return true; // QLocale() returns the default locale (manipulated via loadTranslation()) - if(SettingsPage::hasChanged(ui.showUserStateIcons)) return true; - return false; }