-rw-r--r-- | noncore/settings/networksettings/wlan/wlan.ui | 173 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.cpp | 45 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.h | 3 |
3 files changed, 106 insertions, 115 deletions
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 | |||
@@ -13,4 +13,4 @@ | |||
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> |
@@ -67,6 +67,21 @@ | |||
67 | <widget> | 67 | <widget> |
68 | <class>QButtonGroup</class> | 68 | <class>QCheckBox</class> |
69 | <property stdset="1"> | ||
70 | <name>name</name> | ||
71 | <cstring>essAny</cstring> | ||
72 | </property> | ||
73 | <property stdset="1"> | ||
74 | <name>text</name> | ||
75 | <string>Sepecify Access Point</string> | ||
76 | </property> | ||
77 | </widget> | ||
78 | <widget> | ||
79 | <class>QGroupBox</class> | ||
69 | <property stdset="1"> | 80 | <property stdset="1"> |
70 | <name>name</name> | 81 | <name>name</name> |
71 | <cstring>ButtonGroup45</cstring> | 82 | <cstring>GroupBox1</cstring> |
83 | </property> | ||
84 | <property stdset="1"> | ||
85 | <name>enabled</name> | ||
86 | <bool>false</bool> | ||
72 | </property> | 87 | </property> |
@@ -74,5 +89,5 @@ | |||
74 | <name>title</name> | 89 | <name>title</name> |
75 | <string>ESS ID</string> | 90 | <string>Settings</string> |
76 | </property> | 91 | </property> |
77 | <vbox> | 92 | <grid> |
78 | <property stdset="1"> | 93 | <property stdset="1"> |
@@ -85,7 +100,7 @@ | |||
85 | </property> | 100 | </property> |
86 | <widget> | 101 | <widget row="0" column="0" > |
87 | <class>QRadioButton</class> | 102 | <class>QLabel</class> |
88 | <property stdset="1"> | 103 | <property stdset="1"> |
89 | <name>name</name> | 104 | <name>name</name> |
90 | <cstring>essNon</cstring> | 105 | <cstring>TextLabel1</cstring> |
91 | </property> | 106 | </property> |
@@ -93,14 +108,10 @@ | |||
93 | <name>text</name> | 108 | <name>text</name> |
94 | <string>Non-Spec ESSID: "ANY"</string> | 109 | <string>ESS-ID</string> |
95 | </property> | ||
96 | <property stdset="1"> | ||
97 | <name>checked</name> | ||
98 | <bool>true</bool> | ||
99 | </property> | 110 | </property> |
100 | </widget> | 111 | </widget> |
101 | <widget> | 112 | <widget row="1" column="0" > |
102 | <class>QRadioButton</class> | 113 | <class>QLabel</class> |
103 | <property stdset="1"> | 114 | <property stdset="1"> |
104 | <name>name</name> | 115 | <name>name</name> |
105 | <cstring>essSpecific</cstring> | 116 | <cstring>TextLabel2_2</cstring> |
106 | </property> | 117 | </property> |
@@ -108,6 +119,6 @@ | |||
108 | <name>text</name> | 119 | <name>text</name> |
109 | <string>Specific ESSID</string> | 120 | <string>Network Type</string> |
110 | </property> | 121 | </property> |
111 | </widget> | 122 | </widget> |
112 | <widget> | 123 | <widget row="0" column="1" rowspan="1" colspan="2" > |
113 | <class>QLineEdit</class> | 124 | <class>QLineEdit</class> |
@@ -117,41 +128,20 @@ | |||
117 | </property> | 128 | </property> |
118 | <property stdset="1"> | ||
119 | <name>enabled</name> | ||
120 | <bool>false</bool> | ||
121 | </property> | ||
122 | </widget> | 129 | </widget> |
123 | </vbox> | 130 | <widget row="1" column="1" rowspan="1" colspan="2" > |
124 | </widget> | 131 | <class>QComboBox</class> |
125 | <widget> | 132 | <item> |
126 | <class>QButtonGroup</class> | 133 | <property> |
127 | <property stdset="1"> | 134 | <name>text</name> |
128 | <name>name</name> | 135 | <string>Infrastructure</string> |
129 | <cstring>ButtonGroup46</cstring> | 136 | </property> |
130 | </property> | 137 | </item> |
131 | <property stdset="1"> | 138 | <item> |
132 | <name>title</name> | 139 | <property> |
133 | <string>Network Type</string> | 140 | <name>text</name> |
134 | </property> | 141 | <string>Ad-Hoc</string> |
135 | <grid> | 142 | </property> |
136 | <property stdset="1"> | 143 | </item> |
137 | <name>margin</name> | ||
138 | <number>11</number> | ||
139 | </property> | ||
140 | <property stdset="1"> | ||
141 | <name>spacing</name> | ||
142 | <number>6</number> | ||
143 | </property> | ||
144 | <widget row="0" column="0" rowspan="1" colspan="3" > | ||
145 | <class>QRadioButton</class> | ||
146 | <property stdset="1"> | 144 | <property stdset="1"> |
147 | <name>name</name> | 145 | <name>name</name> |
148 | <cstring>networkInfrastructure</cstring> | 146 | <cstring>networkType</cstring> |
149 | </property> | ||
150 | <property stdset="1"> | ||
151 | <name>text</name> | ||
152 | <string>Infrastructure</string> | ||
153 | </property> | ||
154 | <property stdset="1"> | ||
155 | <name>checked</name> | ||
156 | <bool>true</bool> | ||
157 | </property> | 147 | </property> |
@@ -162,7 +152,3 @@ | |||
162 | <name>name</name> | 152 | <name>name</name> |
163 | <cstring>TextLabel2</cstring> | 153 | <cstring>channelLabel</cstring> |
164 | </property> | ||
165 | <property stdset="1"> | ||
166 | <name>enabled</name> | ||
167 | <bool>false</bool> | ||
168 | </property> | 154 | </property> |
@@ -173,13 +159,2 @@ | |||
173 | </widget> | 159 | </widget> |
174 | <widget row="1" column="0" rowspan="1" colspan="2" > | ||
175 | <class>QRadioButton</class> | ||
176 | <property stdset="1"> | ||
177 | <name>name</name> | ||
178 | <cstring>network802</cstring> | ||
179 | </property> | ||
180 | <property stdset="1"> | ||
181 | <name>text</name> | ||
182 | <string>Ad-Hoc</string> | ||
183 | </property> | ||
184 | </widget> | ||
185 | <widget row="2" column="1" > | 160 | <widget row="2" column="1" > |
@@ -196,3 +171,3 @@ | |||
196 | <name>maxValue</name> | 171 | <name>maxValue</name> |
197 | <number>11</number> | 172 | <number>15</number> |
198 | </property> | 173 | </property> |
@@ -210,3 +185,3 @@ | |||
210 | <name>name</name> | 185 | <name>name</name> |
211 | <cstring>Spacer32</cstring> | 186 | <cstring>Spacer4</cstring> |
212 | </property> | 187 | </property> |
@@ -338,3 +313,3 @@ | |||
338 | <name>name</name> | 313 | <name>name</name> |
339 | <cstring>ButtonGroup44</cstring> | 314 | <cstring>KeyButtonGroup</cstring> |
340 | </property> | 315 | </property> |
@@ -363,2 +338,6 @@ | |||
363 | </property> | 338 | </property> |
339 | <property stdset="1"> | ||
340 | <name>echoMode</name> | ||
341 | <enum>Password</enum> | ||
342 | </property> | ||
364 | </widget> | 343 | </widget> |
@@ -370,2 +349,6 @@ | |||
370 | </property> | 349 | </property> |
350 | <property stdset="1"> | ||
351 | <name>echoMode</name> | ||
352 | <enum>Password</enum> | ||
353 | </property> | ||
371 | </widget> | 354 | </widget> |
@@ -377,2 +360,6 @@ | |||
377 | </property> | 360 | </property> |
361 | <property stdset="1"> | ||
362 | <name>echoMode</name> | ||
363 | <enum>Password</enum> | ||
364 | </property> | ||
378 | </widget> | 365 | </widget> |
@@ -384,2 +371,6 @@ | |||
384 | </property> | 371 | </property> |
372 | <property stdset="1"> | ||
373 | <name>echoMode</name> | ||
374 | <enum>Password</enum> | ||
375 | </property> | ||
385 | </widget> | 376 | </widget> |
@@ -463,23 +454,5 @@ | |||
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> |
@@ -489,3 +462,3 @@ | |||
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> |
@@ -493,5 +466,5 @@ | |||
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> |
@@ -501,7 +474,5 @@ | |||
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> |
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 | |||
@@ -8,2 +8,3 @@ | |||
8 | #include <qlineedit.h> | 8 | #include <qlineedit.h> |
9 | #include <qlabel.h> | ||
9 | #include <qspinbox.h> | 10 | #include <qspinbox.h> |
@@ -12,2 +13,3 @@ | |||
12 | #include <qtabwidget.h> | 13 | #include <qtabwidget.h> |
14 | #include <qcombobox.h> | ||
13 | 15 | ||
@@ -41,2 +43,9 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W | |||
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 | |||
48 | void WLANImp::typeChanged(int mod){ | ||
49 | networkChannel->setEnabled(mod); | ||
50 | channelLabel->setEnabled(mod); | ||
42 | } | 51 | } |
@@ -73,8 +82,6 @@ void WLANImp::parseSettingFile(){ | |||
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 | } |
@@ -84,8 +91,6 @@ void WLANImp::parseSettingFile(){ | |||
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 | } |
@@ -156,6 +161,13 @@ void WLANImp::changeAndSaveSettingFile(){ | |||
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"; |
160 | 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 | } | ||
172 | |||
161 | stream << "\tKEY0=" << keyLineEdit0->text() << "\n"; | 173 | stream << "\tKEY0=" << keyLineEdit0->text() << "\n"; |
@@ -177,3 +189,2 @@ void WLANImp::changeAndSaveSettingFile(){ | |||
177 | } | 189 | } |
178 | stream << "\tCHANNEL=" << networkChannel->value() << "\n"; | ||
179 | stream << "\tRATE=auto\n"; | 190 | stream << "\tRATE=auto\n"; |
@@ -198,3 +209,3 @@ void WLANImp::accept(){ | |||
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; |
@@ -203,2 +214,7 @@ void WLANImp::accept(){ | |||
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 |
@@ -210,2 +226,3 @@ void WLANImp::accept(){ | |||
210 | 226 | ||
227 | return; | ||
211 | // Restart the device now that the settings have changed | 228 | // Restart the device now that the settings have changed |
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 | |||
@@ -20,2 +20,5 @@ protected: | |||
20 | 20 | ||
21 | private slots: | ||
22 | void typeChanged(int); | ||
23 | |||
21 | private: | 24 | private: |