summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-02-22 20:13:50 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-02-22 20:13:50 -0600
commit489038844b7a5d0101ec6d23e67414667b48cf17 (patch)
tree4e44e239da741bd4f8d8ec4dc4a7d2223ef2b848 /ui
parentdca561f97e72e162efdb134631b6b38fdd493803 (diff)
downloadhorizon-489038844b7a5d0101ec6d23e67414667b48cf17.tar.gz
horizon-489038844b7a5d0101ec6d23e67414667b48cf17.tar.bz2
horizon-489038844b7a5d0101ec6d23e67414667b48cf17.tar.xz
horizon-489038844b7a5d0101ec6d23e67414667b48cf17.zip
Qt UI: Re-load CommitPage if Back is chosen
Diffstat (limited to 'ui')
-rw-r--r--ui/qt5/accountpage.cc13
-rw-r--r--ui/qt5/accountpage.hh6
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;
};