From 1039f2df32eb011fd4013167ac20ecdc607e1c7b Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 15 Sep 2011 07:33:07 +0000 Subject: Enhance SAK appearance git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1253791 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdesktop/lock/lockdlg.cc | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) (limited to 'kdesktop/lock/lockdlg.cc') 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("The session is locked
") : - i18n("
The session was locked by %1
").arg( user.fullName() ), frame ); + TQLabel *greetLabel; + if (trinity_desktop_lock_use_system_modal_dialogs) { + greetLabel = new TQLabel( user.fullName().isEmpty() ? + "" + i18n("This computer is in use and has been locked.") + "" : + "" + i18n("This computer is in use and has been locked.") + "
" + i18n("Only '%1' may unlock this session.").arg( user.fullName() ), frame ); + } + else { + greetLabel = new TQLabel( user.fullName().isEmpty() ? + i18n("The session is locked
") : + i18n("
The session was locked by %1
").arg( user.fullName() ), frame ); + } mStatusLabel = new TQLabel( " ", 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 ); -- cgit v1.2.1