summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/wlan/wlanmodule.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings/wlan/wlanmodule.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp36
1 files changed, 33 insertions, 3 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index 7bded85..a4488f9 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -129,15 +129,32 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
return;
}
QDataStream stream(arg,IO_ReadOnly);
QString interface;
QString action;
+ int countMsgs = 0;
+ stream >> interface;
+ qDebug("got count? >%s<",interface.latin1());
+ if (interface == "count"){
+ qDebug("got count");
+ stream >> action;
+ qDebug("Got count num >%s<", action.latin1());
+ countMsgs = action.toInt();
+ }
+
QDialog *toShow;
- while (! stream.atEnd() ){
+ //while (! stream.atEnd() ){
+ for (int i = 0; i < countMsgs; i++){
+ qDebug("start stream %d/%d",i,countMsgs);
+ if (stream.atEnd()){
+ qDebug("end of stream");
+ return;
+ }
stream >> interface;
+ qDebug("got iface");
stream >> action;
qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1());
// find interfaces
Interface *ifa=0;
for ( Interface *i=list.first(); i != 0; i=list.next() ){
if (i->getInterfaceName() == interface){
@@ -172,13 +189,17 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
//FIXME: what if it got closed meanwhile?
wlanconfigWiget = (WLANImp*) configure(ifa);
toShow = (QDialog*) wlanconfigWiget;
}
wlanconfigWiget->showMaximized();
stream >> value;
- qDebug("WLANModule is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() );
+ qDebug("WLANModule (build 4) is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() );
+ if (value.isEmpty()){
+ qDebug("value is empty!!!\nreturning");
+ return;
+ }
if ( action.contains("ESSID") ){
QComboBox *combo = wlanconfigWiget->essid;
bool found = false;
for ( int i = 0; i < combo->count(); i++)
if ( combo->text( i ) == value ){
combo->setCurrentItem( i );
@@ -191,32 +212,41 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
if ( combo->text( i ) == value ){
combo->setCurrentItem( i );
}
}else if (action.contains("Channel")){
bool ok;
+ qDebug("converting channel");
int chan = value.toInt( &ok );
if (ok){
+ qDebug("ok setting channel");
wlanconfigWiget->specifyChan->setChecked( true );
wlanconfigWiget->networkChannel->setValue( chan );
}
}else if (action.contains("MacAddr")){
wlanconfigWiget->specifyAp->setChecked( true );
wlanconfigWiget->macEdit->setText( value );
}else
qDebug("wlan plugin has no clue");
}
+ qDebug("next stream");
}// while stream
+ qDebug("end of stream");
if (toShow) toShow->exec();
+ qDebug("returning");
}
QWidget *WLANModule::getInfo( Interface *i)
{
qDebug("WLANModule::getInfo start");
WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose);
InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i);
info->tabWidget->insertTab(information, "TCP/IP", 0);
-
+ info->tabWidget->setCurrentPage( 0 );
+ info->tabWidget->showPage( information );
+ if (info->tabWidget->currentPage() == information ) qDebug("infotab OK");
+ else qDebug("infotab NOT OK");
+ qDebug("current idx %d", info->tabWidget->currentPageIndex());
qDebug("WLANModule::getInfo return");
return info;
}