Diffstat (limited to 'noncore/settings/networksettings/wlan') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanmodule.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp index 371b689..7bded85 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.cpp +++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp | |||
@@ -67,13 +67,13 @@ bool WLANModule::isOwner(Interface *i){ | |||
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Create, and return the WLANConfigure Module | 69 | * Create, and return the WLANConfigure Module |
70 | * @return QWidget* pointer to this modules configure. | 70 | * @return QWidget* pointer to this modules configure. |
71 | */ | 71 | */ |
72 | QWidget *WLANModule::configure(Interface *i){ | 72 | QWidget *WLANModule::configure(Interface *i){ |
73 | WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, false, Qt::WDestructiveClose); | 73 | WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, true, Qt::WDestructiveClose); |
74 | wlanconfig->setProfile(profile); | 74 | wlanconfig->setProfile(profile); |
75 | return wlanconfig; | 75 | return wlanconfig; |
76 | } | 76 | } |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * Create, and return the Information Module | 79 | * Create, and return the Information Module |
@@ -129,12 +129,13 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
129 | return; | 129 | return; |
130 | } | 130 | } |
131 | 131 | ||
132 | QDataStream stream(arg,IO_ReadOnly); | 132 | QDataStream stream(arg,IO_ReadOnly); |
133 | QString interface; | 133 | QString interface; |
134 | QString action; | 134 | QString action; |
135 | QDialog *toShow; | ||
135 | while (! stream.atEnd() ){ | 136 | while (! stream.atEnd() ){ |
136 | stream >> interface; | 137 | stream >> interface; |
137 | stream >> action; | 138 | stream >> action; |
138 | qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); | 139 | qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); |
139 | // find interfaces | 140 | // find interfaces |
140 | Interface *ifa=0; | 141 | Interface *ifa=0; |
@@ -144,14 +145,14 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
144 | ifa = i; | 145 | ifa = i; |
145 | } | 146 | } |
146 | } | 147 | } |
147 | 148 | ||
148 | if (ifa == 0){ | 149 | if (ifa == 0){ |
149 | qDebug("WLANModule Did not find %s",interface.latin1()); | 150 | qDebug("WLANModule Did not find %s",interface.latin1()); |
150 | qDebug("returning"); | 151 | qDebug("skipping"); |
151 | return; | 152 | count = 0; |
152 | } | 153 | } |
153 | 154 | ||
154 | if (count == 2){ | 155 | if (count == 2){ |
155 | // those should call the interface directly | 156 | // those should call the interface directly |
156 | QWidget *info = getInfo( ifa ); | 157 | QWidget *info = getInfo( ifa ); |
157 | info->showMaximized(); | 158 | info->showMaximized(); |
@@ -167,12 +168,13 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
167 | } | 168 | } |
168 | }else if (count == 3){ | 169 | }else if (count == 3){ |
169 | QString value; | 170 | QString value; |
170 | if (!wlanconfigWiget){ | 171 | if (!wlanconfigWiget){ |
171 | //FIXME: what if it got closed meanwhile? | 172 | //FIXME: what if it got closed meanwhile? |
172 | wlanconfigWiget = (WLANImp*) configure(ifa); | 173 | wlanconfigWiget = (WLANImp*) configure(ifa); |
174 | toShow = (QDialog*) wlanconfigWiget; | ||
173 | } | 175 | } |
174 | wlanconfigWiget->showMaximized(); | 176 | wlanconfigWiget->showMaximized(); |
175 | stream >> value; | 177 | stream >> value; |
176 | qDebug("WLANModule is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); | 178 | qDebug("WLANModule is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); |
177 | if ( action.contains("ESSID") ){ | 179 | if ( action.contains("ESSID") ){ |
178 | QComboBox *combo = wlanconfigWiget->essid; | 180 | QComboBox *combo = wlanconfigWiget->essid; |
@@ -188,21 +190,26 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
188 | for ( int i = 0; i < combo->count(); i++) | 190 | for ( int i = 0; i < combo->count(); i++) |
189 | if ( combo->text( i ) == value ){ | 191 | if ( combo->text( i ) == value ){ |
190 | combo->setCurrentItem( i ); | 192 | combo->setCurrentItem( i ); |
191 | } | 193 | } |
192 | 194 | ||
193 | }else if (action.contains("Channel")){ | 195 | }else if (action.contains("Channel")){ |
194 | wlanconfigWiget->specifyChan->setChecked( true ); | 196 | bool ok; |
195 | wlanconfigWiget->networkChannel->setValue( value.toInt() ); | 197 | int chan = value.toInt( &ok ); |
198 | if (ok){ | ||
199 | wlanconfigWiget->specifyChan->setChecked( true ); | ||
200 | wlanconfigWiget->networkChannel->setValue( chan ); | ||
201 | } | ||
196 | }else if (action.contains("MacAddr")){ | 202 | }else if (action.contains("MacAddr")){ |
197 | wlanconfigWiget->specifyAp->setChecked( true ); | 203 | wlanconfigWiget->specifyAp->setChecked( true ); |
198 | wlanconfigWiget->macEdit->setText( value ); | 204 | wlanconfigWiget->macEdit->setText( value ); |
199 | }else | 205 | }else |
200 | qDebug("wlan plugin has no clue"); | 206 | qDebug("wlan plugin has no clue"); |
201 | } | 207 | } |
202 | }// while stream | 208 | }// while stream |
209 | if (toShow) toShow->exec(); | ||
203 | } | 210 | } |
204 | 211 | ||
205 | QWidget *WLANModule::getInfo( Interface *i) | 212 | QWidget *WLANModule::getInfo( Interface *i) |
206 | { | 213 | { |
207 | qDebug("WLANModule::getInfo start"); | 214 | qDebug("WLANModule::getInfo start"); |
208 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); | 215 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); |