summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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))