summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/wlan/wlanimp2.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings/wlan/wlanimp2.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp2.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp
index cdafb4d..26e3aa9 100644
--- a/noncore/settings/networksettings/wlan/wlanimp2.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp
@@ -29,3 +29,3 @@
*/
-WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), currentProfile("*"), interface(i) {
+WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") {
interfaces = new Interfaces();
@@ -69,10 +69,5 @@ void WLANImp::parseOpts() {
opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace();
- if (opt == "Auto") {
- mode->setCurrentItem(0);
- } else if (opt == "Ad-Hoc") {
- mode->setCurrentItem(2);
- } else {
- // Managed/Infrastructure mode
- mode->setCurrentItem(1);
- }
+
+ for ( int i = 0; i < mode->count(); i++)
+ if ( mode->text( i ) == opt ) mode->setCurrentItem( i );
@@ -205,3 +200,3 @@ void WLANImp::accept() {
// Close out the dialog
- QDialog::accept();
+// FIXME: QDialog::accept();
}
@@ -209,4 +204,13 @@ void WLANImp::accept() {
void WLANImp::writeOpts() {
+ // eh can't really do anything about it other then return. :-D
+ if(!interfaces->isInterfaceSet()){
+ QMessageBox::warning(0,"Inface not set","should not happen!!!");
+ return;
+ }
bool error = false;
+ qDebug("setting wlan interface %s", interfaces->getInterfaceName( error ).latin1() );
+
+ if (error) QMessageBox::warning(0,"Inface not set","should not happen!!!");
+
interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText());
@@ -232,9 +236,12 @@ void WLANImp::writeOpts() {
keyList += "[1]";
- } else if (! keyLineEdit1->text().isNull()) {
+ } //else
+ if (! keyLineEdit1->text().isNull()) {
keyList += keyLineEdit1->text();
keyList += "[2]";
- } else if (! keyLineEdit2->text().isNull()) {
+ } //else
+ if (! keyLineEdit2->text().isNull()) {
keyList += keyLineEdit2->text();
keyList += "[3]";
- } else if (! keyLineEdit3->text().isNull()) {
+ } //else
+ if (! keyLineEdit3->text().isNull()) {
keyList += keyLineEdit3->text();