From 37662b329020e858308b115e971fbdeb77410bec Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 21 May 2024 12:00:16 -0500 Subject: Qt UI: Fix manual network conf interface selection In the Install Environment, if only one interface was available, we made the UI show that there was only one interface, but didn't set it as the chosen interface in the Wizard object. This caused installation to fail. In the Runtime Environment, it was possible to choose Continue without typing an interface name. This would cause installation to fail. Closes: #380 --- ui/qt5/netmanualpage.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ui/qt5') diff --git a/ui/qt5/netmanualpage.cc b/ui/qt5/netmanualpage.cc index 1486461..4e3ffea 100644 --- a/ui/qt5/netmanualpage.cc +++ b/ui/qt5/netmanualpage.cc @@ -198,6 +198,7 @@ void NetManualPage::initializePage() { tr("Configuring interface %1 (%2)") .arg(QString::fromStdString(iface->first)) .arg(iface->second.mac))); + horizonWizard()->chosen_auto_iface = iface->first; } #else /* !HAS_INSTALL_ENV */ QLineEdit *ifaceBox = new QLineEdit; @@ -206,6 +207,7 @@ void NetManualPage::initializePage() { ifaceWidget->layout()->addWidget(ifaceBox); connect(ifaceBox, &QLineEdit::textEdited, [=] { horizonWizard()->chosen_auto_iface = ifaceBox->text().toStdString(); + emit completeChanged(); }); #endif /* HAS_INSTALL_ENV */ @@ -220,6 +222,11 @@ void NetManualPage::initializePage() { #include bool NetManualPage::isComplete() const { +#ifndef HAS_INSTALL_ENV + /* Ensure an interface has been chosen. */ + if(horizonWizard()->chosen_auto_iface.empty()) return false; +#endif /* !HAS_INSTALL_ENV */ + /* REQ: UI.Network.Manual.Enable: At least one must be ticked. */ if(!useV6->isChecked() && !useV4->isChecked()) return false; -- cgit v1.2.3-60-g2f50