diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-05-02 11:53:32 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-05-02 11:53:32 +0900 |
commit | 868c510ed63f27464d74b0c5e8f71f765c02f563 (patch) | |
tree | 00965df32d31204b2fef54a8b532f08de27ba071 | |
parent | a6fbc0f1e09859de2a8414b00c8b39082b0f974e (diff) | |
download | tdebase-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.
-rw-r--r-- | kcontrol/screensaver/scrnsave.cpp | 13 | ||||
-rw-r--r-- | kdesktop/lock/lockdlg.cc | 34 |
2 files changed, 27 insertions, 20 deletions
diff --git a/kcontrol/screensaver/scrnsave.cpp b/kcontrol/screensaver/scrnsave.cpp index 18925e889..a0b26ae46 100644 --- a/kcontrol/screensaver/scrnsave.cpp +++ b/kcontrol/screensaver/scrnsave.cpp @@ -271,7 +271,7 @@ KScreenSaver::KScreenSaver(TQWidget *parent, const char *name, const TQStringLis settingsGroupLayout->addWidget(mHideActiveWindowsFromSaverCheckBox, 3, 1); TQWhatsThis::add( mHideActiveWindowsFromSaverCheckBox, i18n("Hide all active windows from the screen saver and use the desktop background as the screen saver input.") ); - mHideCancelButtonCheckBox = new TQCheckBox( i18n("&Hide Cancel &button"), mSettingsGroup ); + mHideCancelButtonCheckBox = new TQCheckBox( i18n("Hide &cancel button"), mSettingsGroup ); mHideCancelButtonCheckBox->setEnabled( true ); mHideCancelButtonCheckBox->setChecked( mHideCancelButton ); connect( mHideCancelButtonCheckBox, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotHideCancelButton(bool)) ); @@ -697,6 +697,7 @@ void KScreenSaver::slotEnable(bool e) // void KScreenSaver::processLockouts() { + bool useSAK = mTDMConfig->readBoolEntry("UseSAK", false); mActivateLbl->setEnabled( mEnabled ); mWaitEdit->setEnabled( mEnabled ); mLockCheckBox->setEnabled( mEnabled ); @@ -708,7 +709,7 @@ void KScreenSaver::processLockouts() mDelaySaverStartCheckBox->setEnabled( false ); mDelaySaverStartCheckBox->setChecked( false ); } - if (!mUseUnmanagedLockWindows && mTDMConfig->readBoolEntry("UseSAK", false)) { + if (!mUseUnmanagedLockWindows && useSAK) { mUseTSAKCheckBox->setEnabled( true ); mUseTSAKCheckBox->setChecked( mUseTSAK ); } @@ -724,6 +725,14 @@ void KScreenSaver::processLockouts() mHideActiveWindowsFromSaverCheckBox->setEnabled( false ); mHideActiveWindowsFromSaverCheckBox->setChecked( false ); } + if (mUseUnmanagedLockWindows || (useSAK && mUseTSAK)) { + mHideCancelButtonCheckBox->setEnabled( false ); + mHideCancelButtonCheckBox->setChecked( false ); + } + else { + mHideCancelButtonCheckBox->setEnabled( true ); + mHideCancelButtonCheckBox->setChecked( mHideCancelButton ); + } mLockLbl->setEnabled( mEnabled && mLock ); mWaitLockEdit->setEnabled( mEnabled && mLock ); } 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: |