diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt5/partitionchoicepage.cc | 13 | ||||
-rw-r--r-- | ui/qt5/partitionchoicepage.hh | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/ui/qt5/partitionchoicepage.cc b/ui/qt5/partitionchoicepage.cc index 3045b79..ce0a473 100644 --- a/ui/qt5/partitionchoicepage.cc +++ b/ui/qt5/partitionchoicepage.cc @@ -13,6 +13,7 @@ #include "partitionchoicepage.hh" #include <QLabel> +#include <QMessageBox> #include <QVBoxLayout> PartitionChoicePage::PartitionChoicePage(QWidget *parent) @@ -141,3 +142,15 @@ int PartitionChoicePage::nextId() const { return HorizonWizard::Page_Network; } } + +bool PartitionChoicePage::validatePage() { + if(buttons->checkedButton() == eraseButton) { + return (QMessageBox::critical(this, tr("Erase Disk"), + tr("You have chosen to ERASE %1. " + "All data on %1 will be permanently erased.\n\n" + "Do you wish to continue?").arg(QString::fromStdString(horizonWizard()->chosen_disk)), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes); + } + + return true; +} diff --git a/ui/qt5/partitionchoicepage.hh b/ui/qt5/partitionchoicepage.hh index 2e879ba..0483d65 100644 --- a/ui/qt5/partitionchoicepage.hh +++ b/ui/qt5/partitionchoicepage.hh @@ -25,6 +25,7 @@ public: void initializePage() override; bool isComplete() const override; int nextId() const override; + bool validatePage() override; private: QLabel *descLabel; QButtonGroup *buttons; |