summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-06-09 21:11:40 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-06-09 21:11:40 -0500
commit8d7bb2841842aca2eb69bfd847b8674abfa06425 (patch)
treea73916a40c62cd525d3db7a0d14543b135e9f69b
parent8a61818a86d7d7f6b6332790d80b50a8b3a73146 (diff)
downloadtdebase-8d7bb2841842aca2eb69bfd847b8674abfa06425.tar.gz
tdebase-8d7bb2841842aca2eb69bfd847b8674abfa06425.zip
Add keep password option to tdesu
This closes Bug 388
-rw-r--r--tdesu/tdesu/sudlg.cpp3
-rw-r--r--tdesu/tdesu/sudlg.h2
-rw-r--r--tdesu/tdesu/tdesu.cpp4
3 files changed, 5 insertions, 4 deletions
diff --git a/tdesu/tdesu/sudlg.cpp b/tdesu/tdesu/sudlg.cpp
index cfda9168c..71634d5b0 100644
--- a/tdesu/tdesu/sudlg.cpp
+++ b/tdesu/tdesu/sudlg.cpp
@@ -14,7 +14,7 @@
#include <tdesu/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/tdesu/tdesu/sudlg.h b/tdesu/tdesu/sudlg.h
index 64a283a0e..b72186603 100644
--- a/tdesu/tdesu/sudlg.h
+++ b/tdesu/tdesu/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 };
diff --git a/tdesu/tdesu/tdesu.cpp b/tdesu/tdesu/tdesu.cpp
index bb473a7ef..3511b1fa0 100644
--- a/tdesu/tdesu/tdesu.cpp
+++ b/tdesu/tdesu/tdesu.cpp
@@ -274,7 +274,7 @@ static int startApp()
// Try to exec the command with tdesud.
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))