From 489038844b7a5d0101ec6d23e67414667b48cf17 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 22 Feb 2020 20:13:50 -0600 Subject: Qt UI: Re-load CommitPage if Back is chosen --- ui/qt5/accountpage.cc | 13 +++++++++++++ ui/qt5/accountpage.hh | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'ui') 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 #include @@ -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 accountWidgets; }; -- cgit v1.2.3-60-g2f50