Diffstat (limited to 'noncore/settings/networksettings/wlan/wlanmodule.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanmodule.cpp | 72 |
1 files changed, 56 insertions, 16 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp index 3979e60..3c988d5 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.cpp +++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp | |||
@@ -12,3 +12,3 @@ | |||
12 | * Constructor, find all of the possible interfaces | 12 | * Constructor, find all of the possible interfaces |
13 | */ | 13 | */ |
14 | WLANModule::WLANModule() : Module() { | 14 | WLANModule::WLANModule() : Module() { |
@@ -18,3 +18,3 @@ WLANModule::WLANModule() : Module() { | |||
18 | * Delete any interfaces that we own. | 18 | * Delete any interfaces that we own. |
19 | */ | 19 | */ |
20 | WLANModule::~WLANModule(){ | 20 | WLANModule::~WLANModule(){ |
@@ -27,3 +27,3 @@ WLANModule::~WLANModule(){ | |||
27 | * Change the current profile | 27 | * Change the current profile |
28 | */ | 28 | */ |
29 | void WLANModule::setProfile(const QString &newProfile){ | 29 | void WLANModule::setProfile(const QString &newProfile){ |
@@ -35,4 +35,4 @@ void WLANModule::setProfile(const QString &newProfile){ | |||
35 | * @param Interface* can be used in determining the icon. | 35 | * @param Interface* can be used in determining the icon. |
36 | * @return QString the icon name (minus .png, .gif etc) | 36 | * @return QString the icon name (minus .png, .gif etc) |
37 | */ | 37 | */ |
38 | QString WLANModule::getPixmapName(Interface* ){ | 38 | QString WLANModule::getPixmapName(Interface* ){ |
@@ -45,3 +45,3 @@ QString WLANModule::getPixmapName(Interface* ){ | |||
45 | * @return bool true if i is owned by this module, false otherwise. | 45 | * @return bool true if i is owned by this module, false otherwise. |
46 | */ | 46 | */ |
47 | bool WLANModule::isOwner(Interface *i){ | 47 | bool WLANModule::isOwner(Interface *i){ |
@@ -50,3 +50,3 @@ bool WLANModule::isOwner(Interface *i){ | |||
50 | return false; | 50 | return false; |
51 | 51 | ||
52 | i->setHardwareName("802.11b"); | 52 | i->setHardwareName("802.11b"); |
@@ -59,3 +59,3 @@ bool WLANModule::isOwner(Interface *i){ | |||
59 | * @return QWidget* pointer to this modules configure. | 59 | * @return QWidget* pointer to this modules configure. |
60 | */ | 60 | */ |
61 | QWidget *WLANModule::configure(Interface *i){ | 61 | QWidget *WLANModule::configure(Interface *i){ |
@@ -69,3 +69,3 @@ QWidget *WLANModule::configure(Interface *i){ | |||
69 | * @return QWidget* pointer to this modules info. | 69 | * @return QWidget* pointer to this modules info. |
70 | */ | 70 | */ |
71 | QWidget *WLANModule::information(Interface *i){ | 71 | QWidget *WLANModule::information(Interface *i){ |
@@ -74,3 +74,3 @@ QWidget *WLANModule::information(Interface *i){ | |||
74 | return NULL; | 74 | return NULL; |
75 | 75 | ||
76 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); | 76 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); |
@@ -95,7 +95,7 @@ QList<Interface> WLANModule::getInterfaces(){ | |||
95 | * @return Interface* NULL if it was unable to be created. | 95 | * @return Interface* NULL if it was unable to be created. |
96 | */ | 96 | */ |
97 | Interface *WLANModule::addNewInterface(const QString &){ | 97 | Interface *WLANModule::addNewInterface(const QString &){ |
98 | // We can't add a 802.11 interface, either the hardware will be there | 98 | // We can't add a 802.11 interface, either the hardware will be there |
99 | // or it wont. | 99 | // or it wont. |
100 | return NULL; | 100 | return NULL; |
101 | } | 101 | } |
@@ -105,9 +105,49 @@ Interface *WLANModule::addNewInterface(const QString &){ | |||
105 | * @return bool true if successfull, false otherwise. | 105 | * @return bool true if successfull, false otherwise. |
106 | */ | 106 | */ |
107 | bool WLANModule::remove(Interface*){ | 107 | bool WLANModule::remove(Interface*){ |
108 | // Can't remove a hardware device, you can stop it though. | 108 | // Can't remove a hardware device, you can stop it though. |
109 | return false; | 109 | return false; |
110 | } | 110 | } |
111 | 111 | ||
112 | // wlanmodule.cpp | 112 | void WLANModule::receive(const QCString ¶m, const QByteArray &arg) |
113 | { | ||
114 | qDebug("WLANModule::receive "+param); | ||
115 | QStringList params = QStringList::split(",",param); | ||
116 | int count = params.count(); | ||
117 | qDebug("got %i params", count ); | ||
118 | if (count < 2){ | ||
119 | qDebug("Erorr less than 2 parameter"); | ||
120 | qDebug("RETURNING"); | ||
121 | return; | ||
122 | } | ||
123 | |||
124 | QDataStream stream(arg,IO_ReadOnly); | ||
125 | QString interface; | ||
126 | QString action; | ||
127 | |||
128 | stream >> interface; | ||
129 | stream >> action; | ||
130 | qDebug("got interface %s and acion %s", interface.latin1(), action.latin1()); | ||
131 | |||
132 | if (count == 2){ | ||
133 | // those should call the interface | ||
134 | if ( action.contains("start" ) ){ | ||
135 | qDebug("starting %s not yet implemented",interface.latin1()); | ||
136 | } else if ( action.contains("restart" ) ){ | ||
137 | qDebug("restarting %s not yet implemented",interface.latin1()); | ||
138 | } else if ( action.contains("stop" ) ){ | ||
139 | qDebug("stopping %s not yet implemented",interface.latin1()); | ||
140 | } | ||
141 | }else if (count == 3){ | ||
142 | QString value; | ||
143 | stream >> value; | ||
144 | qDebug("setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); | ||
145 | } | ||
146 | // if (param.contains("QString,QString,QString")) { | ||
147 | // QDataStream stream(arg,IO_ReadOnly); | ||
148 | // QString arg1, arg2, arg3; | ||
149 | // stream >> arg1 >> arg2 >> arg3 ; | ||
150 | // qDebug("interface >%s< setting >%s< value >%s<",arg1.latin1(),arg2.latin1(),arg3.latin1()); | ||
151 | // } | ||
152 | } | ||
113 | 153 | ||