Allow starting although tray is not available
This commit is contained in:
parent
cf0a72c2a7
commit
f9d0650df6
|
@ -34,7 +34,10 @@ int main(int argc, char *argv[])
|
||||||
QT_CONFIG_ARGUMENTS qtConfigArgs;
|
QT_CONFIG_ARGUMENTS qtConfigArgs;
|
||||||
Argument windowedArg("windowed", 'w', "opens the tray menu as a regular window");
|
Argument windowedArg("windowed", 'w', "opens the tray menu as a regular window");
|
||||||
windowedArg.setCombinable(true);
|
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(&windowedArg);
|
||||||
|
qtConfigArgs.qtWidgetsGuiArg().addSubArgument(&waitForTrayArg);
|
||||||
parser.setMainArguments({&qtConfigArgs.qtWidgetsGuiArg(), &helpArg});
|
parser.setMainArguments({&qtConfigArgs.qtWidgetsGuiArg(), &helpArg});
|
||||||
try {
|
try {
|
||||||
parser.parseArgs(argc, argv);
|
parser.parseArgs(argc, argv);
|
||||||
|
@ -56,7 +59,7 @@ int main(int argc, char *argv[])
|
||||||
res = application.exec();
|
res = application.exec();
|
||||||
} else {
|
} else {
|
||||||
#ifndef QT_NO_SYSTEMTRAYICON
|
#ifndef QT_NO_SYSTEMTRAYICON
|
||||||
if(QSystemTrayIcon::isSystemTrayAvailable()) {
|
if(QSystemTrayIcon::isSystemTrayAvailable() || waitForTrayArg.isPresent()) {
|
||||||
if(Settings::launchSynchting()) {
|
if(Settings::launchSynchting()) {
|
||||||
syncthingProcess().startSyncthing();
|
syncthingProcess().startSyncthing();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue