author | kergoth <kergoth> | 2003-04-14 23:45:15 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-04-14 23:45:15 (UTC) |
commit | 437c9c5bc73b6feffe769430c66348347d98ba63 (patch) (unidiff) | |
tree | 695179c43edacf47690975b3216419d4eec133be | |
parent | 9de8e53272af12de09283fc796864557db7f29f4 (diff) | |
download | opie-437c9c5bc73b6feffe769430c66348347d98ba63.zip opie-437c9c5bc73b6feffe769430c66348347d98ba63.tar.gz opie-437c9c5bc73b6feffe769430c66348347d98ba63.tar.bz2 |
Oops, remember to call QDialog::accept() in the accept() function :)
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp index 01c9668..73afc92 100644 --- a/noncore/settings/networksettings/wlan/wlanimp2.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp | |||
@@ -170,97 +170,99 @@ void WLANImp::parseKeyStr(QString keystr) { | |||
170 | wepEnabled->setChecked(true); | 170 | wepEnabled->setChecked(true); |
171 | } else { | 171 | } else { |
172 | wepEnabled->setChecked(false); | 172 | wepEnabled->setChecked(false); |
173 | } | 173 | } |
174 | } | 174 | } |
175 | 175 | ||
176 | /** | 176 | /** |
177 | * Check to see if the current config is valid | 177 | * Check to see if the current config is valid |
178 | * Save interfaces | 178 | * Save interfaces |
179 | */ | 179 | */ |
180 | void WLANImp::accept() { | 180 | void WLANImp::accept() { |
181 | if (wepEnabled->isChecked()) { | 181 | if (wepEnabled->isChecked()) { |
182 | if ((keyRadio0->isChecked() && keyLineEdit0->text().isEmpty()) || | 182 | if ((keyRadio0->isChecked() && keyLineEdit0->text().isEmpty()) || |
183 | (keyRadio1->isChecked() && keyLineEdit1->text().isEmpty()) || | 183 | (keyRadio1->isChecked() && keyLineEdit1->text().isEmpty()) || |
184 | (keyRadio2->isChecked() && keyLineEdit2->text().isEmpty()) || | 184 | (keyRadio2->isChecked() && keyLineEdit2->text().isEmpty()) || |
185 | (keyRadio3->isChecked() && keyLineEdit3->text().isEmpty())) { | 185 | (keyRadio3->isChecked() && keyLineEdit3->text().isEmpty())) { |
186 | QMessageBox::information(this, "Error", "Please enter a WEP key.", QMessageBox::Ok); | 186 | QMessageBox::information(this, "Error", "Please enter a WEP key.", QMessageBox::Ok); |
187 | return; | 187 | return; |
188 | } | 188 | } |
189 | } | 189 | } |
190 | 190 | ||
191 | if (essid->currentText().isEmpty()) { | 191 | if (essid->currentText().isEmpty()) { |
192 | QMessageBox::information(this, "Error", "Please select/enter an ESSID.", QMessageBox::Ok); | 192 | QMessageBox::information(this, "Error", "Please select/enter an ESSID.", QMessageBox::Ok); |
193 | return; | 193 | return; |
194 | } | 194 | } |
195 | 195 | ||
196 | if (specifyAp->isChecked() && macEdit->text().isEmpty()) { | 196 | if (specifyAp->isChecked() && macEdit->text().isEmpty()) { |
197 | QMessageBox::information(this, "Error", "Please enter the MAC address of the Access Point.", QMessageBox::Ok); | 197 | QMessageBox::information(this, "Error", "Please enter the MAC address of the Access Point.", QMessageBox::Ok); |
198 | return; | 198 | return; |
199 | } | 199 | } |
200 | 200 | ||
201 | // Try to save the interfaces settings. | 201 | // Try to save the interfaces settings. |
202 | writeOpts(); | 202 | writeOpts(); |
203 | 203 | ||
204 | // Close out the dialog | 204 | // Close out the dialog |
205 | QDialog::accept(); | 205 | QDialog::accept(); |
206 | } | 206 | } |
207 | 207 | ||
208 | void WLANImp::writeOpts() { | 208 | void WLANImp::writeOpts() { |
209 | bool error = false; | 209 | bool error = false; |
210 | 210 | ||
211 | interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText()); | 211 | interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText()); |
212 | interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText()); | 212 | interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText()); |
213 | 213 | ||
214 | if (specifyAp->isChecked()) { | 214 | if (specifyAp->isChecked()) { |
215 | interfaces->setInterfaceOption(QString("wireless_ap"), macEdit->text()); | 215 | interfaces->setInterfaceOption(QString("wireless_ap"), macEdit->text()); |
216 | } else { | 216 | } else { |
217 | interfaces->removeInterfaceOption(QString("wireless_ap")); | 217 | interfaces->removeInterfaceOption(QString("wireless_ap")); |
218 | } | 218 | } |
219 | 219 | ||
220 | if (specifyChan->isChecked()) { | 220 | if (specifyChan->isChecked()) { |
221 | interfaces->setInterfaceOption(QString("wireless_channel"), networkChannel->text()); | 221 | interfaces->setInterfaceOption(QString("wireless_channel"), networkChannel->text()); |
222 | } else { | 222 | } else { |
223 | interfaces->removeInterfaceOption(QString("wireless_channel")); | 223 | interfaces->removeInterfaceOption(QString("wireless_channel")); |
224 | } | 224 | } |
225 | 225 | ||
226 | if (wepEnabled->isChecked()) { | 226 | if (wepEnabled->isChecked()) { |
227 | QStringList keyList; | 227 | QStringList keyList; |
228 | 228 | ||
229 | if (! keyLineEdit0->text().isNull()) { | 229 | if (! keyLineEdit0->text().isNull()) { |
230 | keyList += keyLineEdit0->text(); | 230 | keyList += keyLineEdit0->text(); |
231 | keyList += "[1]"; | 231 | keyList += "[1]"; |
232 | } else if (! keyLineEdit1->text().isNull()) { | 232 | } else if (! keyLineEdit1->text().isNull()) { |
233 | keyList += keyLineEdit1->text(); | 233 | keyList += keyLineEdit1->text(); |
234 | keyList += "[2]"; | 234 | keyList += "[2]"; |
235 | } else if (! keyLineEdit2->text().isNull()) { | 235 | } else if (! keyLineEdit2->text().isNull()) { |
236 | keyList += keyLineEdit2->text(); | 236 | keyList += keyLineEdit2->text(); |
237 | keyList += "[3]"; | 237 | keyList += "[3]"; |
238 | } else if (! keyLineEdit3->text().isNull()) { | 238 | } else if (! keyLineEdit3->text().isNull()) { |
239 | keyList += keyLineEdit3->text(); | 239 | keyList += keyLineEdit3->text(); |
240 | keyList += "[4]"; | 240 | keyList += "[4]"; |
241 | } | 241 | } |
242 | if (acceptNonEnc->isChecked()) { | 242 | if (acceptNonEnc->isChecked()) { |
243 | keyList += "open"; | 243 | keyList += "open"; |
244 | } else { | 244 | } else { |
245 | keyList += "restricted"; | 245 | keyList += "restricted"; |
246 | } | 246 | } |
247 | 247 | ||
248 | keyList += "key"; | 248 | keyList += "key"; |
249 | if (keyRadio0->isChecked()) { | 249 | if (keyRadio0->isChecked()) { |
250 | keyList += "[1]"; | 250 | keyList += "[1]"; |
251 | } else if (keyRadio1->isChecked()) { | 251 | } else if (keyRadio1->isChecked()) { |
252 | keyList += "[2]"; | 252 | keyList += "[2]"; |
253 | } else if (keyRadio2->isChecked()) { | 253 | } else if (keyRadio2->isChecked()) { |
254 | keyList += "[3]"; | 254 | keyList += "[3]"; |
255 | } else if (keyRadio3->isChecked()) { | 255 | } else if (keyRadio3->isChecked()) { |
256 | keyList += "[4]"; | 256 | keyList += "[4]"; |
257 | } | 257 | } |
258 | interfaces->setInterfaceOption(QString("wireless_key"), keyList.join(QString(" "))); | 258 | interfaces->setInterfaceOption(QString("wireless_key"), keyList.join(QString(" "))); |
259 | } else { | 259 | } else { |
260 | interfaces->removeInterfaceOption(QString("wireless_key")); | 260 | interfaces->removeInterfaceOption(QString("wireless_key")); |
261 | } | 261 | } |
262 | interfaces->removeInterfaceOption(QString("wireless_enc")); | 262 | interfaces->removeInterfaceOption(QString("wireless_enc")); |
263 | 263 | ||
264 | if(!interfaceSetup->saveChanges()) | 264 | if(!interfaceSetup->saveChanges()) |
265 | return; | 265 | return; |
266 | |||
267 | QDialog::accept(); | ||
266 | } | 268 | } |