author | zecke <zecke> | 2004-07-09 21:36:37 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-07-09 21:36:37 (UTC) |
commit | 944adb8bf2741a16cf627d19e08f51c08920ad89 (patch) (side-by-side diff) | |
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 @@ -38,24 +38,25 @@ #endif #include <qwindowsystem_qws.h> #include <qpe/resource.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/config.h> #include <opie2/odevice.h> #include <stdio.h> #include <stdlib.h> +#include "passworddialogimpl.h" #include "loginwindowimpl.h" #include "loginapplication.h" #include "inputmethods.h" using namespace Opie::Core; LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_Customize | WStyle_NoBorder | WDestructiveClose ) { QPopupMenu *pop = new QPopupMenu ( this ); pop-> insertItem ( tr( "Restart" ), this, SLOT( restart())); pop-> insertItem ( tr( "Quit" ), this, SLOT( quit())); @@ -81,34 +82,39 @@ LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_C } QString opiedir = ::getenv ( "OPIEDIR" ); QPixmap bgpix ( opiedir + "/pics/launcher/opie-background.jpg" ); if ( !bgpix. isNull ( )) { setBackgroundPixmap ( bgpix ); m_caption-> setBackgroundPixmap ( bgpix); TextLabel1-> setBackgroundPixmap ( bgpix); TextLabel2-> setBackgroundPixmap ( bgpix); } - 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 ( ))); +// 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 ( ))); Config cfg ( "opie-login" ); cfg. setGroup ( "General" ); QString last = cfg. readEntry ( "LastLogin" ); if ( !last. isEmpty ( )) m_user-> setEditText ( last ); calcMaxWindowRect ( ); + + if ( PasswordDialogImpl::needDialog() ) + QTimer::singleShot(10, this, SLOT(showPasswordDialog()) ); + + } LoginWindowImpl::~LoginWindowImpl ( ) { } void LoginWindowImpl::receive ( const QCString &msg, const QByteArray &data ) { QDataStream stream ( data, IO_ReadOnly ); if ( msg == "hideInputMethod()" ) @@ -239,12 +245,18 @@ void LoginWindowImpl::login ( ) lApp-> setLoginAs ( user ); // Draw a big wait icon, the image can be altered in later revisions m_input-> hideInputMethod ( ); new WaitLogo ( ); // WaitLogo::showEvent() calls qApp-> quit() } else { QMessageBox::warning ( this, tr( "Wrong password" ), tr( "The given password is incorrect." )); m_password-> clear ( ); } } + +void LoginWindowImpl::showPasswordDialog() { + PasswordDialogImpl dia( this ); + dia.showMaximized(); + dia.exec(); +} |