-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index db03266..3797e22 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp | |||
@@ -181,68 +181,62 @@ void WLANImp::changeAndSaveSettingFile(){ | |||
181 | if(wepEnabled->isChecked()){ | 181 | if(wepEnabled->isChecked()){ |
182 | stream << "\tKEY=\""; | 182 | stream << "\tKEY=\""; |
183 | if(keyRadio0->isChecked()) stream << keyLineEdit0->text(); | 183 | if(keyRadio0->isChecked()) stream << keyLineEdit0->text(); |
184 | if(keyRadio1->isChecked()) stream << keyLineEdit1->text(); | 184 | if(keyRadio1->isChecked()) stream << keyLineEdit1->text(); |
185 | if(keyRadio2->isChecked()) stream << keyLineEdit2->text(); | 185 | if(keyRadio2->isChecked()) stream << keyLineEdit2->text(); |
186 | if(keyRadio3->isChecked()) stream << keyLineEdit3->text(); | 186 | if(keyRadio3->isChecked()) stream << keyLineEdit3->text(); |
187 | if(authOpen->isChecked()) | 187 | if(authOpen->isChecked()) |
188 | stream << " open"; | 188 | stream << " open"; |
189 | else | 189 | else |
190 | stream << " restricted"; | 190 | stream << " restricted"; |
191 | stream << "\"\n"; | 191 | stream << "\"\n"; |
192 | } | 192 | } |
193 | stream << "\tRATE=auto\n"; | 193 | stream << "\tRATE=auto\n"; |
194 | if(line.contains("esac")) | 194 | if(line.contains("esac")) |
195 | stream << line << "\n"; | 195 | stream << line << "\n"; |
196 | } | 196 | } |
197 | if(line.contains(";;")) | 197 | if(line.contains(";;")) |
198 | output = true; | 198 | output = true; |
199 | if(output && (*it).length() ) | 199 | if(output && (*it).length() ) |
200 | stream << (*it) << '\n'; | 200 | stream << (*it) << '\n'; |
201 | } | 201 | } |
202 | file.close(); | 202 | file.close(); |
203 | } | 203 | } |
204 | 204 | ||
205 | /** | 205 | /** |
206 | * Check to see if the current config is valid | 206 | * Check to see if the current config is valid |
207 | * Save wireless.opts, save interfaces | 207 | * Save wireless.opts, save interfaces |
208 | */ | 208 | */ |
209 | void WLANImp::accept(){ | 209 | void WLANImp::accept(){ |
210 | if(wepEnabled->isChecked()){ | 210 | if(wepEnabled->isChecked()){ |
211 | if(keyLineEdit0->text().isEmpty() && keyLineEdit1->text().isEmpty() && keyLineEdit2->text().isEmpty() && keyLineEdit3->text().isEmpty() ){ | 211 | if(keyLineEdit0->text().isEmpty() && keyLineEdit1->text().isEmpty() && keyLineEdit2->text().isEmpty() && keyLineEdit3->text().isEmpty() ){ |
212 | QMessageBox::information(this, "Error", "Please enter a key for WEP.", QMessageBox::Ok); | 212 | QMessageBox::information(this, "Error", "Please enter a key for WEP.", QMessageBox::Ok); |
213 | return; | 213 | return; |
214 | } | 214 | } |
215 | } | 215 | } |
216 | 216 | ||
217 | if(essAny->isChecked() && essSpecificLineEdit->text().isEmpty()){ | 217 | if(essAny->isChecked() && essSpecificLineEdit->text().isEmpty()){ |
218 | QMessageBox::information(this, "Error", "Please enter a ESS-ID.", QMessageBox::Ok); | 218 | QMessageBox::information(this, "Error", "Please enter a ESS-ID.", QMessageBox::Ok); |
219 | return; | 219 | return; |
220 | } | 220 | } |
221 | 221 | ||
222 | // Ok settings are good here, save | 222 | // Ok settings are good here, save |
223 | changeAndSaveSettingFile(); | 223 | changeAndSaveSettingFile(); |
224 | 224 | ||
225 | // Try to save the interfaces settings. | 225 | // Try to save the interfaces settings. |
226 | if(!interfaceSetup->saveChanges()) | 226 | if(!interfaceSetup->saveChanges()) |
227 | return; | 227 | return; |
228 | 228 | ||
229 | OProcess insert; | 229 | OProcess insert(QString("sh")); |
230 | // OProcess eject; | 230 | insert << "-c"; |
231 | 231 | insert << "cardctl eject && cardctl insert"; | |
232 | insert << "sh -c \"cardctl insert && cardctl eject\""; | ||
233 | // eject << "cardctl eject"; | ||
234 | |||
235 | // if (!eject.start(OProcess::Block, OProcess::NoCommunication) ) { | ||
236 | // qWarning("could not start cardctl eject"); | ||
237 | // } | ||
238 | 232 | ||
239 | if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) { | 233 | if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) { |
240 | qWarning("could not start cardctl insert"); | 234 | qWarning("could not start cardctl"); |
241 | } | 235 | } |
242 | 236 | ||
243 | // Close out the dialog | 237 | // Close out the dialog |
244 | QDialog::accept(); | 238 | QDialog::accept(); |
245 | } | 239 | } |
246 | 240 | ||
247 | // wlanimp.cpp | 241 | // wlanimp.cpp |
248 | 242 | ||