Enhance SAK appearance

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1253791 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent f6af340515
commit 1039f2df32

@ -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 );

@ -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();

@ -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();

@ -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;

Loading…
Cancel
Save