diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-12-13 12:43:34 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-12-13 12:43:34 -0600 |
commit | 5f42328911ec644cb2626b796d48c18f3167e59b (patch) | |
tree | a867932c7bbead4d89222fc1fd865e683ee4fc03 /ui/qt5/pkgsimple.cc | |
parent | 0a4b3b9cd1095f05651bff685d02c809db8768a9 (diff) | |
download | horizon-5f42328911ec644cb2626b796d48c18f3167e59b.tar.gz horizon-5f42328911ec644cb2626b796d48c18f3167e59b.tar.bz2 horizon-5f42328911ec644cb2626b796d48c18f3167e59b.tar.xz horizon-5f42328911ec644cb2626b796d48c18f3167e59b.zip |
Qt UI: Handle edge case (see comment)
Diffstat (limited to 'ui/qt5/pkgsimple.cc')
-rw-r--r-- | ui/qt5/pkgsimple.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ui/qt5/pkgsimple.cc b/ui/qt5/pkgsimple.cc index 9ae9495..ecb192a 100644 --- a/ui/qt5/pkgsimple.cc +++ b/ui/qt5/pkgsimple.cc @@ -11,6 +11,7 @@ */ #include "pkgsimple.hh" +#include "pkgdefaults.hh" #include <QButtonGroup> #include <QGridLayout> @@ -104,3 +105,26 @@ int PkgSimplePage::nextId() const { return HorizonWizard::Page_Boot; } + +bool PkgSimplePage::validatePage() { + /* This code handles the following scenario: + * + * - 'Custom' is selected + * - A non-default option is selected on the Defaults page (i.e., mdevd) + * - Back is chosen + * - A non-custom package selection choice is selected + * + * We need to completely 'reset' the state of the Defaults, including + * the selections on the Defaults page, whenever Next is chosen. + */ + if(horizonWizard()->pkgtype == HorizonWizard::Custom) { + horizonWizard()->removePage(HorizonWizard::Page_PkgCustomDefault); + horizonWizard()->setPage(HorizonWizard::Page_PkgCustomDefault, new PkgDefaultsPage); + } else { + horizonWizard()->sbininit = HorizonWizard::S6; + horizonWizard()->binsh = HorizonWizard::Dash; + horizonWizard()->eudev = true; + } + + return true; +} |