From 3128fc265a353fc7670430844c6455f16c433a8d Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 5 Oct 2023 06:37:24 -0500 Subject: 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 --- ui/qt5/networkingpage.cc | 16 ++++++++++++++++ ui/qt5/networkingpage.hh | 1 + 2 files changed, 17 insertions(+) (limited to 'ui') 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 @@ -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; -- cgit v1.2.3-60-g2f50