Diffstat (limited to 'core/settings/security/security.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/security/security.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp index 75a181b..c4726b3 100644 --- a/core/settings/security/security.cpp +++ b/core/settings/security/security.cpp | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | #include <qpe/password.h> | 24 | #include <qpe/password.h> |
25 | #include <qpe/qpedialog.h> | 25 | #include <qpe/qpedialog.h> |
26 | #include <qpe/qcopenvelope_qws.h> | ||
26 | 27 | ||
27 | #include <qcheckbox.h> | 28 | #include <qcheckbox.h> |
28 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
@@ -72,6 +73,9 @@ | |||
72 | autoLogin=true; | 73 | autoLogin=true; |
73 | } | 74 | } |
74 | 75 | ||
76 | cfg.setGroup("SyncMode"); | ||
77 | int mode = cfg.readNumEntry("Mode",2); // Default to Sharp | ||
78 | syncModeCombo->setCurrentItem( mode - 1 ); | ||
75 | 79 | ||
76 | connect(autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool))); | 80 | connect(autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool))); |
77 | connect(userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int))); | 81 | connect(userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int))); |
@@ -132,6 +136,7 @@ void Security::accept() | |||
132 | { | 136 | { |
133 | applySecurity(); | 137 | applySecurity(); |
134 | QDialog::accept(); | 138 | QDialog::accept(); |
139 | QCopEnvelope env("QPE/System", "securityChanged()" ); | ||
135 | } | 140 | } |
136 | 141 | ||
137 | void Security::done(int r) | 142 | void Security::done(int r) |
@@ -185,14 +190,14 @@ void Security::parseNet(const QString& sn,int& auth_peer,int& auth_peer_bits) | |||
185 | } | 190 | } |
186 | } | 191 | } |
187 | 192 | ||
188 | void Security::loadUsers ( void ) | 193 | void Security::loadUsers ( void ) |
189 | { | 194 | { |
190 | QFile passwd("/etc/passwd"); | 195 | QFile passwd("/etc/passwd"); |
191 | if ( passwd.open(IO_ReadOnly) ) { | 196 | if ( passwd.open(IO_ReadOnly) ) { |
192 | QTextStream t( &passwd ); | 197 | QTextStream t( &passwd ); |
193 | QString s; | 198 | QString s; |
194 | QStringList account; | 199 | QStringList account; |
195 | while ( !t.eof() ) { | 200 | while ( !t.eof() ) { |
196 | account = QStringList::split(':',t.readLine()); | 201 | account = QStringList::split(':',t.readLine()); |
197 | 202 | ||
198 | // Hide disabled accounts | 203 | // Hide disabled accounts |
@@ -200,7 +205,7 @@ void Security::loadUsers ( void ) | |||
200 | 205 | ||
201 | userlist->insertItem(*account.at(0)); | 206 | userlist->insertItem(*account.at(0)); |
202 | // Highlight this item if it is set to autologinToggle | 207 | // Highlight this item if it is set to autologinToggle |
203 | if ( *account.at(0) == autoLoginName) | 208 | if ( *account.at(0) == autoLoginName) |
204 | userlist->setCurrentItem(userlist->count()-1); | 209 | userlist->setCurrentItem(userlist->count()-1); |
205 | } | 210 | } |
206 | } | 211 | } |
@@ -212,7 +217,7 @@ void Security::toggleAutoLogin(bool val) | |||
212 | { | 217 | { |
213 | autoLogin=val; | 218 | autoLogin=val; |
214 | userlist->setEnabled(val); | 219 | userlist->setEnabled(val); |
215 | if (!autoLogin) | 220 | if (!autoLogin) |
216 | autoLoginName=userlist->currentText(); | 221 | autoLoginName=userlist->currentText(); |
217 | } | 222 | } |
218 | void Security::setSyncNet(const QString& sn) | 223 | void Security::setSyncNet(const QString& sn) |
@@ -255,6 +260,8 @@ void Security::applySecurity() | |||
255 | loginCfg.removeEntry("AutoLogin"); | 260 | loginCfg.removeEntry("AutoLogin"); |
256 | } | 261 | } |
257 | 262 | ||
263 | cfg.setGroup("SyncMode"); | ||
264 | cfg.writeEntry("Mode", syncModeCombo->currentItem()+1 ); | ||
258 | } | 265 | } |
259 | } | 266 | } |
260 | 267 | ||