summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings
Unidiff
Diffstat (limited to 'noncore/settings/networksettings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfaces.cpp114
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp2
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp36
3 files changed, 92 insertions, 60 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
@@ -12,13 +12,13 @@
12/** 12/**
13 * Constructor. Reads in the interfaces file and then split the file up by 13 * Constructor. Reads in the interfaces file and then split the file up by
14 * the \n for interfaces variable. 14 * the \n for interfaces variable.
15 * @param useInterfacesFile if an interface file other then the default is 15 * @param useInterfacesFile if an interface file other then the default is
16 * desired to be used it should be passed in. 16 * desired to be used it should be passed in.
17 */ 17 */
18Interfaces::Interfaces(QString useInterfacesFile){ 18Interfaces::Interfaces(QString useInterfacesFile){
19 acceptedFamily.append(INTERFACES_FAMILY_INET); 19 acceptedFamily.append(INTERFACES_FAMILY_INET);
20 acceptedFamily.append(INTERFACES_FAMILY_IPX); 20 acceptedFamily.append(INTERFACES_FAMILY_IPX);
21 acceptedFamily.append(INTERFACES_FAMILY_INET6); 21 acceptedFamily.append(INTERFACES_FAMILY_INET6);
22 22
23 interfacesFile = useInterfacesFile; 23 interfacesFile = useInterfacesFile;
24 QFile file(interfacesFile); 24 QFile file(interfacesFile);
@@ -37,5 +37,5 @@ Interfaces::Interfaces(QString useInterfacesFile){
37 file.close(); 37 file.close();
38 interfaces = QStringList::split("\n", line, true); 38 interfaces = QStringList::split("\n", line, true);
39 39
40 currentIface = interfaces.end(); 40 currentIface = interfaces.end();
41 currentMapping = interfaces.end(); 41 currentMapping = interfaces.end();
@@ -45,8 +45,8 @@ Interfaces::Interfaces(QString useInterfacesFile){
45/** 45/**
46 * Get a list of all interfaces in the interface file. Usefull for 46 * Get a list of all interfaces in the interface file. Usefull for
47 * hardware that is not currently connected such as an 802.11b card 47 * hardware that is not currently connected such as an 802.11b card
48 * not plugged in, but configured for when it is plugged in. 48 * not plugged in, but configured for when it is plugged in.
49 * @return Return string list of interfaces. 49 * @return Return string list of interfaces.
50 **/ 50 **/
51QStringList Interfaces::getInterfaceList(){ 51QStringList Interfaces::getInterfaceList(){
52 QStringList list; 52 QStringList list;
@@ -68,8 +68,8 @@ QStringList Interfaces::getInterfaceList(){
68/** 68/**
69 * Find out if interface is in an "auto" group or not. 69 * Find out if interface is in an "auto" group or not.
70 * Report any duplicates such as eth0 being in two differnt auto's 70 * Report any duplicates such as eth0 being in two differnt auto's
71 * @param interface interface to check to see if it is on or not. 71 * @param interface interface to check to see if it is on or not.
72 * @return true is interface is in auto 72 * @return true is interface is in auto
73 */ 73 */
74bool Interfaces::isAuto(const QString &interface) const { 74bool Interfaces::isAuto(const QString &interface) const {
75 QStringList autoLines = interfaces.grep(QRegExp(AUTO)); 75 QStringList autoLines = interfaces.grep(QRegExp(AUTO));
@@ -85,10 +85,10 @@ bool Interfaces::isAuto(const QString &interface) const {
85 * @param setAuto the value to set interface to. 85 * @param setAuto the value to set interface to.
86 * @return false if already set to setAuto. 86 * @return false if already set to setAuto.
87 * */ 87 * */
88bool Interfaces::setAuto(const QString &interface, bool setAuto){ 88bool Interfaces::setAuto(const QString &interface, bool setAuto){
89 // Don't need to set it if it is already set. 89 // Don't need to set it if it is already set.
90 if(isAuto(interface) == setAuto) 90 if(isAuto(interface) == setAuto)
91 return false; 91 return false;
92 92
93 bool changed = false; 93 bool changed = false;
94 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { 94 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
@@ -126,6 +126,6 @@ bool Interfaces::setAuto(const QString &interface, bool setAuto){
126 * @param interface the name of the interface to set. All whitespace is 126 * @param interface the name of the interface to set. All whitespace is
127 * removed from the interface name. 127 * removed from the interface name.
128 * @return bool true if it is successfull. 128 * @return bool true if it is successfull.
129 */ 129 */
130bool Interfaces::setInterface(QString interface){ 130bool Interfaces::setInterface(QString interface){
131 interface = interface.simplifyWhiteSpace(); 131 interface = interface.simplifyWhiteSpace();
@@ -137,5 +137,5 @@ bool Interfaces::setInterface(QString interface){
137 * A quick helper funtion to see if the current interface is set. 137 * A quick helper funtion to see if the current interface is set.
138 * @return bool true if set, false otherwise. 138 * @return bool true if set, false otherwise.
139 */ 139 */
140bool Interfaces::isInterfaceSet() const { 140bool Interfaces::isInterfaceSet() const {
141 return (interfaces.end() != currentIface); 141 return (interfaces.end() != currentIface);
@@ -150,5 +150,5 @@ bool Interfaces::isInterfaceSet() const {
150 * @param method for the family. see interfaces man page for family methods. 150 * @param method for the family. see interfaces man page for family methods.
151 * @return true if successfull. 151 * @return true if successfull.
152 */ 152 */
153bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ 153bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){
154 if(0 == acceptedFamily.contains(family)) 154 if(0 == acceptedFamily.contains(family))
@@ -165,5 +165,5 @@ bool Interfaces::addInterface(const QString &interface, const QString &family, c
165 * @param newInterface name of the new interface. 165 * @param newInterface name of the new interface.
166 * @return bool true if successfull 166 * @return bool true if successfull
167 */ 167 */
168bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ 168bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){
169 if(!setInterface(interface)) 169 if(!setInterface(interface))
@@ -173,5 +173,5 @@ bool Interfaces::copyInterface(const QString &interface, const QString &newInter
173 QStringList::Iterator it = currentIface; 173 QStringList::Iterator it = currentIface;
174 it++; 174 it++;
175 175
176 // Add the new interface 176 // Add the new interface
177 bool error; 177 bool error;
@@ -179,8 +179,8 @@ bool Interfaces::copyInterface(const QString &interface, const QString &newInter
179 if(!setInterface(newInterface)) 179 if(!setInterface(newInterface))
180 return false; 180 return false;
181 181
182 QStringList::Iterator newIface = currentIface; 182 QStringList::Iterator newIface = currentIface;
183 newIface++; 183 newIface++;
184 184
185 // Copy all of the lines 185 // Copy all of the lines
186 for ( ; it != interfaces.end(); ++it ){ 186 for ( ; it != interfaces.end(); ++it ){
@@ -189,5 +189,5 @@ bool Interfaces::copyInterface(const QString &interface, const QString &newInter
189 newIface = interfaces.insert(newIface, *it); 189 newIface = interfaces.insert(newIface, *it);
190 } 190 }
191 191
192 return true; 192 return true;
193} 193}
@@ -196,5 +196,5 @@ bool Interfaces::copyInterface(const QString &interface, const QString &newInter
196 * Remove the currently selected interface and all of its options. 196 * Remove the currently selected interface and all of its options.
197 * @return bool if successfull or not. 197 * @return bool if successfull or not.
198 */ 198 */
199bool Interfaces::removeInterface(){ 199bool Interfaces::removeInterface(){
200 return removeStanza(currentIface); 200 return removeStanza(currentIface);
@@ -205,5 +205,5 @@ bool Interfaces::removeInterface(){
205 * @return QString name of the hardware interface (eth0, usb2, wlan1...). 205 * @return QString name of the hardware interface (eth0, usb2, wlan1...).
206 * @param error set to true if any error occurs, false otherwise. 206 * @param error set to true if any error occurs, false otherwise.
207 */ 207 */
208QString Interfaces::getInterfaceName(bool &error){ 208QString Interfaces::getInterfaceName(bool &error){
209 if(currentIface == interfaces.end()){ 209 if(currentIface == interfaces.end()){
@@ -227,5 +227,5 @@ QString Interfaces::getInterfaceName(bool &error){
227 * @return QString name of the family (inet, inet6, ipx). 227 * @return QString name of the family (inet, inet6, ipx).
228 * @param error set to true if any error occurs, false otherwise. 228 * @param error set to true if any error occurs, false otherwise.
229 */ 229 */
230QString Interfaces::getInterfaceFamily(bool &error){ 230QString Interfaces::getInterfaceFamily(bool &error){
231 QString name = getInterfaceName(error); 231 QString name = getInterfaceName(error);
@@ -250,5 +250,5 @@ QString Interfaces::getInterfaceFamily(bool &error){
250 * See the man page of interfaces for possible methods depending on the family. 250 * See the man page of interfaces for possible methods depending on the family.
251 * @param error set to true if any error occurs, false otherwise. 251 * @param error set to true if any error occurs, false otherwise.
252 */ 252 */
253QString Interfaces::getInterfaceMethod(bool &error){ 253QString Interfaces::getInterfaceMethod(bool &error){
254 QString name = getInterfaceName(error); 254 QString name = getInterfaceName(error);
@@ -268,8 +268,8 @@ QString Interfaces::getInterfaceMethod(bool &error){
268 268
269/** 269/**
270 * Sets the interface name to newName. 270 * Sets the interface name to newName.
271 * @param newName the new name of the interface. All whitespace is removed. 271 * @param newName the new name of the interface. All whitespace is removed.
272 * @return bool true if successfull. 272 * @return bool true if successfull.
273 */ 273 */
274bool Interfaces::setInterfaceName(const QString &newName){ 274bool Interfaces::setInterfaceName(const QString &newName){
275 if(currentIface == interfaces.end()) 275 if(currentIface == interfaces.end())
@@ -279,13 +279,13 @@ bool Interfaces::setInterfaceName(const QString &newName){
279 bool returnValue = false; 279 bool returnValue = false;
280 (*currentIface) = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); 280 (*currentIface) = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue));
281 return !returnValue; 281 return !returnValue;
282} 282}
283 283
284/** 284/**
285 * Sets the interface family to newName. 285 * Sets the interface family to newName.
286 * @param newName the new name of the interface. Must be one of the families 286 * @param newName the new name of the interface. Must be one of the families
287 * defined in the interfaces.h file. 287 * defined in the interfaces.h file.
288 * @return bool true if successfull. 288 * @return bool true if successfull.
289 */ 289 */
290bool Interfaces::setInterfaceFamily(const QString &newName){ 290bool Interfaces::setInterfaceFamily(const QString &newName){
291 if(currentIface == interfaces.end()) 291 if(currentIface == interfaces.end())
@@ -295,5 +295,5 @@ bool Interfaces::setInterfaceFamily(const QString &newName){
295 bool returnValue = false; 295 bool returnValue = false;
296 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(newName).arg(getInterfaceMethod(returnValue)); 296 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(newName).arg(getInterfaceMethod(returnValue));
297 return !returnValue; 297 return !returnValue;
298} 298}
299 299
@@ -302,5 +302,5 @@ bool Interfaces::setInterfaceFamily(const QString &newName){
302 * @param newName the new name of the interface 302 * @param newName the new name of the interface
303 * @return bool true if successfull. 303 * @return bool true if successfull.
304 */ 304 */
305bool Interfaces::setInterfaceMethod(const QString &newName){ 305bool Interfaces::setInterfaceMethod(const QString &newName){
306 if(currentIface == interfaces.end()) 306 if(currentIface == interfaces.end())
@@ -308,5 +308,5 @@ bool Interfaces::setInterfaceMethod(const QString &newName){
308 bool returnValue = false; 308 bool returnValue = false;
309 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(getInterfaceFamily(returnValue)).arg(newName); 309 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(getInterfaceFamily(returnValue)).arg(newName);
310 return !returnValue; 310 return !returnValue;
311} 311}
312 312
@@ -320,5 +320,5 @@ bool Interfaces::setInterfaceMethod(const QString &newName){
320 * @param error set to true if any error occurs, false otherwise. 320 * @param error set to true if any error occurs, false otherwise.
321 * @return QString the options value. QString::null if error == true 321 * @return QString the options value. QString::null if error == true
322 */ 322 */
323QString Interfaces::getInterfaceOption(const QString &option, bool &error){ 323QString Interfaces::getInterfaceOption(const QString &option, bool &error){
324 return getOption(currentIface, option, error); 324 return getOption(currentIface, option, error);
@@ -332,5 +332,5 @@ QString Interfaces::getInterfaceOption(const QString &option, bool &error){
332 * @param error set to true if any error occurs, false otherwise. 332 * @param error set to true if any error occurs, false otherwise.
333 * @return QString the options value. QString::null if error == true 333 * @return QString the options value. QString::null if error == true
334 */ 334 */
335bool Interfaces::setInterfaceOption(const QString &option, const QString &value){ 335bool Interfaces::setInterfaceOption(const QString &option, const QString &value){
336 return setOption(currentIface, option, value); 336 return setOption(currentIface, option, value);
@@ -338,9 +338,9 @@ bool Interfaces::setInterfaceOption(const QString &option, const QString &value)
338 338
339/** 339/**
340 * Removes a value for an option in the currently selected interface. 340 * Removes a value for an option in the currently selected interface.
341 * @param option the options to set the value. 341 * @param option the options to set the value.
342 * @param error set to true if any error occurs, false otherwise. 342 * @param error set to true if any error occurs, false otherwise.
343 * @return QString the options value. QString::null if error == true 343 * @return QString the options value. QString::null if error == true
344 */ 344 */
345bool Interfaces::removeInterfaceOption(const QString &option){ 345bool Interfaces::removeInterfaceOption(const QString &option){
346 return removeOption(currentIface, option); 346 return removeOption(currentIface, option);
@@ -348,10 +348,10 @@ bool Interfaces::removeInterfaceOption(const QString &option){
348 348
349/** 349/**
350 * Removes a value for an option in the currently selected interface. 350 * Removes a value for an option in the currently selected interface.
351 * @param option the options to set the value. 351 * @param option the options to set the value.
352 * @param value the value that option should be set to. 352 * @param value the value that option should be set to.
353 * @param error set to true if any error occurs, false otherwise. 353 * @param error set to true if any error occurs, false otherwise.
354 * @return QString the options value. QString::null if error == true 354 * @return QString the options value. QString::null if error == true
355 */ 355 */
356bool Interfaces::removeInterfaceOption(const QString &option, const QString &value){ 356bool Interfaces::removeInterfaceOption(const QString &option, const QString &value){
357 return removeOption(currentIface, option, value); 357 return removeOption(currentIface, option, value);
@@ -360,6 +360,6 @@ bool Interfaces::removeInterfaceOption(const QString &option, const QString &val
360/** 360/**
361 * Removes all of the options from the currently selected interface. 361 * Removes all of the options from the currently selected interface.
362 * @return bool error if if successfull 362 * @return bool error if if successfull
363 */ 363 */
364bool Interfaces::removeAllInterfaceOptions(){ 364bool Interfaces::removeAllInterfaceOptions(){
365 return removeAllOptions(currentIface); 365 return removeAllOptions(currentIface);
@@ -371,6 +371,6 @@ bool Interfaces::removeAllInterfaceOptions(){
371 * @param interface the name of the interface to set. All whitespace is 371 * @param interface the name of the interface to set. All whitespace is
372 * removed from the interface name. 372 * removed from the interface name.
373 * @return bool true if it is successfull. 373 * @return bool true if it is successfull.
374 */ 374 */
375bool Interfaces::setMapping(const QString &interface){ 375bool Interfaces::setMapping(const QString &interface){
376 QString interfaceName = interface.simplifyWhiteSpace(); 376 QString interfaceName = interface.simplifyWhiteSpace();
@@ -382,5 +382,5 @@ bool Interfaces::setMapping(const QString &interface){
382 * Adds a new Mapping to the interfaces file with interfaces. 382 * Adds a new Mapping to the interfaces file with interfaces.
383 * @param interface the name(s) of the interfaces to set to this mapping 383 * @param interface the name(s) of the interfaces to set to this mapping
384 */ 384 */
385void Interfaces::addMapping(const QString &option){ 385void Interfaces::addMapping(const QString &option){
386 interfaces.append(""); 386 interfaces.append("");
@@ -394,5 +394,5 @@ void Interfaces::addMapping(const QString &option){
394bool Interfaces::removeMapping(){ 394bool Interfaces::removeMapping(){
395 return removeStanza(currentMapping); 395 return removeStanza(currentMapping);
396} 396}
397 397
398/** 398/**
@@ -401,5 +401,5 @@ bool Interfaces::removeMapping(){
401 * @param value value to go with map 401 * @param value value to go with map
402 * @return bool true if it is successfull. 402 * @return bool true if it is successfull.
403 */ 403 */
404bool Interfaces::setMap(const QString &map, const QString &value){ 404bool Interfaces::setMap(const QString &map, const QString &value){
405 return setOption(currentMapping, map, value); 405 return setOption(currentMapping, map, value);
@@ -411,5 +411,5 @@ bool Interfaces::setMap(const QString &map, const QString &value){
411 * @param value value to go with map 411 * @param value value to go with map
412 * @return bool true if it is successfull. 412 * @return bool true if it is successfull.
413 */ 413 */
414bool Interfaces::removeMap(const QString &map, const QString &value){ 414bool Interfaces::removeMap(const QString &map, const QString &value){
415 return removeOption(currentMapping, map, value); 415 return removeOption(currentMapping, map, value);
@@ -421,5 +421,5 @@ bool Interfaces::removeMap(const QString &map, const QString &value){
421 * @param bool true if it is successfull. 421 * @param bool true if it is successfull.
422 * @return value that goes to the map 422 * @return value that goes to the map
423 */ 423 */
424QString Interfaces::getMap(const QString &map, bool &error){ 424QString Interfaces::getMap(const QString &map, bool &error){
425 return getOption(currentMapping, map, error); 425 return getOption(currentMapping, map, error);
@@ -430,5 +430,5 @@ QString Interfaces::getMap(const QString &map, bool &error){
430 * @param argument the script name. 430 * @param argument the script name.
431 * @return true if successfull. 431 * @return true if successfull.
432 */ 432 */
433bool Interfaces::setScript(const QString &argument){ 433bool Interfaces::setScript(const QString &argument){
434 return setOption(currentMapping, "script", argument); 434 return setOption(currentMapping, "script", argument);
@@ -438,5 +438,5 @@ bool Interfaces::setScript(const QString &argument){
438 * @param error true if could not retrieve the current script argument. 438 * @param error true if could not retrieve the current script argument.
439 * @return QString the argument of the script for the current mapping. 439 * @return QString the argument of the script for the current mapping.
440 */ 440 */
441QString Interfaces::getScript(bool &error){ 441QString Interfaces::getScript(bool &error){
442 return getOption(currentMapping, "script", error); 442 return getOption(currentMapping, "script", error);
@@ -446,5 +446,5 @@ QString Interfaces::getScript(bool &error){
446 446
447/** 447/**
448 * Helper function used to parse through the QStringList and put pointers in 448 * Helper function used to parse through the QStringList and put pointers in
449 * the correct place. 449 * the correct place.
450 * @param stanza The stanza (auto, iface, mapping) to look for. 450 * @param stanza The stanza (auto, iface, mapping) to look for.
@@ -452,5 +452,5 @@ QString Interfaces::getScript(bool &error){
452 * @param interator interator to place at location of stanza if successfull. 452 * @param interator interator to place at location of stanza if successfull.
453 * @return bool true if the stanza is found. 453 * @return bool true if the stanza is found.
454 */ 454 */
455bool Interfaces::setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator){ 455bool Interfaces::setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator){
456 bool found = false; 456 bool found = false;
@@ -493,5 +493,5 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op
493 if(start == interfaces.end()) 493 if(start == interfaces.end())
494 return false; 494 return false;
495 495
496 bool found = false; 496 bool found = false;
497 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 497 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
@@ -524,5 +524,5 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op
524 * @param stanza the stanza to remove 524 * @param stanza the stanza to remove
525 * @return bool true if successfull. 525 * @return bool true if successfull.
526 */ 526 */
527bool Interfaces::removeStanza(QStringList::Iterator &stanza){ 527bool Interfaces::removeStanza(QStringList::Iterator &stanza){
528 if(stanza == interfaces.end()) 528 if(stanza == interfaces.end())
@@ -541,5 +541,5 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString
541 if(start == interfaces.end()) 541 if(start == interfaces.end())
542 return false; 542 return false;
543 543
544 bool found = false; 544 bool found = false;
545 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 545 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
@@ -568,5 +568,5 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString
568 if(start == interfaces.end()) 568 if(start == interfaces.end())
569 return false; 569 return false;
570 570
571 bool found = false; 571 bool found = false;
572 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 572 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
@@ -594,5 +594,5 @@ bool Interfaces::removeAllOptions(const QStringList::Iterator &start){
594 if(start == interfaces.end()) 594 if(start == interfaces.end())
595 return false; 595 return false;
596 596
597 QStringList::Iterator it = start; 597 QStringList::Iterator it = start;
598 it = ++it; 598 it = ++it;
@@ -621,5 +621,5 @@ QString Interfaces::getOption(const QStringList::Iterator &start, const QString
621 return QString(); 621 return QString();
622 } 622 }
623 623
624 QString value; 624 QString value;
625 bool found = false; 625 bool found = false;
@@ -648,5 +648,5 @@ QString Interfaces::getOption(const QStringList::Iterator &start, const QString
648 * Removes any excess blank lines over 1 line long. 648 * Removes any excess blank lines over 1 line long.
649 * @return bool true if successfull, false if not. 649 * @return bool true if successfull, false if not.
650 */ 650 */
651bool Interfaces::write(){ 651bool Interfaces::write(){
652 QFile::remove(interfacesFile); 652 QFile::remove(interfacesFile);
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
@@ -188,4 +188,6 @@ void InterfaceSetupImp::setProfile(const QString &profile){
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
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
@@ -133,7 +133,24 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
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());
@@ -176,5 +193,9 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
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;
@@ -195,6 +216,8 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
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 );
@@ -206,6 +229,9 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
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
@@ -216,5 +242,9 @@ QWidget *WLANModule::getInfo( Interface *i)
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;