diff options
Diffstat (limited to 'ui/qt5')
-rw-r--r-- | ui/qt5/netsimplewifipage.cc | 13 |
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 |