diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-18 21:06:33 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-18 21:06:33 -0600 |
commit | 36dbc2a2250dedce03824d2526f41fcefe8bbedb (patch) | |
tree | 25535109f0f05ac78e0f5e4f237a815fcf31d391 /ui | |
parent | d80193261012fd22af1dcfdfd1d01c393f100233 (diff) | |
download | horizon-36dbc2a2250dedce03824d2526f41fcefe8bbedb.tar.gz horizon-36dbc2a2250dedce03824d2526f41fcefe8bbedb.tar.bz2 horizon-36dbc2a2250dedce03824d2526f41fcefe8bbedb.tar.xz horizon-36dbc2a2250dedce03824d2526f41fcefe8bbedb.zip |
Qt UI: Simplify wifi logic and fix passphrase design
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt5/netsimplewifipage.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ui/qt5/netsimplewifipage.cc b/ui/qt5/netsimplewifipage.cc index 866cc5f..071031f 100644 --- a/ui/qt5/netsimplewifipage.cc +++ b/ui/qt5/netsimplewifipage.cc @@ -75,18 +75,17 @@ void NetworkSimpleWirelessPage::scanDone(QString message) { void NetworkSimpleWirelessPage::networkChosen(QListWidgetItem *current, QListWidgetItem *) { - emit completeChanged(); passphrase->clear(); + passphrase->hide(); if(current == nullptr) { - passphrase->hide(); + emit completeChanged(); return; } QStringList flags = current->data(Qt::UserRole).toStringList(); if(flags.length() == 0) { - passphrase->hide(); - return; + goto done; } for(auto &flag : flags) { @@ -94,25 +93,26 @@ void NetworkSimpleWirelessPage::networkChosen(QListWidgetItem *current, passphrase->setEnabled(false); passphrase->setPlaceholderText(tr("WPA Enterprise networks are not supported in this release of Horizon.")); passphrase->show(); - return; + goto done; } if(flag.startsWith("WPA-PSK") || flag.startsWith("WPA2-PSK")) { passphrase->setEnabled(true); passphrase->setPlaceholderText(tr("WPA Passphrase")); passphrase->show(); - return; + goto done; } if(flag.startsWith("WEP")) { passphrase->setEnabled(true); passphrase->setPlaceholderText(tr("WEP Passphrase")); passphrase->show(); - return; + goto done; } } - passphrase->hide(); +done: + emit completeChanged(); return; } @@ -195,6 +195,7 @@ void NetworkSimpleWirelessPage::doScan() { void NetworkSimpleWirelessPage::initializePage() { doScan(); + passphrase->setMinimumWidth(ssidListView->size().width()); } bool NetworkSimpleWirelessPage::isComplete() const { |