From ddc34803a0f4fc75dc185f3b75de9060afee8cab Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 26 Aug 2016 13:36:51 +0300 Subject: [PATCH] Fix issue with Config dialog Apply button. In some cases the Apply or OK buttons will not save settings because of section that was active in the moment of applying. For example made change in one section, change to another and click Apply. The change will not be applied. --HG-- branch : develop --- src/app/tape/dialogs/tapeconfigdialog.cpp | 14 +++--------- src/app/valentina/dialogs/configdialog.cpp | 22 +++++-------------- .../dialogs/configpages/communitypage.cpp | 1 - 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/src/app/tape/dialogs/tapeconfigdialog.cpp b/src/app/tape/dialogs/tapeconfigdialog.cpp index 833761b46..457a79e4c 100644 --- a/src/app/tape/dialogs/tapeconfigdialog.cpp +++ b/src/app/tape/dialogs/tapeconfigdialog.cpp @@ -190,17 +190,9 @@ void TapeConfigDialog::createIcon(const QString &icon, const QString &text) //--------------------------------------------------------------------------------------------------------------------- void TapeConfigDialog::Apply() { - switch (contentsWidget->currentRow()) - { - case (0): - configurationPage->Apply(); - break; - case (1): - pathPage->Apply(); - break; - default: - break; - } + configurationPage->Apply(); + pathPage->Apply(); + qApp->TapeSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c()); emit UpdateProperties(); setResult(QDialog::Accepted); diff --git a/src/app/valentina/dialogs/configdialog.cpp b/src/app/valentina/dialogs/configdialog.cpp index 75be4fd14..5e12c1c10 100644 --- a/src/app/valentina/dialogs/configdialog.cpp +++ b/src/app/valentina/dialogs/configdialog.cpp @@ -191,23 +191,11 @@ void ConfigDialog::createIcon(const QString &icon, const QString &text) //--------------------------------------------------------------------------------------------------------------------- void ConfigDialog::Apply() { - switch (contentsWidget->currentRow()) - { - case (0): - configurationPage->Apply(); - break; - case (1): - patternPage->Apply(); - break; - case (2): - communityPage->Apply(); - break; - case (3): - pathPage->Apply(); - break; - default: - break; - } + configurationPage->Apply(); + patternPage->Apply(); + communityPage->Apply(); + pathPage->Apply(); + qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c()); emit UpdateProperties(); setResult(QDialog::Accepted); diff --git a/src/app/valentina/dialogs/configpages/communitypage.cpp b/src/app/valentina/dialogs/configpages/communitypage.cpp index 8b7206e91..7893e5259 100644 --- a/src/app/valentina/dialogs/configpages/communitypage.cpp +++ b/src/app/valentina/dialogs/configpages/communitypage.cpp @@ -90,7 +90,6 @@ void CommunityPage::Apply() settings->SetUsername(this->username->text()); settings->SetSavePassword(this->savePassword->isChecked()); settings->SetUserPassword(this->userpassword->text()); - } //---------------------------------------------------------------------------------------------------------------------