summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-14 19:30:22 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-14 19:30:22 -0600
commit444825dd4e46432346938b98ade360efac252e41 (patch)
treec3444d246a5701448a9001992e3690dae0232476 /ui
parentc7b43428d243a231cc351cf5b5f7f12ebe4a931a (diff)
downloadhorizon-444825dd4e46432346938b98ade360efac252e41.tar.gz
horizon-444825dd4e46432346938b98ade360efac252e41.tar.bz2
horizon-444825dd4e46432346938b98ade360efac252e41.tar.xz
horizon-444825dd4e46432346938b98ade360efac252e41.zip
Qt UI: First pass at associating with a network
Diffstat (limited to 'ui')
-rw-r--r--ui/qt5/netsimplewifipage.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/qt5/netsimplewifipage.cc b/ui/qt5/netsimplewifipage.cc
index 65d56c9..12f8301 100644
--- a/ui/qt5/netsimplewifipage.cc
+++ b/ui/qt5/netsimplewifipage.cc
@@ -18,6 +18,7 @@
#include <QVBoxLayout>
#ifdef HAS_INSTALL_ENV
+# include <QMessageBox>
int scanResults(wpactrl_t *control, char const *s, size_t len, void *page, tain_t *) {
NetworkSimpleWirelessPage *our_page = reinterpret_cast<NetworkSimpleWirelessPage *>(page);
return our_page->processScan(control, s, len);
@@ -299,6 +300,18 @@ int NetworkSimpleWirelessPage::processScan(wpactrl_t *c, const char *, size_t) {
#endif /* HAS_INSTALL_ENV */
bool NetworkSimpleWirelessPage::validatePage() {
+#ifdef HAS_INSTALL_ENV
+ const char *ssid, *pass;
+ if(passphrase->isHidden()) pass = nullptr;
+ else pass = passphrase->text().toStdString().c_str();
+ ssid = ssidListView->selectedItems()[0]->text().toStdString().c_str();
+
+ if(wpactrl_associate_g(&control, ssid, pass) == 0) {
+ QMessageBox::critical(this, tr("Could Not Connect"), tr("An issue occurred connecting to the specified wireless network. Ensure your passphrase is correct and try again."));
+ return false;
+ }
+#endif /* HAS_INSTALL_ENV */
+
/* What a hack!
*
* Independent Pages means the DHCP page is never cleaned, even when Back