Allow setting KAuth parent widget.
This commit is contained in:
parent
4b1793f79b
commit
5814c6c02a
|
@ -58,6 +58,8 @@ KAuth::ExecuteJob* ExternalCommand::m_job;
|
||||||
QCA::PrivateKey* ExternalCommand::privateKey;
|
QCA::PrivateKey* ExternalCommand::privateKey;
|
||||||
QCA::Initializer* ExternalCommand::init;
|
QCA::Initializer* ExternalCommand::init;
|
||||||
bool ExternalCommand::helperStarted = false;
|
bool ExternalCommand::helperStarted = false;
|
||||||
|
QWidget* ExternalCommand::parent;
|
||||||
|
|
||||||
|
|
||||||
/** Creates a new ExternalCommand instance without Report.
|
/** Creates a new ExternalCommand instance without Report.
|
||||||
@param cmd the command to run
|
@param cmd the command to run
|
||||||
|
@ -368,6 +370,7 @@ bool ExternalCommand::startHelper()
|
||||||
KAuth::Action action = KAuth::Action(QStringLiteral("org.kde.kpmcore.externalcommand.init"));
|
KAuth::Action action = KAuth::Action(QStringLiteral("org.kde.kpmcore.externalcommand.init"));
|
||||||
action.setHelperId(QStringLiteral("org.kde.kpmcore.externalcommand"));
|
action.setHelperId(QStringLiteral("org.kde.kpmcore.externalcommand"));
|
||||||
action.setTimeout(10 * 24 * 3600 * 1000); // 10 days
|
action.setTimeout(10 * 24 * 3600 * 1000); // 10 days
|
||||||
|
action.setParentWidget(parent);
|
||||||
QVariantMap arguments;
|
QVariantMap arguments;
|
||||||
arguments.insert(QStringLiteral("pubkey"), pubkey.toDER());
|
arguments.insert(QStringLiteral("pubkey"), pubkey.toDER());
|
||||||
action.setArguments(arguments);
|
action.setArguments(arguments);
|
||||||
|
|
|
@ -99,6 +99,13 @@ public:
|
||||||
/**< stop ExternalCommand Helper */
|
/**< stop ExternalCommand Helper */
|
||||||
static void stopHelper();
|
static void stopHelper();
|
||||||
|
|
||||||
|
/**< Sets a parent widget for the authentication dialog.
|
||||||
|
* @param p parent widget
|
||||||
|
*/
|
||||||
|
static void setParentWidget(QWidget *p) {
|
||||||
|
parent = p;
|
||||||
|
}
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void progress(int);
|
void progress(int);
|
||||||
void reportSignal(const QVariantMap&);
|
void reportSignal(const QVariantMap&);
|
||||||
|
@ -122,6 +129,7 @@ private:
|
||||||
static QCA::Initializer *init;
|
static QCA::Initializer *init;
|
||||||
static QCA::PrivateKey *privateKey;
|
static QCA::PrivateKey *privateKey;
|
||||||
static bool helperStarted;
|
static bool helperStarted;
|
||||||
|
static QWidget *parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue