summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorMichael Maltese <mchtly@gmail.com>2017-05-31 16:15:48 -0700
committerMichael Maltese <mchtly@gmail.com>2017-06-05 17:04:29 -0700
commit5a4ee87d6a271a24200d7b599fbdb019cd45ac04 (patch)
treecd3233d90735e9bce1a7597596864c6d3a564c68 /Source/Core
parentd712914d81c84d5bba62bbad2ccd8c717367427e (diff)
DolphinQt2: Settings: emit ThemeChanged signal
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt2/Settings.cpp6
-rw-r--r--Source/Core/DolphinQt2/Settings.h2
-rw-r--r--Source/Core/DolphinQt2/Settings/InterfacePane.cpp5
3 files changed, 11 insertions, 2 deletions
diff --git a/Source/Core/DolphinQt2/Settings.cpp b/Source/Core/DolphinQt2/Settings.cpp
index a1ec7d7b94..cc19bcdd7b 100644
--- a/Source/Core/DolphinQt2/Settings.cpp
+++ b/Source/Core/DolphinQt2/Settings.cpp
@@ -27,6 +27,12 @@ Settings& Settings::Instance()
return settings;
}
+void Settings::SetThemeName(const QString& theme_name)
+{
+ SConfig::GetInstance().theme_name = theme_name.toStdString();
+ emit ThemeChanged();
+}
+
QString Settings::GetThemeDir() const
{
return QString::fromStdString(File::GetThemeDir(SConfig::GetInstance().theme_name));
diff --git a/Source/Core/DolphinQt2/Settings.h b/Source/Core/DolphinQt2/Settings.h
index d7f3dae319..47b9a9656f 100644
--- a/Source/Core/DolphinQt2/Settings.h
+++ b/Source/Core/DolphinQt2/Settings.h
@@ -26,6 +26,7 @@ public:
static Settings& Instance();
// UI
+ void SetThemeName(const QString& theme_name);
QString GetThemeDir() const;
QString GetResourcesDir() const;
QString GetProfilesDir() const;
@@ -109,6 +110,7 @@ public:
void Save();
signals:
+ void ThemeChanged();
void PathAdded(const QString&);
void PathRemoved(const QString&);
diff --git a/Source/Core/DolphinQt2/Settings/InterfacePane.cpp b/Source/Core/DolphinQt2/Settings/InterfacePane.cpp
index fd404fb83c..b6d4bd11f1 100644
--- a/Source/Core/DolphinQt2/Settings/InterfacePane.cpp
+++ b/Source/Core/DolphinQt2/Settings/InterfacePane.cpp
@@ -17,6 +17,8 @@
#include "Common/StringUtil.h"
#include "Core/ConfigManager.h"
+#include "DolphinQt2/Settings.h"
+
InterfacePane::InterfacePane(QWidget* parent) : QWidget(parent)
{
CreateLayout();
@@ -106,7 +108,7 @@ void InterfacePane::ConnectLayout()
connect(m_checkbox_top_window, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_render_to_window, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig);
connect(m_combobox_theme, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::activated),
- [this](const QString& text) { OnSaveConfig(); });
+ &Settings::Instance(), &Settings::SetThemeName);
connect(m_combobox_language, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
[this](int index) { OnSaveConfig(); });
connect(m_checkbox_confirm_on_stop, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig);
@@ -140,7 +142,6 @@ void InterfacePane::OnSaveConfig()
settings.bRenderWindowAutoSize = m_checkbox_auto_window->isChecked();
settings.bKeepWindowOnTop = m_checkbox_top_window->isChecked();
settings.bRenderToMain = m_checkbox_render_to_window->isChecked();
- settings.theme_name = m_combobox_theme->currentText().toStdString();
// In Game Options
settings.bConfirmStop = m_checkbox_confirm_on_stop->isChecked();