-rw-r--r-- | core/settings/security/main.cpp | 10 | ||||
-rw-r--r-- | core/settings/security/security.cpp | 5 | ||||
-rw-r--r-- | core/settings/security/security.h | 1 | ||||
-rw-r--r-- | core/settings/security/security.pro | 4 | ||||
-rw-r--r-- | core/settings/security/securitybase.ui | 2 |
5 files changed, 5 insertions, 17 deletions
diff --git a/core/settings/security/main.cpp b/core/settings/security/main.cpp index c15bb31..3141fb8 100644 --- a/core/settings/security/main.cpp +++ b/core/settings/security/main.cpp | |||
@@ -15,24 +15,18 @@ | |||
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
22 | #include <qpe/qcopenvelope_qws.h> | 22 | #include <qpe/qcopenvelope_qws.h> |
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | 24 | ||
25 | #include "security.h" | 25 | #include "security.h" |
26 | 26 | ||
27 | #include <opie/oapplicationfactory.h> | ||
27 | 28 | ||
28 | int main(int argc, char** argv) | 29 | OPIE_EXPORT_APP( OApplicationFactory<Security> ) |
29 | { | ||
30 | QPEApplication a(argc,argv); | ||
31 | 30 | ||
32 | Security dlg; | ||
33 | 31 | ||
34 | a.showMainWidget(&dlg); | ||
35 | |||
36 | return a.exec(); | ||
37 | } | ||
38 | 32 | ||
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp index 42a39c2..81363d2 100644 --- a/core/settings/security/security.cpp +++ b/core/settings/security/security.cpp | |||
@@ -111,25 +111,24 @@ void Security::updateGUI() | |||
111 | 111 | ||
112 | void Security::show() | 112 | void Security::show() |
113 | { | 113 | { |
114 | //valid=FALSE; | 114 | //valid=FALSE; |
115 | setEnabled(FALSE); | 115 | setEnabled(FALSE); |
116 | SecurityBase::show(); | 116 | SecurityBase::show(); |
117 | if ( passcode.isEmpty() ) { | 117 | if ( passcode.isEmpty() ) { |
118 | // could insist... | 118 | // could insist... |
119 | //changePassCode(); | 119 | //changePassCode(); |
120 | //if ( passcode.isEmpty() ) | 120 | //if ( passcode.isEmpty() ) |
121 | //reject(); | 121 | //reject(); |
122 | } else { | 122 | } else { |
123 | |||
124 | if (!valid) // security passcode was not asked yet, so ask now | 123 | if (!valid) // security passcode was not asked yet, so ask now |
125 | { | 124 | { |
126 | QString pc = enterPassCode(tr("Enter passcode")); | 125 | QString pc = enterPassCode(tr("Enter passcode")); |
127 | if ( pc != passcode ) { | 126 | if ( pc != passcode ) { |
128 | QMessageBox::critical(this, tr("Passcode incorrect"), | 127 | QMessageBox::critical(this, tr("Passcode incorrect"), |
129 | tr("The passcode entered is incorrect.\nAccess denied")); | 128 | tr("The passcode entered is incorrect.\nAccess denied")); |
130 | reject(); | 129 | reject(); |
131 | return; | 130 | return; |
132 | } | 131 | } |
133 | } | 132 | } |
134 | } | 133 | } |
135 | setEnabled(TRUE); | 134 | setEnabled(TRUE); |
@@ -230,25 +229,24 @@ void Security::toggleAutoLogin(bool val) | |||
230 | 229 | ||
231 | 230 | ||
232 | void Security::setSyncNet(const QString& sn) | 231 | void Security::setSyncNet(const QString& sn) |
233 | { | 232 | { |
234 | int auth_peer,auth_peer_bits; | 233 | int auth_peer,auth_peer_bits; |
235 | parseNet(sn,auth_peer,auth_peer_bits); | 234 | parseNet(sn,auth_peer,auth_peer_bits); |
236 | selectNet(auth_peer,auth_peer_bits); | 235 | selectNet(auth_peer,auth_peer_bits); |
237 | } | 236 | } |
238 | 237 | ||
239 | void Security::applySecurity() | 238 | void Security::applySecurity() |
240 | { | 239 | { |
241 | if ( valid ) { | 240 | if ( valid ) { |
242 | |||
243 | Config cfg("Security"); | 241 | Config cfg("Security"); |
244 | cfg.setGroup("Passcode"); | 242 | cfg.setGroup("Passcode"); |
245 | cfg.writeEntry("passcode",passcode); | 243 | cfg.writeEntry("passcode",passcode); |
246 | cfg.writeEntry("passcode_poweron",passcode_poweron->isChecked()); | 244 | cfg.writeEntry("passcode_poweron",passcode_poweron->isChecked()); |
247 | cfg.setGroup("Sync"); | 245 | cfg.setGroup("Sync"); |
248 | int auth_peer=0; | 246 | int auth_peer=0; |
249 | int auth_peer_bits; | 247 | int auth_peer_bits; |
250 | QString sn = syncnet->currentText(); | 248 | QString sn = syncnet->currentText(); |
251 | parseNet(sn,auth_peer,auth_peer_bits); | 249 | parseNet(sn,auth_peer,auth_peer_bits); |
252 | cfg.writeEntry("auth_peer",auth_peer); | 250 | cfg.writeEntry("auth_peer",auth_peer); |
253 | cfg.writeEntry("auth_peer_bits",auth_peer_bits); | 251 | cfg.writeEntry("auth_peer_bits",auth_peer_bits); |
254 | /* | 252 | /* |
@@ -261,27 +259,24 @@ void Security::applySecurity() | |||
261 | */ | 259 | */ |
262 | 260 | ||
263 | QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; | 261 | QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; |
264 | Config loginCfg(configFile,Config::File); | 262 | Config loginCfg(configFile,Config::File); |
265 | loginCfg.setGroup("General"); | 263 | loginCfg.setGroup("General"); |
266 | 264 | ||
267 | if (autoLogin) { | 265 | if (autoLogin) { |
268 | loginCfg.writeEntry("AutoLogin",autoLoginName); | 266 | loginCfg.writeEntry("AutoLogin",autoLoginName); |
269 | } else { | 267 | } else { |
270 | loginCfg.removeEntry("AutoLogin"); | 268 | loginCfg.removeEntry("AutoLogin"); |
271 | } | 269 | } |
272 | 270 | ||
273 | cfg.setGroup("SyncMode"); | ||
274 | cfg.writeEntry("Mode", syncModeCombo->currentItem()+1 ); | ||
275 | |||
276 | } | 271 | } |
277 | } | 272 | } |
278 | 273 | ||
279 | void Security::changeLoginName( int idx ) | 274 | void Security::changeLoginName( int idx ) |
280 | { | 275 | { |
281 | autoLoginName = userlist->text(idx);; | 276 | autoLoginName = userlist->text(idx);; |
282 | updateGUI(); | 277 | updateGUI(); |
283 | } | 278 | } |
284 | 279 | ||
285 | void Security::changePassCode() | 280 | void Security::changePassCode() |
286 | { | 281 | { |
287 | QString new1; | 282 | QString new1; |
diff --git a/core/settings/security/security.h b/core/settings/security/security.h index 2f18f91..52d56de 100644 --- a/core/settings/security/security.h +++ b/core/settings/security/security.h | |||
@@ -20,24 +20,25 @@ | |||
20 | #ifndef SECURITY_H | 20 | #ifndef SECURITY_H |
21 | #define SECURITY_H | 21 | #define SECURITY_H |
22 | 22 | ||
23 | #include "securitybase.h" | 23 | #include "securitybase.h" |
24 | 24 | ||
25 | class QPEDialogListener; | 25 | class QPEDialogListener; |
26 | 26 | ||
27 | class Security : public SecurityBase | 27 | class Security : public SecurityBase |
28 | { | 28 | { |
29 | Q_OBJECT | 29 | Q_OBJECT |
30 | 30 | ||
31 | public: | 31 | public: |
32 | static QString appName() { return QString::fromLatin1("security"); } | ||
32 | Security( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 33 | Security( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
33 | ~Security(); | 34 | ~Security(); |
34 | 35 | ||
35 | void show(); | 36 | void show(); |
36 | 37 | ||
37 | protected: | 38 | protected: |
38 | void accept(); | 39 | void accept(); |
39 | void applySecurity(); | 40 | void applySecurity(); |
40 | void done(int); | 41 | void done(int); |
41 | 42 | ||
42 | private slots: | 43 | private slots: |
43 | void changePassCode(); | 44 | void changePassCode(); |
diff --git a/core/settings/security/security.pro b/core/settings/security/security.pro index c359537..67995d4 100644 --- a/core/settings/security/security.pro +++ b/core/settings/security/security.pro | |||
@@ -1,15 +1,13 @@ | |||
1 | TEMPLATE= app | 1 | CONFIG += qt warn_on release quick-app |
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = security.h | 2 | HEADERS = security.h |
5 | SOURCES = security.cpp main.cpp | 3 | SOURCES = security.cpp main.cpp |
6 | INTERFACES= securitybase.ui | 4 | INTERFACES= securitybase.ui |
7 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH+= ../$(OPIEDIR)/include | 6 | DEPENDPATH+= ../$(OPIEDIR)/include |
9 | LIBS += -lqpe | 7 | LIBS += -lqpe |
10 | TARGET = security | 8 | TARGET = security |
11 | 9 | ||
12 | TRANSLATIONS = ../../../i18n/de/security.ts \ | 10 | TRANSLATIONS = ../../../i18n/de/security.ts \ |
13 | ../../../i18n/nl/security.ts \ | 11 | ../../../i18n/nl/security.ts \ |
14 | ../../../i18n/xx/security.ts \ | 12 | ../../../i18n/xx/security.ts \ |
15 | ../../../i18n/en/security.ts \ | 13 | ../../../i18n/en/security.ts \ |
diff --git a/core/settings/security/securitybase.ui b/core/settings/security/securitybase.ui index 73290e5..9fb63a8 100644 --- a/core/settings/security/securitybase.ui +++ b/core/settings/security/securitybase.ui | |||
@@ -2,25 +2,25 @@ | |||
2 | <class>SecurityBase</class> | 2 | <class>SecurityBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>SecurityBase</cstring> | 7 | <cstring>SecurityBase</cstring> |
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>339</width> | 14 | <width>329</width> |
15 | <height>483</height> | 15 | <height>483</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>Security Settings</string> | 20 | <string>Security Settings</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |