summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp7
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp120
2 files changed, 62 insertions, 65 deletions
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 5029525..544498f 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -645,13 +645,6 @@ void MainWindowImp::receive(const QCString &msg, const QByteArray &arg)
645 param = param.left( param.length() - 1 ); 645 param = param.left( param.length() - 1 );
646 qDebug("dest >%s< param >"+param+"<",dest.latin1()); 646 qDebug("dest >%s< param >"+param+"<",dest.latin1());
647 647
648// if (param.contains("QString,QString,QString")) {
649// QDataStream stream(arg,IO_ReadOnly);
650// QString arg1, arg2, arg3;
651// stream >> arg1 >> arg2 >> arg3 ;
652// qDebug("args: >%s< >%s< >%s<",arg1.latin1(),arg2.latin1(),arg3.latin1());
653// }
654
655 QMap<Module*, QLibrary*>::Iterator it; 648 QMap<Module*, QLibrary*>::Iterator it;
656 for( it = libraries.begin(); it != libraries.end(); ++it ){ 649 for( it = libraries.begin(); it != libraries.end(); ++it ){
657 qDebug("plugin >%s<", it.key()->type().latin1() ); 650 qDebug("plugin >%s<", it.key()->type().latin1() );
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index bc467bb..e34f0ce 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -7,6 +7,7 @@
7#include <qcheckbox.h> 7#include <qcheckbox.h>
8#include <qcombobox.h> 8#include <qcombobox.h>
9#include <qlabel.h> 9#include <qlabel.h>
10#include <qlineedit.h>
10#include <qprogressbar.h> 11#include <qprogressbar.h>
11#include <qspinbox.h> 12#include <qspinbox.h>
12#include <qtabwidget.h> 13#include <qtabwidget.h>
@@ -131,69 +132,72 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
131 QDataStream stream(arg,IO_ReadOnly); 132 QDataStream stream(arg,IO_ReadOnly);
132 QString interface; 133 QString interface;
133 QString action; 134 QString action;
134 135 while (! stream.atEnd() ){
135 stream >> interface; 136 stream >> interface;
136 stream >> action; 137 stream >> action;
137 qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); 138 qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1());
138 // find interfaces 139 // find interfaces
139 Interface *ifa=0; 140 Interface *ifa=0;
140 for ( Interface *i=list.first(); i != 0; i=list.next() ){ 141 for ( Interface *i=list.first(); i != 0; i=list.next() ){
141 if (i->getInterfaceName() == interface){ 142 if (i->getInterfaceName() == interface){
142 qDebug("WLANModule found interface %s",interface.latin1()); 143 qDebug("WLANModule found interface %s",interface.latin1());
143 ifa = i; 144 ifa = i;
145 }
144 } 146 }
145 }
146
147 if (ifa == 0){
148 qFatal("WLANModule Did not find %s",interface.latin1());
149 }
150 147
151 if (count == 2){ 148 if (ifa == 0){
152 // those should call the interface directly 149 qFatal("WLANModule Did not find %s",interface.latin1());
153 QWidget *info = getInfo( ifa );
154 info->showMaximized();
155
156 if ( action.contains("start" ) ){
157 ifa->start();
158 } else if ( action.contains("restart" ) ){
159 ifa->restart();
160 } else if ( action.contains("stop" ) ){
161 ifa->stop();
162 }else if ( action.contains("refresh" ) ){
163 ifa->refresh();
164 }
165 }else if (count == 3){
166 QString value;
167 if (!wlanconfigWiget){
168 //FIXME: what if it got closed meanwhile?
169 wlanconfigWiget = (WLANImp*) configure(ifa);
170 } 150 }
171 wlanconfigWiget->showMaximized(); 151
172 stream >> value; 152 if (count == 2){
173 qDebug("WLANModule is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); 153 // those should call the interface directly
174 if ( action.contains("ESSID") ){ 154 QWidget *info = getInfo( ifa );
175 QComboBox *combo = wlanconfigWiget->essid; 155 info->showMaximized();
176 bool found = false; 156
177 for ( int i = 0; i < combo->count(); i++) 157 if ( action.contains("start" ) ){
178 if ( combo->text( i ) == value ){ 158 ifa->start();
179 combo->setCurrentItem( i ); 159 } else if ( action.contains("restart" ) ){
180 found = true; 160 ifa->restart();
161 } else if ( action.contains("stop" ) ){
162 ifa->stop();
163 }else if ( action.contains("refresh" ) ){
164 ifa->refresh();
165 }
166 }else if (count == 3){
167 QString value;
168 if (!wlanconfigWiget){
169 //FIXME: what if it got closed meanwhile?
170 wlanconfigWiget = (WLANImp*) configure(ifa);
171 }
172 wlanconfigWiget->showMaximized();
173 stream >> value;
174 qDebug("WLANModule is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() );
175 if ( action.contains("ESSID") ){
176 QComboBox *combo = wlanconfigWiget->essid;
177 bool found = false;
178 for ( int i = 0; i < combo->count(); i++)
179 if ( combo->text( i ) == value ){
180 combo->setCurrentItem( i );
181 found = true;
181 } 182 }
182 if (!found) combo->insertItem( value, 0 ); 183 if (!found) combo->insertItem( value, 0 );
183 }else if ( action.contains("Mode") ){ 184 }else if ( action.contains("Mode") ){
184 QComboBox *combo = wlanconfigWiget->mode; 185 QComboBox *combo = wlanconfigWiget->mode;
185 for ( int i = 0; i < combo->count(); i++) 186 for ( int i = 0; i < combo->count(); i++)
186 if ( combo->text( i ) == value ){ 187 if ( combo->text( i ) == value ){
187 combo->setCurrentItem( i ); 188 combo->setCurrentItem( i );
188 } 189 }
189 190
190 }else if (action.contains("Channel")){ 191 }else if (action.contains("Channel")){
191 wlanconfigWiget->specifyChan->setChecked( true ); 192 wlanconfigWiget->specifyChan->setChecked( true );
192 wlanconfigWiget->networkChannel->setValue( value.toInt() ); 193 wlanconfigWiget->networkChannel->setValue( value.toInt() );
193 }else 194 }else if (action.contains("MacAddr")){
194 qDebug("wlan plugin has no clue"); 195 wlanconfigWiget->specifyAp->setChecked( true );
195 } 196 wlanconfigWiget->macEdit->setText( value );
196 197 }else
198 qDebug("wlan plugin has no clue");
199 }
200 }// while stream
197} 201}
198 202
199QWidget *WLANModule::getInfo( Interface *i) 203QWidget *WLANModule::getInfo( Interface *i)