summaryrefslogtreecommitdiffstats
path: root/kcontrol
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2014-05-05 15:08:46 +0900
committerMichele Calgaro <[email protected]>2014-05-05 15:08:46 +0900
commit975f19a704fe395947c209c0fc4c164f3a1de5b6 (patch)
tree80cb0e8f157b4064eaba1a67b218521dbc62fc10 /kcontrol
parent6a31c6a61f47083cde645b1c32f769871ed450b3 (diff)
parent868c510ed63f27464d74b0c5e8f71f765c02f563 (diff)
downloadtdebase-975f19a704fe395947c209c0fc4c164f3a1de5b6.tar.gz
tdebase-975f19a704fe395947c209c0fc4c164f3a1de5b6.zip
Merged code for bug 1584 from local branch
Diffstat (limited to 'kcontrol')
-rw-r--r--kcontrol/screensaver/scrnsave.cpp34
-rw-r--r--kcontrol/screensaver/scrnsave.h3
2 files changed, 34 insertions, 3 deletions
diff --git a/kcontrol/screensaver/scrnsave.cpp b/kcontrol/screensaver/scrnsave.cpp
index 33df74f27..a0b26ae46 100644
--- a/kcontrol/screensaver/scrnsave.cpp
+++ b/kcontrol/screensaver/scrnsave.cpp
@@ -177,7 +177,7 @@ KScreenSaver::KScreenSaver(TQWidget *parent, const char *name, const TQStringLis
mSettingsGroup = new TQGroupBox( i18n("Settings"), this );
mSettingsGroup->setColumnLayout( 0, Qt::Vertical );
leftColumnLayout->addWidget( mSettingsGroup );
- TQGridLayout *settingsGroupLayout = new TQGridLayout( mSettingsGroup->layout(), 4, 2, KDialog::spacingHint() );
+ TQGridLayout *settingsGroupLayout = new TQGridLayout( mSettingsGroup->layout(), 5, 2, KDialog::spacingHint() );
mEnabledCheckBox = new TQCheckBox(i18n("Start a&utomatically"), mSettingsGroup);
mEnabledCheckBox->setChecked(mEnabled);
@@ -264,13 +264,20 @@ KScreenSaver::KScreenSaver(TQWidget *parent, const char *name, const TQStringLis
settingsGroupLayout->addWidget(mUseUnmanagedLockWindowsCheckBox, 2, 1);
TQWhatsThis::add( mUseUnmanagedLockWindowsCheckBox, i18n("Use old-style unmanaged X11 lock windows.") );
- mHideActiveWindowsFromSaverCheckBox = new TQCheckBox( i18n("&Hide active windows from saver"), mSettingsGroup );
+ mHideActiveWindowsFromSaverCheckBox = new TQCheckBox( i18n("Hide active &windows from saver"), mSettingsGroup );
mHideActiveWindowsFromSaverCheckBox->setEnabled( true );
mHideActiveWindowsFromSaverCheckBox->setChecked( mHideActiveWindowsFromSaver );
connect( mHideActiveWindowsFromSaverCheckBox, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotHideActiveWindowsFromSaver( bool ) ) );
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->setEnabled( true );
+ mHideCancelButtonCheckBox->setChecked( mHideCancelButton );
+ connect( mHideCancelButtonCheckBox, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotHideCancelButton(bool)) );
+ settingsGroupLayout->addWidget(mHideCancelButtonCheckBox, 4, 1);
+ TQWhatsThis::add(mHideCancelButtonCheckBox, i18n("Hide Cancel button from the \"Desktop Session Locked\" dialog."));
+
// right column
TQBoxLayout* rightColumnLayout = new TQVBoxLayout(topLayout, KDialog::spacingHint());
@@ -432,6 +439,7 @@ void KScreenSaver::readSettings( bool useDefaults )
mUseTSAK = config->readBoolEntry("UseTDESAK", true);
mUseUnmanagedLockWindows = config->readBoolEntry("UseUnmanagedLockWindows", false);
mHideActiveWindowsFromSaver = config->readBoolEntry("HideActiveWindowsFromSaver", true);
+ mHideCancelButton = config->readBoolEntry("HideCancelButton", false);
mSaver = config->readEntry("Saver");
if (mTimeout < 60) mTimeout = 60;
@@ -484,6 +492,7 @@ void KScreenSaver::save()
config->writeEntry("UseTDESAK", mUseTSAK);
config->writeEntry("UseUnmanagedLockWindows", mUseUnmanagedLockWindows);
config->writeEntry("HideActiveWindowsFromSaver", mHideActiveWindowsFromSaver);
+ config->writeEntry("HideCancelButton", mHideCancelButton);
if ( !mSaver.isEmpty() )
config->writeEntry("Saver", mSaver);
@@ -688,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 );
@@ -699,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 );
}
@@ -715,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 );
}
@@ -980,6 +998,16 @@ void KScreenSaver::slotHideActiveWindowsFromSaver( bool h )
//---------------------------------------------------------------------------
//
+void KScreenSaver::slotHideCancelButton( bool h )
+{
+ if (mHideCancelButtonCheckBox->isEnabled()) mHideCancelButton = h;
+ processLockouts();
+ mChanged = true;
+ emit changed(true);
+}
+
+//---------------------------------------------------------------------------
+//
void KScreenSaver::slotSetupDone(TDEProcess *)
{
mPrevSelected = -1; // see ugly hack in slotPreviewExited()
diff --git a/kcontrol/screensaver/scrnsave.h b/kcontrol/screensaver/scrnsave.h
index a8f6e53b0..d52c81227 100644
--- a/kcontrol/screensaver/scrnsave.h
+++ b/kcontrol/screensaver/scrnsave.h
@@ -60,6 +60,7 @@ protected slots:
void slotUseTSAK( bool );
void slotUseUnmanagedLockWindows( bool );
void slotHideActiveWindowsFromSaver( bool );
+ void slotHideCancelButton( bool );
void processLockouts();
void slotSetupDone(TDEProcess*);
// when selecting a new screensaver, the old preview will
@@ -103,6 +104,7 @@ protected:
TQCheckBox *mUseTSAKCheckBox;
TQCheckBox *mUseUnmanagedLockWindowsCheckBox;
TQCheckBox *mHideActiveWindowsFromSaverCheckBox;
+ TQCheckBox *mHideCancelButtonCheckBox;
int mSelected;
int mPrevSelected;
@@ -121,6 +123,7 @@ protected:
bool mUseTSAK;
bool mUseUnmanagedLockWindows;
bool mHideActiveWindowsFromSaver;
+ bool mHideCancelButton;
KSimpleConfig* mTDMConfig;
};