-rw-r--r-- | library/password.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/library/password.cpp b/library/password.cpp index 6d126c4..25fb1b8 100644 --- a/library/password.cpp +++ b/library/password.cpp | |||
@@ -78,13 +78,13 @@ PasswordDialog::PasswordDialog( QWidget* parent, const char* name, WFlags fl ) | |||
78 | QFont f( font() ); | 78 | QFont f( font() ); |
79 | f.setPointSize( 18 ); | 79 | f.setPointSize( 18 ); |
80 | setFont( f ); | 80 | setFont( f ); |
81 | f.setPointSize( 12 ); | 81 | f.setPointSize( 12 ); |
82 | prompt->setFont( f ); | 82 | prompt->setFont( f ); |
83 | } | 83 | } |
84 | 84 | ||
85 | button_0->installEventFilter( this ); | 85 | button_0->installEventFilter( this ); |
86 | button_1->installEventFilter( this ); | 86 | button_1->installEventFilter( this ); |
87 | button_2->installEventFilter( this ); | 87 | button_2->installEventFilter( this ); |
88 | button_3->installEventFilter( this ); | 88 | button_3->installEventFilter( this ); |
89 | button_4->installEventFilter( this ); | 89 | button_4->installEventFilter( this ); |
90 | button_5->installEventFilter( this ); | 90 | button_5->installEventFilter( this ); |
@@ -213,18 +213,19 @@ public: | |||
213 | PasswordDialog *passw; | 213 | PasswordDialog *passw; |
214 | bool modl; | 214 | bool modl; |
215 | }; | 215 | }; |
216 | 216 | ||
217 | class OwnerDlg : public QDialog | 217 | class OwnerDlg : public QDialog |
218 | { | 218 | { |
219 | Q_OBJECT | ||
219 | public: | 220 | public: |
220 | 221 | ||
221 | OwnerDlg( QWidget *parent, const char * name, Contact c, | 222 | OwnerDlg( QWidget *parent, const char * name, Contact c, |
222 | bool modal, bool fullscreen = FALSE ) | 223 | bool modal, bool fullscreen = FALSE ) |
223 | : QDialog( parent, name, modal, | 224 | : QDialog( parent, name, modal, |
224 | fullscreen ? | 225 | fullscreen ? |
225 | WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop : 0 ) | 226 | WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop : 0 ) |
226 | { | 227 | { |
227 | if ( fullscreen ) { | 228 | if ( fullscreen ) { |
228 | QRect desk = qApp->desktop()->geometry(); | 229 | QRect desk = qApp->desktop()->geometry(); |
229 | setGeometry( 0, 0, desk.width(), desk.height() ); | 230 | setGeometry( 0, 0, desk.width(), desk.height() ); |
230 | } | 231 | } |
@@ -239,13 +240,13 @@ public: | |||
239 | } | 240 | } |
240 | 241 | ||
241 | void resizeEvent( QResizeEvent * ) | 242 | void resizeEvent( QResizeEvent * ) |
242 | { | 243 | { |
243 | tv->resize( size() ); | 244 | tv->resize( size() ); |
244 | } | 245 | } |
245 | 246 | ||
246 | bool eventFilter(QObject *o, QEvent *e) | 247 | bool eventFilter(QObject *o, QEvent *e) |
247 | { | 248 | { |
248 | if (e->type() == QEvent::KeyPress || e->type() == QEvent::MouseButtonPress ) { | 249 | if (e->type() == QEvent::KeyPress || e->type() == QEvent::MouseButtonPress ) { |
249 | accept(); | 250 | accept(); |
250 | return TRUE; | 251 | return TRUE; |
251 | } | 252 | } |
@@ -286,22 +287,22 @@ QString Password::getPassword( const QString& prompt ) | |||
286 | 287 | ||
287 | /*! | 288 | /*! |
288 | Return if a prompt for the user's passcode is needed. | 289 | Return if a prompt for the user's passcode is needed. |
289 | 290 | ||
290 | If \a at_poweron is TRUE, the dialog is only used if the user's | 291 | If \a at_poweron is TRUE, the dialog is only used if the user's |
291 | preference request it at poweron | 292 | preference request it at poweron |
292 | 293 | ||
293 | Opie extension to speed up suspend/resume. | 294 | Opie extension to speed up suspend/resume. |
294 | */ | 295 | */ |
295 | 296 | ||
296 | bool Password::needToAuthenticate(bool at_poweron) | 297 | bool Password::needToAuthenticate(bool at_poweron) |
297 | { | 298 | { |
298 | Config cfg("Security"); | 299 | Config cfg("Security"); |
299 | cfg.setGroup("Passcode"); | 300 | cfg.setGroup("Passcode"); |
300 | QString passcode = cfg.readEntry("passcode"); | 301 | QString passcode = cfg.readEntry("passcode"); |
301 | 302 | ||
302 | return ( !passcode.isEmpty() | 303 | return ( !passcode.isEmpty() |
303 | && (!at_poweron || cfg.readNumEntry("passcode_poweron",0)) ); | 304 | && (!at_poweron || cfg.readNumEntry("passcode_poweron",0)) ); |
304 | } | 305 | } |
305 | 306 | ||
306 | /*! | 307 | /*! |
307 | Prompt, fullscreen, for the user's passcode until they get it right. | 308 | Prompt, fullscreen, for the user's passcode until they get it right. |
@@ -321,13 +322,13 @@ void Password::authenticate(bool at_poweron) | |||
321 | { | 322 | { |
322 | // Do it as a fullscreen modal dialog | 323 | // Do it as a fullscreen modal dialog |
323 | PasswdDlg pd(0,0,TRUE,TRUE); | 324 | PasswdDlg pd(0,0,TRUE,TRUE); |
324 | 325 | ||
325 | // see if there is contact information. | 326 | // see if there is contact information. |
326 | OwnerDlg *oi = 0; | 327 | OwnerDlg *oi = 0; |
327 | QString vfilename = Global::applicationFileName("addressbook", | 328 | QString vfilename = Global::applicationFileName("addressbook", |
328 | "businesscard.vcf"); | 329 | "businesscard.vcf"); |
329 | if (QFile::exists(vfilename)) { | 330 | if (QFile::exists(vfilename)) { |
330 | Contact c; | 331 | Contact c; |
331 | c = Contact::readVCard( vfilename )[0]; | 332 | c = Contact::readVCard( vfilename )[0]; |
332 | 333 | ||
333 | oi = new OwnerDlg(0, 0, c, TRUE, TRUE); | 334 | oi = new OwnerDlg(0, 0, c, TRUE, TRUE); |