From 87f6d04cd4cb9cf2349a7abb0537554cc0e9853a Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Mon, 7 Dec 2015 21:20:06 +0100 Subject: [PATCH] Revert "Remove broken option from snoresend" This reverts commit 3aedea7933984ac0c7dca0442b23e41bec0ba4c4. The methode is not broken and used by kde emerge. --- src/snoresend/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/snoresend/main.cpp b/src/snoresend/main.cpp index bf83c41..36d8efe 100644 --- a/src/snoresend/main.cpp +++ b/src/snoresend/main.cpp @@ -107,6 +107,9 @@ int main(int argc, char *argv[]) QCommandLineOption _bringProcessToFront(QStringList() << QStringLiteral("bring-process-to-front"), QStringLiteral("Bring process with pid to front if notification is clicked."), QStringLiteral("pid")); parser.addOption(_bringProcessToFront); + QCommandLineOption _bringWindowToFront(QStringList() << QStringLiteral("bring-window-to-front"), QStringLiteral("Bring window with wid to front if notification is clicked."), QStringLiteral("wid")); + parser.addOption(_bringWindowToFront); + parser.process(app); qCDebug(SNORE) << app.arguments(); if (parser.isSet(title) && parser.isSet(message)) { @@ -133,7 +136,7 @@ int main(int argc, char *argv[]) parser.showHelp(-1); } Notification n(application, alert, parser.value(title), parser.value(message), icon, Notification::defaultTimeout(), static_cast(prio)); - if (parser.isSet(_bringProcessToFront)) { + if (parser.isSet(_bringProcessToFront) || parser.isSet(_bringWindowToFront)) { n.addAction(Action(1, qApp->translate("SnoreSend", "Bring to Front"))); } int returnCode = -1; @@ -147,6 +150,8 @@ int main(int argc, char *argv[]) if (noti.closeReason() == Notification::Closed) { if (parser.isSet(_bringProcessToFront)) { bringToFront(parser.value(_bringProcessToFront)); + } else if (parser.isSet(_bringWindowToFront)) { + Utils::bringWindowToFront((HWND)parser.value(_bringWindowToFront).toULongLong(), true); } } returnCode = noti.closeReason();