Changeset 2669

Show
Ignore:
Timestamp:
09/02/08 07:50:25 (3 months ago)
Author:
kris
Message:

Fixed the wifi tool to now properly work with SSID's that have a space in the
name

Location:
pcbsd/trunk/wificonfig
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pcbsd/trunk/wificonfig/wificonfig.pro

    r2167 r2669  
    3333TARGET  = wificonfig 
    3434 
     35QMAKE_LIBDIR    = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib 
     36 
    3537DESTDIR = /PCBSD/networkmanager/bin/ 
    3638 
  • pcbsd/trunk/wificonfig/wificonfigwidgetbase.cpp

    r2446 r2669  
    9494      }     
    9595             
    96              
    97     // If we are using WEP security, write the ifconfig line 
    98       QString confLine = "ifconfig_" + DeviceName + "=\""; 
    99       confLine += ifConfigLine; 
    100       if ( checkBSSID->isChecked() ) { 
    101           confLine += " bssid " + lineBSSID->text() + " wepmode on";   
    102       } else { 
    103           confLine += " ssid \"" + lineSSID->text() + "\" wepmode on"; 
    104       } 
    105  
    106       if ( WEPHex ) { 
    107       confLine += " wepkey 0x" + WEPKey + " weptxkey " + tmp.setNum(WEPIndex); 
    108       } else { 
    109       confLine += " wepkey \"" + WEPKey + "\" weptxkey " + tmp.setNum(WEPIndex); 
    110       } 
    111  
    112       confLine += "\""; 
    113      saveValue( "/etc/rc.conf", "ifconfig_" + DeviceName, confLine, -1); 
     96     // Indicate that we are using WPA supplicant 
     97     saveValue( "/etc/rc.conf", "ifconfig_" + DeviceName, "ifconfig_" + DeviceName + "=\"WPA " + ifConfigLine + "\"", -1); 
     98 
     99     // Now create the wpa_supplicant file based on saved configuration 
     100    QFile fileout( "/etc/wpa_supplicant.conf" ); 
     101    if ( fileout.open( IO_WriteOnly ) ) { 
     102        QTextStream streamout( &fileout ); 
     103        if ( checkBSSID->isChecked() ) { 
     104            streamout << "network={\n bssid=\"" + lineBSSID->text() + "\"\n"; 
     105        } else { 
     106            streamout << "network={\n ssid=\"" + lineSSID->text() + "\"\n"; 
     107        } 
     108 
     109        streamout << " scan_ssid=1\n"; 
     110        streamout << " key_mgmt=NONE\n"; 
     111        streamout << " wep_tx_keyidx=" + tmp.setNum(WEPIndex -1) + "\n"; 
     112        streamout << " wep_key" + tmp.setNum(WEPIndex -1) + "=" + WEPKey + "\n"; 
     113        streamout << "}\n"; 
     114        fileout.close(); 
     115    } 
     116 
    114117             
    115118    } else if (radioSecurityWPAPersonal->isChecked() ) { 
     
    10251028                        if ( ok ) { 
    10261029                            WEPIndex = tmp2.toInt(&ok); 
     1030                            WEPIndex++; 
    10271031                        } 
    10281032                        radioSecurityWEP->setChecked(TRUE);      
  • pcbsd/trunk/wificonfig/wifiselectiondialog.cpp

    r2657 r2669  
    6060                 tmp = line; 
    6161                 tmp = tmp.simplified(); 
    62                  tmp.truncate(tmp.find(" ")); 
     62                 tmp.truncate(tmp.find(":")); 
     63                 tmp.truncate(tmp.findRev(" ")); 
    6364                 ssid = tmp; 
    6465                  
     
    6667                 tmp = line; 
    6768                 tmp = tmp.simplified(); 
    68                  tmp = tmp.section(" ", 4, 4); 
     69 
     70                 // First remove the SSID which may have spaces in it 
     71                 tmp.remove(0, tmp.find(":")); 
     72                   
     73                 // Now find the strength section 
     74                 tmp = tmp.section(" ", 3, 3); 
    6975                 tmp.truncate(tmp.find(":")); 
    7076                 strength = tmp; 
     
    166172     
    167173    selectedSSID = listWifi->text(sel); 
    168     selectedSSID.truncate( selectedSSID.find(" ") ); 
     174    selectedSSID.truncate( selectedSSID.find("(") - 1 ); 
    169175     
    170176    // Emit the new network SSID the user selected