diff --git a/src/gui/formsettings.cpp b/src/gui/formsettings.cpp index 080d15058..86a97cf00 100755 --- a/src/gui/formsettings.cpp +++ b/src/gui/formsettings.cpp @@ -104,6 +104,14 @@ FormSettings::FormSettings(QWidget *parent) : QDialog(parent), m_ui(new Ui::Form this, SLOT(onMysqlPasswordChanged(QString))); connect(m_ui->m_btnMysqlTestSetup, SIGNAL(clicked()), this, SLOT(mysqlTestConnection())); + connect(m_ui->m_spinMysqlPort, SIGNAL(editingFinished()), + this, SLOT(onMysqlDataStorageEdited())); + connect(m_ui->m_txtMysqlHostname->lineEdit(), SIGNAL(textEdited(QString)), + this, SLOT(onMysqlDataStorageEdited())); + connect(m_ui->m_txtMysqlPassword->lineEdit(), SIGNAL(textEdited(QString)), + this, SLOT(onMysqlDataStorageEdited())); + connect(m_ui->m_txtMysqlUsername->lineEdit(), SIGNAL(textEdited(QString)), + this, SLOT(onMysqlDataStorageEdited())); // Load all settings. loadGeneral(); @@ -491,7 +499,8 @@ void FormSettings::saveDataStorage() { Settings::instance()->setValue(APP_CFG_DB, "database_driver", selected_db_driver); - if (original_db_driver != selected_db_driver) { + if (original_db_driver != selected_db_driver || + m_initialSettings.m_mysqlDataStorageChanged) { m_changedDataTexts.append(tr("data storage backend changed")); } } @@ -539,6 +548,10 @@ void FormSettings::onMysqlPasswordChanged(const QString &new_password) { } } +void FormSettings::onMysqlDataStorageEdited() { + m_initialSettings.m_mysqlDataStorageChanged = true; +} + void FormSettings::loadGeneral() { // Load auto-start status. SystemFactory::AutoStartStatus autostart_status = SystemFactory::instance()->getAutoStartStatus(); diff --git a/src/gui/formsettings.h b/src/gui/formsettings.h index f83355260..9eb169a10 100644 --- a/src/gui/formsettings.h +++ b/src/gui/formsettings.h @@ -15,10 +15,12 @@ struct TemporarySettings { public: TemporarySettings() - : m_webBrowserProgress(QColor()) { + : m_webBrowserProgress(QColor()), + m_mysqlDataStorageChanged(false) { } QColor m_webBrowserProgress; + bool m_mysqlDataStorageChanged; }; class FormSettings : public QDialog { @@ -58,6 +60,7 @@ class FormSettings : public QDialog { void onMysqlHostnameChanged(const QString &new_hostname); void onMysqlUsernameChanged(const QString &new_username); void onMysqlPasswordChanged(const QString &new_password); + void onMysqlDataStorageEdited(); void loadLanguage(); void saveLanguage();