summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/qt5/horizonwizard.cc56
-rw-r--r--ui/qt5/horizonwizard.hh4
2 files changed, 54 insertions, 6 deletions
diff --git a/ui/qt5/horizonwizard.cc b/ui/qt5/horizonwizard.cc
index 72b4239..0987e47 100644
--- a/ui/qt5/horizonwizard.cc
+++ b/ui/qt5/horizonwizard.cc
@@ -46,17 +46,18 @@ HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent) {
setFixedSize(QSize(650, 450));
- setOption(DisabledBackButtonOnLastPage);
setOption(HaveHelpButton);
- setOption(NoCancelButton);
+ /* REQ: UI.Global.Back.Save */
+ setOption(IndependentPages);
+ /* REQ: UI.Language.Buttons, Iface.UI.StandardButtons */
+ setOption(NoBackButtonOnStartPage);
setSizeGripEnabled(false);
setPage(Page_Intro, new IntroPage);
setPage(Page_Network, new NetworkingPage);
- QObject::connect(this, static_cast<void (QWizard:: *)(void)>(&QWizard::helpRequested),
- [=](void) {
+ QObject::connect(this, &QWizard::helpRequested, [=](void) {
if(help_id_map.find(currentId()) == help_id_map.end()) {
qDebug() << "no help available for " << currentId();
QMessageBox nohelp(QMessageBox::Warning,
@@ -76,4 +77,51 @@ HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent) {
HorizonHelpWindow help(&helpfile, this);
help.exec();
});
+
+
+ /* REQ: UI.Global.Cancel.Confirm */
+ QObject::disconnect(button(CancelButton), &QAbstractButton::clicked,
+ this, &QWizard::reject);
+ QObject::connect(button(CancelButton), &QAbstractButton::clicked,
+ [=](bool) {
+ QMessageBox cancel(QMessageBox::Question,
+ tr("Cancel Adélie Linux System Installation"),
+ #ifdef HAS_INSTALL_ENV
+ tr("Adélie Linux has not yet been set up on your computer. Cancellation will reboot your computer. Do you wish to cancel?"),
+ #else
+ tr("You have not yet completed the System Installation wizard. No installfile will be generated. Do you wish to cancel?"),
+ #endif
+ QMessageBox::Yes | QMessageBox::No,
+ this);
+ cancel.setDefaultButton(QMessageBox::No);
+ if(cancel.exec() == QMessageBox::Yes) {
+ reject();
+ }
+ });
+
+ /* REQ: Iface.UI.ButtonAccel */
+ setButtonText(HelpButton, tr("Help (F1)"));
+ setButtonText(CancelButton, tr("Cancel (F3)"));
+ setButtonText(BackButton, tr("Back (F5)"));
+ setButtonText(NextButton, tr("Next (F8)"));
+
+ f1 = new QShortcut(Qt::Key_F1, this);
+ connect(f1, &QShortcut::activated,
+ button(HelpButton), &QAbstractButton::click);
+ f1->setWhatsThis(tr("Activates the Help screen."));
+
+ f3 = new QShortcut(Qt::Key_F3, this);
+ connect(f3, &QShortcut::activated,
+ button(CancelButton), &QAbstractButton::click);
+ f3->setWhatsThis(tr("Prompts to cancel the installation."));
+
+ f5 = new QShortcut(Qt::Key_F5, this);
+ connect(f5, &QShortcut::activated,
+ button(BackButton), &QAbstractButton::click);
+ f5->setWhatsThis(tr("Goes back to the previous page."));
+
+ f8 = new QShortcut(Qt::Key_F8, this);
+ connect(f8, &QShortcut::activated,
+ button(NextButton), &QAbstractButton::click);
+ f5->setWhatsThis(tr("Goes forward to the next page."));
}
diff --git a/ui/qt5/horizonwizard.hh b/ui/qt5/horizonwizard.hh
index c47fb49..adf3791 100644
--- a/ui/qt5/horizonwizard.hh
+++ b/ui/qt5/horizonwizard.hh
@@ -1,6 +1,7 @@
#ifndef HORIZONWIZARD_HH
#define HORIZONWIZARD_HH
+#include <QShortcut>
#include <QWizard>
#include <string>
@@ -34,8 +35,7 @@ public:
};
HorizonWizard(QWidget *parent = nullptr);
- /* collected information stored here */
- std::string keymap;
+ QShortcut *f1, *f3, *f5, *f8;
};
#endif /* !HORIZONWIZARD_HH */