summaryrefslogtreecommitdiff
path: root/ui/qt5/runner
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-07 05:41:58 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-07 05:41:58 -0600
commitcb7de585fc83ac327d2b33d2a88ea81221f0c96f (patch)
treec614199e8fa648ce799a7546584e44c30ee7b71b /ui/qt5/runner
parent5287ea303f22f937df8f4b61b67f7bc163138b99 (diff)
downloadhorizon-cb7de585fc83ac327d2b33d2a88ea81221f0c96f.tar.gz
horizon-cb7de585fc83ac327d2b33d2a88ea81221f0c96f.tar.bz2
horizon-cb7de585fc83ac327d2b33d2a88ea81221f0c96f.tar.xz
horizon-cb7de585fc83ac327d2b33d2a88ea81221f0c96f.zip
Qt UI: Implement UI.Finish requirements
Diffstat (limited to 'ui/qt5/runner')
-rw-r--r--ui/qt5/runner/finishedpage.cc42
-rw-r--r--ui/qt5/runner/finishedpage.hh4
2 files changed, 43 insertions, 3 deletions
diff --git a/ui/qt5/runner/finishedpage.cc b/ui/qt5/runner/finishedpage.cc
index 153f703..933a372 100644
--- a/ui/qt5/runner/finishedpage.cc
+++ b/ui/qt5/runner/finishedpage.cc
@@ -12,6 +12,46 @@
#include "finishedpage.hh"
-FinishedPage::FinishedPage(QWidget *parent) : QWizardPage(parent) {
+#include <QFileDialog>
+#include <QLabel>
+#include <QMessageBox>
+#include <QPushButton>
+#include <QVBoxLayout>
+
+FinishedPage::FinishedPage(QWidget *parent) : HorizonWizardPage(parent) {
setTitle(tr("Adélie Linux Successfully Installed"));
+ loadWatermark("finish");
+
+ QLabel *descLabel = new QLabel(tr(
+ "Congratulations!\n\n"
+ "Adélie Linux has been successfully installed on this computer. "
+ "Be sure to read our Handbooks to learn how to get the most out of your new operating environment.\n\n"
+ "Remember to eject your installation media (CD, DVD, USB drive).\n\n"
+ "We hope you enjoy using Adélie.\n\nChoose \"Finish\" to restart your computer."));
+ descLabel->setWordWrap(true);
+
+ QPushButton *owo = new QPushButton(tr("&Save Installation Data"));
+ owo->setWhatsThis(tr("Saves the HorizonScript and log files associated with this installation."));
+ owo->setAutoDefault(false);
+ owo->setDefault(false);
+ connect(owo, &QPushButton::clicked, [=]{
+ bool success = true;
+
+ QString dir = QFileDialog::getExistingDirectory(this, tr("Choose Directory"), "/target/root");
+ if(dir.size() > 0) {
+ success = QFile::copy("/etc/horizon/installfile", dir + QDir::separator() + "installfile");
+ if(success) success = QFile::copy("/var/log/horizon/executor.log", dir + QDir::separator() + "install.log");
+ }
+
+ if(!success) {
+ QMessageBox::critical(this, tr("Could Not Save Installation Data"), tr("Unable to save installation data to %1.").arg(dir));
+ }
+ });
+
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(descLabel);
+ layout->addStretch();
+ layout->addWidget(owo, 0, Qt::AlignCenter);
+
+ setLayout(layout);
}
diff --git a/ui/qt5/runner/finishedpage.hh b/ui/qt5/runner/finishedpage.hh
index 4a97b28..3cdb236 100644
--- a/ui/qt5/runner/finishedpage.hh
+++ b/ui/qt5/runner/finishedpage.hh
@@ -13,9 +13,9 @@
#ifndef FINISHEDPAGE_HH
#define FINISHEDPAGE_HH
-#include <QWizardPage>
+#include "../horizonwizardpage.hh"
-class FinishedPage : public QWizardPage {
+class FinishedPage : public HorizonWizardPage {
public:
FinishedPage(QWidget *parent = nullptr);
};