Diffstat (limited to 'noncore/settings/networksettings/wlan') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/wlan/keyedit.cpp | 1 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlan.ui | 96 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.cpp | 33 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanmodule.cpp | 2 |
4 files changed, 73 insertions, 59 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 | |||
@@ -1,12 +1,13 @@ | |||
1 | #include "keyedit.h" | 1 | #include "keyedit.h" |
2 | #include <qlineedit.h> | 2 | #include <qlineedit.h> |
3 | 3 | ||
4 | KeyEdit::KeyEdit(QWidget* parent, const char* name) : | 4 | KeyEdit::KeyEdit(QWidget* parent, const char* name) : |
5 | QLineEdit(parent, name) | 5 | QLineEdit(parent, name) |
6 | { | 6 | { |
7 | setEchoMode(Password); | ||
7 | } | 8 | } |
8 | 9 | ||
9 | KeyEdit::~KeyEdit() | 10 | KeyEdit::~KeyEdit() |
10 | { | 11 | { |
11 | } | 12 | } |
12 | 13 | ||
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 | |||
@@ -8,13 +8,13 @@ | |||
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
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> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Wireless Configuration</string> | 20 | <string>Wireless Configuration</string> |
@@ -284,100 +284,106 @@ | |||
284 | </spacer> | 284 | </spacer> |
285 | <widget> | 285 | <widget> |
286 | <class>QComboBox</class> | 286 | <class>QComboBox</class> |
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> |
321 | </property> | 305 | </property> |
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> |
350 | </property> | 376 | </property> |
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> |
381 | <class>QWidget</class> | 387 | <class>QWidget</class> |
382 | <property stdset="1"> | 388 | <property stdset="1"> |
383 | <name>name</name> | 389 | <name>name</name> |
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 | |||
@@ -24,13 +24,13 @@ | |||
24 | #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" | 24 | #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" |
25 | #define PREUP "/etc/netwrok/if-pre-up.d/wireless-tools" | 25 | #define PREUP "/etc/netwrok/if-pre-up.d/wireless-tools" |
26 | 26 | ||
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 | */ |
30 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), currentProfile("*"), interface(i) { | 30 | WLANImp::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"); |
34 | 34 | ||
35 | // Check sanity - the existance of the wireless-tools if-pre-up script | 35 | // Check sanity - the existance of the wireless-tools if-pre-up script |
36 | QFile file(QString(PREUP)); | 36 | QFile file(QString(PREUP)); |
@@ -64,20 +64,15 @@ void WLANImp::parseOpts() { | |||
64 | essid->setEditText("any"); | 64 | essid->setEditText("any"); |
65 | } else { | 65 | } else { |
66 | essid->setEditText(opt); | 66 | essid->setEditText(opt); |
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()) { |
81 | specifyAp->setChecked(true); | 76 | specifyAp->setChecked(true); |
82 | macEdit->setText(opt); | 77 | macEdit->setText(opt); |
83 | } | 78 | } |
@@ -200,18 +195,27 @@ void WLANImp::accept() { | |||
200 | } | 195 | } |
201 | 196 | ||
202 | // Try to save the interfaces settings. | 197 | // Try to save the interfaces settings. |
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 | ||
209 | void WLANImp::writeOpts() { | 204 | void WLANImp::writeOpts() { |
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; | 210 | bool error = false; |
211 | 211 | ||
212 | qDebug("setting wlan interface %s", interfaces->getInterfaceName( error ).latin1() ); | ||
213 | |||
214 | if (error) QMessageBox::warning(0,"Inface not set","should not happen!!!"); | ||
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()); |
214 | 218 | ||
215 | if (specifyAp->isChecked()) { | 219 | if (specifyAp->isChecked()) { |
216 | interfaces->setInterfaceOption(QString("wireless_ap"), macEdit->text()); | 220 | interfaces->setInterfaceOption(QString("wireless_ap"), macEdit->text()); |
217 | } else { | 221 | } else { |
@@ -227,19 +231,22 @@ void WLANImp::writeOpts() { | |||
227 | if (wepEnabled->isChecked()) { | 231 | if (wepEnabled->isChecked()) { |
228 | QStringList keyList; | 232 | QStringList keyList; |
229 | 233 | ||
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 | } |
243 | if (acceptNonEnc->isChecked()) { | 250 | if (acceptNonEnc->isChecked()) { |
244 | keyList += "open"; | 251 | keyList += "open"; |
245 | } else { | 252 | } else { |
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,8 +1,8 @@ | |||
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" |
6 | 6 | ||
7 | #include <qcheckbox.h> | 7 | #include <qcheckbox.h> |
8 | #include <qcombobox.h> | 8 | #include <qcombobox.h> |