From 231f90a8e5bbb633bd88c35543c0d4c3c5e35c1b Mon Sep 17 00:00:00 2001 From: Weslly Date: Wed, 28 Jun 2017 17:09:32 -0300 Subject: [PATCH] Fix apply button on settings window --- src/gui/MainWindow.cpp | 4 +++- src/gui/SettingsWidget.cpp | 4 +--- src/gui/SettingsWidget.h | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 7027d94c2..0d40e89e8 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -240,8 +240,10 @@ MainWindow::MainWindow() SLOT(databaseStatusChanged(DatabaseWidget*))); connect(m_ui->stackedWidget, SIGNAL(currentChanged(int)), SLOT(setMenuActionState())); connect(m_ui->stackedWidget, SIGNAL(currentChanged(int)), SLOT(updateWindowTitle())); - connect(m_ui->settingsWidget, SIGNAL(editFinished(bool)), SLOT(switchToDatabases())); connect(m_ui->settingsWidget, SIGNAL(accepted()), SLOT(applySettingsChanges())); + connect(m_ui->settingsWidget, SIGNAL(apply()), SLOT(applySettingsChanges())); + connect(m_ui->settingsWidget, SIGNAL(accepted()), SLOT(switchToDatabases())); + connect(m_ui->settingsWidget, SIGNAL(rejected()), SLOT(switchToDatabases())); connect(m_ui->actionDatabaseNew, SIGNAL(triggered()), m_ui->tabWidget, SLOT(newDatabase())); diff --git a/src/gui/SettingsWidget.cpp b/src/gui/SettingsWidget.cpp index e8fe9fcb9..185372beb 100644 --- a/src/gui/SettingsWidget.cpp +++ b/src/gui/SettingsWidget.cpp @@ -68,6 +68,7 @@ SettingsWidget::SettingsWidget(QWidget* parent) } connect(this, SIGNAL(accepted()), SLOT(saveSettings())); + connect(this, SIGNAL(apply()), SLOT(saveSettings())); connect(this, SIGNAL(rejected()), SLOT(reject())); connect(m_generalUi->autoSaveAfterEveryChangeCheckBox, SIGNAL(toggled(bool)), @@ -213,8 +214,6 @@ void SettingsWidget::saveSettings() for (const ExtraPage& page: asConst(m_extraPages)) { page.saveSettings(); } - - emit editFinished(true); } void SettingsWidget::reject() @@ -224,7 +223,6 @@ void SettingsWidget::reject() autoType()->registerGlobalShortcut(m_globalAutoTypeKey, m_globalAutoTypeModifiers); } - emit editFinished(false); } void SettingsWidget::enableAutoSaveOnExit(bool checked) diff --git a/src/gui/SettingsWidget.h b/src/gui/SettingsWidget.h index f2fc9f2db..27566037d 100644 --- a/src/gui/SettingsWidget.h +++ b/src/gui/SettingsWidget.h @@ -46,9 +46,6 @@ public: void addSettingsPage(ISettingsPage * page); void loadSettings(); -signals: - void editFinished(bool accepted); - private slots: void saveSettings(); void reject();