summaryrefslogtreecommitdiff
path: root/ui/qt5
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2024-05-21 12:00:16 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2024-05-21 12:00:16 -0500
commit37662b329020e858308b115e971fbdeb77410bec (patch)
tree9996a810d2a98bebbd1643a6dd69627d7c92aeff /ui/qt5
parent5df1abdb743ac71986cabe8c76dcd9a0f75e44da (diff)
downloadhorizon-37662b329020e858308b115e971fbdeb77410bec.tar.gz
horizon-37662b329020e858308b115e971fbdeb77410bec.tar.bz2
horizon-37662b329020e858308b115e971fbdeb77410bec.tar.xz
horizon-37662b329020e858308b115e971fbdeb77410bec.zip
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
Diffstat (limited to 'ui/qt5')
-rw-r--r--ui/qt5/netmanualpage.cc7
1 files changed, 7 insertions, 0 deletions
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 <iostream>
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;