summaryrefslogtreecommitdiff
path: root/noncore/net/networksetup/wlan/infoimp.cpp
Unidiff
Diffstat (limited to 'noncore/net/networksetup/wlan/infoimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/wlan/infoimp.cpp56
1 files changed, 0 insertions, 56 deletions
diff --git a/noncore/net/networksetup/wlan/infoimp.cpp b/noncore/net/networksetup/wlan/infoimp.cpp
deleted file mode 100644
index bd56678..0000000
--- a/noncore/net/networksetup/wlan/infoimp.cpp
+++ b/dev/null
@@ -1,56 +0,0 @@
1#include "infoimp.h"
2#include "wextensions.h"
3
4#include <qtimer.h>
5#include <qprogressbar.h>
6#include <qlabel.h>
7
8/**
9 * Constructor. If wireless extensions are enabled on device name then
10 * start a timer that every second will update the information.
11 */
12WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInfo(parent, name, fl){
13 WExtensions *wExtensions = new WExtensions(name);
14 if(!wExtensions->doesHaveWirelessExtensions()){
15 delete wExtensions;
16 qDebug("WlanInfoImp::No wireless extension");
17 return;
18 }
19 delete wExtensions;
20 timer = new QTimer( this );
21 connect( timer, SIGNAL(timeout()), this, SLOT(update()));
22 timer->start( 1000, false );
23}
24
25/**
26 * Updates the information about the wireless device.
27 */
28void WlanInfoImp::update(){
29 WExtensions *wExtensions = new WExtensions(this->name());
30 if(!wExtensions->doesHaveWirelessExtensions()){
31 qDebug("No extension");
32 delete wExtensions;
33 timer->stop();
34 return;
35 }
36 essidLabel->setText(wExtensions->essid());
37 apLabel->setText(wExtensions->ap());
38 stationLabel->setText(wExtensions->station());
39 modeLabel->setText(wExtensions->mode());
40 channelLabel->setText(QString("%1").arg(wExtensions->channel()));
41 int signal = 0;
42 int noise = 0;
43 int quality = 0;
44 wExtensions->stats(signal, noise, quality);
45 if(signalProgressBar->progress() != signal)
46 signalProgressBar->setProgress(signal);
47 if(noiseProgressBar->progress() != noise)
48 noiseProgressBar->setProgress(noise);
49 if(qualityProgressBar->progress() != quality)
50 qualityProgressBar->setProgress(quality);
51 rateLabel->setText(QString("%1 Mb/s").arg(wExtensions->rate()));
52 delete wExtensions;
53}
54
55// infoimp.cpp
56