From fb2b148b727636e9d8886ace302a89eecb502938 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Sun, 29 May 2022 17:33:12 +0800 Subject: [PATCH] feat: add option to start minimized --- GPClient/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GPClient/main.cpp b/GPClient/main.cpp index 0c91fc7..94e8a2b 100644 --- a/GPClient/main.cpp +++ b/GPClient/main.cpp @@ -45,6 +45,7 @@ int main(int argc, char *argv[]) parser.addOptions({ {"json", "Write the result of the handshake with the GlobalConnect server to stdout as JSON and terminate. Useful for scripting."}, {"now", "Do not show the dialog with the connect button; connect immediately instead."}, + {"start-minimized", "Launch the client minimized."}, }); parser.process(app); @@ -54,7 +55,7 @@ int main(int argc, char *argv[]) ? static_cast(new VpnJson(nullptr)) // Print to stdout and exit : static_cast(new VpnDbus(nullptr)); // Contact GPService daemon via dbus GPClient w(nullptr, vpn); - w.show(); + parser.isSet("start-minimized") ? w.showMinimized() : w.show(); if (positional.size() > 0) { w.portal(positional.at(0));