3 files changed, 35 insertions, 3 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp index a62a90c..71d0cf5 100644 --- a/noncore/settings/networksettings/interfaces/interfaces.cpp +++ b/noncore/settings/networksettings/interfaces/interfaces.cpp | |||
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index f19cbdd..b40d101 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | |||
@@ -178,23 +178,25 @@ void InterfaceSetupImp::setProfile(const QString &profile){ | |||
178 | 178 | ||
179 | // IP Information | 179 | // IP Information |
180 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); | 180 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); |
181 | QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); | 181 | QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); |
182 | qDebug("dns >%s<",dns.latin1()); | 182 | qDebug("dns >%s<",dns.latin1()); |
183 | if(dns.contains(" ")){ | 183 | if(dns.contains(" ")){ |
184 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); | 184 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); |
185 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); | 185 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); |
186 | }else firstDNSLineEdit->setText(dns); | 186 | }else firstDNSLineEdit->setText(dns); |
187 | 187 | ||
188 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); | 188 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); |
189 | subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); | 189 | subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); |
190 | if (subnetMaskEdit->text().isEmpty()) | ||
191 | subnetMaskEdit->setText( "255.255.255.0" ); | ||
190 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); | 192 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); |
191 | 193 | ||
192 | 194 | ||
193 | 195 | ||
194 | qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1()); | 196 | qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1()); |
195 | qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1()); | 197 | qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1()); |
196 | 198 | ||
197 | } | 199 | } |
198 | 200 | ||
199 | // interfacesetup.cpp | 201 | // interfacesetup.cpp |
200 | 202 | ||
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 | |||
@@ -123,27 +123,44 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
123 | QStringList params = QStringList::split(",",param); | 123 | QStringList params = QStringList::split(",",param); |
124 | int count = params.count(); | 124 | int count = params.count(); |
125 | qDebug("WLANModule got %i params", count ); | 125 | qDebug("WLANModule got %i params", count ); |
126 | if (count < 2){ | 126 | if (count < 2){ |
127 | qDebug("Erorr less than 2 parameter"); | 127 | qDebug("Erorr less than 2 parameter"); |
128 | qDebug("RETURNING"); | 128 | qDebug("RETURNING"); |
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 | int countMsgs = 0; | ||
136 | stream >> interface; | ||
137 | qDebug("got count? >%s<",interface.latin1()); | ||
138 | if (interface == "count"){ | ||
139 | qDebug("got count"); | ||
140 | stream >> action; | ||
141 | qDebug("Got count num >%s<", action.latin1()); | ||
142 | countMsgs = action.toInt(); | ||
143 | } | ||
144 | |||
135 | QDialog *toShow; | 145 | QDialog *toShow; |
136 | while (! stream.atEnd() ){ | 146 | //while (! stream.atEnd() ){ |
147 | for (int i = 0; i < countMsgs; i++){ | ||
148 | qDebug("start stream %d/%d",i,countMsgs); | ||
149 | if (stream.atEnd()){ | ||
150 | qDebug("end of stream"); | ||
151 | return; | ||
152 | } | ||
137 | stream >> interface; | 153 | stream >> interface; |
154 | qDebug("got iface"); | ||
138 | stream >> action; | 155 | stream >> action; |
139 | qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); | 156 | qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); |
140 | // find interfaces | 157 | // find interfaces |
141 | Interface *ifa=0; | 158 | Interface *ifa=0; |
142 | for ( Interface *i=list.first(); i != 0; i=list.next() ){ | 159 | for ( Interface *i=list.first(); i != 0; i=list.next() ){ |
143 | if (i->getInterfaceName() == interface){ | 160 | if (i->getInterfaceName() == interface){ |
144 | qDebug("WLANModule found interface %s",interface.latin1()); | 161 | qDebug("WLANModule found interface %s",interface.latin1()); |
145 | ifa = i; | 162 | ifa = i; |
146 | } | 163 | } |
147 | } | 164 | } |
148 | 165 | ||
149 | if (ifa == 0){ | 166 | if (ifa == 0){ |
@@ -166,57 +183,70 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
166 | }else if ( action.contains("refresh" ) ){ | 183 | }else if ( action.contains("refresh" ) ){ |
167 | ifa->refresh(); | 184 | ifa->refresh(); |
168 | } | 185 | } |
169 | }else if (count == 3){ | 186 | }else if (count == 3){ |
170 | QString value; | 187 | QString value; |
171 | if (!wlanconfigWiget){ | 188 | if (!wlanconfigWiget){ |
172 | //FIXME: what if it got closed meanwhile? | 189 | //FIXME: what if it got closed meanwhile? |
173 | wlanconfigWiget = (WLANImp*) configure(ifa); | 190 | wlanconfigWiget = (WLANImp*) configure(ifa); |
174 | toShow = (QDialog*) wlanconfigWiget; | 191 | toShow = (QDialog*) wlanconfigWiget; |
175 | } | 192 | } |
176 | wlanconfigWiget->showMaximized(); | 193 | wlanconfigWiget->showMaximized(); |
177 | stream >> value; | 194 | stream >> value; |
178 | qDebug("WLANModule is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); | 195 | qDebug("WLANModule (build 4) is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); |
196 | if (value.isEmpty()){ | ||
197 | qDebug("value is empty!!!\nreturning"); | ||
198 | return; | ||
199 | } | ||
179 | if ( action.contains("ESSID") ){ | 200 | if ( action.contains("ESSID") ){ |
180 | QComboBox *combo = wlanconfigWiget->essid; | 201 | QComboBox *combo = wlanconfigWiget->essid; |
181 | bool found = false; | 202 | bool found = false; |
182 | for ( int i = 0; i < combo->count(); i++) | 203 | for ( int i = 0; i < combo->count(); i++) |
183 | if ( combo->text( i ) == value ){ | 204 | if ( combo->text( i ) == value ){ |
184 | combo->setCurrentItem( i ); | 205 | combo->setCurrentItem( i ); |
185 | found = true; | 206 | found = true; |
186 | } | 207 | } |
187 | if (!found) combo->insertItem( value, 0 ); | 208 | if (!found) combo->insertItem( value, 0 ); |
188 | }else if ( action.contains("Mode") ){ | 209 | }else if ( action.contains("Mode") ){ |
189 | QComboBox *combo = wlanconfigWiget->mode; | 210 | QComboBox *combo = wlanconfigWiget->mode; |
190 | for ( int i = 0; i < combo->count(); i++) | 211 | for ( int i = 0; i < combo->count(); i++) |
191 | if ( combo->text( i ) == value ){ | 212 | if ( combo->text( i ) == value ){ |
192 | combo->setCurrentItem( i ); | 213 | combo->setCurrentItem( i ); |
193 | } | 214 | } |
194 | 215 | ||
195 | }else if (action.contains("Channel")){ | 216 | }else if (action.contains("Channel")){ |
196 | bool ok; | 217 | bool ok; |
218 | qDebug("converting channel"); | ||
197 | int chan = value.toInt( &ok ); | 219 | int chan = value.toInt( &ok ); |
198 | if (ok){ | 220 | if (ok){ |
221 | qDebug("ok setting channel"); | ||
199 | wlanconfigWiget->specifyChan->setChecked( true ); | 222 | wlanconfigWiget->specifyChan->setChecked( true ); |
200 | wlanconfigWiget->networkChannel->setValue( chan ); | 223 | wlanconfigWiget->networkChannel->setValue( chan ); |
201 | } | 224 | } |
202 | }else if (action.contains("MacAddr")){ | 225 | }else if (action.contains("MacAddr")){ |
203 | wlanconfigWiget->specifyAp->setChecked( true ); | 226 | wlanconfigWiget->specifyAp->setChecked( true ); |
204 | wlanconfigWiget->macEdit->setText( value ); | 227 | wlanconfigWiget->macEdit->setText( value ); |
205 | }else | 228 | }else |
206 | qDebug("wlan plugin has no clue"); | 229 | qDebug("wlan plugin has no clue"); |
207 | } | 230 | } |
231 | qDebug("next stream"); | ||
208 | }// while stream | 232 | }// while stream |
233 | qDebug("end of stream"); | ||
209 | if (toShow) toShow->exec(); | 234 | if (toShow) toShow->exec(); |
235 | qDebug("returning"); | ||
210 | } | 236 | } |
211 | 237 | ||
212 | QWidget *WLANModule::getInfo( Interface *i) | 238 | QWidget *WLANModule::getInfo( Interface *i) |
213 | { | 239 | { |
214 | qDebug("WLANModule::getInfo start"); | 240 | qDebug("WLANModule::getInfo start"); |
215 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); | 241 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); |
216 | InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); | 242 | InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); |
217 | info->tabWidget->insertTab(information, "TCP/IP", 0); | 243 | info->tabWidget->insertTab(information, "TCP/IP", 0); |
218 | 244 | info->tabWidget->setCurrentPage( 0 ); | |
245 | info->tabWidget->showPage( information ); | ||
246 | if (info->tabWidget->currentPage() == information ) qDebug("infotab OK"); | ||
247 | else qDebug("infotab NOT OK"); | ||
248 | qDebug("current idx %d", info->tabWidget->currentPageIndex()); | ||
219 | qDebug("WLANModule::getInfo return"); | 249 | qDebug("WLANModule::getInfo return"); |
220 | return info; | 250 | return info; |
221 | } | 251 | } |
222 | 252 | ||