diff options
Diffstat (limited to 'src/ui/dialog/Wizard.cpp')
-rw-r--r-- | src/ui/dialog/Wizard.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/ui/dialog/Wizard.cpp b/src/ui/dialog/Wizard.cpp index bdb7a669..65a5d822 100644 --- a/src/ui/dialog/Wizard.cpp +++ b/src/ui/dialog/Wizard.cpp @@ -48,8 +48,10 @@ Wizard::Wizard(QWidget* parent) : QWizard(parent) { setPixmap(QWizard::LogoPixmap, QPixmap(":/logo_small.png")); setPixmap(QWizard::BannerPixmap, QPixmap(":/banner.png")); - int next_page_id = GlobalSettingStation::GetInstance().LookupSettings( - "wizard.next_page", -1); + int next_page_id = GlobalSettingStation::GetInstance() + .GetSettings() + .value("wizard.next_page", -1) + .toInt(); setStartId(next_page_id); connect(this, &Wizard::accepted, this, &Wizard::slot_wizard_accepted); @@ -58,17 +60,8 @@ Wizard::Wizard(QWidget* parent) : QWizard(parent) { void Wizard::slot_wizard_accepted() { // Don't show is mapped to show -> negation try { - auto& settings = GlobalSettingStation::GetInstance().GetMainSettings(); - if (!settings.exists("wizard")) { - settings.add("wizard", libconfig::Setting::TypeGroup); - } - auto& wizard = settings["wizard"]; - if (!wizard.exists("show_wizard")) { - wizard.add("show_wizard", libconfig::Setting::TypeBoolean) = false; - } else { - wizard["show_wizard"] = false; - } - GlobalSettingStation::GetInstance().SyncSettings(); + auto settings = GlobalSettingStation::GetInstance().GetSettings(); + settings.setValue("wizard/show_wizard", false); } catch (...) { GF_UI_LOG_ERROR("setting operation error"); } |