1 /****************************************************************************
2 ** ui.h extension file, included from the uic-generated form implementation.
4 ** If you want to add, delete, or rename functions or slots, use
5 ** Qt Designer to update this file, preserving your code.
7 ** You should not define a constructor or destructor in this file.
8 ** Instead, write your code in functions called init() and destroy().
9 ** These will automatically be called by the form's constructor and
11 *****************************************************************************/
13 void ScanResults::init()
19 void ScanResults::destroy()
25 void ScanResults::setWpaGui(WpaGui
*_wpagui
)
30 timer
= new QTimer(this);
31 connect(timer
, SIGNAL(timeout()), SLOT(getResults()));
32 timer
->start(10000, FALSE
);
36 void ScanResults::updateResults()
44 reply_len
= sizeof(reply
) - 1;
45 if (wpagui
->ctrlRequest("SCAN_RESULTS", reply
, &reply_len
) < 0)
47 reply
[reply_len
] = '\0';
49 scanResultsView
->clear();
52 QStringList lines
= QStringList::split(QChar('\n'), res
);
54 for (QStringList::Iterator it
= lines
.begin(); it
!= lines
.end(); it
++) {
60 QStringList cols
= QStringList::split(QChar('\t'), *it
, true);
61 QString ssid
, bssid
, freq
, signal
, flags
;
62 bssid
= cols
.count() > 0 ? cols
[0] : "";
63 freq
= cols
.count() > 1 ? cols
[1] : "";
64 signal
= cols
.count() > 2 ? cols
[2] : "";
65 flags
= cols
.count() > 3 ? cols
[3] : "";
66 ssid
= cols
.count() > 4 ? cols
[4] : "";
67 new Q3ListViewItem(scanResultsView
, ssid
, bssid
, freq
, signal
, flags
);
72 void ScanResults::scanRequest()
75 size_t reply_len
= sizeof(reply
);
80 wpagui
->ctrlRequest("SCAN", reply
, &reply_len
);
84 void ScanResults::getResults()
92 void ScanResults::bssSelected( Q3ListViewItem
* sel
)
94 NetworkConfig
*nc
= new NetworkConfig();
97 nc
->setWpaGui(wpagui
);
98 nc
->paramsFromScanResults(sel
);