Diffstat (limited to 'noncore/net/networksetup/wlan/wlanimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/networksetup/wlan/wlanimp.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp index 74eef5f..517604f 100644 --- a/noncore/net/networksetup/wlan/wlanimp.cpp +++ b/noncore/net/networksetup/wlan/wlanimp.cpp | |||
@@ -52,97 +52,96 @@ void WLANImp::readConfig() | |||
52 | break; | 52 | break; |
53 | case 2: | 53 | case 2: |
54 | keyRadio2->setChecked( true ); | 54 | keyRadio2->setChecked( true ); |
55 | break; | 55 | break; |
56 | case 3: | 56 | case 3: |
57 | keyRadio3->setChecked( true ); | 57 | keyRadio3->setChecked( true ); |
58 | break; | 58 | break; |
59 | } | 59 | } |
60 | keyLineEdit0->setText(config.readEntry( "dot11WEPDefaultKey0" )); | 60 | keyLineEdit0->setText(config.readEntry( "dot11WEPDefaultKey0" )); |
61 | keyLineEdit1->setText(config.readEntry( "dot11WEPDefaultKey1" )); | 61 | keyLineEdit1->setText(config.readEntry( "dot11WEPDefaultKey1" )); |
62 | keyLineEdit2->setText(config.readEntry( "dot11WEPDefaultKey2" )); | 62 | keyLineEdit2->setText(config.readEntry( "dot11WEPDefaultKey2" )); |
63 | keyLineEdit3->setText(config.readEntry( "dot11WEPDefaultKey3" )); | 63 | keyLineEdit3->setText(config.readEntry( "dot11WEPDefaultKey3" )); |
64 | return; | 64 | return; |
65 | } | 65 | } |
66 | 66 | ||
67 | bool WLANImp::writeConfig() | 67 | bool WLANImp::writeConfig() |
68 | { | 68 | { |
69 | qWarning( "WLANImp::writeConfig() called." ); | 69 | qWarning( "WLANImp::writeConfig() called." ); |
70 | config.setGroup( "Properties" ); | 70 | config.setGroup( "Properties" ); |
71 | if( essNon->isChecked() ) { | 71 | if( essNon->isChecked() ) { |
72 | config.writeEntry( "SSID", "any" ); | 72 | config.writeEntry( "SSID", "any" ); |
73 | } else { | 73 | } else { |
74 | config.writeEntry( "SSID", essSpecificLineEdit->text() ); | 74 | config.writeEntry( "SSID", essSpecificLineEdit->text() ); |
75 | } | 75 | } |
76 | if( networkInfrastructure->isChecked() ){ | 76 | if( networkInfrastructure->isChecked() ){ |
77 | config.writeEntry( "Mode", "Managed" ); | 77 | config.writeEntry( "Mode", "Managed" ); |
78 | } else if( network802->isChecked() ){ | 78 | } else if( network802->isChecked() ){ |
79 | config.writeEntry( "Mode", "adhoc" ); | 79 | config.writeEntry( "Mode", "adhoc" ); |
80 | } | 80 | } |
81 | config.writeEntry( "CHANNEL", networkChannel->value() ); | 81 | config.writeEntry( "CHANNEL", networkChannel->value() ); |
82 | // config.readEntry( "RATE", "auto" ); | 82 | // config.readEntry( "RATE", "auto" ); |
83 | wepEnabled->isChecked() ? config.writeEntry( "dot11PrivacyInvoked", "true" ) : config.writeEntry( "dot11PrivacyInvoked", "false" ); | 83 | wepEnabled->isChecked() ? config.writeEntry( "dot11PrivacyInvoked", "true" ) : config.writeEntry( "dot11PrivacyInvoked", "false" ); |
84 | authOpen->isChecked() ? config.writeEntry( "AuthType", "opensystem" ) : config.writeEntry( "AuthType", "sharedkey" ); | 84 | authOpen->isChecked() ? config.writeEntry( "AuthType", "opensystem" ) : config.writeEntry( "AuthType", "sharedkey" ); |
85 | key40->isChecked() ? config.writeEntry( "PRIV_KEY128", "false" ) : config.writeEntry( "PRIV_KEY128", "true" ); | 85 | key40->isChecked() ? config.writeEntry( "PRIV_KEY128", "false" ) : config.writeEntry( "PRIV_KEY128", "true" ); |
86 | if( keyRadio0->isChecked() ){ | 86 | if( keyRadio0->isChecked() ){ |
87 | config.writeEntry( "dot11WEPDefaultKeyID", 0 ); | 87 | config.writeEntry( "dot11WEPDefaultKeyID", 0 ); |
88 | } else if( keyRadio1->isChecked() ){ | 88 | } else if( keyRadio1->isChecked() ){ |
89 | config.writeEntry( "dot11WEPDefaultKeyID", 1 ); | 89 | config.writeEntry( "dot11WEPDefaultKeyID", 1 ); |
90 | } else if( keyRadio2->isChecked() ){ | 90 | } else if( keyRadio2->isChecked() ){ |
91 | config.writeEntry( "dot11WEPDefaultKeyID", 2 ); | 91 | config.writeEntry( "dot11WEPDefaultKeyID", 2 ); |
92 | } else if( keyRadio3->isChecked() ){ | 92 | } else if( keyRadio3->isChecked() ){ |
93 | config.writeEntry( "dot11WEPDefaultKeyID", 3 ); | 93 | config.writeEntry( "dot11WEPDefaultKeyID", 3 ); |
94 | } | 94 | } |
95 | config.writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() ); | 95 | config.writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() ); |
96 | config.writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() ); | 96 | config.writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() ); |
97 | config.writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() ); | 97 | config.writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() ); |
98 | config.writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() ); | 98 | config.writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() ); |
99 | return writeWirelessOpts( config ); | 99 | return writeWirelessOpts( config ); |
100 | // return true; | ||
101 | } | 100 | } |
102 | 101 | ||
103 | /** | 102 | /** |
104 | */ | 103 | */ |
105 | void WLANImp::accept() | 104 | void WLANImp::accept() |
106 | { | 105 | { |
107 | if ( writeConfig() ) | 106 | if ( writeConfig() ) |
108 | QDialog::accept(); | 107 | QDialog::accept(); |
109 | } | 108 | } |
110 | 109 | ||
111 | void WLANImp::done ( int r ) | 110 | void WLANImp::done ( int r ) |
112 | { | 111 | { |
113 | QDialog::done ( r ); | 112 | QDialog::done ( r ); |
114 | close ( ); | 113 | close ( ); |
115 | } | 114 | } |
116 | 115 | ||
117 | bool WLANImp::writeWirelessOpts( Config &config, QString scheme ) | 116 | bool WLANImp::writeWirelessOpts( Config &config, QString scheme ) |
118 | { | 117 | { |
119 | qWarning( "WLANImp::writeWirelessOpts entered." ); | 118 | qWarning( "WLANImp::writeWirelessOpts entered." ); |
120 | QString prev = "/etc/pcmcia/wireless.opts"; | 119 | QString prev = "/etc/pcmcia/wireless.opts"; |
121 | QFile prevFile(prev); | 120 | QFile prevFile(prev); |
122 | if ( !prevFile.open( IO_ReadOnly ) ) | 121 | if ( !prevFile.open( IO_ReadOnly ) ) |
123 | return false; | 122 | return false; |
124 | 123 | ||
125 | QString tmp = "/etc/pcmcia/wireless.opts-qpe-new"; | 124 | QString tmp = "/etc/pcmcia/wireless.opts-qpe-new"; |
126 | QFile tmpFile(tmp); | 125 | QFile tmpFile(tmp); |
127 | if ( !tmpFile.open( IO_WriteOnly ) ) | 126 | if ( !tmpFile.open( IO_WriteOnly ) ) |
128 | return false; | 127 | return false; |
129 | 128 | ||
130 | bool retval = true; | 129 | bool retval = true; |
131 | 130 | ||
132 | QTextStream in( &prevFile ); | 131 | QTextStream in( &prevFile ); |
133 | QTextStream out( &tmpFile ); | 132 | QTextStream out( &tmpFile ); |
134 | 133 | ||
135 | config.setGroup("Properties"); | 134 | config.setGroup("Properties"); |
136 | 135 | ||
137 | QString line; | 136 | QString line; |
138 | bool found=false; | 137 | bool found=false; |
139 | bool done=false; | 138 | bool done=false; |
140 | while ( !in.atEnd() ) { | 139 | while ( !in.atEnd() ) { |
141 | QString line = in.readLine(); | 140 | QString line = in.readLine(); |
142 | QString wline = line.simplifyWhiteSpace(); | 141 | QString wline = line.simplifyWhiteSpace(); |
143 | if ( !done ) { | 142 | if ( !done ) { |
144 | if ( found ) { | 143 | if ( found ) { |
145 | // skip existing entry for this scheme, and write our own. | 144 | // skip existing entry for this scheme, and write our own. |
146 | if ( wline == ";;" ) { | 145 | if ( wline == ";;" ) { |
147 | found = false; | 146 | found = false; |
148 | continue; | 147 | continue; |