diff options
Diffstat (limited to 'ui/qt5/runner/finishedpage.cc')
-rw-r--r-- | ui/qt5/runner/finishedpage.cc | 42 |
1 files changed, 41 insertions, 1 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); } |