diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-16 05:31:28 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-16 05:31:28 +0000 |
commit | 76da651e47a07dde3b2babf82bf32c915ebf41c6 (patch) | |
tree | 7f84d71caa05da5181f84099d0a3dfc346dd3824 | |
parent | 94ee9219ddacdc535bed160960c1e4c136cb8a7e (diff) | |
download | tdebase-76da651e47a07dde3b2babf82bf32c915ebf41c6.tar.gz tdebase-76da651e47a07dde3b2babf82bf32c915ebf41c6.zip |
Add configuration option for SAK usage to KDM control center module
Replace call in kdm to system() with KProcess
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1253892 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r-- | kcontrol/kdm/kdm-appear.cpp | 20 | ||||
-rw-r--r-- | kcontrol/kdm/kdm-appear.h | 1 | ||||
-rw-r--r-- | kdm/kfrontend/kgapp.cpp | 10 |
3 files changed, 30 insertions, 1 deletions
diff --git a/kcontrol/kdm/kdm-appear.cpp b/kcontrol/kdm/kdm-appear.cpp index 73227ca51..651cd8782 100644 --- a/kcontrol/kdm/kdm-appear.cpp +++ b/kcontrol/kdm/kdm-appear.cpp @@ -30,6 +30,7 @@ #include <tqwhatsthis.h> #include <tqvalidator.h> #include <tqstylefactory.h> +#include <tqcheckbox.h> #include <tqstyle.h> #include <klocale.h> @@ -237,6 +238,19 @@ KDMAppearanceWidget::KDMAppearanceWidget(TQWidget *parent, const char *name) TQWhatsThis::add( langcombo, wtstr ); + // The SAK group box + group = new TQGroupBox(0, Qt::Vertical, i18n("Secure Attention Key"), this); + vbox->addWidget(group); + + sakbox = new TQCheckBox( i18n("Enable Secure Attention Key"), group ); + connect( sakbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()) ); + TQGridLayout *hbox2 = new TQGridLayout( group->tqlayout(), 2, 2, KDialog::spacingHint() ); + hbox2->setColStretch(1, 1); + hbox2->addWidget(sakbox, 1, 0); + wtstr = i18n("Here you can enable or disable the Secure Attention Key [SAK] anti-spoofing measure."); + TQWhatsThis::add( sakbox, wtstr ); + + vbox->addStretch(1); } @@ -257,6 +271,7 @@ void KDMAppearanceWidget::makeReadOnly() colcombo->setEnabled(false); echocombo->setEnabled(false); langcombo->setEnabled(false); + sakbox->setEnabled(false); } void KDMAppearanceWidget::loadLanguageList(KLanguageButton *combo) @@ -448,6 +463,8 @@ void KDMAppearanceWidget::save() config->writeEntry("GreeterPos", xLineEdit->text() + ',' + yLineEdit->text()); config->writeEntry("Language", langcombo->current()); + + config->writeEntry("UseSAK", sakbox->isChecked()); } @@ -497,6 +514,9 @@ void KDMAppearanceWidget::load() // get the language langcombo->setCurrentItem(config->readEntry("Language", "C")); + + // See if the SAK is enabled + sakbox->setChecked(config->readBoolEntry("UseSAK", true)); } diff --git a/kcontrol/kdm/kdm-appear.h b/kcontrol/kdm/kdm-appear.h index 9dc451f0a..958a91fb3 100644 --- a/kcontrol/kdm/kdm-appear.h +++ b/kcontrol/kdm/kdm-appear.h @@ -90,6 +90,7 @@ private: KBackedComboBox *colcombo; KBackedComboBox *echocombo; KLanguageButton *langcombo; + TQCheckBox *sakbox; }; diff --git a/kdm/kfrontend/kgapp.cpp b/kdm/kfrontend/kgapp.cpp index 5e1581fb2..1f2cd64da 100644 --- a/kdm/kfrontend/kgapp.cpp +++ b/kdm/kfrontend/kgapp.cpp @@ -186,8 +186,11 @@ kg_main( const char *argv0 ) KCrash::setSafer( true ); trinity_desktop_lock_use_sak = _useSAK; + KProcess *tsak = 0; if (trinity_desktop_lock_use_sak) { - system(TQString(TQCString( argv0, strrchr( argv0, '/' ) - argv0 + 2 ) + "tsak &").ascii()); + tsak = new KProcess; + *tsak << TQCString( argv0, strrchr( argv0, '/' ) - argv0 + 2 ) + "tsak"; + tsak->start(); } #ifdef HAVE_XCOMPOSITE @@ -429,6 +432,11 @@ kg_main( const char *argv0 ) kwin->detach(); delete kwin; } + if (tsak) { + tsak->closeStdin(); + tsak->detach(); + delete tsak; + } delete proc; UnsecureDisplay( dpy ); restore_modifiers(); |