Diffstat (limited to 'noncore/net/networksetup/wlan/wlanmodule.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/networksetup/wlan/wlanmodule.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/noncore/net/networksetup/wlan/wlanmodule.cpp b/noncore/net/networksetup/wlan/wlanmodule.cpp index 73e753c..7507c54 100644 --- a/noncore/net/networksetup/wlan/wlanmodule.cpp +++ b/noncore/net/networksetup/wlan/wlanmodule.cpp | |||
@@ -7,21 +7,20 @@ | |||
7 | #include <qprogressbar.h> | 7 | #include <qprogressbar.h> |
8 | 8 | ||
9 | /** | 9 | /** |
10 | * Constructor, find all of the possible interfaces | 10 | * Constructor, find all of the possible interfaces |
11 | */ | 11 | */ |
12 | WLANModule::WLANModule() : Module() { | 12 | WLANModule::WLANModule() : Module() { |
13 | // get output from iwconfig | ||
14 | } | 13 | } |
15 | 14 | ||
16 | /** | 15 | /** |
17 | */ | 16 | */ |
18 | WLANModule::~WLANModule(){ | 17 | WLANModule::~WLANModule(){ |
19 | Interface *i; | 18 | Interface *i; |
20 | for ( i=list.first(); i != 0; i=list.next() ) | 19 | for ( i=list.first(); i != 0; i=list.next() ) |
21 | delete i; | 20 | delete i; |
22 | } | 21 | } |
23 | 22 | ||
24 | /** | 23 | /** |
25 | * Change the current profile | 24 | * Change the current profile |
26 | */ | 25 | */ |
27 | void WLANModule::setProfile(QString newProfile){ | 26 | void WLANModule::setProfile(QString newProfile){ |
@@ -44,18 +43,15 @@ QString WLANModule::getPixmapName(Interface* ){ | |||
44 | */ | 43 | */ |
45 | bool WLANModule::isOwner(Interface *i){ | 44 | bool WLANModule::isOwner(Interface *i){ |
46 | WExtensions we(i->getInterfaceName()); | 45 | WExtensions we(i->getInterfaceName()); |
47 | if(!we.doesHaveWirelessExtensions()) | 46 | if(!we.doesHaveWirelessExtensions()) |
48 | return false; | 47 | return false; |
49 | 48 | ||
50 | //if(i->getInterfaceName() == "eth0" || i->getInterfaceName() == "wlan0"){ | 49 | i->setHardwareName("802.11b"); |
51 | i->setHardwareName("802.11b"); | 50 | list.append(i); |
52 | list.append(i); | 51 | return true; |
53 | return true; | ||
54 | //} | ||
55 | //return false; | ||
56 | } | 52 | } |
57 | 53 | ||
58 | /** | 54 | /** |
59 | * Create, set tabWiget and return the WLANConfigure Module | 55 | * Create, set tabWiget and return the WLANConfigure Module |
60 | * @param tabWidget a pointer to the tab widget that this configure has. | 56 | * @param tabWidget a pointer to the tab widget that this configure has. |
61 | * @return QWidget* pointer to the tab widget in this modules configure. | 57 | * @return QWidget* pointer to the tab widget in this modules configure. |
@@ -72,14 +68,14 @@ QWidget *WLANModule::configure(Interface *, QTabWidget **tabWidget){ | |||
72 | * @return QWidget* pointer to the tab widget in this modules info. | 68 | * @return QWidget* pointer to the tab widget in this modules info. |
73 | */ | 69 | */ |
74 | QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){ | 70 | QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){ |
75 | WExtensions we(i->getInterfaceName()); | 71 | WExtensions we(i->getInterfaceName()); |
76 | if(!we.doesHaveWirelessExtensions()) | 72 | if(!we.doesHaveWirelessExtensions()) |
77 | return NULL; | 73 | return NULL; |
78 | 74 | ||
79 | WlanInfo *info = new WlanInfo(0, "wireless info"); | 75 | WlanInfo *info = new WlanInfo(0, "wireless info", Qt::WDestructiveClose); |
80 | (*tabWidget) = info->tabWidget; | 76 | (*tabWidget) = info->tabWidget; |
81 | 77 | ||
82 | info->essidLabel->setText(we.essid()); | 78 | info->essidLabel->setText(we.essid()); |
83 | info->apLabel->setText(we.ap()); | 79 | info->apLabel->setText(we.ap()); |
84 | info->stationLabel->setText(we.station()); | 80 | info->stationLabel->setText(we.station()); |
85 | info->modeLabel->setText(we.mode()); | 81 | info->modeLabel->setText(we.mode()); |
@@ -89,12 +85,16 @@ QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){ | |||
89 | int quality = 0; | 85 | int quality = 0; |
90 | we.stats(signal, noise, quality); | 86 | we.stats(signal, noise, quality); |
91 | info->signalProgressBar->setProgress(signal); | 87 | info->signalProgressBar->setProgress(signal); |
92 | info->noiseProgressBar->setProgress(noise); | 88 | info->noiseProgressBar->setProgress(noise); |
93 | info->qualityProgressBar->setProgress(quality); | 89 | info->qualityProgressBar->setProgress(quality); |
94 | info->rateLabel->setText(QString("%1 Mb/s").arg(we.rate())); | 90 | info->rateLabel->setText(QString("%1 Mb/s").arg(we.rate())); |
91 | //WlanInfo info (0, "wireless info", true); | ||
92 | //info.show(); | ||
93 | //return NULL; | ||
94 | |||
95 | return info; | 95 | return info; |
96 | } | 96 | } |
97 | 97 | ||
98 | /** | 98 | /** |
99 | * Get all active (up or down) interfaces | 99 | * Get all active (up or down) interfaces |
100 | * @return QList<Interface> A list of interfaces that exsist that havn't | 100 | * @return QList<Interface> A list of interfaces that exsist that havn't |