mirror of
https://github.com/status-im/snorenotify.git
synced 2025-02-22 13:08:16 +00:00
Ifdef two cmd arguments of snoresend that are currently only supported on windows.
This commit is contained in:
parent
87f6d04cd4
commit
7c7bba556c
@ -66,7 +66,7 @@ public:
|
||||
Frontend = 1 << 2,
|
||||
|
||||
/**
|
||||
* General plugins, currently there are not plugins implemented.
|
||||
* General plugins, currently there are no plugins implemented.
|
||||
*/
|
||||
Plugin = 1 << 3,
|
||||
|
||||
|
@ -104,12 +104,13 @@ int main(int argc, char *argv[])
|
||||
QCommandLineOption silent(QStringList() << QStringLiteral("silent"), QStringLiteral("Don't print to stdout."));
|
||||
parser.addOption(silent);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
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);
|
||||
|
||||
#endif
|
||||
parser.process(app);
|
||||
qCDebug(SNORE) << app.arguments();
|
||||
if (parser.isSet(title) && parser.isSet(message)) {
|
||||
@ -148,11 +149,13 @@ int main(int argc, char *argv[])
|
||||
cout << qPrintable(reason) << endl;
|
||||
}
|
||||
if (noti.closeReason() == Notification::Closed) {
|
||||
#ifdef Q_OS_WIN
|
||||
if (parser.isSet(_bringProcessToFront)) {
|
||||
bringToFront(parser.value(_bringProcessToFront));
|
||||
} else if (parser.isSet(_bringWindowToFront)) {
|
||||
Utils::bringWindowToFront((HWND)parser.value(_bringWindowToFront).toULongLong(), true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
returnCode = noti.closeReason();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user