diff options
-rw-r--r-- | ui/qt5/accountpage.cc | 13 | ||||
-rw-r--r-- | ui/qt5/accountpage.hh | 6 |
2 files changed, 17 insertions, 2 deletions
diff --git a/ui/qt5/accountpage.cc b/ui/qt5/accountpage.cc index 0541b60..f4be6ac 100644 --- a/ui/qt5/accountpage.cc +++ b/ui/qt5/accountpage.cc @@ -11,6 +11,9 @@ */ #include "accountpage.hh" +#ifdef HAS_INSTALL_ENV +# include "commitpage.hh" +#endif /* HAS_INSTALL_ENV */ #include <algorithm> #include <QLabel> @@ -51,3 +54,13 @@ bool AccountPage::isComplete() const { return widget->isValid(); }); } + +#ifdef HAS_INSTALL_ENV +bool AccountPage::validatePage() { + /* hack to re-initialise page in case the user goes back */ + horizonWizard()->removePage(HorizonWizard::Page_Commit); + horizonWizard()->setPage(HorizonWizard::Page_Commit, new CommitPage); + + return true; +} +#endif /* HAS_INSTALL_ENV */ diff --git a/ui/qt5/accountpage.hh b/ui/qt5/accountpage.hh index de0e9a7..9ca7577 100644 --- a/ui/qt5/accountpage.hh +++ b/ui/qt5/accountpage.hh @@ -21,8 +21,10 @@ class AccountPage : public HorizonWizardPage { public: AccountPage(QWidget *parent = nullptr); - - bool isComplete() const; + bool isComplete() const override; +#ifdef HAS_INSTALL_ENV + bool validatePage() override; +#endif std::array<UserAccountWidget *, 4> accountWidgets; }; |