diff options
Diffstat (limited to 'kdesktop')
-rw-r--r-- | kdesktop/lock/lockdlg.cc | 48 | ||||
-rw-r--r-- | kdesktop/lock/lockprocess.cc | 14 | ||||
-rw-r--r-- | kdesktop/lock/sakdlg.cc | 43 | ||||
-rw-r--r-- | kdesktop/lock/sakdlg.h | 7 |
4 files changed, 61 insertions, 51 deletions
diff --git a/kdesktop/lock/lockdlg.cc b/kdesktop/lock/lockdlg.cc index 8059a28c7..fee47dfdb 100644 --- a/kdesktop/lock/lockdlg.cc +++ b/kdesktop/lock/lockdlg.cc @@ -96,13 +96,24 @@ PasswordDlg::PasswordDlg(LockProcess *parent, GreeterPluginHandle *plugin) frame->setFrameStyle( TQFrame::Panel | TQFrame::Raised ); frame->setLineWidth( 2 ); - TQLabel *pixLabel = new TQLabel( frame, "pixlabel" ); - pixLabel->setPixmap(DesktopIcon("lock")); + TQLabel *pixLabel; + if (!trinity_desktop_lock_use_system_modal_dialogs) { + pixLabel = new TQLabel( frame, "pixlabel" ); + pixLabel->setPixmap(DesktopIcon("lock")); + } KUser user; - TQLabel *greetLabel = new TQLabel( user.fullName().isEmpty() ? - i18n("<nobr><b>The session is locked</b><br>") : - i18n("<nobr><b>The session was locked by %1</b><br>").arg( user.fullName() ), frame ); + TQLabel *greetLabel; + if (trinity_desktop_lock_use_system_modal_dialogs) { + greetLabel = new TQLabel( user.fullName().isEmpty() ? + "<b>" + i18n("This computer is in use and has been locked.") + "</b>" : + "<b>" + i18n("This computer is in use and has been locked.") + "</b><br><nobr>" + i18n("Only '%1' may unlock this session.").arg( user.fullName() ), frame ); + } + else { + greetLabel = new TQLabel( user.fullName().isEmpty() ? + i18n("<nobr><b>The session is locked</b><br>") : + i18n("<nobr><b>The session was locked by %1</b><br>").arg( user.fullName() ), frame ); + } mStatusLabel = new TQLabel( "<b> </b>", frame ); mStatusLabel->tqsetAlignment( TQLabel::AlignCenter ); @@ -134,13 +145,26 @@ PasswordDlg::PasswordDlg(LockProcess *parent, GreeterPluginHandle *plugin) layButtons->addWidget( ok ); layButtons->addWidget( cancel ); - frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); - frameLayout->addMultiCellWidget( pixLabel, 0, 2, 0, 0, Qt::AlignTop ); - frameLayout->addWidget( greetLabel, 0, 1 ); - frameLayout->addItem( greet->getLayoutItem(), 1, 1 ); - frameLayout->addLayout( layStatus, 2, 1 ); - frameLayout->addMultiCellWidget( sep, 3, 3, 0, 1 ); - frameLayout->addMultiCellLayout( layButtons, 4, 4, 0, 1 ); + if (trinity_desktop_lock_use_system_modal_dialogs) { + KSMModalDialogHeader* theader = new KSMModalDialogHeader( frame ); + + frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); + frameLayout->addMultiCellWidget( theader, 0, 0, 0, 2, Qt::AlignTop ); + frameLayout->addWidget( greetLabel, 1, 1 ); + frameLayout->addItem( greet->getLayoutItem(), 2, 1 ); + frameLayout->addLayout( layStatus, 3, 1 ); + frameLayout->addMultiCellWidget( sep, 4, 4, 0, 1 ); + frameLayout->addMultiCellLayout( layButtons, 5, 5, 0, 1 ); + } + else { + frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); + frameLayout->addMultiCellWidget( pixLabel, 0, 2, 0, 0, Qt::AlignTop ); + frameLayout->addWidget( greetLabel, 0, 1 ); + frameLayout->addItem( greet->getLayoutItem(), 1, 1 ); + frameLayout->addLayout( layStatus, 2, 1 ); + frameLayout->addMultiCellWidget( sep, 3, 3, 0, 1 ); + frameLayout->addMultiCellLayout( layButtons, 4, 4, 0, 1 ); + } setTabOrder( ok, cancel ); setTabOrder( cancel, mNewSessButton ); diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index 206dc9718..17de269bf 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -134,6 +134,7 @@ extern bool trinity_desktop_lock_use_sak; extern bool trinity_desktop_lock_forced; bool trinity_desktop_lock_autohide_lockdlg = TRUE; +bool trinity_desktop_lock_closing_windows = FALSE; #define ENABLE_CONTINUOUS_LOCKDLG_DISPLAY \ if (!mForceContinualLockDisplayTimer->isActive()) mForceContinualLockDisplayTimer->start(100, FALSE); \ @@ -316,15 +317,24 @@ static void sighup_handler(int) bool LockProcess::closeCurrentWindow() { + trinity_desktop_lock_closing_windows = TRUE; if (currentDialog != NULL) { mForceReject = true; - currentDialog->close(); + if (dynamic_cast<SAKDlg*>(currentDialog)) { + dynamic_cast<SAKDlg*>(currentDialog)->closeDialogForced(); + } + else { + currentDialog->close(); + } } if( mDialogs.isEmpty() ) { + trinity_desktop_lock_closing_windows = FALSE; + mForceReject = false; return false; } else { + trinity_desktop_lock_closing_windows = TRUE; return true; } } @@ -1402,6 +1412,8 @@ bool LockProcess::checkPass() // Wait for SAK press before continuing... SAKDlg inDlg( this ); int ret = execDialog( &inDlg ); + if (trinity_desktop_lock_closing_windows) + return 0; } showVkbd(); diff --git a/kdesktop/lock/sakdlg.cc b/kdesktop/lock/sakdlg.cc index 719f2122f..1647fb527 100644 --- a/kdesktop/lock/sakdlg.cc +++ b/kdesktop/lock/sakdlg.cc @@ -24,6 +24,7 @@ #include <kuser.h> #include <dcopref.h> #include <kmessagebox.h> +#include <kdialog.h> #include <tqlayout.h> #include <tqpushbutton.h> @@ -81,13 +82,12 @@ SAKDlg::SAKDlg(LockProcess *parent) frame->setFrameStyle( TQFrame::Panel | TQFrame::Raised ); frame->setLineWidth( 2 ); - mpixLabel = new TQLabel( frame, "pixlabel" ); - mpixLabel->setPixmap(DesktopIcon("unlock")); + KSMModalDialogHeader* theader = new KSMModalDialogHeader( frame ); KUser user; mStatusLabel = new TQLabel( "<b> </b>", frame ); - mStatusLabel->tqsetAlignment( TQLabel::AlignCenter ); + mStatusLabel->tqsetAlignment( TQLabel::AlignVCenter ); TQVBoxLayout *unlockDialogLayout = new TQVBoxLayout( this ); unlockDialogLayout->addWidget( frame ); @@ -96,11 +96,10 @@ SAKDlg::SAKDlg(LockProcess *parent) layStatus->addWidget( mStatusLabel ); frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); - frameLayout->addMultiCellWidget( mpixLabel, 0, 2, 0, 0, Qt::AlignTop ); - frameLayout->addLayout( layStatus, 1, 1 ); + frameLayout->addMultiCellWidget( theader, 0, 0, 0, 1, Qt::AlignTop | AlignHCenter ); + frameLayout->addMultiCellLayout( layStatus, 1, 1, 0, 1, AlignHCenter | AlignVCenter); - setKDEIcon(); - mStatusLabel->setText("<b>" + i18n("Press Ctrl+Alt+Del to begin.") + "</b>"); + mStatusLabel->setText("<b>" + i18n("Press Ctrl+Alt+Del to begin.") + "</b><p>" + i18n("This process helps keep your password secure.") + "<br>" + i18n("It prevents unauthorized users from emulating the login screen.")); installEventFilter(this); @@ -126,6 +125,11 @@ SAKDlg::~SAKDlg() hide(); } +void SAKDlg::closeDialogForced() +{ + TQDialog::reject(); +} + void SAKDlg::reject() { @@ -137,31 +141,6 @@ void SAKDlg::updateLabel(TQString &txt) mStatusLabel->setText("<b>" + txt + "</b>"); } -void SAKDlg::setUnlockIcon() -{ - mpixLabel->setPixmap(DesktopIcon("unlock")); -} - -void SAKDlg::setKDEIcon() -{ - mpixLabel->setPixmap(DesktopIcon("about_kde")); -} - -void SAKDlg::setInfoIcon() -{ - mpixLabel->setPixmap(DesktopIcon("messagebox_info")); -} - -void SAKDlg::setWarningIcon() -{ - mpixLabel->setPixmap(DesktopIcon("messagebox_warning")); -} - -void SAKDlg::setErrorIcon() -{ - mpixLabel->setPixmap(DesktopIcon("messagebox_critical")); -} - void SAKDlg::show() { TQDialog::show(); diff --git a/kdesktop/lock/sakdlg.h b/kdesktop/lock/sakdlg.h index a9a3c31a0..d72f8d46e 100644 --- a/kdesktop/lock/sakdlg.h +++ b/kdesktop/lock/sakdlg.h @@ -34,11 +34,7 @@ public: virtual void show(); void updateLabel( TQString &txt ); - void setUnlockIcon(); - void setKDEIcon(); - void setInfoIcon(); - void setWarningIcon(); - void setErrorIcon(); + void closeDialogForced(); private slots: void slotSAKProcessExited(); @@ -50,7 +46,6 @@ private: TQFrame *frame; TQGridLayout *frameLayout; TQLabel *mStatusLabel; - TQLabel *mpixLabel; int mCapsLocked; bool mUnlockingFailed; TQStringList layoutsList; |