summaryrefslogtreecommitdiff
path: root/noncore
authorbenmeyer <benmeyer>2002-12-11 22:08:02 (UTC)
committer benmeyer <benmeyer>2002-12-11 22:08:02 (UTC)
commit6523ee46d49203d11f34a3dbbf966a318cef7def (patch) (unidiff)
tree2a51a44e1fb114c3f4d8f3965d5106c8930fba16 /noncore
parentc5737bbbe357ea7481a9f6a406ef81bbeba0d541 (diff)
downloadopie-6523ee46d49203d11f34a3dbbf966a318cef7def.zip
opie-6523ee46d49203d11f34a3dbbf966a318cef7def.tar.gz
opie-6523ee46d49203d11f34a3dbbf966a318cef7def.tar.bz2
New cleaner layout
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/networksetup/wlan/wlan.ui167
-rw-r--r--noncore/net/networksetup/wlan/wlanimp.cpp43
-rw-r--r--noncore/net/networksetup/wlan/wlanimp.h3
-rw-r--r--noncore/settings/networksettings/wlan/wlan.ui167
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp43
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.h3
6 files changed, 204 insertions, 222 deletions
diff --git a/noncore/net/networksetup/wlan/wlan.ui b/noncore/net/networksetup/wlan/wlan.ui
index 47d6db6..09593b3 100644
--- a/noncore/net/networksetup/wlan/wlan.ui
+++ b/noncore/net/networksetup/wlan/wlan.ui
@@ -12,6 +12,6 @@
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>237</width> 14 <width>239</width>
15 <height>286</height> 15 <height>277</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
@@ -66,53 +66,19 @@
66 </property> 66 </property>
67 <widget> 67 <widget>
68 <class>QButtonGroup</class> 68 <class>QCheckBox</class>
69 <property stdset="1">
70 <name>name</name>
71 <cstring>ButtonGroup45</cstring>
72 </property>
73 <property stdset="1">
74 <name>title</name>
75 <string>ESS ID</string>
76 </property>
77 <vbox>
78 <property stdset="1">
79 <name>margin</name>
80 <number>11</number>
81 </property>
82 <property stdset="1">
83 <name>spacing</name>
84 <number>6</number>
85 </property>
86 <widget>
87 <class>QRadioButton</class>
88 <property stdset="1">
89 <name>name</name>
90 <cstring>essNon</cstring>
91 </property>
92 <property stdset="1">
93 <name>text</name>
94 <string>Non-Spec ESSID: "ANY"</string>
95 </property>
96 <property stdset="1">
97 <name>checked</name>
98 <bool>true</bool>
99 </property>
100 </widget>
101 <widget>
102 <class>QRadioButton</class>
103 <property stdset="1"> 69 <property stdset="1">
104 <name>name</name> 70 <name>name</name>
105 <cstring>essSpecific</cstring> 71 <cstring>essAny</cstring>
106 </property> 72 </property>
107 <property stdset="1"> 73 <property stdset="1">
108 <name>text</name> 74 <name>text</name>
109 <string>Specific ESSID</string> 75 <string>Sepecify Access Point</string>
110 </property> 76 </property>
111 </widget> 77 </widget>
112 <widget> 78 <widget>
113 <class>QLineEdit</class> 79 <class>QGroupBox</class>
114 <property stdset="1"> 80 <property stdset="1">
115 <name>name</name> 81 <name>name</name>
116 <cstring>essSpecificLineEdit</cstring> 82 <cstring>GroupBox1</cstring>
117 </property> 83 </property>
118 <property stdset="1"> 84 <property stdset="1">
@@ -120,16 +86,7 @@
120 <bool>false</bool> 86 <bool>false</bool>
121 </property> 87 </property>
122 </widget>
123 </vbox>
124 </widget>
125 <widget>
126 <class>QButtonGroup</class>
127 <property stdset="1">
128 <name>name</name>
129 <cstring>ButtonGroup46</cstring>
130 </property>
131 <property stdset="1"> 88 <property stdset="1">
132 <name>title</name> 89 <name>title</name>
133 <string>Network Type</string> 90 <string>Settings</string>
134 </property> 91 </property>
135 <grid> 92 <grid>
@@ -142,43 +99,61 @@
142 <number>6</number> 99 <number>6</number>
143 </property> 100 </property>
144 <widget row="0" column="0" rowspan="1" colspan="3" > 101 <widget row="0" column="0" >
145 <class>QRadioButton</class> 102 <class>QLabel</class>
146 <property stdset="1"> 103 <property stdset="1">
147 <name>name</name> 104 <name>name</name>
148 <cstring>networkInfrastructure</cstring> 105 <cstring>TextLabel1</cstring>
149 </property> 106 </property>
150 <property stdset="1"> 107 <property stdset="1">
151 <name>text</name> 108 <name>text</name>
152 <string>Infrastructure</string> 109 <string>ESS-ID</string>
153 </property>
154 <property stdset="1">
155 <name>checked</name>
156 <bool>true</bool>
157 </property> 110 </property>
158 </widget> 111 </widget>
159 <widget row="2" column="0" > 112 <widget row="1" column="0" >
160 <class>QLabel</class> 113 <class>QLabel</class>
161 <property stdset="1"> 114 <property stdset="1">
162 <name>name</name> 115 <name>name</name>
163 <cstring>TextLabel2</cstring> 116 <cstring>TextLabel2_2</cstring>
164 </property> 117 </property>
165 <property stdset="1"> 118 <property stdset="1">
166 <name>enabled</name> 119 <name>text</name>
167 <bool>false</bool> 120 <string>Network Type</string>
168 </property> 121 </property>
122 </widget>
123 <widget row="0" column="1" rowspan="1" colspan="2" >
124 <class>QLineEdit</class>
169 <property stdset="1"> 125 <property stdset="1">
126 <name>name</name>
127 <cstring>essSpecificLineEdit</cstring>
128 </property>
129 </widget>
130 <widget row="1" column="1" rowspan="1" colspan="2" >
131 <class>QComboBox</class>
132 <item>
133 <property>
170 <name>text</name> 134 <name>text</name>
171 <string>Channel</string> 135 <string>Infrastructure</string>
136 </property>
137 </item>
138 <item>
139 <property>
140 <name>text</name>
141 <string>Ad-Hoc</string>
142 </property>
143 </item>
144 <property stdset="1">
145 <name>name</name>
146 <cstring>networkType</cstring>
172 </property> 147 </property>
173 </widget> 148 </widget>
174 <widget row="1" column="0" rowspan="1" colspan="2" > 149 <widget row="2" column="0" >
175 <class>QRadioButton</class> 150 <class>QLabel</class>
176 <property stdset="1"> 151 <property stdset="1">
177 <name>name</name> 152 <name>name</name>
178 <cstring>network802</cstring> 153 <cstring>channelLabel</cstring>
179 </property> 154 </property>
180 <property stdset="1"> 155 <property stdset="1">
181 <name>text</name> 156 <name>text</name>
182 <string>Ad-Hoc</string> 157 <string>Channel</string>
183 </property> 158 </property>
184 </widget> 159 </widget>
@@ -195,5 +170,5 @@
195 <property stdset="1"> 170 <property stdset="1">
196 <name>maxValue</name> 171 <name>maxValue</name>
197 <number>11</number> 172 <number>15</number>
198 </property> 173 </property>
199 <property stdset="1"> 174 <property stdset="1">
@@ -209,5 +184,5 @@
209 <property> 184 <property>
210 <name>name</name> 185 <name>name</name>
211 <cstring>Spacer32</cstring> 186 <cstring>Spacer4</cstring>
212 </property> 187 </property>
213 <property stdset="1"> 188 <property stdset="1">
@@ -337,5 +312,5 @@
337 <property stdset="1"> 312 <property stdset="1">
338 <name>name</name> 313 <name>name</name>
339 <cstring>ButtonGroup44</cstring> 314 <cstring>KeyButtonGroup</cstring>
340 </property> 315 </property>
341 <property stdset="1"> 316 <property stdset="1">
@@ -362,4 +337,8 @@
362 <cstring>keyLineEdit0</cstring> 337 <cstring>keyLineEdit0</cstring>
363 </property> 338 </property>
339 <property stdset="1">
340 <name>echoMode</name>
341 <enum>Password</enum>
342 </property>
364 </widget> 343 </widget>
365 <widget row="1" column="1" > 344 <widget row="1" column="1" >
@@ -369,4 +348,8 @@
369 <cstring>keyLineEdit1</cstring> 348 <cstring>keyLineEdit1</cstring>
370 </property> 349 </property>
350 <property stdset="1">
351 <name>echoMode</name>
352 <enum>Password</enum>
353 </property>
371 </widget> 354 </widget>
372 <widget row="2" column="1" > 355 <widget row="2" column="1" >
@@ -376,4 +359,8 @@
376 <cstring>keyLineEdit2</cstring> 359 <cstring>keyLineEdit2</cstring>
377 </property> 360 </property>
361 <property stdset="1">
362 <name>echoMode</name>
363 <enum>Password</enum>
364 </property>
378 </widget> 365 </widget>
379 <widget row="3" column="1" > 366 <widget row="3" column="1" >
@@ -383,4 +370,8 @@
383 <cstring>keyLineEdit3</cstring> 370 <cstring>keyLineEdit3</cstring>
384 </property> 371 </property>
372 <property stdset="1">
373 <name>echoMode</name>
374 <enum>Password</enum>
375 </property>
385 </widget> 376 </widget>
386 <widget row="0" column="0" > 377 <widget row="0" column="0" >
@@ -462,25 +453,7 @@
462<connections> 453<connections>
463 <connection> 454 <connection>
464 <sender>essSpecific</sender> 455 <sender>wepEnabled</sender>
465 <signal>toggled(bool)</signal>
466 <receiver>essSpecificLineEdit</receiver>
467 <slot>setEnabled(bool)</slot>
468 </connection>
469 <connection>
470 <sender>network802</sender>
471 <signal>clicked()</signal>
472 <receiver>essSpecific</receiver>
473 <slot>animateClick()</slot>
474 </connection>
475 <connection>
476 <sender>network802</sender>
477 <signal>toggled(bool)</signal>
478 <receiver>TextLabel2</receiver>
479 <slot>setEnabled(bool)</slot>
480 </connection>
481 <connection>
482 <sender>network802</sender>
483 <signal>toggled(bool)</signal> 456 <signal>toggled(bool)</signal>
484 <receiver>networkChannel</receiver> 457 <receiver>ButtonGroup43</receiver>
485 <slot>setEnabled(bool)</slot> 458 <slot>setEnabled(bool)</slot>
486 </connection> 459 </connection>
@@ -488,11 +461,11 @@
488 <sender>wepEnabled</sender> 461 <sender>wepEnabled</sender>
489 <signal>toggled(bool)</signal> 462 <signal>toggled(bool)</signal>
490 <receiver>ButtonGroup43</receiver> 463 <receiver>KeyButtonGroup</receiver>
491 <slot>setEnabled(bool)</slot> 464 <slot>setEnabled(bool)</slot>
492 </connection> 465 </connection>
493 <connection> 466 <connection>
494 <sender>wepEnabled</sender> 467 <sender>essAny</sender>
495 <signal>toggled(bool)</signal> 468 <signal>toggled(bool)</signal>
496 <receiver>ButtonGroup44</receiver> 469 <receiver>GroupBox1</receiver>
497 <slot>setEnabled(bool)</slot> 470 <slot>setEnabled(bool)</slot>
498 </connection> 471 </connection>
@@ -500,9 +473,7 @@
500<tabstops> 473<tabstops>
501 <tabstop>tabWidget</tabstop> 474 <tabstop>tabWidget</tabstop>
502 <tabstop>essNon</tabstop> 475 <tabstop>essAny</tabstop>
503 <tabstop>essSpecific</tabstop>
504 <tabstop>essSpecificLineEdit</tabstop> 476 <tabstop>essSpecificLineEdit</tabstop>
505 <tabstop>networkInfrastructure</tabstop> 477 <tabstop>networkType</tabstop>
506 <tabstop>network802</tabstop>
507 <tabstop>networkChannel</tabstop> 478 <tabstop>networkChannel</tabstop>
508 <tabstop>wepEnabled</tabstop> 479 <tabstop>wepEnabled</tabstop>
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp
index 6a56358..ef7329e 100644
--- a/noncore/net/networksetup/wlan/wlanimp.cpp
+++ b/noncore/net/networksetup/wlan/wlanimp.cpp
@@ -7,8 +7,10 @@
7#include <qmessagebox.h> 7#include <qmessagebox.h>
8#include <qlineedit.h> 8#include <qlineedit.h>
9#include <qlabel.h>
9#include <qspinbox.h> 10#include <qspinbox.h>
10#include <qradiobutton.h> 11#include <qradiobutton.h>
11#include <qcheckbox.h> 12#include <qcheckbox.h>
12#include <qtabwidget.h> 13#include <qtabwidget.h>
14#include <qcombobox.h>
13 15
14/* system() */ 16/* system() */
@@ -40,4 +42,11 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W
40 else 42 else
41 qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1()); 43 qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1());
44 connect(networkType, SIGNAL(activated(int)), this, SLOT(typeChanged(int)));
45
46}
47
48void WLANImp::typeChanged(int mod){
49 networkChannel->setEnabled(mod);
50 channelLabel->setEnabled(mod);
42} 51}
43 52
@@ -72,10 +81,8 @@ void WLANImp::parseSettingFile(){
72 QString id = line.mid(line.find("ESSID=")+6, line.length()); 81 QString id = line.mid(line.find("ESSID=")+6, line.length());
73 if(id == "any"){ 82 if(id == "any"){
74 essNon->setChecked(true); 83 essAny->setChecked(false);
75 essSpecific->setChecked(false);
76 }else{ 84 }else{
77 essSpecific->setChecked(true); 85 essAny->setChecked(true);
78 essSpecificLineEdit->setText(id); 86 essSpecificLineEdit->setText(id);
79 essNon->setChecked(false);
80 } 87 }
81 } 88 }
@@ -83,10 +90,8 @@ void WLANImp::parseSettingFile(){
83 QString mode = line.mid(line.find("MODE=")+5, line.length()); 90 QString mode = line.mid(line.find("MODE=")+5, line.length());
84 if(mode == "Managed"){ 91 if(mode == "Managed"){
85 network802->setChecked( false ); 92 networkType->setCurrentItem(0);
86 networkInfrastructure->setChecked( true );
87 } 93 }
88 else{ 94 else{
89 network802->setChecked( true ); 95 networkType->setCurrentItem(0);
90 networkInfrastructure->setChecked( false );
91 } 96 }
92 } 97 }
@@ -155,7 +160,14 @@ void WLANImp::changeAndSaveSettingFile(){
155 if(!line.contains("esac")) 160 if(!line.contains("esac"))
156 stream << line << "\n"; 161 stream << line << "\n";
157 162 if(!essAny->isChecked() == true){
158 stream << "\tESSID=" << (essNon->isChecked() == true ? QString("any") : essSpecificLineEdit->text()) << '\n'; 163 stream << "\tESSID=any\n";
159 stream << "\tMODE=" << (networkInfrastructure->isChecked() == true ? "Managed" : "ad-hoc") << '\n'; 164 stream << "\tMODE=Managed\n";
165 stream << "\tCHANNEL=6\n";
166 }
167 else{
168 stream << "\tESSID=" << essSpecificLineEdit->text() << '\n';
169 stream << "\tMODE=" << ( networkType->currentItem() == 0 ? "Managed" : "ad-hoc") << '\n';
170 stream << "\tCHANNEL=" << networkChannel->value() << "\n";
171 }
160 172
161 stream << "\tKEY0=" << keyLineEdit0->text() << "\n"; 173 stream << "\tKEY0=" << keyLineEdit0->text() << "\n";
@@ -176,5 +188,4 @@ void WLANImp::changeAndSaveSettingFile(){
176 stream << "\"\n"; 188 stream << "\"\n";
177 } 189 }
178 stream << "\tCHANNEL=" << networkChannel->value() << "\n";
179 stream << "\tRATE=auto\n"; 190 stream << "\tRATE=auto\n";
180 if(line.contains("esac")) 191 if(line.contains("esac"))
@@ -197,9 +208,14 @@ void WLANImp::accept(){
197 if(keyLineEdit0->text().isEmpty() && keyLineEdit1->text().isEmpty() && keyLineEdit2->text().isEmpty() && keyLineEdit3->text().isEmpty() ) 208 if(keyLineEdit0->text().isEmpty() && keyLineEdit1->text().isEmpty() && keyLineEdit2->text().isEmpty() && keyLineEdit3->text().isEmpty() )
198 { 209 {
199 QMessageBox::information(this, "", "Please enter a key for WEP.", QMessageBox::Ok); 210 QMessageBox::information(this, "Error", "Please enter a key for WEP.", QMessageBox::Ok);
200 return; 211 return;
201 } 212 }
202 } 213 }
203 214
215 if(essSpecificLineEdit->text().isEmpty()){
216 QMessageBox::information(this, "Error", "Please enter a ESS-ID.", QMessageBox::Ok);
217 return;
218 }
219
204 // Ok settings are good here, save 220 // Ok settings are good here, save
205 changeAndSaveSettingFile(); 221 changeAndSaveSettingFile();
@@ -209,4 +225,5 @@ void WLANImp::accept(){
209 return; 225 return;
210 226
227 return;
211 // Restart the device now that the settings have changed 228 // Restart the device now that the settings have changed
212 QString initpath; 229 QString initpath;
diff --git a/noncore/net/networksetup/wlan/wlanimp.h b/noncore/net/networksetup/wlan/wlanimp.h
index df599af..310836c 100644
--- a/noncore/net/networksetup/wlan/wlanimp.h
+++ b/noncore/net/networksetup/wlan/wlanimp.h
@@ -19,4 +19,7 @@ protected:
19 void accept(); 19 void accept();
20 20
21private slots:
22 void typeChanged(int);
23
21private: 24private:
22 void parseSettingFile(); 25 void parseSettingFile();
diff --git a/noncore/settings/networksettings/wlan/wlan.ui b/noncore/settings/networksettings/wlan/wlan.ui
index 47d6db6..09593b3 100644
--- a/noncore/settings/networksettings/wlan/wlan.ui
+++ b/noncore/settings/networksettings/wlan/wlan.ui
@@ -12,6 +12,6 @@
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>237</width> 14 <width>239</width>
15 <height>286</height> 15 <height>277</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
@@ -66,53 +66,19 @@
66 </property> 66 </property>
67 <widget> 67 <widget>
68 <class>QButtonGroup</class> 68 <class>QCheckBox</class>
69 <property stdset="1">
70 <name>name</name>
71 <cstring>ButtonGroup45</cstring>
72 </property>
73 <property stdset="1">
74 <name>title</name>
75 <string>ESS ID</string>
76 </property>
77 <vbox>
78 <property stdset="1">
79 <name>margin</name>
80 <number>11</number>
81 </property>
82 <property stdset="1">
83 <name>spacing</name>
84 <number>6</number>
85 </property>
86 <widget>
87 <class>QRadioButton</class>
88 <property stdset="1">
89 <name>name</name>
90 <cstring>essNon</cstring>
91 </property>
92 <property stdset="1">
93 <name>text</name>
94 <string>Non-Spec ESSID: "ANY"</string>
95 </property>
96 <property stdset="1">
97 <name>checked</name>
98 <bool>true</bool>
99 </property>
100 </widget>
101 <widget>
102 <class>QRadioButton</class>
103 <property stdset="1"> 69 <property stdset="1">
104 <name>name</name> 70 <name>name</name>
105 <cstring>essSpecific</cstring> 71 <cstring>essAny</cstring>
106 </property> 72 </property>
107 <property stdset="1"> 73 <property stdset="1">
108 <name>text</name> 74 <name>text</name>
109 <string>Specific ESSID</string> 75 <string>Sepecify Access Point</string>
110 </property> 76 </property>
111 </widget> 77 </widget>
112 <widget> 78 <widget>
113 <class>QLineEdit</class> 79 <class>QGroupBox</class>
114 <property stdset="1"> 80 <property stdset="1">
115 <name>name</name> 81 <name>name</name>
116 <cstring>essSpecificLineEdit</cstring> 82 <cstring>GroupBox1</cstring>
117 </property> 83 </property>
118 <property stdset="1"> 84 <property stdset="1">
@@ -120,16 +86,7 @@
120 <bool>false</bool> 86 <bool>false</bool>
121 </property> 87 </property>
122 </widget>
123 </vbox>
124 </widget>
125 <widget>
126 <class>QButtonGroup</class>
127 <property stdset="1">
128 <name>name</name>
129 <cstring>ButtonGroup46</cstring>
130 </property>
131 <property stdset="1"> 88 <property stdset="1">
132 <name>title</name> 89 <name>title</name>
133 <string>Network Type</string> 90 <string>Settings</string>
134 </property> 91 </property>
135 <grid> 92 <grid>
@@ -142,43 +99,61 @@
142 <number>6</number> 99 <number>6</number>
143 </property> 100 </property>
144 <widget row="0" column="0" rowspan="1" colspan="3" > 101 <widget row="0" column="0" >
145 <class>QRadioButton</class> 102 <class>QLabel</class>
146 <property stdset="1"> 103 <property stdset="1">
147 <name>name</name> 104 <name>name</name>
148 <cstring>networkInfrastructure</cstring> 105 <cstring>TextLabel1</cstring>
149 </property> 106 </property>
150 <property stdset="1"> 107 <property stdset="1">
151 <name>text</name> 108 <name>text</name>
152 <string>Infrastructure</string> 109 <string>ESS-ID</string>
153 </property>
154 <property stdset="1">
155 <name>checked</name>
156 <bool>true</bool>
157 </property> 110 </property>
158 </widget> 111 </widget>
159 <widget row="2" column="0" > 112 <widget row="1" column="0" >
160 <class>QLabel</class> 113 <class>QLabel</class>
161 <property stdset="1"> 114 <property stdset="1">
162 <name>name</name> 115 <name>name</name>
163 <cstring>TextLabel2</cstring> 116 <cstring>TextLabel2_2</cstring>
164 </property> 117 </property>
165 <property stdset="1"> 118 <property stdset="1">
166 <name>enabled</name> 119 <name>text</name>
167 <bool>false</bool> 120 <string>Network Type</string>
168 </property> 121 </property>
122 </widget>
123 <widget row="0" column="1" rowspan="1" colspan="2" >
124 <class>QLineEdit</class>
169 <property stdset="1"> 125 <property stdset="1">
126 <name>name</name>
127 <cstring>essSpecificLineEdit</cstring>
128 </property>
129 </widget>
130 <widget row="1" column="1" rowspan="1" colspan="2" >
131 <class>QComboBox</class>
132 <item>
133 <property>
170 <name>text</name> 134 <name>text</name>
171 <string>Channel</string> 135 <string>Infrastructure</string>
136 </property>
137 </item>
138 <item>
139 <property>
140 <name>text</name>
141 <string>Ad-Hoc</string>
142 </property>
143 </item>
144 <property stdset="1">
145 <name>name</name>
146 <cstring>networkType</cstring>
172 </property> 147 </property>
173 </widget> 148 </widget>
174 <widget row="1" column="0" rowspan="1" colspan="2" > 149 <widget row="2" column="0" >
175 <class>QRadioButton</class> 150 <class>QLabel</class>
176 <property stdset="1"> 151 <property stdset="1">
177 <name>name</name> 152 <name>name</name>
178 <cstring>network802</cstring> 153 <cstring>channelLabel</cstring>
179 </property> 154 </property>
180 <property stdset="1"> 155 <property stdset="1">
181 <name>text</name> 156 <name>text</name>
182 <string>Ad-Hoc</string> 157 <string>Channel</string>
183 </property> 158 </property>
184 </widget> 159 </widget>
@@ -195,5 +170,5 @@
195 <property stdset="1"> 170 <property stdset="1">
196 <name>maxValue</name> 171 <name>maxValue</name>
197 <number>11</number> 172 <number>15</number>
198 </property> 173 </property>
199 <property stdset="1"> 174 <property stdset="1">
@@ -209,5 +184,5 @@
209 <property> 184 <property>
210 <name>name</name> 185 <name>name</name>
211 <cstring>Spacer32</cstring> 186 <cstring>Spacer4</cstring>
212 </property> 187 </property>
213 <property stdset="1"> 188 <property stdset="1">
@@ -337,5 +312,5 @@
337 <property stdset="1"> 312 <property stdset="1">
338 <name>name</name> 313 <name>name</name>
339 <cstring>ButtonGroup44</cstring> 314 <cstring>KeyButtonGroup</cstring>
340 </property> 315 </property>
341 <property stdset="1"> 316 <property stdset="1">
@@ -362,4 +337,8 @@
362 <cstring>keyLineEdit0</cstring> 337 <cstring>keyLineEdit0</cstring>
363 </property> 338 </property>
339 <property stdset="1">
340 <name>echoMode</name>
341 <enum>Password</enum>
342 </property>
364 </widget> 343 </widget>
365 <widget row="1" column="1" > 344 <widget row="1" column="1" >
@@ -369,4 +348,8 @@
369 <cstring>keyLineEdit1</cstring> 348 <cstring>keyLineEdit1</cstring>
370 </property> 349 </property>
350 <property stdset="1">
351 <name>echoMode</name>
352 <enum>Password</enum>
353 </property>
371 </widget> 354 </widget>
372 <widget row="2" column="1" > 355 <widget row="2" column="1" >
@@ -376,4 +359,8 @@
376 <cstring>keyLineEdit2</cstring> 359 <cstring>keyLineEdit2</cstring>
377 </property> 360 </property>
361 <property stdset="1">
362 <name>echoMode</name>
363 <enum>Password</enum>
364 </property>
378 </widget> 365 </widget>
379 <widget row="3" column="1" > 366 <widget row="3" column="1" >
@@ -383,4 +370,8 @@
383 <cstring>keyLineEdit3</cstring> 370 <cstring>keyLineEdit3</cstring>
384 </property> 371 </property>
372 <property stdset="1">
373 <name>echoMode</name>
374 <enum>Password</enum>
375 </property>
385 </widget> 376 </widget>
386 <widget row="0" column="0" > 377 <widget row="0" column="0" >
@@ -462,25 +453,7 @@
462<connections> 453<connections>
463 <connection> 454 <connection>
464 <sender>essSpecific</sender> 455 <sender>wepEnabled</sender>
465 <signal>toggled(bool)</signal>
466 <receiver>essSpecificLineEdit</receiver>
467 <slot>setEnabled(bool)</slot>
468 </connection>
469 <connection>
470 <sender>network802</sender>
471 <signal>clicked()</signal>
472 <receiver>essSpecific</receiver>
473 <slot>animateClick()</slot>
474 </connection>
475 <connection>
476 <sender>network802</sender>
477 <signal>toggled(bool)</signal>
478 <receiver>TextLabel2</receiver>
479 <slot>setEnabled(bool)</slot>
480 </connection>
481 <connection>
482 <sender>network802</sender>
483 <signal>toggled(bool)</signal> 456 <signal>toggled(bool)</signal>
484 <receiver>networkChannel</receiver> 457 <receiver>ButtonGroup43</receiver>
485 <slot>setEnabled(bool)</slot> 458 <slot>setEnabled(bool)</slot>
486 </connection> 459 </connection>
@@ -488,11 +461,11 @@
488 <sender>wepEnabled</sender> 461 <sender>wepEnabled</sender>
489 <signal>toggled(bool)</signal> 462 <signal>toggled(bool)</signal>
490 <receiver>ButtonGroup43</receiver> 463 <receiver>KeyButtonGroup</receiver>
491 <slot>setEnabled(bool)</slot> 464 <slot>setEnabled(bool)</slot>
492 </connection> 465 </connection>
493 <connection> 466 <connection>
494 <sender>wepEnabled</sender> 467 <sender>essAny</sender>
495 <signal>toggled(bool)</signal> 468 <signal>toggled(bool)</signal>
496 <receiver>ButtonGroup44</receiver> 469 <receiver>GroupBox1</receiver>
497 <slot>setEnabled(bool)</slot> 470 <slot>setEnabled(bool)</slot>
498 </connection> 471 </connection>
@@ -500,9 +473,7 @@
500<tabstops> 473<tabstops>
501 <tabstop>tabWidget</tabstop> 474 <tabstop>tabWidget</tabstop>
502 <tabstop>essNon</tabstop> 475 <tabstop>essAny</tabstop>
503 <tabstop>essSpecific</tabstop>
504 <tabstop>essSpecificLineEdit</tabstop> 476 <tabstop>essSpecificLineEdit</tabstop>
505 <tabstop>networkInfrastructure</tabstop> 477 <tabstop>networkType</tabstop>
506 <tabstop>network802</tabstop>
507 <tabstop>networkChannel</tabstop> 478 <tabstop>networkChannel</tabstop>
508 <tabstop>wepEnabled</tabstop> 479 <tabstop>wepEnabled</tabstop>
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index 6a56358..ef7329e 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -7,8 +7,10 @@
7#include <qmessagebox.h> 7#include <qmessagebox.h>
8#include <qlineedit.h> 8#include <qlineedit.h>
9#include <qlabel.h>
9#include <qspinbox.h> 10#include <qspinbox.h>
10#include <qradiobutton.h> 11#include <qradiobutton.h>
11#include <qcheckbox.h> 12#include <qcheckbox.h>
12#include <qtabwidget.h> 13#include <qtabwidget.h>
14#include <qcombobox.h>
13 15
14/* system() */ 16/* system() */
@@ -40,4 +42,11 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W
40 else 42 else
41 qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1()); 43 qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1());
44 connect(networkType, SIGNAL(activated(int)), this, SLOT(typeChanged(int)));
45
46}
47
48void WLANImp::typeChanged(int mod){
49 networkChannel->setEnabled(mod);
50 channelLabel->setEnabled(mod);
42} 51}
43 52
@@ -72,10 +81,8 @@ void WLANImp::parseSettingFile(){
72 QString id = line.mid(line.find("ESSID=")+6, line.length()); 81 QString id = line.mid(line.find("ESSID=")+6, line.length());
73 if(id == "any"){ 82 if(id == "any"){
74 essNon->setChecked(true); 83 essAny->setChecked(false);
75 essSpecific->setChecked(false);
76 }else{ 84 }else{
77 essSpecific->setChecked(true); 85 essAny->setChecked(true);
78 essSpecificLineEdit->setText(id); 86 essSpecificLineEdit->setText(id);
79 essNon->setChecked(false);
80 } 87 }
81 } 88 }
@@ -83,10 +90,8 @@ void WLANImp::parseSettingFile(){
83 QString mode = line.mid(line.find("MODE=")+5, line.length()); 90 QString mode = line.mid(line.find("MODE=")+5, line.length());
84 if(mode == "Managed"){ 91 if(mode == "Managed"){
85 network802->setChecked( false ); 92 networkType->setCurrentItem(0);
86 networkInfrastructure->setChecked( true );
87 } 93 }
88 else{ 94 else{
89 network802->setChecked( true ); 95 networkType->setCurrentItem(0);
90 networkInfrastructure->setChecked( false );
91 } 96 }
92 } 97 }
@@ -155,7 +160,14 @@ void WLANImp::changeAndSaveSettingFile(){
155 if(!line.contains("esac")) 160 if(!line.contains("esac"))
156 stream << line << "\n"; 161 stream << line << "\n";
157 162 if(!essAny->isChecked() == true){
158 stream << "\tESSID=" << (essNon->isChecked() == true ? QString("any") : essSpecificLineEdit->text()) << '\n'; 163 stream << "\tESSID=any\n";
159 stream << "\tMODE=" << (networkInfrastructure->isChecked() == true ? "Managed" : "ad-hoc") << '\n'; 164 stream << "\tMODE=Managed\n";
165 stream << "\tCHANNEL=6\n";
166 }
167 else{
168 stream << "\tESSID=" << essSpecificLineEdit->text() << '\n';
169 stream << "\tMODE=" << ( networkType->currentItem() == 0 ? "Managed" : "ad-hoc") << '\n';
170 stream << "\tCHANNEL=" << networkChannel->value() << "\n";
171 }
160 172
161 stream << "\tKEY0=" << keyLineEdit0->text() << "\n"; 173 stream << "\tKEY0=" << keyLineEdit0->text() << "\n";
@@ -176,5 +188,4 @@ void WLANImp::changeAndSaveSettingFile(){
176 stream << "\"\n"; 188 stream << "\"\n";
177 } 189 }
178 stream << "\tCHANNEL=" << networkChannel->value() << "\n";
179 stream << "\tRATE=auto\n"; 190 stream << "\tRATE=auto\n";
180 if(line.contains("esac")) 191 if(line.contains("esac"))
@@ -197,9 +208,14 @@ void WLANImp::accept(){
197 if(keyLineEdit0->text().isEmpty() && keyLineEdit1->text().isEmpty() && keyLineEdit2->text().isEmpty() && keyLineEdit3->text().isEmpty() ) 208 if(keyLineEdit0->text().isEmpty() && keyLineEdit1->text().isEmpty() && keyLineEdit2->text().isEmpty() && keyLineEdit3->text().isEmpty() )
198 { 209 {
199 QMessageBox::information(this, "", "Please enter a key for WEP.", QMessageBox::Ok); 210 QMessageBox::information(this, "Error", "Please enter a key for WEP.", QMessageBox::Ok);
200 return; 211 return;
201 } 212 }
202 } 213 }
203 214
215 if(essSpecificLineEdit->text().isEmpty()){
216 QMessageBox::information(this, "Error", "Please enter a ESS-ID.", QMessageBox::Ok);
217 return;
218 }
219
204 // Ok settings are good here, save 220 // Ok settings are good here, save
205 changeAndSaveSettingFile(); 221 changeAndSaveSettingFile();
@@ -209,4 +225,5 @@ void WLANImp::accept(){
209 return; 225 return;
210 226
227 return;
211 // Restart the device now that the settings have changed 228 // Restart the device now that the settings have changed
212 QString initpath; 229 QString initpath;
diff --git a/noncore/settings/networksettings/wlan/wlanimp.h b/noncore/settings/networksettings/wlan/wlanimp.h
index df599af..310836c 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.h
+++ b/noncore/settings/networksettings/wlan/wlanimp.h
@@ -19,4 +19,7 @@ protected:
19 void accept(); 19 void accept();
20 20
21private slots:
22 void typeChanged(int);
23
21private: 24private:
22 void parseSettingFile(); 25 void parseSettingFile();