-rw-r--r-- | noncore/settings/networksettings/wlan/wlan.pro | 14 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlan.ui | 482 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.cpp | 266 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.h | 37 |
4 files changed, 644 insertions, 155 deletions
diff --git a/noncore/settings/networksettings/wlan/wlan.pro b/noncore/settings/networksettings/wlan/wlan.pro index f193bcc..9ddc154 100644 --- a/noncore/settings/networksettings/wlan/wlan.pro +++ b/noncore/settings/networksettings/wlan/wlan.pro @@ -2,8 +2,8 @@ TEMPLATE = lib CONFIG += qt warn_on release #CONFIG += qt warn_on debug DESTDIR = $(OPIEDIR)/plugins/networksettings -HEADERS = wlanimp.h infoimp.h wlanmodule.h wextensions.h -SOURCES = wlanimp.cpp infoimp.cpp wlanmodule.cpp wextensions.cpp +HEADERS = infoimp.h wlanmodule.h wextensions.h +SOURCES = infoimp.cpp wlanmodule.cpp wextensions.cpp INCLUDEPATH += $(OPIEDIR)/include ../ ../interfaces/ DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -L../interfaces/ -linterfaces @@ -11,6 +11,16 @@ INTERFACES = wlan.ui info.ui TARGET = wlanplugin VERSION = 1.0.0 +#CONFIG += wirelessopts +wirelessopts { + HEADERS += wlanimp.h + SOURCES += wlanimp.cpp +} + +! wirelessopts { + HEADERS += wlanimp2.h + SOURCES += wlanimp2.cpp +} include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/settings/networksettings/wlan/wlan.ui b/noncore/settings/networksettings/wlan/wlan.ui index 744c559..e7c8dbb 100644 --- a/noncore/settings/networksettings/wlan/wlan.ui +++ b/noncore/settings/networksettings/wlan/wlan.ui @@ -11,13 +11,13 @@ <rect> <x>0</x> <y>0</y> - <width>239</width> - <height>277</height> + <width>255</width> + <height>299</height> </rect> </property> <property stdset="1"> <name>caption</name> - <string>Wireless LAN Setting</string> + <string>Wireless Configuration</string> </property> <property stdset="1"> <name>sizeGripEnabled</name> @@ -55,135 +55,216 @@ <name>title</name> <string>General</string> </attribute> - <vbox> + <spacer> + <property> + <name>name</name> + <cstring>Spacer31</cstring> + </property> <property stdset="1"> - <name>margin</name> - <number>11</number> + <name>orientation</name> + <enum>Vertical</enum> </property> <property stdset="1"> - <name>spacing</name> - <number>6</number> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> </property> + </spacer> <widget> - <class>QCheckBox</class> + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>essAny</cstring> + <cstring>modeLabel</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>geometry</name> + <rect> + <x>11</x> + <y>11</y> + <width>84</width> + <height>29</height> + </rect> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>1</vsizetype> + </sizepolicy> </property> <property stdset="1"> <name>text</name> - <string>&Specify Access Point</string> + <string>Mode</string> </property> </widget> <widget> - <class>QGroupBox</class> + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>GroupBox1</cstring> + <cstring>essidLabel</cstring> </property> <property stdset="1"> <name>enabled</name> - <bool>false</bool> + <bool>true</bool> </property> <property stdset="1"> - <name>title</name> - <string>Specific &Access Point Settings</string> + <name>geometry</name> + <rect> + <x>11</x> + <y>46</y> + <width>84</width> + <height>29</height> + </rect> </property> - <grid> <property stdset="1"> - <name>margin</name> - <number>11</number> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>1</vsizetype> + </sizepolicy> </property> <property stdset="1"> - <name>spacing</name> - <number>6</number> + <name>text</name> + <string>ESS-ID</string> </property> - <widget row="0" column="0" > - <class>QLabel</class> + </widget> + <widget> + <class>QSpinBox</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1</cstring> + <cstring>networkChannel</cstring> </property> <property stdset="1"> - <name>text</name> - <string>ESS-ID</string> + <name>enabled</name> + <bool>false</bool> </property> - </widget> - <widget row="1" column="0" > - <class>QLabel</class> <property stdset="1"> - <name>name</name> - <cstring>TextLabel2</cstring> + <name>geometry</name> + <rect> + <x>146</x> + <y>139</y> + <width>58</width> + <height>25</height> + </rect> </property> <property stdset="1"> - <name>text</name> - <string>Network Type</string> + <name>maxValue</name> + <number>15</number> + </property> + <property stdset="1"> + <name>minValue</name> + <number>1</number> + </property> + <property stdset="1"> + <name>value</name> + <number>1</number> </property> </widget> - <widget row="0" column="1" rowspan="1" colspan="2" > + <widget> <class>QLineEdit</class> <property stdset="1"> <name>name</name> - <cstring>essSpecificLineEdit</cstring> + <cstring>macEdit</cstring> </property> - </widget> - <widget row="1" column="1" rowspan="1" colspan="2" > - <class>QComboBox</class> - <item> - <property> - <name>text</name> - <string>Infrastructure</string> + <property stdset="1"> + <name>enabled</name> + <bool>false</bool> </property> - </item> - <item> - <property> - <name>text</name> - <string>Ad-Hoc</string> + <property stdset="1"> + <name>geometry</name> + <rect> + <x>56</x> + <y>108</y> + <width>182</width> + <height>25</height> + </rect> </property> - </item> <property stdset="1"> - <name>name</name> - <cstring>networkType</cstring> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>1</vsizetype> + </sizepolicy> </property> </widget> - <widget row="2" column="0" > + <widget> <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>channelLabel</cstring> + <cstring>macLabel</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>false</bool> + </property> + <property stdset="1"> + <name>geometry</name> + <rect> + <x>11</x> + <y>108</y> + <width>39</width> + <height>25</height> + </rect> </property> <property stdset="1"> <name>text</name> - <string>Channel</string> + <string>MAC</string> </property> </widget> - <widget row="2" column="1" > - <class>QSpinBox</class> + <widget> + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>networkChannel</cstring> + <cstring>specifyAp</cstring> </property> <property stdset="1"> - <name>enabled</name> - <bool>false</bool> + <name>geometry</name> + <rect> + <x>11</x> + <y>81</y> + <width>227</width> + <height>21</height> + </rect> </property> <property stdset="1"> - <name>maxValue</name> - <number>15</number> + <name>text</name> + <string>Specify &Access Point</string> + </property> + </widget> + <widget> + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>specifyChan</cstring> </property> <property stdset="1"> - <name>minValue</name> - <number>1</number> + <name>geometry</name> + <rect> + <x>11</x> + <y>141</y> + <width>129</width> + <height>21</height> + </rect> </property> <property stdset="1"> - <name>value</name> - <number>6</number> + <name>text</name> + <string>Specify &Channel</string> </property> </widget> - <spacer row="2" column="2" > + <spacer> <property> <name>name</name> - <cstring>Spacer4</cstring> + <cstring>Spacer10</cstring> </property> <property stdset="1"> <name>orientation</name> @@ -201,76 +282,112 @@ </size> </property> </spacer> - </grid> - </widget> - <spacer> + <widget> + <class>QComboBox</class> + <item> <property> + <name>text</name> + <string>Auto</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Managed</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Ad-Hoc</string> + </property> + </item> + <property stdset="1"> <name>name</name> - <cstring>Spacer31</cstring> + <cstring>mode</cstring> </property> <property stdset="1"> - <name>orientation</name> - <enum>Vertical</enum> + <name>enabled</name> + <bool>true</bool> </property> <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> + <name>geometry</name> + <rect> + <x>101</x> + <y>11</y> + <width>103</width> + <height>29</height> + </rect> </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>0</vsizetype> + </sizepolicy> </property> - </spacer> - </vbox> </widget> <widget> - <class>QWidget</class> + <class>QComboBox</class> + <item> + <property> + <name>text</name> + <string>any</string> + </property> + </item> <property stdset="1"> <name>name</name> - <cstring>WepPage</cstring> + <cstring>essid</cstring> </property> - <attribute> - <name>title</name> - <string>Encryption</string> - </attribute> - <vbox> <property stdset="1"> - <name>margin</name> - <number>11</number> + <name>geometry</name> + <rect> + <x>101</x> + <y>46</y> + <width>103</width> + <height>29</height> + </rect> </property> <property stdset="1"> - <name>spacing</name> - <number>6</number> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + </sizepolicy> </property> - <widget> - <class>QCheckBox</class> <property stdset="1"> - <name>name</name> - <cstring>wepEnabled</cstring> + <name>editable</name> + <bool>true</bool> </property> <property stdset="1"> - <name>text</name> - <string>&Enable WEP</string> + <name>currentItem</name> + <number>0</number> </property> - </widget> - <widget> - <class>QButtonGroup</class> <property stdset="1"> - <name>name</name> - <cstring>ButtonGroup43</cstring> + <name>sizeLimit</name> + <number>5</number> </property> <property stdset="1"> - <name>enabled</name> + <name>autoCompletion</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>duplicatesEnabled</name> <bool>false</bool> </property> + </widget> + </widget> + <widget> + <class>QWidget</class> <property stdset="1"> - <name>title</name> - <string>&Authentication Type</string> + <name>name</name> + <cstring>WepPage</cstring> </property> - <hbox> + <attribute> + <name>title</name> + <string>Encryption</string> + </attribute> + <grid> <property stdset="1"> <name>margin</name> <number>11</number> @@ -279,35 +396,39 @@ <name>spacing</name> <number>6</number> </property> - <widget> - <class>QRadioButton</class> - <property stdset="1"> + <spacer row="0" column="0" > + <property> <name>name</name> - <cstring>authOpen</cstring> + <cstring>Spacer30</cstring> </property> <property stdset="1"> - <name>text</name> - <string>&Open System</string> + <name>orientation</name> + <enum>Vertical</enum> </property> <property stdset="1"> - <name>checked</name> - <bool>true</bool> + <name>sizeType</name> + <enum>Expanding</enum> </property> - </widget> - <widget> - <class>QRadioButton</class> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget row="0" column="0" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>authShared</cstring> + <cstring>wepEnabled</cstring> </property> <property stdset="1"> <name>text</name> - <string>&Shared Key</string> + <string>&Enable Encryption</string> </property> </widget> - </hbox> - </widget> - <widget> + <widget row="1" column="0" > <class>QButtonGroup</class> <property stdset="1"> <name>name</name> @@ -382,7 +503,7 @@ </property> <property stdset="1"> <name>text</name> - <string>Key 1</string> + <string>Key &1</string> </property> <property stdset="1"> <name>checked</name> @@ -397,7 +518,7 @@ </property> <property stdset="1"> <name>text</name> - <string>Key 2</string> + <string>Key &2</string> </property> </widget> <widget row="2" column="0" > @@ -408,7 +529,7 @@ </property> <property stdset="1"> <name>text</name> - <string>Key 3</string> + <string>Key &3</string> </property> </widget> <widget row="3" column="0" > @@ -419,42 +540,96 @@ </property> <property stdset="1"> <name>text</name> - <string>Key 4</string> + <string>Key &4</string> </property> </widget> </grid> </widget> - <spacer> - <property> + <widget row="2" column="0" > + <class>QButtonGroup</class> + <property stdset="1"> <name>name</name> - <cstring>Spacer30</cstring> + <cstring>NonEncButtonGroup</cstring> </property> <property stdset="1"> - <name>orientation</name> - <enum>Vertical</enum> + <name>enabled</name> + <bool>false</bool> </property> <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> + <name>title</name> + <string>Non-encrypted Packets</string> </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> + <property stdset="1"> + <name>radioButtonExclusive</name> + <bool>true</bool> </property> - </spacer> - </vbox> + <grid> + <property stdset="1"> + <name>margin</name> + <number>11</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget row="0" column="0" > + <class>QRadioButton</class> + <property stdset="1"> + <name>name</name> + <cstring>acceptNonEnc</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>&Accept</string> + </property> + <property stdset="1"> + <name>checked</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>buttonGroupId</name> + <number>0</number> + </property> + </widget> + <widget row="0" column="1" > + <class>QRadioButton</class> + <property stdset="1"> + <name>name</name> + <cstring>rejectNonEnc</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>&Reject</string> + </property> + <property stdset="1"> + <name>buttonGroupId</name> + <number>1</number> + </property> + </widget> + </grid> + </widget> + </grid> </widget> </widget> </vbox> </widget> <connections> <connection> - <sender>wepEnabled</sender> + <sender>specifyAp</sender> + <signal>toggled(bool)</signal> + <receiver>macLabel</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>specifyAp</sender> + <signal>toggled(bool)</signal> + <receiver>macEdit</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>specifyChan</sender> <signal>toggled(bool)</signal> - <receiver>ButtonGroup43</receiver> + <receiver>networkChannel</receiver> <slot>setEnabled(bool)</slot> </connection> <connection> @@ -464,21 +639,15 @@ <slot>setEnabled(bool)</slot> </connection> <connection> - <sender>essAny</sender> + <sender>wepEnabled</sender> <signal>toggled(bool)</signal> - <receiver>GroupBox1</receiver> + <receiver>NonEncButtonGroup</receiver> <slot>setEnabled(bool)</slot> </connection> </connections> <tabstops> <tabstop>tabWidget</tabstop> - <tabstop>essAny</tabstop> - <tabstop>essSpecificLineEdit</tabstop> - <tabstop>networkType</tabstop> - <tabstop>networkChannel</tabstop> <tabstop>wepEnabled</tabstop> - <tabstop>authOpen</tabstop> - <tabstop>authShared</tabstop> <tabstop>keyRadio0</tabstop> <tabstop>keyLineEdit0</tabstop> <tabstop>keyRadio1</tabstop> @@ -487,5 +656,12 @@ <tabstop>keyLineEdit2</tabstop> <tabstop>keyRadio3</tabstop> <tabstop>keyLineEdit3</tabstop> + <tabstop>acceptNonEnc</tabstop> + <tabstop>mode</tabstop> + <tabstop>essid</tabstop> + <tabstop>specifyAp</tabstop> + <tabstop>macEdit</tabstop> + <tabstop>specifyChan</tabstop> + <tabstop>networkChannel</tabstop> </tabstops> </UI> diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp new file mode 100644 index 0000000..01c9668 --- a/dev/null +++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp @@ -0,0 +1,266 @@ +#include "wlanimp2.h" +#include "interfacesetupimp.h" + +#include <qfile.h> +#include <qdir.h> +#include <qtextstream.h> +#include <qmessagebox.h> +#include <qlineedit.h> +#include <qlabel.h> +#include <qspinbox.h> +#include <qradiobutton.h> +#include <qcheckbox.h> +#include <qtabwidget.h> +#include <qcombobox.h> + +#ifdef QWS + #include <opie/oprocess.h> +#else + #define OProcess KProcess + #include <kprocess.h> +#endif + +#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" +#define PREUP "/etc/netwrok/if-pre-up.d/wireless-tools" + +/** + * Constructor, read in the wireless.opts file for parsing later. + */ +WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), currentProfile("*"), interface(i) { + interfaces = new Interfaces; + interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); + tabWidget->insertTab(interfaceSetup, "TCP/IP"); + + // Check sanity - the existance of the wireless-tools if-pre-up script + QFile file(QString(PREUP)); + if (file.exists()) { + qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools")); + } +} + +WLANImp::~WLANImp() { + delete interfaces; +} + +/** + * Change the profile for both wireless settings and network settings. + */ +void WLANImp::setProfile(const QString &profile){ + interfaceSetup->setProfile(profile); + parseOpts(); +} + +void WLANImp::parseOpts() { + bool error; + QString opt; + + if (! interfaces->isInterfaceSet()) + return; + + + opt = interfaces->getInterfaceOption("wireless_essid", error); + if(opt == "any" || opt == "off" || opt.isNull()){ + essid->setEditText("any"); + } else { + essid->setEditText(opt); + } + + 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); + } + + opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace(); + if (! opt.isNull()) { + specifyAp->setChecked(true); + macEdit->setText(opt); + } + + opt = interfaces->getInterfaceOption("wireless_channel", error).simplifyWhiteSpace(); + if (! opt.isNull()) { + specifyChan->setChecked(true); + networkChannel->setValue(opt.toInt()); + } + + opt = interfaces->getInterfaceOption("wireless_key", error).simplifyWhiteSpace(); + if (opt.isNull()) + opt = interfaces->getInterfaceOption("wireless_enc", error).simplifyWhiteSpace(); + parseKeyStr(opt); +} + +void WLANImp::parseKeyStr(QString keystr) { + int loc = 0; + int index = 1; + QString key; + QStringList keys = QStringList::split(QRegExp("\\s+"), keystr); + int enc = -1; // encryption state + + for (QStringList::Iterator it = keys.begin(); it != keys.end(); ++it) { + if ((*it).left(3) == "off") { + // encryption disabled + enc = 0; + } else if ((*it).left(2) == "on") { + // encryption enabled + enc = 1; + } else if ((*it).left(4) == "open") { + // open mode, accept non encrypted packets + acceptNonEnc->setChecked(true); + } else if ((*it).left(10) == "restricted") { + // restricted mode, only accept encrypted packets + rejectNonEnc->setChecked(true); + } else if ((*it).left(3) == "key") { + // new set of options + } else if ((*it).left(1) == "[") { + index = (*it).mid(1, 1).toInt(); + // switch current key to index + switch (index) { + case 1: + keyRadio0->setChecked(true); + break; + case 2: + keyRadio1->setChecked(true); + break; + case 3: + keyRadio2->setChecked(true); + break; + case 4: + keyRadio3->setChecked(true); + break; + } + } else { + // key + key = (*it); + } + if (! key.isNull()) { + if (enc == -1) + enc = 1; + QStringList::Iterator next = ++it; + if (it == keys.end()) { + break; + } + if ((*(next)).left(1) == "[") { + // set key at index + index = (*(next)).mid(1, 1).toInt(); + } else { + index = 1; + } + switch (index) { + case 1: + keyLineEdit0->setText(key); + break; + case 2: + keyLineEdit1->setText(key); + break; + case 3: + keyLineEdit2->setText(key); + break; + case 4: + keyLineEdit3->setText(key); + break; + } + key = QString::null; + } + } + if (enc == 1) { + wepEnabled->setChecked(true); + } else { + wepEnabled->setChecked(false); + } +} + +/** + * Check to see if the current config is valid + * Save interfaces + */ +void WLANImp::accept() { + if (wepEnabled->isChecked()) { + if ((keyRadio0->isChecked() && keyLineEdit0->text().isEmpty()) || + (keyRadio1->isChecked() && keyLineEdit1->text().isEmpty()) || + (keyRadio2->isChecked() && keyLineEdit2->text().isEmpty()) || + (keyRadio3->isChecked() && keyLineEdit3->text().isEmpty())) { + QMessageBox::information(this, "Error", "Please enter a WEP key.", QMessageBox::Ok); + return; + } + } + + if (essid->currentText().isEmpty()) { + QMessageBox::information(this, "Error", "Please select/enter an ESSID.", QMessageBox::Ok); + return; + } + + if (specifyAp->isChecked() && macEdit->text().isEmpty()) { + QMessageBox::information(this, "Error", "Please enter the MAC address of the Access Point.", QMessageBox::Ok); + return; + } + + // Try to save the interfaces settings. + writeOpts(); + + // Close out the dialog + QDialog::accept(); +} + +void WLANImp::writeOpts() { + bool error = false; + + interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText()); + interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText()); + + if (specifyAp->isChecked()) { + interfaces->setInterfaceOption(QString("wireless_ap"), macEdit->text()); + } else { + interfaces->removeInterfaceOption(QString("wireless_ap")); + } + + if (specifyChan->isChecked()) { + interfaces->setInterfaceOption(QString("wireless_channel"), networkChannel->text()); + } else { + interfaces->removeInterfaceOption(QString("wireless_channel")); + } + + if (wepEnabled->isChecked()) { + QStringList keyList; + + if (! keyLineEdit0->text().isNull()) { + keyList += keyLineEdit0->text(); + keyList += "[1]"; + } else if (! keyLineEdit1->text().isNull()) { + keyList += keyLineEdit1->text(); + keyList += "[2]"; + } else if (! keyLineEdit2->text().isNull()) { + keyList += keyLineEdit2->text(); + keyList += "[3]"; + } else if (! keyLineEdit3->text().isNull()) { + keyList += keyLineEdit3->text(); + keyList += "[4]"; + } + if (acceptNonEnc->isChecked()) { + keyList += "open"; + } else { + keyList += "restricted"; + } + + keyList += "key"; + if (keyRadio0->isChecked()) { + keyList += "[1]"; + } else if (keyRadio1->isChecked()) { + keyList += "[2]"; + } else if (keyRadio2->isChecked()) { + keyList += "[3]"; + } else if (keyRadio3->isChecked()) { + keyList += "[4]"; + } + interfaces->setInterfaceOption(QString("wireless_key"), keyList.join(QString(" "))); + } else { + interfaces->removeInterfaceOption(QString("wireless_key")); + } + interfaces->removeInterfaceOption(QString("wireless_enc")); + + if(!interfaceSetup->saveChanges()) + return; +} diff --git a/noncore/settings/networksettings/wlan/wlanimp2.h b/noncore/settings/networksettings/wlan/wlanimp2.h new file mode 100644 index 0000000..992d09a --- a/dev/null +++ b/noncore/settings/networksettings/wlan/wlanimp2.h @@ -0,0 +1,37 @@ +#ifndef WLANIMP_H +#define WLANIMP_H + +#include "wlan.h" +#include "interfaces.h" +#include <qstringlist.h> + +class InterfaceSetupImp; +class Interface; +class Config; + +class WLANImp : public WLAN { + Q_OBJECT + +public: + WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); + ~WLANImp(); + void setProfile(const QString &profile); + +protected: + void accept(); + +private: + void parseOpts(); + void writeOpts(); + + void parseKeyStr(QString keystr); + + InterfaceSetupImp *interfaceSetup; + Interfaces *interfaces; + Interface *interface; + + QString currentProfile; +}; + +#endif + |