summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-06-09 21:11:40 -0500
committerSlávek Banko <slavek.banko@axis.cz>2012-06-13 21:27:49 +0200
commit05322ae8b762d214f623bbaba95688c0f0ff589d (patch)
treefa4671289685d6662340005af78282b95c3d9c30
parent0c7737264e69a97c8ea2353b3bef4b776dd17695 (diff)
downloadtdebase-05322ae8b762d214f623bbaba95688c0f0ff589d.tar.gz
tdebase-05322ae8b762d214f623bbaba95688c0f0ff589d.zip
Add keep password option to tdesu
This closes Bug 388 (cherry picked from commit 8d7bb2841842aca2eb69bfd847b8674abfa06425)
-rw-r--r--kdesu/kdesu/kdesu.cpp4
-rw-r--r--kdesu/kdesu/sudlg.cpp3
-rw-r--r--kdesu/kdesu/sudlg.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/kdesu/kdesu/kdesu.cpp b/kdesu/kdesu/kdesu.cpp
index daa522ee1..e456064a5 100644
--- a/kdesu/kdesu/kdesu.cpp
+++ b/kdesu/kdesu/kdesu.cpp
@@ -274,7 +274,7 @@ static int startApp()
// Try to exec the command with kdesud.
bool keep = !args->isSet("n") && have_daemon;
- bool terminal = true;
+ bool terminal = args->isSet("t");
bool new_dcop = args->isSet("newdcop");
bool withIgnoreButton = args->isSet("ignorebutton");
@@ -360,7 +360,7 @@ static int startApp()
KStartupInfoData data;
data.setSilent( KStartupInfoData::Yes );
KStartupInfo::sendChange( id, data );
- KDEsuDialog dlg(user, auth_user, keep && !terminal,icon, withIgnoreButton);
+ KDEsuDialog dlg(user, auth_user, keep && !terminal,icon, withIgnoreButton, timeout);
if (prompt)
dlg.addLine(i18n("Command:"), command);
if ((priority != 50) || (scheduler != SuProcess::SchedNormal))
diff --git a/kdesu/kdesu/sudlg.cpp b/kdesu/kdesu/sudlg.cpp
index 483633739..ae5ecff47 100644
--- a/kdesu/kdesu/sudlg.cpp
+++ b/kdesu/kdesu/sudlg.cpp
@@ -14,7 +14,7 @@
#include <kdesu/su.h>
#include "sudlg.h"
-KDEsuDialog::KDEsuDialog(TQCString user, TQCString auth_user, bool enableKeep,const TQString& icon, bool withIgnoreButton)
+KDEsuDialog::KDEsuDialog(TQCString user, TQCString auth_user, bool enableKeep,const TQString& icon, bool withIgnoreButton, int timeout)
: KPasswordDialog(Password, enableKeep, (withIgnoreButton ? User1:NoDefault), icon)
{
KConfig* config = KGlobal::config();
@@ -43,6 +43,7 @@ KDEsuDialog::KDEsuDialog(TQCString user, TQCString auth_user, bool enableKeep,co
}
}
setPrompt(prompt);
+ setKeepWarning(i18n("<qt>The stored password will be:<br> * Kept for up to %1 hours<br> * Destroyed on logout").arg(timeout));
if( withIgnoreButton )
setButtonText(User1, i18n("&Ignore"));
diff --git a/kdesu/kdesu/sudlg.h b/kdesu/kdesu/sudlg.h
index 4277ca67c..2d73d470d 100644
--- a/kdesu/kdesu/sudlg.h
+++ b/kdesu/kdesu/sudlg.h
@@ -15,7 +15,7 @@ class KDEsuDialog
Q_OBJECT
public:
- KDEsuDialog(TQCString user, TQCString auth_user, bool enableKeep, const TQString& icon , bool withIgnoreButton=false);
+ KDEsuDialog(TQCString user, TQCString auth_user, bool enableKeep, const TQString& icon , bool withIgnoreButton=false, int timeout=-1);
~KDEsuDialog();
enum ResultCodes { AsUser = 10 };