From f9d0650df68ff4d93b28c384db53f396e1dd17e4 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 14 Sep 2016 19:34:14 +0200 Subject: [PATCH] Allow starting although tray is not available --- application/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/main.cpp b/application/main.cpp index eda1e7b..9260e2f 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -34,7 +34,10 @@ int main(int argc, char *argv[]) QT_CONFIG_ARGUMENTS qtConfigArgs; Argument windowedArg("windowed", 'w', "opens the tray menu as a regular window"); windowedArg.setCombinable(true); + Argument waitForTrayArg("wait", '\0', "wait until the system tray becomes available instead of showing an error message if the system tray is not available on start-up"); + waitForTrayArg.setCombinable(true); qtConfigArgs.qtWidgetsGuiArg().addSubArgument(&windowedArg); + qtConfigArgs.qtWidgetsGuiArg().addSubArgument(&waitForTrayArg); parser.setMainArguments({&qtConfigArgs.qtWidgetsGuiArg(), &helpArg}); try { parser.parseArgs(argc, argv); @@ -56,7 +59,7 @@ int main(int argc, char *argv[]) res = application.exec(); } else { #ifndef QT_NO_SYSTEMTRAYICON - if(QSystemTrayIcon::isSystemTrayAvailable()) { + if(QSystemTrayIcon::isSystemTrayAvailable() || waitForTrayArg.isPresent()) { if(Settings::launchSynchting()) { syncthingProcess().startSyncthing(); }