Changeset 2895
- Timestamp:
- 10/11/08 06:46:46 (17 months ago)
- Location:
- pcbsd
- Files:
-
- 6 modified
-
branches/7.0/wificonfig/wificonfigwidgetbase.cpp (modified) (3 diffs)
-
branches/7.0/wificonfig/wifiselectiondialog.cpp (modified) (5 diffs)
-
branches/7.0/wificonfig/wifiselectiondialog.ui (modified) (1 diff)
-
trunk/wificonfig/wificonfigwidgetbase.cpp (modified) (3 diffs)
-
trunk/wificonfig/wifiselectiondialog.cpp (modified) (5 diffs)
-
trunk/wificonfig/wifiselectiondialog.ui (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pcbsd/branches/7.0/wificonfig/wificonfigwidgetbase.cpp
r2669 r2895 78 78 if ( radioSecurityDisabled->isChecked() ) 79 79 { 80 if ( checkBSSID->isChecked() ) { 81 saveValue( "/etc/rc.conf", "ifconfig_" + DeviceName, "ifconfig_" + DeviceName + "=\"" + ifConfigLine + " bssid " + lineBSSID->text() + "\"", -1); 82 } else { 83 saveValue( "/etc/rc.conf", "ifconfig_" + DeviceName, "ifconfig_" + DeviceName + "=\"" + ifConfigLine + " ssid " + lineSSID->text() + "\"", -1); 84 } 80 saveValue( "/etc/rc.conf", "ifconfig_" + DeviceName, "ifconfig_" + DeviceName + "=\"WPA " + ifConfigLine + "\"", -1); 81 82 // Now create the wpa_supplicant file based on saved configuration 83 QFile fileout( "/etc/wpa_supplicant.conf" ); 84 if ( fileout.open( IO_WriteOnly ) ) { 85 86 QTextStream streamout( &fileout ); 87 if ( checkBSSID->isChecked() ) { 88 streamout << "network={\n bssid=\"" + lineBSSID->text() + "\"\n"; 89 } else { 90 streamout << "network={\n ssid=\"" + lineSSID->text() + "\"\n"; 91 } 92 93 streamout << " scan_ssid=1\n"; 94 streamout << " key_mgmt=NONE\n"; 95 streamout << "}\n"; 96 fileout.close(); 97 98 } 85 99 } else if (radioSecurityWEP->isChecked() ) { 86 100 // Write the settings with WEP enabled … … 1005 1019 } 1006 1020 1007 if ( line.find("key_mgmt=") != -1 ) 1008 { 1009 tmp2 = line.remove(0, line.find("=") +1 ); 1010 if ( tmp2 == "NONE" ) { 1011 radioSecurityWEP->setChecked(TRUE); 1012 } 1013 1014 } 1021 // Check if we are using a WEP key for this network 1015 1022 if ( line.find("wep_key") != -1 ) 1016 1023 { … … 1020 1027 radioSecurityWEP->setChecked(TRUE); 1021 1028 } 1022 if ( line.find("wep_tx_keyidx") != -1 ) 1029 1030 // Check for the WEP tx key id 1031 if ( line.find("wep_tx_keyidx") != -1 ) 1023 1032 { 1024 1033 tmp2 = line.remove(0, line.find("wep_tx_keyidx") +1 ); -
pcbsd/branches/7.0/wificonfig/wifiselectiondialog.cpp
r2669 r2895 46 46 47 47 // Start the scan and get the output 48 line = getLineFromCommandOutput("ifconfig " + DeviceName + " up list scan >/tmp/.wifilist 2>/tmp/.wifilist");48 line = getLineFromCommandOutput("ifconfig -v " + DeviceName + " up list scan >/tmp/.wifilist 2>/tmp/.wifilist"); 49 49 50 50 // Now read the output file … … 60 60 tmp = line; 61 61 tmp = tmp.simplified(); 62 tmp. truncate(tmp.find(":"));63 tmp.truncate(tmp.findRev(""));62 tmp.remove(0, tmp.indexOf("SSID<") + 5); 63 tmp.truncate(tmp.indexOf(">")); 64 64 ssid = tmp; 65 65 66 66 // Get the signal strength of this device 67 67 tmp = line; … … 72 72 73 73 // Now find the strength section 74 tmp = tmp.section(" ", 3, 3); 75 tmp.truncate(tmp.find(":")); 74 tmp.truncate(tmp.findRev("SSID<")); 75 tmp.truncate(tmp.findRev(":")); 76 tmp.remove(0, tmp.findRev(" ")); 76 77 strength = tmp; 77 78 79 //QMessageBox::warning( this, "Testing", "SSID:" + ssid + " STR:" + strength ); 78 80 // Add the device to the list box 79 81 strength.toInt(&ok); 80 if ( ok ) {82 if ( ok && !ssid.isEmpty() && ssid != " " ) { 81 83 newStrength = tmp.toInt(&ok); 82 84 if ( newStrength < 25 ) … … 100 102 101 103 } else { 104 if ( ! ssid.isEmpty() && ssid != " " ) { 102 105 // If we didn't get the signal strength, still display the SSID 103 106 FileLoad="/PCBSD/networkmanager/pics/tray_wifi.png"; … … 108 111 109 112 foundItem = 1; 113 } 110 114 } 111 115 -
pcbsd/branches/7.0/wificonfig/wifiselectiondialog.ui
r2166 r2895 6 6 <x>0</x> 7 7 <y>0</y> 8 <width> 292</width>9 <height> 274</height>8 <width>420</width> 9 <height>314</height> 10 10 </rect> 11 11 </property> -
pcbsd/trunk/wificonfig/wificonfigwidgetbase.cpp
r2669 r2895 78 78 if ( radioSecurityDisabled->isChecked() ) 79 79 { 80 if ( checkBSSID->isChecked() ) { 81 saveValue( "/etc/rc.conf", "ifconfig_" + DeviceName, "ifconfig_" + DeviceName + "=\"" + ifConfigLine + " bssid " + lineBSSID->text() + "\"", -1); 82 } else { 83 saveValue( "/etc/rc.conf", "ifconfig_" + DeviceName, "ifconfig_" + DeviceName + "=\"" + ifConfigLine + " ssid " + lineSSID->text() + "\"", -1); 84 } 80 saveValue( "/etc/rc.conf", "ifconfig_" + DeviceName, "ifconfig_" + DeviceName + "=\"WPA " + ifConfigLine + "\"", -1); 81 82 // Now create the wpa_supplicant file based on saved configuration 83 QFile fileout( "/etc/wpa_supplicant.conf" ); 84 if ( fileout.open( IO_WriteOnly ) ) { 85 86 QTextStream streamout( &fileout ); 87 if ( checkBSSID->isChecked() ) { 88 streamout << "network={\n bssid=\"" + lineBSSID->text() + "\"\n"; 89 } else { 90 streamout << "network={\n ssid=\"" + lineSSID->text() + "\"\n"; 91 } 92 93 streamout << " scan_ssid=1\n"; 94 streamout << " key_mgmt=NONE\n"; 95 streamout << "}\n"; 96 fileout.close(); 97 98 } 85 99 } else if (radioSecurityWEP->isChecked() ) { 86 100 // Write the settings with WEP enabled … … 1005 1019 } 1006 1020 1007 if ( line.find("key_mgmt=") != -1 ) 1008 { 1009 tmp2 = line.remove(0, line.find("=") +1 ); 1010 if ( tmp2 == "NONE" ) { 1011 radioSecurityWEP->setChecked(TRUE); 1012 } 1013 1014 } 1021 // Check if we are using a WEP key for this network 1015 1022 if ( line.find("wep_key") != -1 ) 1016 1023 { … … 1020 1027 radioSecurityWEP->setChecked(TRUE); 1021 1028 } 1022 if ( line.find("wep_tx_keyidx") != -1 ) 1029 1030 // Check for the WEP tx key id 1031 if ( line.find("wep_tx_keyidx") != -1 ) 1023 1032 { 1024 1033 tmp2 = line.remove(0, line.find("wep_tx_keyidx") +1 ); -
pcbsd/trunk/wificonfig/wifiselectiondialog.cpp
r2669 r2895 46 46 47 47 // Start the scan and get the output 48 line = getLineFromCommandOutput("ifconfig " + DeviceName + " up list scan >/tmp/.wifilist 2>/tmp/.wifilist");48 line = getLineFromCommandOutput("ifconfig -v " + DeviceName + " up list scan >/tmp/.wifilist 2>/tmp/.wifilist"); 49 49 50 50 // Now read the output file … … 60 60 tmp = line; 61 61 tmp = tmp.simplified(); 62 tmp. truncate(tmp.find(":"));63 tmp.truncate(tmp.findRev(""));62 tmp.remove(0, tmp.indexOf("SSID<") + 5); 63 tmp.truncate(tmp.indexOf(">")); 64 64 ssid = tmp; 65 65 66 66 // Get the signal strength of this device 67 67 tmp = line; … … 72 72 73 73 // Now find the strength section 74 tmp = tmp.section(" ", 3, 3); 75 tmp.truncate(tmp.find(":")); 74 tmp.truncate(tmp.findRev("SSID<")); 75 tmp.truncate(tmp.findRev(":")); 76 tmp.remove(0, tmp.findRev(" ")); 76 77 strength = tmp; 77 78 79 //QMessageBox::warning( this, "Testing", "SSID:" + ssid + " STR:" + strength ); 78 80 // Add the device to the list box 79 81 strength.toInt(&ok); 80 if ( ok ) {82 if ( ok && !ssid.isEmpty() && ssid != " " ) { 81 83 newStrength = tmp.toInt(&ok); 82 84 if ( newStrength < 25 ) … … 100 102 101 103 } else { 104 if ( ! ssid.isEmpty() && ssid != " " ) { 102 105 // If we didn't get the signal strength, still display the SSID 103 106 FileLoad="/PCBSD/networkmanager/pics/tray_wifi.png"; … … 108 111 109 112 foundItem = 1; 113 } 110 114 } 111 115 -
pcbsd/trunk/wificonfig/wifiselectiondialog.ui
r2166 r2895 6 6 <x>0</x> 7 7 <y>0</y> 8 <width> 292</width>9 <height> 274</height>8 <width>420</width> 9 <height>314</height> 10 10 </rect> 11 11 </property>
