author | tille <tille> | 2003-06-16 16:56:06 (UTC) |
---|---|---|
committer | tille <tille> | 2003-06-16 16:56:06 (UTC) |
commit | ad64cf15ac6ac064619079592f7656464e88baac (patch) (unidiff) | |
tree | 54ed14a9cff9bdefcadb5ac5e04e5b3c104207ac /noncore/settings/networksettings/wlan | |
parent | c6e6ec7a25dd0acfd970d0b9e2f43a8ea500b98b (diff) | |
download | opie-ad64cf15ac6ac064619079592f7656464e88baac.zip opie-ad64cf15ac6ac064619079592f7656464e88baac.tar.gz opie-ad64cf15ac6ac064619079592f7656464e88baac.tar.bz2 |
add support for multiline qcop calls
and macaddrs
Diffstat (limited to 'noncore/settings/networksettings/wlan') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanmodule.cpp | 120 |
1 files changed, 62 insertions, 58 deletions
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 | |||
@@ -9,2 +9,3 @@ | |||
9 | #include <qlabel.h> | 9 | #include <qlabel.h> |
10 | #include <qlineedit.h> | ||
10 | #include <qprogressbar.h> | 11 | #include <qprogressbar.h> |
@@ -133,65 +134,68 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
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 | } |