From 3843864ff96444544662a7c191b279c9332dd06e Mon Sep 17 00:00:00 2001 From: xarkes Date: Thu, 1 Mar 2018 16:30:31 +0100 Subject: [PATCH] Remember color scheme on exit --- src/dialogs/preferences/GeneralOptionsWidget.cpp | 3 +++ src/utils/Configuration.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/dialogs/preferences/GeneralOptionsWidget.cpp b/src/dialogs/preferences/GeneralOptionsWidget.cpp index 0d40e91e..1ada10cb 100644 --- a/src/dialogs/preferences/GeneralOptionsWidget.cpp +++ b/src/dialogs/preferences/GeneralOptionsWidget.cpp @@ -32,6 +32,8 @@ void GeneralOptionsWidget::updateFontFromConfig() void GeneralOptionsWidget::updateThemeFromConfig() { + // Disconnect currentIndexChanged because clearing the comboxBox and refiling it causes its index to change. + disconnect(ui->colorComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_colorComboBox_currentIndexChanged(int))); ui->themeComboBox->setCurrentIndex(Config()->getDarkTheme() ? 1 : 0); QList themes = Core()->getColorThemes(); @@ -42,6 +44,7 @@ void GeneralOptionsWidget::updateThemeFromConfig() QString curTheme = Config()->getCurrentTheme(); int index = themes.indexOf(curTheme) + 1; ui->colorComboBox->setCurrentIndex(index); + connect(ui->colorComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_colorComboBox_currentIndexChanged(int))); } void GeneralOptionsWidget::on_fontSelectionButton_clicked() diff --git a/src/utils/Configuration.cpp b/src/utils/Configuration.cpp index c7e12b54..dafee172 100644 --- a/src/utils/Configuration.cpp +++ b/src/utils/Configuration.cpp @@ -23,6 +23,11 @@ Configuration* Configuration::instance() void Configuration::loadInitial() { setDarkTheme(getDarkTheme()); + QString theme = s.value("theme").toString(); + if (theme != "default") + { + Core()->cmd(QString("eco %1").arg(theme)); + } } void Configuration::resetAll()