diff options
Diffstat (limited to '')
-rw-r--r-- | src/ui/dialog/Wizard.cpp (renamed from src/ui/Wizard.cpp) | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/ui/Wizard.cpp b/src/ui/dialog/Wizard.cpp index a8576627..0f051874 100644 --- a/src/ui/Wizard.cpp +++ b/src/ui/dialog/Wizard.cpp @@ -1,4 +1,6 @@ /** + * Copyright (C) 2021 Saturneric + * * This file is part of GpgFrontend. * * GpgFrontend is free software: you can redistribute it and/or modify @@ -6,25 +8,27 @@ * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * Foobar is distributed in the hope that it will be useful, + * GpgFrontend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <https://www.gnu.org/licenses/>. + * along with GpgFrontend. If not, see <https://www.gnu.org/licenses/>. + * + * The initial version of the source code is inherited from + * the gpg4usb project, which is under GPL-3.0-or-later. * - * The initial version of the source code is inherited from gpg4usb-team. - * Their source code version also complies with GNU General Public License. + * All the source code of GpgFrontend was modified and released by + * Saturneric<[email protected]> starting on May 12, 2021. * - * The source code version of this software was modified and released - * by Saturneric<[email protected]> starting on May 12, 2021. + * SPDX-License-Identifier: GPL-3.0-or-later * */ -#include "ui/Wizard.h" +#include "Wizard.h" -#include "ui/settings/GlobalSettingStation.h" +#include "core/function/GlobalSettingStation.h" namespace GpgFrontend::UI { @@ -52,10 +56,10 @@ Wizard::Wizard(QWidget* parent) : QWizard(parent) { } setStartId(next_page_id); - connect(this, SIGNAL(accepted()), this, SLOT(slotWizardAccepted())); + connect(this, &Wizard::accepted, this, &Wizard::slot_wizard_accepted); } -void Wizard::slotWizardAccepted() { +void Wizard::slot_wizard_accepted() { LOG(INFO) << _("Called"); // Don't show is mapped to show -> negation try { @@ -69,12 +73,12 @@ void Wizard::slotWizardAccepted() { } else { wizard["show_wizard"] = false; } - GlobalSettingStation::GetInstance().Sync(); + GlobalSettingStation::GetInstance().SyncSettings(); } catch (...) { LOG(ERROR) << _("Setting Operation Error"); } if (field("openHelp").toBool()) { - emit signalOpenHelp("docu.html#content"); + emit SignalOpenHelp("docu.html#content"); } } @@ -169,17 +173,17 @@ ChoosePage::ChoosePage(QWidget* parent) : QWizardPage(parent) { layout->addWidget(encrDecyTextLabel); layout->addWidget(signVerifyTextLabel); setLayout(layout); - nextPage = Wizard::Page_Conclusion; + next_page_ = Wizard::Page_Conclusion; } -int ChoosePage::nextId() const { return nextPage; } +int ChoosePage::nextId() const { return next_page_; } -void ChoosePage::slotJumpPage(const QString& page) { +void ChoosePage::slot_jump_page(const QString& page) { QMetaObject qmo = Wizard::staticMetaObject; int index = qmo.indexOfEnumerator("WizardPages"); QMetaEnum m = qmo.enumerator(index); - nextPage = m.keyToValue(page.toUtf8().data()); + next_page_ = m.keyToValue(page.toUtf8().data()); wizard()->next(); } @@ -200,10 +204,6 @@ KeyGenPage::KeyGenPage(QWidget* parent) : QWizardPage(parent) { "docu_keygen.html#content" ">" + QString(_("Offline tutorial")) + "</a>"); - // linkLabel->setOpenExternalLinks(true); - - // connect(linkLabel, SIGNAL(linkActivated(QString)), - // parentWidget()->parentWidget(), SLOT(openHelp(QString))); auto* createKeyButtonBox = new QWidget(this); auto* createKeyButtonBoxLayout = new QHBoxLayout(createKeyButtonBox); @@ -214,15 +214,15 @@ KeyGenPage::KeyGenPage(QWidget* parent) : QWizardPage(parent) { layout->addWidget(topLabel); layout->addWidget(linkLabel); layout->addWidget(createKeyButtonBox); - connect(createKeyButton, SIGNAL(clicked(bool)), this, - SLOT(slotGenerateKeyDialog())); + connect(createKeyButton, &QPushButton::clicked, this, + &KeyGenPage::slot_generate_key_dialog); setLayout(layout); } int KeyGenPage::nextId() const { return Wizard::Page_Conclusion; } -void KeyGenPage::slotGenerateKeyDialog() { +void KeyGenPage::slot_generate_key_dialog() { LOG(INFO) << "Try Opening KeyGenDialog"; (new KeyGenDialog(this))->show(); wizard()->next(); @@ -247,19 +247,19 @@ ConclusionPage::ConclusionPage(QWidget* parent) : QWizardPage(parent) { bottomLabel->setOpenExternalLinks(true); bottomLabel->setWordWrap(true); - openHelpCheckBox = new QCheckBox(_("Open offline help.")); - openHelpCheckBox->setChecked(true); + open_help_check_box_ = new QCheckBox(_("Open offline help.")); + open_help_check_box_->setChecked(true); - dontShowWizardCheckBox = new QCheckBox(_("Dont show the wizard again.")); - dontShowWizardCheckBox->setChecked(true); + dont_show_wizard_checkbox_ = new QCheckBox(_("Dont show the wizard again.")); + dont_show_wizard_checkbox_->setChecked(true); - registerField("showWizard", dontShowWizardCheckBox); + registerField("showWizard", dont_show_wizard_checkbox_); // registerField("openHelp", openHelpCheckBox); auto* layout = new QVBoxLayout; layout->addWidget(bottomLabel); // layout->addWidget(openHelpCheckBox); - layout->addWidget(dontShowWizardCheckBox); + layout->addWidget(dont_show_wizard_checkbox_); setLayout(layout); setVisible(true); } |