aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/Wizard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/dialog/Wizard.cpp')
-rw-r--r--src/ui/dialog/Wizard.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/ui/dialog/Wizard.cpp b/src/ui/dialog/Wizard.cpp
index 3a3c0800..8e77dada 100644
--- a/src/ui/dialog/Wizard.cpp
+++ b/src/ui/dialog/Wizard.cpp
@@ -29,14 +29,16 @@
#include "Wizard.h"
#include "core/function/GlobalSettingStation.h"
+#include "ui/GpgFrontendUI.h"
+#include "ui/dialog/key_generate/KeyGenerateDialog.h"
namespace GpgFrontend::UI {
Wizard::Wizard(QWidget* parent) : QWizard(parent) {
- setPage(Page_Intro, new IntroPage(this));
- setPage(Page_Choose, new ChoosePage(this));
- setPage(Page_GenKey, new KeyGenPage(this));
- setPage(Page_Conclusion, new ConclusionPage(this));
+ setPage(kPAGE_INTRO, new IntroPage(this));
+ setPage(kPAGE_CHOOSE, new ChoosePage(this));
+ setPage(kPAGE_GEN_KEY, new KeyGenPage(this));
+ setPage(kPAGE_CONCLUSION, new ConclusionPage(this));
#ifndef Q_WS_MAC
setWizardStyle(ModernStyle);
#endif
@@ -45,10 +47,7 @@ Wizard::Wizard(QWidget* parent) : QWizard(parent) {
setPixmap(QWizard::LogoPixmap,
QPixmap(":/icons/gpgfrontend_logo.png").scaled(64, 64));
- int next_page_id = GlobalSettingStation::GetInstance()
- .GetSettings()
- .value("wizard.next_page", -1)
- .toInt();
+ int next_page_id = GetSettings().value("wizard.next_page", -1).toInt();
setStartId(next_page_id);
connect(this, &Wizard::accepted, this, &Wizard::slot_wizard_accepted);
@@ -57,7 +56,7 @@ Wizard::Wizard(QWidget* parent) : QWizard(parent) {
void Wizard::slot_wizard_accepted() {
// Don't show is mapped to show -> negation
try {
- auto settings = GlobalSettingStation::GetInstance().GetSettings();
+ auto settings = GetSettings();
settings.setValue("wizard/show_wizard", false);
} catch (...) {
FLOG_W("setting operation error");
@@ -101,7 +100,7 @@ IntroPage::IntroPage(QWidget* parent) : QWizardPage(parent) {
setLayout(layout);
}
-int IntroPage::nextId() const { return Wizard::Page_Choose; }
+int IntroPage::nextId() const { return Wizard::kPAGE_CHOOSE; }
ChoosePage::ChoosePage(QWidget* parent) : QWizardPage(parent) {
setTitle(tr("Choose your action..."));
@@ -146,7 +145,7 @@ ChoosePage::ChoosePage(QWidget* parent) : QWizardPage(parent) {
layout->addWidget(encr_decy_text_label);
layout->addWidget(sign_verify_text_label);
setLayout(layout);
- next_page_ = Wizard::Page_Conclusion;
+ next_page_ = Wizard::kPAGE_CONCLUSION;
}
int ChoosePage::nextId() const { return next_page_; }
@@ -193,10 +192,10 @@ KeyGenPage::KeyGenPage(QWidget* parent) : QWizardPage(parent) {
setLayout(layout);
}
-int KeyGenPage::nextId() const { return Wizard::Page_Conclusion; }
+int KeyGenPage::nextId() const { return Wizard::kPAGE_CONCLUSION; }
void KeyGenPage::slot_generate_key_dialog() {
- (new KeyGenDialog(kGpgFrontendDefaultChannel, this))->show();
+ (new KeyGenerateDialog(kGpgFrontendDefaultChannel, this))->show();
wizard()->next();
}