summaryrefslogtreecommitdiff
path: root/core/settings/security/security.cpp
Unidiff
Diffstat (limited to 'core/settings/security/security.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/settings/security/security.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp
index c4726b3..00ea105 100644
--- a/core/settings/security/security.cpp
+++ b/core/settings/security/security.cpp
@@ -108,29 +108,33 @@ void Security::updateGUI()
108 108
109} 109}
110 110
111 111
112void Security::show() 112void 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
125 {
123 QString pc = enterPassCode(tr("Enter passcode")); 126 QString pc = enterPassCode(tr("Enter passcode"));
124 if ( pc != passcode ) { 127 if ( pc != passcode ) {
125 QMessageBox::critical(this, tr("Passcode incorrect"), 128 QMessageBox::critical(this, tr("Passcode incorrect"),
126 tr("The passcode entered is incorrect.\nAccess denied")); 129 tr("The passcode entered is incorrect.\nAccess denied"));
127 reject(); 130 reject();
128 return; 131 return;
129 } 132 }
130 } 133 }
134 }
131 setEnabled(TRUE); 135 setEnabled(TRUE);
132 valid=TRUE; 136 valid=TRUE;
133} 137}
134 138
135void Security::accept() 139void Security::accept()
136{ 140{
@@ -210,29 +214,35 @@ void Security::loadUsers ( void )
210 } 214 }
211 } 215 }
212 passwd.close(); 216 passwd.close();
213 } 217 }
214 218
215} 219}
220
216void Security::toggleAutoLogin(bool val) 221void Security::toggleAutoLogin(bool val)
217{ 222{
218 autoLogin=val; 223 autoLogin=val;
219 userlist->setEnabled(val); 224 userlist->setEnabled(val);
220 if (!autoLogin) 225 if (!autoLogin)
221 autoLoginName=userlist->currentText(); 226 autoLoginName=userlist->currentText();
222} 227}
228
229
230
231
223void Security::setSyncNet(const QString& sn) 232void Security::setSyncNet(const QString& sn)
224{ 233{
225 int auth_peer,auth_peer_bits; 234 int auth_peer,auth_peer_bits;
226 parseNet(sn,auth_peer,auth_peer_bits); 235 parseNet(sn,auth_peer,auth_peer_bits);
227 selectNet(auth_peer,auth_peer_bits); 236 selectNet(auth_peer,auth_peer_bits);
228} 237}
229 238
230void Security::applySecurity() 239void Security::applySecurity()
231{ 240{
232 if ( valid ) { 241 if ( valid ) {
242<<<<<<< security.cpp
233 Config cfg("Security"); 243 Config cfg("Security");
234 cfg.setGroup("Passcode"); 244 cfg.setGroup("Passcode");
235 cfg.writeEntry("passcode",passcode); 245 cfg.writeEntry("passcode",passcode);
236 cfg.writeEntry("passcode_poweron",passcode_poweron->isChecked()); 246 cfg.writeEntry("passcode_poweron",passcode_poweron->isChecked());
237 cfg.setGroup("Sync"); 247 cfg.setGroup("Sync");
238 int auth_peer=0; 248 int auth_peer=0;
@@ -259,12 +269,13 @@ void Security::applySecurity()
259 } else { 269 } else {
260 loginCfg.removeEntry("AutoLogin"); 270 loginCfg.removeEntry("AutoLogin");
261 } 271 }
262 272
263 cfg.setGroup("SyncMode"); 273 cfg.setGroup("SyncMode");
264 cfg.writeEntry("Mode", syncModeCombo->currentItem()+1 ); 274 cfg.writeEntry("Mode", syncModeCombo->currentItem()+1 );
275
265 } 276 }
266} 277}
267 278
268void Security::changeLoginName( int idx ) 279void Security::changeLoginName( int idx )
269{ 280{
270 autoLoginName = userlist->text(idx);; 281 autoLoginName = userlist->text(idx);;