diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2023-10-05 06:37:24 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2023-10-05 06:37:24 -0500 |
commit | 3128fc265a353fc7670430844c6455f16c433a8d (patch) | |
tree | f3fc2b910b1ce3853c5602f28849287b3b07d966 | |
parent | e34d60f58d7845641646eb872bbd9c0e8ee40f2a (diff) | |
download | horizon-3128fc265a353fc7670430844c6455f16c433a8d.tar.gz horizon-3128fc265a353fc7670430844c6455f16c433a8d.tar.bz2 horizon-3128fc265a353fc7670430844c6455f16c433a8d.tar.xz horizon-3128fc265a353fc7670430844c6455f16c433a8d.zip |
Qt UI: Respawn DHCP page from NetworkingPage, too
We are already recreating the DHCP page every time the interface chooser
is shown. However, if we don't do this from the main network page, then
systems with a single interface will never recreate the DHCP page.
This means failures are "sticky" / "forever".
Fixes: #354
-rw-r--r-- | ui/qt5/networkingpage.cc | 16 | ||||
-rw-r--r-- | ui/qt5/networkingpage.hh | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/ui/qt5/networkingpage.cc b/ui/qt5/networkingpage.cc index d7b5ced..c00f18f 100644 --- a/ui/qt5/networkingpage.cc +++ b/ui/qt5/networkingpage.cc @@ -12,6 +12,7 @@ #include "networkingpage.hh" #include "horizonwizard.hh" +#include "netdhcppage.hh" #ifdef HAS_INSTALL_ENV # include <QDir> @@ -154,3 +155,18 @@ int NetworkingPage::nextId() const { return HorizonWizard::Page_DateTime; } } + +bool NetworkingPage::validatePage() { +#ifdef HAS_INSTALL_ENV + /* What a hack! + * + * Independent Pages means the DHCP page is never cleaned, even when Back + * is chosen. So, we have to do it from here. Note that it isn't enough + * to do it from NetworkIfacePage, because if only we have one interface, + * that page will never be shown! + * REF: adelie/horizon#354 */ + horizonWizard()->removePage(HorizonWizard::Page_Network_DHCP); + horizonWizard()->setPage(HorizonWizard::Page_Network_DHCP, new NetDHCPPage); +#endif /* HAS_INSTALL_ENV */ + return true; +} diff --git a/ui/qt5/networkingpage.hh b/ui/qt5/networkingpage.hh index 7bd03cf..9462d63 100644 --- a/ui/qt5/networkingpage.hh +++ b/ui/qt5/networkingpage.hh @@ -25,6 +25,7 @@ public: void initializePage() override; bool isComplete() const override; int nextId() const override; + bool validatePage() override; private: QButtonGroup *radioGroup; QRadioButton *simple, *advanced, *skip; |