summaryrefslogtreecommitdiffstats
path: root/kdesktop/lock/lockdlg.cc
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2014-05-02 11:53:32 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2014-05-02 11:53:32 +0900
commit868c510ed63f27464d74b0c5e8f71f765c02f563 (patch)
tree00965df32d31204b2fef54a8b532f08de27ba071 /kdesktop/lock/lockdlg.cc
parenta6fbc0f1e09859de2a8414b00c8b39082b0f974e (diff)
downloadtdebase-868c510ed63f27464d74b0c5e8f71f765c02f563.tar.gz
tdebase-868c510ed63f27464d74b0c5e8f71f765c02f563.zip
"Hide Cancel button" functionality in kdesktop_lock is now fully working
also on SAK available and enabled systems. This (finally!) fully solves bug 1584.
Diffstat (limited to 'kdesktop/lock/lockdlg.cc')
-rw-r--r--kdesktop/lock/lockdlg.cc34
1 files changed, 16 insertions, 18 deletions
diff --git a/kdesktop/lock/lockdlg.cc b/kdesktop/lock/lockdlg.cc
index 847e018d1..bfa727678 100644
--- a/kdesktop/lock/lockdlg.cc
+++ b/kdesktop/lock/lockdlg.cc
@@ -152,11 +152,13 @@ void PasswordDlg::init(GreeterPluginHandle *plugin)
ok = new KPushButton( i18n("Unl&ock"), frame );
ok->setDefault(true);
- if (!trinity_desktop_lock_hide_cancel_button)
- {
+ bool show_cancel_button = !trinity_desktop_lock_hide_cancel_button ||
+ trinity_desktop_lock_use_sak ||
+ !trinity_desktop_lock_use_system_modal_dialogs;
+ if (show_cancel_button)
cancel = new KPushButton( KStdGuiItem::cancel(), frame );
- // if (!trinity_desktop_lock_autohide_lockdlg && !trinity_desktop_lock_use_sak) cancel->setEnabled(false);
- }
+ else
+ cancel = NULL;
greet = plugin->info->create( this, 0, this, mLayoutButton, TQString::null,
KGreeterPlugin::Authenticate, KGreeterPlugin::ExUnlock );
@@ -172,10 +174,8 @@ void PasswordDlg::init(GreeterPluginHandle *plugin)
layButtons->addWidget( mNewSessButton );
layButtons->addStretch();
layButtons->addWidget(ok);
- if (!trinity_desktop_lock_hide_cancel_button)
- {
+ if (show_cancel_button)
layButtons->addWidget(cancel);
- }
if (trinity_desktop_lock_use_system_modal_dialogs) {
KSMModalDialogHeader* theader = new KSMModalDialogHeader( frame );
@@ -210,15 +210,19 @@ void PasswordDlg::init(GreeterPluginHandle *plugin)
frameLayout->addMultiCellLayout( layButtons, 4, 4, 0, 1 );
}
- setTabOrder( ok, cancel );
- if (!trinity_desktop_lock_hide_cancel_button)
+ if (show_cancel_button)
{
+ setTabOrder( ok, cancel );
setTabOrder( cancel, mNewSessButton );
}
+ else
+ {
+ setTabOrder( ok, mNewSessButton );
+ }
setTabOrder( mNewSessButton, mLayoutButton );
connect(mLayoutButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(layoutClicked()));
- if (!trinity_desktop_lock_hide_cancel_button)
+ if (show_cancel_button)
{
connect(cancel, TQT_SIGNAL(clicked()), TQT_SLOT(reject()));
}
@@ -271,8 +275,8 @@ PasswordDlg::~PasswordDlg()
void PasswordDlg::reject()
{
- if (!trinity_desktop_lock_hide_cancel_button || trinity_desktop_lock_autohide_lockdlg ||
- trinity_desktop_lock_use_sak)
+ if (!trinity_desktop_lock_hide_cancel_button || trinity_desktop_lock_use_sak ||
+ !trinity_desktop_lock_use_system_modal_dialogs || trinity_desktop_lock_autohide_lockdlg)
{
TQDialog::reject();
}
@@ -345,11 +349,6 @@ void PasswordDlg::timerEvent(TQTimerEvent *ev)
mUnlockingFailed = false;
updateLabel();
ok->setEnabled(true);
- if (!trinity_desktop_lock_hide_cancel_button)
- // if (trinity_desktop_lock_autohide_lockdlg || trinity_desktop_lock_use_sak)
- {
- cancel->setEnabled(true);
- }
mNewSessButton->setEnabled( true );
greet->revive();
greet->start();
@@ -464,7 +463,6 @@ void PasswordDlg::reapVerify()
updateLabel();
mFailedTimerId = startTimer(1500);
ok->setEnabled(false);
- //cancel->setEnabled(false);
mNewSessButton->setEnabled( false );
return;
case AuthAbort: