X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=libeap%2Fwpa_supplicant%2Fwpa_gui%2Fscanresults.ui.h;fp=libeap%2Fwpa_supplicant%2Fwpa_gui%2Fscanresults.ui.h;h=0000000000000000000000000000000000000000;hb=4f319dde67a76fe0aaf33f6d2788968012584ada;hp=530d2e6a495c074e3db26445eb3695ae9f64f6a3;hpb=ed09b5e64dd485851310307979d5eed14678087b;p=mech_eap.git diff --git a/libeap/wpa_supplicant/wpa_gui/scanresults.ui.h b/libeap/wpa_supplicant/wpa_gui/scanresults.ui.h deleted file mode 100644 index 530d2e6..0000000 --- a/libeap/wpa_supplicant/wpa_gui/scanresults.ui.h +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you want to add, delete, or rename functions or slots, use -** Qt Designer to update this file, preserving your code. -** -** You should not define a constructor or destructor in this file. -** Instead, write your code in functions called init() and destroy(). -** These will automatically be called by the form's constructor and -** destructor. -*****************************************************************************/ - -void ScanResults::init() -{ - wpagui = NULL; -} - - -void ScanResults::destroy() -{ - delete timer; -} - - -void ScanResults::setWpaGui(WpaGui *_wpagui) -{ - wpagui = _wpagui; - updateResults(); - - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), SLOT(getResults())); - timer->start(10000, FALSE); -} - - -void ScanResults::updateResults() -{ - char reply[8192]; - size_t reply_len; - - if (wpagui == NULL) - return; - - reply_len = sizeof(reply) - 1; - if (wpagui->ctrlRequest("SCAN_RESULTS", reply, &reply_len) < 0) - return; - reply[reply_len] = '\0'; - - scanResultsView->clear(); - - QString res(reply); - QStringList lines = QStringList::split(QChar('\n'), res); - bool first = true; - for (QStringList::Iterator it = lines.begin(); it != lines.end(); it++) { - if (first) { - first = false; - continue; - } - - QStringList cols = QStringList::split(QChar('\t'), *it, true); - QString ssid, bssid, freq, signal, flags; - bssid = cols.count() > 0 ? cols[0] : ""; - freq = cols.count() > 1 ? cols[1] : ""; - signal = cols.count() > 2 ? cols[2] : ""; - flags = cols.count() > 3 ? cols[3] : ""; - ssid = cols.count() > 4 ? cols[4] : ""; - new Q3ListViewItem(scanResultsView, ssid, bssid, freq, signal, flags); - } -} - - -void ScanResults::scanRequest() -{ - char reply[10]; - size_t reply_len = sizeof(reply); - - if (wpagui == NULL) - return; - - wpagui->ctrlRequest("SCAN", reply, &reply_len); -} - - -void ScanResults::getResults() -{ - updateResults(); -} - - - - -void ScanResults::bssSelected( Q3ListViewItem * sel ) -{ - NetworkConfig *nc = new NetworkConfig(); - if (nc == NULL) - return; - nc->setWpaGui(wpagui); - nc->paramsFromScanResults(sel); - nc->show(); - nc->exec(); -}