summaryrefslogtreecommitdiff
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
parent5287ea303f22f937df8f4b61b67f7bc163138b99 (diff)
downloadhorizon-cb7de585fc83ac327d2b33d2a88ea81221f0c96f.tar.gz
horizon-cb7de585fc83ac327d2b33d2a88ea81221f0c96f.tar.bz2
horizon-cb7de585fc83ac327d2b33d2a88ea81221f0c96f.tar.xz
horizon-cb7de585fc83ac327d2b33d2a88ea81221f0c96f.zip
Qt UI: Implement UI.Finish requirements
-rw-r--r--assets/README4
-rw-r--r--ui/qt5/horizon.qrc2
-rw-r--r--ui/qt5/resources/finish-high.pngbin0 -> 437322 bytes
-rw-r--r--ui/qt5/resources/finish-low.pngbin0 -> 114486 bytes
-rw-r--r--ui/qt5/runner/finishedpage.cc42
-rw-r--r--ui/qt5/runner/finishedpage.hh4
6 files changed, 49 insertions, 3 deletions
diff --git a/assets/README b/assets/README
index 4104288..89cb925 100644
--- a/assets/README
+++ b/assets/README
@@ -5,3 +5,7 @@ on the World Wide Web at: https://gitlab.com/cybernix/Newaita.
The status icons are from the Papirus icon theme, licensed GPL-3.0-only and
available on the World Wide Web at:
https://github.com/PapirusDevelopmentTeam/papirus-icon-theme.
+
+The Balloon image used for the Qt UI's "Finish" watermark is from Crystal on
+Flickr, licensed CC-BY-2.0 and available on the World Wide Web at:
+https://www.flickr.com/photos/crystalflickr/190713106
diff --git a/ui/qt5/horizon.qrc b/ui/qt5/horizon.qrc
index 46dbccd..58272c1 100644
--- a/ui/qt5/horizon.qrc
+++ b/ui/qt5/horizon.qrc
@@ -8,6 +8,8 @@
<file>resources/software-low.png</file>
<file>resources/acct-high.png</file>
<file>resources/acct-low.png</file>
+ <file>resources/finish-high.png</file>
+ <file>resources/finish-low.png</file>
<file alias="resources/status-current-high.svg">../../assets/status-current-high.svg</file>
<file alias="resources/status-current-low.svg">../../assets/status-current-low.svg</file>
<file alias="resources/status-issue-high.svg">../../assets/status-issue-high.svg</file>
diff --git a/ui/qt5/resources/finish-high.png b/ui/qt5/resources/finish-high.png
new file mode 100644
index 0000000..729d6bf
--- /dev/null
+++ b/ui/qt5/resources/finish-high.png
Binary files differ
diff --git a/ui/qt5/resources/finish-low.png b/ui/qt5/resources/finish-low.png
new file mode 100644
index 0000000..46c18c8
--- /dev/null
+++ b/ui/qt5/resources/finish-low.png
Binary files differ
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);
};