Apply settings immediately

This commit is contained in:
Jonas Kvinge 2019-04-21 03:15:35 +02:00
parent 4cc926a627
commit 2d3509ae56
3 changed files with 5 additions and 0 deletions

View File

@ -2117,6 +2117,7 @@ SettingsDialog *MainWindow::CreateSettingsDialog() {
// Settings // Settings
connect(settings_dialog, SIGNAL(accepted()), SLOT(ReloadAllSettings())); connect(settings_dialog, SIGNAL(accepted()), SLOT(ReloadAllSettings()));
connect(settings_dialog, SIGNAL(ReloadSettings()), SLOT(ReloadAllSettings()));
// Allows custom notification preview // Allows custom notification preview
connect(settings_dialog, SIGNAL(NotificationPreview(OSD::Behaviour, QString, QString)), SLOT(HandleNotificationPreview(OSD::Behaviour, QString, QString))); connect(settings_dialog, SIGNAL(NotificationPreview(OSD::Behaviour, QString, QString)), SLOT(HandleNotificationPreview(OSD::Behaviour, QString, QString)));

View File

@ -232,9 +232,12 @@ void SettingsDialog::AddPage(Page id, SettingsPage *page, QTreeWidgetItem *paren
} }
void SettingsDialog::Save() { void SettingsDialog::Save() {
for (const PageData &data : pages_.values()) { for (const PageData &data : pages_.values()) {
data.page_->Save(); data.page_->Save();
} }
emit ReloadSettings();
} }
void SettingsDialog::accept() { void SettingsDialog::accept() {

View File

@ -113,6 +113,7 @@ class SettingsDialog : public QDialog {
void ComboBoxLoadFromSettings(QSettings &s, QComboBox *combobox, QString setting, QString default_value); void ComboBoxLoadFromSettings(QSettings &s, QComboBox *combobox, QString setting, QString default_value);
signals: signals:
void ReloadSettings();
void NotificationPreview(OSD::Behaviour, QString, QString); void NotificationPreview(OSD::Behaviour, QString, QString);
private slots: private slots: