-rw-r--r-- | noncore/net/networksetup/wlan/wlanimp.cpp | 4 | ||||
-rw-r--r-- | noncore/net/networksetup/wlan/wlanimp.h | 1 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.cpp | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.h | 1 |
4 files changed, 10 insertions, 0 deletions
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp index 3b0e0b7..ea19207 100644 --- a/noncore/net/networksetup/wlan/wlanimp.cpp +++ b/noncore/net/networksetup/wlan/wlanimp.cpp | |||
@@ -1,87 +1,91 @@ | |||
1 | #include "wlanimp.h" | 1 | #include "wlanimp.h" |
2 | 2 | ||
3 | /* Config class */ | 3 | /* Config class */ |
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | /* Global namespace */ | 5 | /* Global namespace */ |
6 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
7 | /* system() */ | 7 | /* system() */ |
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <qfile.h> | 9 | #include <qfile.h> |
10 | #include <qdir.h> | 10 | #include <qdir.h> |
11 | #include <qtextstream.h> | 11 | #include <qtextstream.h> |
12 | #include <qmessagebox.h> | 12 | #include <qmessagebox.h> |
13 | #include <qlineedit.h> | 13 | #include <qlineedit.h> |
14 | #include <qspinbox.h> | 14 | #include <qspinbox.h> |
15 | #include <qradiobutton.h> | 15 | #include <qradiobutton.h> |
16 | #include <qcheckbox.h> | 16 | #include <qcheckbox.h> |
17 | #include <qregexp.h> | 17 | #include <qregexp.h> |
18 | 18 | ||
19 | WLANImp::WLANImp( QWidget* parent, const char* name):WLAN(parent, name){ | 19 | WLANImp::WLANImp( QWidget* parent, const char* name):WLAN(parent, name){ |
20 | config = new Config("wireless"); | 20 | config = new Config("wireless"); |
21 | readConfig(); | 21 | readConfig(); |
22 | } | 22 | } |
23 | 23 | ||
24 | WLANImp::~WLANImp( ){ | ||
25 | delete config; | ||
26 | } | ||
27 | |||
24 | void WLANImp::readConfig() | 28 | void WLANImp::readConfig() |
25 | { | 29 | { |
26 | qWarning( "WLANImp::readConfig() called." ); | 30 | qWarning( "WLANImp::readConfig() called." ); |
27 | config->setGroup( "Properties" ); | 31 | config->setGroup( "Properties" ); |
28 | QString ssid = config->readEntry( "SSID", "any" ); | 32 | QString ssid = config->readEntry( "SSID", "any" ); |
29 | if( ssid == "any" || ssid == "ANY" ){ | 33 | if( ssid == "any" || ssid == "ANY" ){ |
30 | essNon->setChecked( true ); | 34 | essNon->setChecked( true ); |
31 | } else { | 35 | } else { |
32 | essSpecific->setChecked( true ); | 36 | essSpecific->setChecked( true ); |
33 | essSpecificLineEdit->setText( ssid ); | 37 | essSpecificLineEdit->setText( ssid ); |
34 | } | 38 | } |
35 | QString mode = config->readEntry( "Mode", "Managed" ); | 39 | QString mode = config->readEntry( "Mode", "Managed" ); |
36 | if( mode == "adhoc" ) { | 40 | if( mode == "adhoc" ) { |
37 | network802->setChecked( true ); | 41 | network802->setChecked( true ); |
38 | } else { | 42 | } else { |
39 | networkInfrastructure->setChecked( true ); | 43 | networkInfrastructure->setChecked( true ); |
40 | } | 44 | } |
41 | networkChannel->setValue( config->readNumEntry( "CHANNEL", 1 ) ); | 45 | networkChannel->setValue( config->readNumEntry( "CHANNEL", 1 ) ); |
42 | // config->readEntry( "RATE", "auto" ); | 46 | // config->readEntry( "RATE", "auto" ); |
43 | config->readEntry( "dot11PrivacyInvoked" ) == "true" ? wepEnabled->setChecked( true ) : wepEnabled->setChecked( false ); | 47 | config->readEntry( "dot11PrivacyInvoked" ) == "true" ? wepEnabled->setChecked( true ) : wepEnabled->setChecked( false ); |
44 | config->readEntry( "AuthType", "opensystem" ); | 48 | config->readEntry( "AuthType", "opensystem" ); |
45 | config->readEntry( "PRIV_KEY128", "false" ) == "false" ? key40->setChecked( true ) : key128->setChecked( true ); | 49 | config->readEntry( "PRIV_KEY128", "false" ) == "false" ? key40->setChecked( true ) : key128->setChecked( true ); |
46 | int defaultkey = config->readNumEntry( "dot11WEPDefaultKeyID", 0 ); | 50 | int defaultkey = config->readNumEntry( "dot11WEPDefaultKeyID", 0 ); |
47 | switch( defaultkey ){ | 51 | switch( defaultkey ){ |
48 | case 0: | 52 | case 0: |
49 | keyRadio0->setChecked( true ); | 53 | keyRadio0->setChecked( true ); |
50 | break; | 54 | break; |
51 | case 1: | 55 | case 1: |
52 | keyRadio1->setChecked( true ); | 56 | keyRadio1->setChecked( true ); |
53 | break; | 57 | break; |
54 | case 2: | 58 | case 2: |
55 | keyRadio2->setChecked( true ); | 59 | keyRadio2->setChecked( true ); |
56 | break; | 60 | break; |
57 | case 3: | 61 | case 3: |
58 | keyRadio3->setChecked( true ); | 62 | keyRadio3->setChecked( true ); |
59 | break; | 63 | break; |
60 | } | 64 | } |
61 | keyLineEdit0->setText(config->readEntry( "dot11WEPDefaultKey0" )); | 65 | keyLineEdit0->setText(config->readEntry( "dot11WEPDefaultKey0" )); |
62 | keyLineEdit1->setText(config->readEntry( "dot11WEPDefaultKey1" )); | 66 | keyLineEdit1->setText(config->readEntry( "dot11WEPDefaultKey1" )); |
63 | keyLineEdit2->setText(config->readEntry( "dot11WEPDefaultKey2" )); | 67 | keyLineEdit2->setText(config->readEntry( "dot11WEPDefaultKey2" )); |
64 | keyLineEdit3->setText(config->readEntry( "dot11WEPDefaultKey3" )); | 68 | keyLineEdit3->setText(config->readEntry( "dot11WEPDefaultKey3" )); |
65 | return; | 69 | return; |
66 | } | 70 | } |
67 | 71 | ||
68 | bool WLANImp::writeConfig() | 72 | bool WLANImp::writeConfig() |
69 | { | 73 | { |
70 | qWarning( "WLANImp::writeConfig() called." ); | 74 | qWarning( "WLANImp::writeConfig() called." ); |
71 | config->setGroup( "Properties" ); | 75 | config->setGroup( "Properties" ); |
72 | if( essNon->isChecked() ) { | 76 | if( essNon->isChecked() ) { |
73 | config->writeEntry( "SSID", "any" ); | 77 | config->writeEntry( "SSID", "any" ); |
74 | } else { | 78 | } else { |
75 | config->writeEntry( "SSID", essSpecificLineEdit->text() ); | 79 | config->writeEntry( "SSID", essSpecificLineEdit->text() ); |
76 | } | 80 | } |
77 | if( networkInfrastructure->isChecked() ){ | 81 | if( networkInfrastructure->isChecked() ){ |
78 | config->writeEntry( "Mode", "Managed" ); | 82 | config->writeEntry( "Mode", "Managed" ); |
79 | } else if( network802->isChecked() ){ | 83 | } else if( network802->isChecked() ){ |
80 | config->writeEntry( "Mode", "adhoc" ); | 84 | config->writeEntry( "Mode", "adhoc" ); |
81 | } | 85 | } |
82 | config->writeEntry( "CHANNEL", networkChannel->value() ); | 86 | config->writeEntry( "CHANNEL", networkChannel->value() ); |
83 | // config->readEntry( "RATE", "auto" ); | 87 | // config->readEntry( "RATE", "auto" ); |
84 | wepEnabled->isChecked() ? config->writeEntry( "dot11PrivacyInvoked", "true" ) : config->writeEntry( "dot11PrivacyInvoked", "false" ); | 88 | wepEnabled->isChecked() ? config->writeEntry( "dot11PrivacyInvoked", "true" ) : config->writeEntry( "dot11PrivacyInvoked", "false" ); |
85 | authOpen->isChecked() ? config->writeEntry( "AuthType", "opensystem" ) : config->writeEntry( "AuthType", "sharedkey" ); | 89 | authOpen->isChecked() ? config->writeEntry( "AuthType", "opensystem" ) : config->writeEntry( "AuthType", "sharedkey" ); |
86 | key40->isChecked() ? config->writeEntry( "PRIV_KEY128", "false" ) : config->writeEntry( "PRIV_KEY128", "true" ); | 90 | key40->isChecked() ? config->writeEntry( "PRIV_KEY128", "false" ) : config->writeEntry( "PRIV_KEY128", "true" ); |
87 | if( keyRadio0->isChecked() ){ | 91 | if( keyRadio0->isChecked() ){ |
diff --git a/noncore/net/networksetup/wlan/wlanimp.h b/noncore/net/networksetup/wlan/wlanimp.h index 79e931d..22ce143 100644 --- a/noncore/net/networksetup/wlan/wlanimp.h +++ b/noncore/net/networksetup/wlan/wlanimp.h | |||
@@ -1,27 +1,28 @@ | |||
1 | #ifndef WLANIMP_H | 1 | #ifndef WLANIMP_H |
2 | #define WLANIMP_H | 2 | #define WLANIMP_H |
3 | 3 | ||
4 | #include "wlan.h" | 4 | #include "wlan.h" |
5 | 5 | ||
6 | #include <qpe/config.h> | 6 | #include <qpe/config.h> |
7 | 7 | ||
8 | class WLANImp : public WLAN { | 8 | class WLANImp : public WLAN { |
9 | Q_OBJECT | 9 | Q_OBJECT |
10 | 10 | ||
11 | public: | 11 | public: |
12 | WLANImp( QWidget* parent = 0, const char* name = 0); | 12 | WLANImp( QWidget* parent = 0, const char* name = 0); |
13 | ~WLANImp( ); | ||
13 | 14 | ||
14 | protected: | 15 | protected: |
15 | void accept(); | 16 | void accept(); |
16 | void done ( int r ); | 17 | void done ( int r ); |
17 | 18 | ||
18 | private: | 19 | private: |
19 | void readConfig(); | 20 | void readConfig(); |
20 | bool writeConfig(); | 21 | bool writeConfig(); |
21 | bool writeWirelessOpts( QString scheme = "*" ); | 22 | bool writeWirelessOpts( QString scheme = "*" ); |
22 | bool writeWlanngOpts( QString scheme = "*" ); | 23 | bool writeWlanngOpts( QString scheme = "*" ); |
23 | Config* config; | 24 | Config* config; |
24 | }; | 25 | }; |
25 | 26 | ||
26 | #endif | 27 | #endif |
27 | 28 | ||
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index 3b0e0b7..ea19207 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp | |||
@@ -1,87 +1,91 @@ | |||
1 | #include "wlanimp.h" | 1 | #include "wlanimp.h" |
2 | 2 | ||
3 | /* Config class */ | 3 | /* Config class */ |
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | /* Global namespace */ | 5 | /* Global namespace */ |
6 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
7 | /* system() */ | 7 | /* system() */ |
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <qfile.h> | 9 | #include <qfile.h> |
10 | #include <qdir.h> | 10 | #include <qdir.h> |
11 | #include <qtextstream.h> | 11 | #include <qtextstream.h> |
12 | #include <qmessagebox.h> | 12 | #include <qmessagebox.h> |
13 | #include <qlineedit.h> | 13 | #include <qlineedit.h> |
14 | #include <qspinbox.h> | 14 | #include <qspinbox.h> |
15 | #include <qradiobutton.h> | 15 | #include <qradiobutton.h> |
16 | #include <qcheckbox.h> | 16 | #include <qcheckbox.h> |
17 | #include <qregexp.h> | 17 | #include <qregexp.h> |
18 | 18 | ||
19 | WLANImp::WLANImp( QWidget* parent, const char* name):WLAN(parent, name){ | 19 | WLANImp::WLANImp( QWidget* parent, const char* name):WLAN(parent, name){ |
20 | config = new Config("wireless"); | 20 | config = new Config("wireless"); |
21 | readConfig(); | 21 | readConfig(); |
22 | } | 22 | } |
23 | 23 | ||
24 | WLANImp::~WLANImp( ){ | ||
25 | delete config; | ||
26 | } | ||
27 | |||
24 | void WLANImp::readConfig() | 28 | void WLANImp::readConfig() |
25 | { | 29 | { |
26 | qWarning( "WLANImp::readConfig() called." ); | 30 | qWarning( "WLANImp::readConfig() called." ); |
27 | config->setGroup( "Properties" ); | 31 | config->setGroup( "Properties" ); |
28 | QString ssid = config->readEntry( "SSID", "any" ); | 32 | QString ssid = config->readEntry( "SSID", "any" ); |
29 | if( ssid == "any" || ssid == "ANY" ){ | 33 | if( ssid == "any" || ssid == "ANY" ){ |
30 | essNon->setChecked( true ); | 34 | essNon->setChecked( true ); |
31 | } else { | 35 | } else { |
32 | essSpecific->setChecked( true ); | 36 | essSpecific->setChecked( true ); |
33 | essSpecificLineEdit->setText( ssid ); | 37 | essSpecificLineEdit->setText( ssid ); |
34 | } | 38 | } |
35 | QString mode = config->readEntry( "Mode", "Managed" ); | 39 | QString mode = config->readEntry( "Mode", "Managed" ); |
36 | if( mode == "adhoc" ) { | 40 | if( mode == "adhoc" ) { |
37 | network802->setChecked( true ); | 41 | network802->setChecked( true ); |
38 | } else { | 42 | } else { |
39 | networkInfrastructure->setChecked( true ); | 43 | networkInfrastructure->setChecked( true ); |
40 | } | 44 | } |
41 | networkChannel->setValue( config->readNumEntry( "CHANNEL", 1 ) ); | 45 | networkChannel->setValue( config->readNumEntry( "CHANNEL", 1 ) ); |
42 | // config->readEntry( "RATE", "auto" ); | 46 | // config->readEntry( "RATE", "auto" ); |
43 | config->readEntry( "dot11PrivacyInvoked" ) == "true" ? wepEnabled->setChecked( true ) : wepEnabled->setChecked( false ); | 47 | config->readEntry( "dot11PrivacyInvoked" ) == "true" ? wepEnabled->setChecked( true ) : wepEnabled->setChecked( false ); |
44 | config->readEntry( "AuthType", "opensystem" ); | 48 | config->readEntry( "AuthType", "opensystem" ); |
45 | config->readEntry( "PRIV_KEY128", "false" ) == "false" ? key40->setChecked( true ) : key128->setChecked( true ); | 49 | config->readEntry( "PRIV_KEY128", "false" ) == "false" ? key40->setChecked( true ) : key128->setChecked( true ); |
46 | int defaultkey = config->readNumEntry( "dot11WEPDefaultKeyID", 0 ); | 50 | int defaultkey = config->readNumEntry( "dot11WEPDefaultKeyID", 0 ); |
47 | switch( defaultkey ){ | 51 | switch( defaultkey ){ |
48 | case 0: | 52 | case 0: |
49 | keyRadio0->setChecked( true ); | 53 | keyRadio0->setChecked( true ); |
50 | break; | 54 | break; |
51 | case 1: | 55 | case 1: |
52 | keyRadio1->setChecked( true ); | 56 | keyRadio1->setChecked( true ); |
53 | break; | 57 | break; |
54 | case 2: | 58 | case 2: |
55 | keyRadio2->setChecked( true ); | 59 | keyRadio2->setChecked( true ); |
56 | break; | 60 | break; |
57 | case 3: | 61 | case 3: |
58 | keyRadio3->setChecked( true ); | 62 | keyRadio3->setChecked( true ); |
59 | break; | 63 | break; |
60 | } | 64 | } |
61 | keyLineEdit0->setText(config->readEntry( "dot11WEPDefaultKey0" )); | 65 | keyLineEdit0->setText(config->readEntry( "dot11WEPDefaultKey0" )); |
62 | keyLineEdit1->setText(config->readEntry( "dot11WEPDefaultKey1" )); | 66 | keyLineEdit1->setText(config->readEntry( "dot11WEPDefaultKey1" )); |
63 | keyLineEdit2->setText(config->readEntry( "dot11WEPDefaultKey2" )); | 67 | keyLineEdit2->setText(config->readEntry( "dot11WEPDefaultKey2" )); |
64 | keyLineEdit3->setText(config->readEntry( "dot11WEPDefaultKey3" )); | 68 | keyLineEdit3->setText(config->readEntry( "dot11WEPDefaultKey3" )); |
65 | return; | 69 | return; |
66 | } | 70 | } |
67 | 71 | ||
68 | bool WLANImp::writeConfig() | 72 | bool WLANImp::writeConfig() |
69 | { | 73 | { |
70 | qWarning( "WLANImp::writeConfig() called." ); | 74 | qWarning( "WLANImp::writeConfig() called." ); |
71 | config->setGroup( "Properties" ); | 75 | config->setGroup( "Properties" ); |
72 | if( essNon->isChecked() ) { | 76 | if( essNon->isChecked() ) { |
73 | config->writeEntry( "SSID", "any" ); | 77 | config->writeEntry( "SSID", "any" ); |
74 | } else { | 78 | } else { |
75 | config->writeEntry( "SSID", essSpecificLineEdit->text() ); | 79 | config->writeEntry( "SSID", essSpecificLineEdit->text() ); |
76 | } | 80 | } |
77 | if( networkInfrastructure->isChecked() ){ | 81 | if( networkInfrastructure->isChecked() ){ |
78 | config->writeEntry( "Mode", "Managed" ); | 82 | config->writeEntry( "Mode", "Managed" ); |
79 | } else if( network802->isChecked() ){ | 83 | } else if( network802->isChecked() ){ |
80 | config->writeEntry( "Mode", "adhoc" ); | 84 | config->writeEntry( "Mode", "adhoc" ); |
81 | } | 85 | } |
82 | config->writeEntry( "CHANNEL", networkChannel->value() ); | 86 | config->writeEntry( "CHANNEL", networkChannel->value() ); |
83 | // config->readEntry( "RATE", "auto" ); | 87 | // config->readEntry( "RATE", "auto" ); |
84 | wepEnabled->isChecked() ? config->writeEntry( "dot11PrivacyInvoked", "true" ) : config->writeEntry( "dot11PrivacyInvoked", "false" ); | 88 | wepEnabled->isChecked() ? config->writeEntry( "dot11PrivacyInvoked", "true" ) : config->writeEntry( "dot11PrivacyInvoked", "false" ); |
85 | authOpen->isChecked() ? config->writeEntry( "AuthType", "opensystem" ) : config->writeEntry( "AuthType", "sharedkey" ); | 89 | authOpen->isChecked() ? config->writeEntry( "AuthType", "opensystem" ) : config->writeEntry( "AuthType", "sharedkey" ); |
86 | key40->isChecked() ? config->writeEntry( "PRIV_KEY128", "false" ) : config->writeEntry( "PRIV_KEY128", "true" ); | 90 | key40->isChecked() ? config->writeEntry( "PRIV_KEY128", "false" ) : config->writeEntry( "PRIV_KEY128", "true" ); |
87 | if( keyRadio0->isChecked() ){ | 91 | if( keyRadio0->isChecked() ){ |
diff --git a/noncore/settings/networksettings/wlan/wlanimp.h b/noncore/settings/networksettings/wlan/wlanimp.h index 79e931d..22ce143 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.h +++ b/noncore/settings/networksettings/wlan/wlanimp.h | |||
@@ -1,27 +1,28 @@ | |||
1 | #ifndef WLANIMP_H | 1 | #ifndef WLANIMP_H |
2 | #define WLANIMP_H | 2 | #define WLANIMP_H |
3 | 3 | ||
4 | #include "wlan.h" | 4 | #include "wlan.h" |
5 | 5 | ||
6 | #include <qpe/config.h> | 6 | #include <qpe/config.h> |
7 | 7 | ||
8 | class WLANImp : public WLAN { | 8 | class WLANImp : public WLAN { |
9 | Q_OBJECT | 9 | Q_OBJECT |
10 | 10 | ||
11 | public: | 11 | public: |
12 | WLANImp( QWidget* parent = 0, const char* name = 0); | 12 | WLANImp( QWidget* parent = 0, const char* name = 0); |
13 | ~WLANImp( ); | ||
13 | 14 | ||
14 | protected: | 15 | protected: |
15 | void accept(); | 16 | void accept(); |
16 | void done ( int r ); | 17 | void done ( int r ); |
17 | 18 | ||
18 | private: | 19 | private: |
19 | void readConfig(); | 20 | void readConfig(); |
20 | bool writeConfig(); | 21 | bool writeConfig(); |
21 | bool writeWirelessOpts( QString scheme = "*" ); | 22 | bool writeWirelessOpts( QString scheme = "*" ); |
22 | bool writeWlanngOpts( QString scheme = "*" ); | 23 | bool writeWlanngOpts( QString scheme = "*" ); |
23 | Config* config; | 24 | Config* config; |
24 | }; | 25 | }; |
25 | 26 | ||
26 | #endif | 27 | #endif |
27 | 28 | ||