author | zecke <zecke> | 2004-07-09 21:36:37 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-07-09 21:36:37 (UTC) |
commit | 944adb8bf2741a16cf627d19e08f51c08920ad89 (patch) (unidiff) | |
tree | 5f9edc9784e0268a00fe68ec74d7151900c5183a /core/opie-login/loginwindowimpl.cpp | |
parent | c5d3262afd775bce81b99c5dc06e74c4686cee2a (diff) | |
download | opie-944adb8bf2741a16cf627d19e08f51c08920ad89.zip opie-944adb8bf2741a16cf627d19e08f51c08920ad89.tar.gz opie-944adb8bf2741a16cf627d19e08f51c08920ad89.tar.bz2 |
Add setting a root password if none is set to opie-login
If you directly start Opie-Taskbar or use AutoLogin
you will not be presented by a set root password gui
Diffstat (limited to 'core/opie-login/loginwindowimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/opie-login/loginwindowimpl.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/opie-login/loginwindowimpl.cpp b/core/opie-login/loginwindowimpl.cpp index 32f98f3..73c2cbe 100644 --- a/core/opie-login/loginwindowimpl.cpp +++ b/core/opie-login/loginwindowimpl.cpp | |||
@@ -44,12 +44,13 @@ | |||
44 | 44 | ||
45 | #include <opie2/odevice.h> | 45 | #include <opie2/odevice.h> |
46 | 46 | ||
47 | #include <stdio.h> | 47 | #include <stdio.h> |
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | 49 | ||
50 | #include "passworddialogimpl.h" | ||
50 | #include "loginwindowimpl.h" | 51 | #include "loginwindowimpl.h" |
51 | #include "loginapplication.h" | 52 | #include "loginapplication.h" |
52 | #include "inputmethods.h" | 53 | #include "inputmethods.h" |
53 | 54 | ||
54 | using namespace Opie::Core; | 55 | using namespace Opie::Core; |
55 | 56 | ||
@@ -87,22 +88,27 @@ LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_C | |||
87 | setBackgroundPixmap ( bgpix ); | 88 | setBackgroundPixmap ( bgpix ); |
88 | m_caption-> setBackgroundPixmap ( bgpix); | 89 | m_caption-> setBackgroundPixmap ( bgpix); |
89 | TextLabel1-> setBackgroundPixmap ( bgpix); | 90 | TextLabel1-> setBackgroundPixmap ( bgpix); |
90 | TextLabel2-> setBackgroundPixmap ( bgpix); | 91 | TextLabel2-> setBackgroundPixmap ( bgpix); |
91 | } | 92 | } |
92 | 93 | ||
93 | m_caption-> setText ( tr("<center>Welcome to OPIE %1</center><center>& %2 %3</center>"). arg(QPE_VERSION). arg ( ODevice::inst ( )-> systemString ( )). arg ( ODevice::inst ( )-> systemVersionString ( ))); | 94 | //m_caption-> setText ( tr("<center>Welcome to OPIE %1</center><center>& %2 %3</center>"). arg(QPE_VERSION). arg ( ODevice::inst ( )-> systemString ( )). arg ( ODevice::inst ( )-> systemVersionString ( ))); |
94 | 95 | ||
95 | Config cfg ( "opie-login" ); | 96 | Config cfg ( "opie-login" ); |
96 | cfg. setGroup ( "General" ); | 97 | cfg. setGroup ( "General" ); |
97 | QString last = cfg. readEntry ( "LastLogin" ); | 98 | QString last = cfg. readEntry ( "LastLogin" ); |
98 | 99 | ||
99 | if ( !last. isEmpty ( )) | 100 | if ( !last. isEmpty ( )) |
100 | m_user-> setEditText ( last ); | 101 | m_user-> setEditText ( last ); |
101 | 102 | ||
102 | calcMaxWindowRect ( ); | 103 | calcMaxWindowRect ( ); |
104 | |||
105 | if ( PasswordDialogImpl::needDialog() ) | ||
106 | QTimer::singleShot(10, this, SLOT(showPasswordDialog()) ); | ||
107 | |||
108 | |||
103 | } | 109 | } |
104 | 110 | ||
105 | LoginWindowImpl::~LoginWindowImpl ( ) | 111 | LoginWindowImpl::~LoginWindowImpl ( ) |
106 | { | 112 | { |
107 | } | 113 | } |
108 | 114 | ||
@@ -245,6 +251,12 @@ void LoginWindowImpl::login ( ) | |||
245 | } | 251 | } |
246 | else { | 252 | else { |
247 | QMessageBox::warning ( this, tr( "Wrong password" ), tr( "The given password is incorrect." )); | 253 | QMessageBox::warning ( this, tr( "Wrong password" ), tr( "The given password is incorrect." )); |
248 | m_password-> clear ( ); | 254 | m_password-> clear ( ); |
249 | } | 255 | } |
250 | } | 256 | } |
257 | |||
258 | void LoginWindowImpl::showPasswordDialog() { | ||
259 | PasswordDialogImpl dia( this ); | ||
260 | dia.showMaximized(); | ||
261 | dia.exec(); | ||
262 | } | ||