summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/wlan/info.ui108
-rw-r--r--noncore/net/networksetup/wlan/wlan.pro4
-rw-r--r--noncore/net/networksetup/wlan/wlanmodule.cpp18
-rw-r--r--noncore/settings/networksettings/wlan/info.ui108
-rw-r--r--noncore/settings/networksettings/wlan/wlan.pro4
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp18
6 files changed, 74 insertions, 186 deletions
diff --git a/noncore/net/networksetup/wlan/info.ui b/noncore/net/networksetup/wlan/info.ui
index 52d3a43..1e3e8b5 100644
--- a/noncore/net/networksetup/wlan/info.ui
+++ b/noncore/net/networksetup/wlan/info.ui
@@ -1,84 +1,84 @@
<!DOCTYPE UI><UI>
<class>WlanInfo</class>
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>WlanInfo</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>279</width>
- <height>292</height>
+ <width>242</width>
+ <height>316</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
- <string>WLAN Information</string>
+ <string>Interface Information</string>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>0</number>
</property>
<widget>
<class>QTabWidget</class>
<property stdset="1">
<name>name</name>
<cstring>tabWidget</cstring>
</property>
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Widget2</cstring>
</property>
<attribute>
<name>title</name>
<string>802.11b</string>
</attribute>
<grid>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget row="3" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel4</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Frequency</string>
</property>
</widget>
<widget row="2" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel3</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Mode</string>
</property>
</widget>
<widget row="1" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel2</cstring>
</property>
<property stdset="1">
@@ -122,242 +122,200 @@
<name>frameShadow</name>
<enum>Sunken</enum>
</property>
</widget>
<widget row="2" column="1" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>modeLabel</cstring>
</property>
<property stdset="1">
<name>frameShape</name>
<enum>Panel</enum>
</property>
<property stdset="1">
<name>frameShadow</name>
<enum>Sunken</enum>
</property>
</widget>
<widget row="1" column="1" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>essidLabel</cstring>
</property>
<property stdset="1">
<name>frameShape</name>
<enum>Panel</enum>
</property>
<property stdset="1">
<name>frameShadow</name>
<enum>Sunken</enum>
</property>
</widget>
<widget row="0" column="1" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>stationLabel</cstring>
</property>
<property stdset="1">
<name>frameShape</name>
<enum>Panel</enum>
</property>
<property stdset="1">
<name>frameShadow</name>
<enum>Sunken</enum>
</property>
</widget>
<widget row="3" column="1" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>freqLabel</cstring>
</property>
<property stdset="1">
<name>frameShape</name>
<enum>Panel</enum>
</property>
<property stdset="1">
<name>frameShadow</name>
<enum>Sunken</enum>
</property>
</widget>
- <spacer row="5" column="1" >
+ <spacer row="9" column="1" >
<property>
<name>name</name>
<cstring>Spacer7</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
- </grid>
- </widget>
- <widget>
- <class>QWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>tab</cstring>
- </property>
- <attribute>
- <name>title</name>
- <string>Statistics</string>
- </attribute>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>11</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <spacer row="4" column="1" >
- <property>
- <name>name</name>
- <cstring>Spacer2</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Vertical</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget row="0" column="1" >
+ <widget row="5" column="1" >
<class>QProgressBar</class>
<property stdset="1">
<name>name</name>
<cstring>signalProgressBar</cstring>
</property>
</widget>
- <widget row="1" column="1" >
+ <widget row="6" column="1" >
<class>QProgressBar</class>
<property stdset="1">
<name>name</name>
<cstring>noiseProgressBar</cstring>
</property>
</widget>
- <widget row="2" column="1" >
+ <widget row="7" column="1" >
<class>QProgressBar</class>
<property stdset="1">
<name>name</name>
<cstring>qualityProgressBar</cstring>
</property>
</widget>
- <widget row="0" column="0" >
+ <widget row="8" column="1" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel1_2</cstring>
+ <cstring>rateLabel</cstring>
</property>
<property stdset="1">
- <name>text</name>
- <string>Signal</string>
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
</property>
</widget>
- <widget row="1" column="0" >
+ <widget row="8" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel2_2</cstring>
+ <cstring>TextLabel4_2</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Noise</string>
+ <string>Rate</string>
</property>
</widget>
- <widget row="2" column="0" >
+ <widget row="7" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel3_2</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Quality</string>
</property>
</widget>
- <widget row="3" column="0" >
+ <widget row="6" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel4_2</cstring>
+ <cstring>TextLabel2_2</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Rate</string>
+ <string>Noise</string>
</property>
</widget>
- <widget row="3" column="1" >
+ <widget row="5" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>rateLabel</cstring>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>1</vsizetype>
- </sizepolicy>
- </property>
- <property stdset="1">
- <name>frameShape</name>
- <enum>Panel</enum>
+ <cstring>TextLabel1_2</cstring>
</property>
<property stdset="1">
- <name>frameShadow</name>
- <enum>Sunken</enum>
+ <name>text</name>
+ <string>Signal</string>
</property>
</widget>
</grid>
</widget>
</widget>
</vbox>
</widget>
<customwidgets>
<customwidget>
<class>QWidget</class>
<header location="local">qwidget.h</header>
<sizehint>
<width>100</width>
<height>100</height>
</sizehint>
<container>0</container>
<sizepolicy>
<hordata>7</hordata>
<verdata>7</verdata>
</sizepolicy>
<pixmap>image0</pixmap>
</customwidget>
</customwidgets>
<images>
<image>
<name>image0</name>
<data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
</image>
</images>
</UI>
diff --git a/noncore/net/networksetup/wlan/wlan.pro b/noncore/net/networksetup/wlan/wlan.pro
index 432a096..f28feb2 100644
--- a/noncore/net/networksetup/wlan/wlan.pro
+++ b/noncore/net/networksetup/wlan/wlan.pro
@@ -1,12 +1,12 @@
TEMPLATE = lib
CONFIG += qt warn_on release
#CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/plugins/networksetup
-HEADERS = wlanimp.h wlanmodule.h wextensions.h
-SOURCES = wlanimp.cpp wlanmodule.cpp wextensions.cpp
+HEADERS = wlanimp.h infoimp.h wlanmodule.h wextensions.h
+SOURCES = wlanimp.cpp infoimp.cpp wlanmodule.cpp wextensions.cpp
INCLUDEPATH += $(OPIEDIR)/include ../
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
INTERFACES = wlan.ui info.ui
TARGET = wlanplugin
VERSION = 1.0.0
diff --git a/noncore/net/networksetup/wlan/wlanmodule.cpp b/noncore/net/networksetup/wlan/wlanmodule.cpp
index bf2589e..3993ca0 100644
--- a/noncore/net/networksetup/wlan/wlanmodule.cpp
+++ b/noncore/net/networksetup/wlan/wlanmodule.cpp
@@ -1,125 +1,111 @@
#include "wlanmodule.h"
#include "wlanimp.h"
-#include "info.h"
+#include "infoimp.h"
#include "wextensions.h"
#include <qlabel.h>
#include <qprogressbar.h>
/**
* Constructor, find all of the possible interfaces
*/
WLANModule::WLANModule() : Module() {
}
/**
*/
WLANModule::~WLANModule(){
Interface *i;
for ( i=list.first(); i != 0; i=list.next() )
delete i;
}
/**
* Change the current profile
*/
void WLANModule::setProfile(QString newProfile){
profile = newProfile;
}
/**
* get the icon name for this device.
* @param Interface* can be used in determining the icon.
* @return QString the icon name (minus .png, .gif etc)
*/
QString WLANModule::getPixmapName(Interface* ){
return "wlan";
}
/**
* Check to see if the interface i is owned by this module.
* @param Interface* interface to check against
* @return bool true if i is owned by this module, false otherwise.
*/
bool WLANModule::isOwner(Interface *i){
WExtensions we(i->getInterfaceName());
if(!we.doesHaveWirelessExtensions())
return false;
i->setHardwareName("802.11b");
list.append(i);
return true;
}
/**
* Create, set tabWiget and return the WLANConfigure Module
* @param tabWidget a pointer to the tab widget that this configure has.
* @return QWidget* pointer to the tab widget in this modules configure.
*/
QWidget *WLANModule::configure(Interface *, QTabWidget **tabWidget){
WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", false, Qt::WDestructiveClose);
(*tabWidget) = wlanconfig->tabWidget;
return wlanconfig;
}
/**
* Create, set tabWiget and return the Information Module
* @param tabWidget a pointer to the tab widget that this information has.
* @return QWidget* pointer to the tab widget in this modules info.
*/
QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){
WExtensions we(i->getInterfaceName());
if(!we.doesHaveWirelessExtensions())
return NULL;
- WlanInfo *info = new WlanInfo(0, "wireless info", Qt::WDestructiveClose);
+ WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose);
(*tabWidget) = info->tabWidget;
-
- info->essidLabel->setText(we.essid());
- info->apLabel->setText(we.ap());
- info->stationLabel->setText(we.station());
- info->modeLabel->setText(we.mode());
- info->freqLabel->setText(QString("%1 GHz").arg(we.frequency()));
- int signal = 0;
- int noise = 0;
- int quality = 0;
- we.stats(signal, noise, quality);
- info->signalProgressBar->setProgress(signal);
- info->noiseProgressBar->setProgress(noise);
- info->qualityProgressBar->setProgress(quality);
- info->rateLabel->setText(QString("%1 Mb/s").arg(we.rate()));
return info;
}
/**
* Get all active (up or down) interfaces
* @return QList<Interface> A list of interfaces that exsist that havn't
* been called by isOwner()
*/
QList<Interface> WLANModule::getInterfaces(){
return list;
}
/**
* Attempt to add a new interface as defined by name
* @param name the name of the type of interface that should be created given
* by possibleNewInterfaces();
* @return Interface* NULL if it was unable to be created.
*/
Interface *WLANModule::addNewInterface(QString ){
// We can't add a 802.11 interface, either the hardware will be there
// or it wont.
return NULL;
}
/**
* Attempts to remove the interface, doesn't delete i
* @return bool true if successfull, false otherwise.
*/
bool WLANModule::remove(Interface*){
// Can't remove a hardware device, you can stop it though.
return false;
}
// wlanmodule.cpp
diff --git a/noncore/settings/networksettings/wlan/info.ui b/noncore/settings/networksettings/wlan/info.ui
index 52d3a43..1e3e8b5 100644
--- a/noncore/settings/networksettings/wlan/info.ui
+++ b/noncore/settings/networksettings/wlan/info.ui
@@ -1,84 +1,84 @@
<!DOCTYPE UI><UI>
<class>WlanInfo</class>
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>WlanInfo</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>279</width>
- <height>292</height>
+ <width>242</width>
+ <height>316</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
- <string>WLAN Information</string>
+ <string>Interface Information</string>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>0</number>
</property>
<widget>
<class>QTabWidget</class>
<property stdset="1">
<name>name</name>
<cstring>tabWidget</cstring>
</property>
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Widget2</cstring>
</property>
<attribute>
<name>title</name>
<string>802.11b</string>
</attribute>
<grid>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget row="3" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel4</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Frequency</string>
</property>
</widget>
<widget row="2" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel3</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Mode</string>
</property>
</widget>
<widget row="1" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel2</cstring>
</property>
<property stdset="1">
@@ -122,242 +122,200 @@
<name>frameShadow</name>
<enum>Sunken</enum>
</property>
</widget>
<widget row="2" column="1" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>modeLabel</cstring>
</property>
<property stdset="1">
<name>frameShape</name>
<enum>Panel</enum>
</property>
<property stdset="1">
<name>frameShadow</name>
<enum>Sunken</enum>
</property>
</widget>
<widget row="1" column="1" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>essidLabel</cstring>
</property>
<property stdset="1">
<name>frameShape</name>
<enum>Panel</enum>
</property>
<property stdset="1">
<name>frameShadow</name>
<enum>Sunken</enum>
</property>
</widget>
<widget row="0" column="1" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>stationLabel</cstring>
</property>
<property stdset="1">
<name>frameShape</name>
<enum>Panel</enum>
</property>
<property stdset="1">
<name>frameShadow</name>
<enum>Sunken</enum>
</property>
</widget>
<widget row="3" column="1" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>freqLabel</cstring>
</property>
<property stdset="1">
<name>frameShape</name>
<enum>Panel</enum>
</property>
<property stdset="1">
<name>frameShadow</name>
<enum>Sunken</enum>
</property>
</widget>
- <spacer row="5" column="1" >
+ <spacer row="9" column="1" >
<property>
<name>name</name>
<cstring>Spacer7</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
- </grid>
- </widget>
- <widget>
- <class>QWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>tab</cstring>
- </property>
- <attribute>
- <name>title</name>
- <string>Statistics</string>
- </attribute>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>11</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <spacer row="4" column="1" >
- <property>
- <name>name</name>
- <cstring>Spacer2</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Vertical</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget row="0" column="1" >
+ <widget row="5" column="1" >
<class>QProgressBar</class>
<property stdset="1">
<name>name</name>
<cstring>signalProgressBar</cstring>
</property>
</widget>
- <widget row="1" column="1" >
+ <widget row="6" column="1" >
<class>QProgressBar</class>
<property stdset="1">
<name>name</name>
<cstring>noiseProgressBar</cstring>
</property>
</widget>
- <widget row="2" column="1" >
+ <widget row="7" column="1" >
<class>QProgressBar</class>
<property stdset="1">
<name>name</name>
<cstring>qualityProgressBar</cstring>
</property>
</widget>
- <widget row="0" column="0" >
+ <widget row="8" column="1" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel1_2</cstring>
+ <cstring>rateLabel</cstring>
</property>
<property stdset="1">
- <name>text</name>
- <string>Signal</string>
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
</property>
</widget>
- <widget row="1" column="0" >
+ <widget row="8" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel2_2</cstring>
+ <cstring>TextLabel4_2</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Noise</string>
+ <string>Rate</string>
</property>
</widget>
- <widget row="2" column="0" >
+ <widget row="7" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel3_2</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Quality</string>
</property>
</widget>
- <widget row="3" column="0" >
+ <widget row="6" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel4_2</cstring>
+ <cstring>TextLabel2_2</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Rate</string>
+ <string>Noise</string>
</property>
</widget>
- <widget row="3" column="1" >
+ <widget row="5" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>rateLabel</cstring>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>1</vsizetype>
- </sizepolicy>
- </property>
- <property stdset="1">
- <name>frameShape</name>
- <enum>Panel</enum>
+ <cstring>TextLabel1_2</cstring>
</property>
<property stdset="1">
- <name>frameShadow</name>
- <enum>Sunken</enum>
+ <name>text</name>
+ <string>Signal</string>
</property>
</widget>
</grid>
</widget>
</widget>
</vbox>
</widget>
<customwidgets>
<customwidget>
<class>QWidget</class>
<header location="local">qwidget.h</header>
<sizehint>
<width>100</width>
<height>100</height>
</sizehint>
<container>0</container>
<sizepolicy>
<hordata>7</hordata>
<verdata>7</verdata>
</sizepolicy>
<pixmap>image0</pixmap>
</customwidget>
</customwidgets>
<images>
<image>
<name>image0</name>
<data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
</image>
</images>
</UI>
diff --git a/noncore/settings/networksettings/wlan/wlan.pro b/noncore/settings/networksettings/wlan/wlan.pro
index 432a096..f28feb2 100644
--- a/noncore/settings/networksettings/wlan/wlan.pro
+++ b/noncore/settings/networksettings/wlan/wlan.pro
@@ -1,12 +1,12 @@
TEMPLATE = lib
CONFIG += qt warn_on release
#CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/plugins/networksetup
-HEADERS = wlanimp.h wlanmodule.h wextensions.h
-SOURCES = wlanimp.cpp wlanmodule.cpp wextensions.cpp
+HEADERS = wlanimp.h infoimp.h wlanmodule.h wextensions.h
+SOURCES = wlanimp.cpp infoimp.cpp wlanmodule.cpp wextensions.cpp
INCLUDEPATH += $(OPIEDIR)/include ../
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
INTERFACES = wlan.ui info.ui
TARGET = wlanplugin
VERSION = 1.0.0
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index bf2589e..3993ca0 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -1,125 +1,111 @@
#include "wlanmodule.h"
#include "wlanimp.h"
-#include "info.h"
+#include "infoimp.h"
#include "wextensions.h"
#include <qlabel.h>
#include <qprogressbar.h>
/**
* Constructor, find all of the possible interfaces
*/
WLANModule::WLANModule() : Module() {
}
/**
*/
WLANModule::~WLANModule(){
Interface *i;
for ( i=list.first(); i != 0; i=list.next() )
delete i;
}
/**
* Change the current profile
*/
void WLANModule::setProfile(QString newProfile){
profile = newProfile;
}
/**
* get the icon name for this device.
* @param Interface* can be used in determining the icon.
* @return QString the icon name (minus .png, .gif etc)
*/
QString WLANModule::getPixmapName(Interface* ){
return "wlan";
}
/**
* Check to see if the interface i is owned by this module.
* @param Interface* interface to check against
* @return bool true if i is owned by this module, false otherwise.
*/
bool WLANModule::isOwner(Interface *i){
WExtensions we(i->getInterfaceName());
if(!we.doesHaveWirelessExtensions())
return false;
i->setHardwareName("802.11b");
list.append(i);
return true;
}
/**
* Create, set tabWiget and return the WLANConfigure Module
* @param tabWidget a pointer to the tab widget that this configure has.
* @return QWidget* pointer to the tab widget in this modules configure.
*/
QWidget *WLANModule::configure(Interface *, QTabWidget **tabWidget){
WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", false, Qt::WDestructiveClose);
(*tabWidget) = wlanconfig->tabWidget;
return wlanconfig;
}
/**
* Create, set tabWiget and return the Information Module
* @param tabWidget a pointer to the tab widget that this information has.
* @return QWidget* pointer to the tab widget in this modules info.
*/
QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){
WExtensions we(i->getInterfaceName());
if(!we.doesHaveWirelessExtensions())
return NULL;
- WlanInfo *info = new WlanInfo(0, "wireless info", Qt::WDestructiveClose);
+ WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose);
(*tabWidget) = info->tabWidget;
-
- info->essidLabel->setText(we.essid());
- info->apLabel->setText(we.ap());
- info->stationLabel->setText(we.station());
- info->modeLabel->setText(we.mode());
- info->freqLabel->setText(QString("%1 GHz").arg(we.frequency()));
- int signal = 0;
- int noise = 0;
- int quality = 0;
- we.stats(signal, noise, quality);
- info->signalProgressBar->setProgress(signal);
- info->noiseProgressBar->setProgress(noise);
- info->qualityProgressBar->setProgress(quality);
- info->rateLabel->setText(QString("%1 Mb/s").arg(we.rate()));
return info;
}
/**
* Get all active (up or down) interfaces
* @return QList<Interface> A list of interfaces that exsist that havn't
* been called by isOwner()
*/
QList<Interface> WLANModule::getInterfaces(){
return list;
}
/**
* Attempt to add a new interface as defined by name
* @param name the name of the type of interface that should be created given
* by possibleNewInterfaces();
* @return Interface* NULL if it was unable to be created.
*/
Interface *WLANModule::addNewInterface(QString ){
// We can't add a 802.11 interface, either the hardware will be there
// or it wont.
return NULL;
}
/**
* Attempts to remove the interface, doesn't delete i
* @return bool true if successfull, false otherwise.
*/
bool WLANModule::remove(Interface*){
// Can't remove a hardware device, you can stop it though.
return false;
}
// wlanmodule.cpp