summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/wlan
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/wlan') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/wlan/keyedit.cpp1
-rw-r--r--noncore/settings/networksettings/wlan/wlan.ui96
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp2.cpp35
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp2
4 files changed, 74 insertions, 60 deletions
diff --git a/noncore/settings/networksettings/wlan/keyedit.cpp b/noncore/settings/networksettings/wlan/keyedit.cpp
index ad9ecae..13a1c3b 100644
--- a/noncore/settings/networksettings/wlan/keyedit.cpp
+++ b/noncore/settings/networksettings/wlan/keyedit.cpp
@@ -4,6 +4,7 @@
4KeyEdit::KeyEdit(QWidget* parent, const char* name) : 4KeyEdit::KeyEdit(QWidget* parent, const char* name) :
5 QLineEdit(parent, name) 5 QLineEdit(parent, name)
6{ 6{
7 setEchoMode(Password);
7} 8}
8 9
9KeyEdit::~KeyEdit() 10KeyEdit::~KeyEdit()
diff --git a/noncore/settings/networksettings/wlan/wlan.ui b/noncore/settings/networksettings/wlan/wlan.ui
index 7932445..7e39e23 100644
--- a/noncore/settings/networksettings/wlan/wlan.ui
+++ b/noncore/settings/networksettings/wlan/wlan.ui
@@ -11,7 +11,7 @@
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>251</width> 14 <width>247</width>
15 <height>299</height> 15 <height>299</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
@@ -287,34 +287,18 @@
287 <item> 287 <item>
288 <property> 288 <property>
289 <name>text</name> 289 <name>text</name>
290 <string>Auto</string> 290 <string>any</string>
291 </property>
292 </item>
293 <item>
294 <property>
295 <name>text</name>
296 <string>Managed</string>
297 </property>
298 </item>
299 <item>
300 <property>
301 <name>text</name>
302 <string>Ad-Hoc</string>
303 </property> 291 </property>
304 </item> 292 </item>
305 <property stdset="1"> 293 <property stdset="1">
306 <name>name</name> 294 <name>name</name>
307 <cstring>mode</cstring> 295 <cstring>essid</cstring>
308 </property>
309 <property stdset="1">
310 <name>enabled</name>
311 <bool>true</bool>
312 </property> 296 </property>
313 <property stdset="1"> 297 <property stdset="1">
314 <name>geometry</name> 298 <name>geometry</name>
315 <rect> 299 <rect>
316 <x>101</x> 300 <x>101</x>
317 <y>11</y> 301 <y>46</y>
318 <width>103</width> 302 <width>103</width>
319 <height>29</height> 303 <height>29</height>
320 </rect> 304 </rect>
@@ -322,28 +306,70 @@
322 <property stdset="1"> 306 <property stdset="1">
323 <name>sizePolicy</name> 307 <name>sizePolicy</name>
324 <sizepolicy> 308 <sizepolicy>
325 <hsizetype>1</hsizetype> 309 <hsizetype>7</hsizetype>
326 <vsizetype>0</vsizetype> 310 <vsizetype>0</vsizetype>
327 </sizepolicy> 311 </sizepolicy>
328 </property> 312 </property>
313 <property stdset="1">
314 <name>editable</name>
315 <bool>true</bool>
316 </property>
317 <property stdset="1">
318 <name>currentItem</name>
319 <number>0</number>
320 </property>
321 <property stdset="1">
322 <name>sizeLimit</name>
323 <number>5</number>
324 </property>
325 <property stdset="1">
326 <name>autoCompletion</name>
327 <bool>true</bool>
328 </property>
329 <property stdset="1">
330 <name>duplicatesEnabled</name>
331 <bool>false</bool>
332 </property>
329 </widget> 333 </widget>
330 <widget> 334 <widget>
331 <class>QComboBox</class> 335 <class>QComboBox</class>
332 <item> 336 <item>
333 <property> 337 <property>
334 <name>text</name> 338 <name>text</name>
335 <string>any</string> 339 <string>Infrastructure</string>
340 </property>
341 </item>
342 <item>
343 <property>
344 <name>text</name>
345 <string>Auto</string>
346 </property>
347 </item>
348 <item>
349 <property>
350 <name>text</name>
351 <string>Managed</string>
352 </property>
353 </item>
354 <item>
355 <property>
356 <name>text</name>
357 <string>Ad-Hoc</string>
336 </property> 358 </property>
337 </item> 359 </item>
338 <property stdset="1"> 360 <property stdset="1">
339 <name>name</name> 361 <name>name</name>
340 <cstring>essid</cstring> 362 <cstring>mode</cstring>
363 </property>
364 <property stdset="1">
365 <name>enabled</name>
366 <bool>true</bool>
341 </property> 367 </property>
342 <property stdset="1"> 368 <property stdset="1">
343 <name>geometry</name> 369 <name>geometry</name>
344 <rect> 370 <rect>
345 <x>101</x> 371 <x>101</x>
346 <y>46</y> 372 <y>11</y>
347 <width>103</width> 373 <width>103</width>
348 <height>29</height> 374 <height>29</height>
349 </rect> 375 </rect>
@@ -351,30 +377,10 @@
351 <property stdset="1"> 377 <property stdset="1">
352 <name>sizePolicy</name> 378 <name>sizePolicy</name>
353 <sizepolicy> 379 <sizepolicy>
354 <hsizetype>7</hsizetype> 380 <hsizetype>1</hsizetype>
355 <vsizetype>0</vsizetype> 381 <vsizetype>0</vsizetype>
356 </sizepolicy> 382 </sizepolicy>
357 </property> 383 </property>
358 <property stdset="1">
359 <name>editable</name>
360 <bool>true</bool>
361 </property>
362 <property stdset="1">
363 <name>currentItem</name>
364 <number>0</number>
365 </property>
366 <property stdset="1">
367 <name>sizeLimit</name>
368 <number>5</number>
369 </property>
370 <property stdset="1">
371 <name>autoCompletion</name>
372 <bool>true</bool>
373 </property>
374 <property stdset="1">
375 <name>duplicatesEnabled</name>
376 <bool>false</bool>
377 </property>
378 </widget> 384 </widget>
379 </widget> 385 </widget>
380 <widget> 386 <widget>
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
@@ -27,7 +27,7 @@
27/** 27/**
28 * Constructor, read in the wireless.opts file for parsing later. 28 * Constructor, read in the wireless.opts file for parsing later.
29 */ 29 */
30WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), currentProfile("*"), interface(i) { 30WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") {
31 interfaces = new Interfaces(); 31 interfaces = new Interfaces();
32 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); 32 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces);
33 tabWidget->insertTab(interfaceSetup, "TCP/IP"); 33 tabWidget->insertTab(interfaceSetup, "TCP/IP");
@@ -67,14 +67,9 @@ void WLANImp::parseOpts() {
67 } 67 }
68 68
69 opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace(); 69 opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace();
70 if (opt == "Auto") { 70
71 mode->setCurrentItem(0); 71 for ( int i = 0; i < mode->count(); i++)
72 } else if (opt == "Ad-Hoc") { 72 if ( mode->text( i ) == opt ) mode->setCurrentItem( i );
73 mode->setCurrentItem(2);
74 } else {
75 // Managed/Infrastructure mode
76 mode->setCurrentItem(1);
77 }
78 73
79 opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace(); 74 opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace();
80 if (! opt.isNull()) { 75 if (! opt.isNull()) {
@@ -203,11 +198,20 @@ void WLANImp::accept() {
203 writeOpts(); 198 writeOpts();
204 199
205 // Close out the dialog 200 // Close out the dialog
206 QDialog::accept(); 201// FIXME: QDialog::accept();
207} 202}
208 203
209void WLANImp::writeOpts() { 204void WLANImp::writeOpts() {
210 bool error = false; 205 // eh can't really do anything about it other then return. :-D
206 if(!interfaces->isInterfaceSet()){
207 QMessageBox::warning(0,"Inface not set","should not happen!!!");
208 return;
209 }
210 bool error = false;
211
212 qDebug("setting wlan interface %s", interfaces->getInterfaceName( error ).latin1() );
213
214 if (error) QMessageBox::warning(0,"Inface not set","should not happen!!!");
211 215
212 interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText()); 216 interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText());
213 interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText()); 217 interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText());
@@ -230,13 +234,16 @@ void WLANImp::writeOpts() {
230 if (! keyLineEdit0->text().isNull()) { 234 if (! keyLineEdit0->text().isNull()) {
231 keyList += keyLineEdit0->text(); 235 keyList += keyLineEdit0->text();
232 keyList += "[1]"; 236 keyList += "[1]";
233 } else if (! keyLineEdit1->text().isNull()) { 237 } //else
238 if (! keyLineEdit1->text().isNull()) {
234 keyList += keyLineEdit1->text(); 239 keyList += keyLineEdit1->text();
235 keyList += "[2]"; 240 keyList += "[2]";
236 } else if (! keyLineEdit2->text().isNull()) { 241 } //else
242 if (! keyLineEdit2->text().isNull()) {
237 keyList += keyLineEdit2->text(); 243 keyList += keyLineEdit2->text();
238 keyList += "[3]"; 244 keyList += "[3]";
239 } else if (! keyLineEdit3->text().isNull()) { 245 } //else
246 if (! keyLineEdit3->text().isNull()) {
240 keyList += keyLineEdit3->text(); 247 keyList += keyLineEdit3->text();
241 keyList += "[4]"; 248 keyList += "[4]";
242 } 249 }
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index a4488f9..b4c3509 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -1,5 +1,5 @@
1#include "wlanmodule.h" 1#include "wlanmodule.h"
2#include "wlanimp.h" 2#include "wlanimp2.h"
3#include "infoimp.h" 3#include "infoimp.h"
4#include "wextensions.h" 4#include "wextensions.h"
5#include "interfaceinformationimp.h" 5#include "interfaceinformationimp.h"