mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-02 11:36:18 -04:00
Add --minimized CLI option
This commit is contained in:
parent
15ac8ac4f8
commit
c9a64be699
3 changed files with 10 additions and 1 deletions
|
@ -84,6 +84,7 @@ int main(int argc, char** argv)
|
|||
QCommandLineOption pwstdinOption("pw-stdin", QObject::tr("read password of the database from stdin"));
|
||||
QCommandLineOption allowScreenCaptureOption("allow-screencapture",
|
||||
QObject::tr("allow screenshots and app recording (Windows/macOS)"));
|
||||
QCommandLineOption startMinimized("minimized", QObject::tr("start minimized to the system tray"));
|
||||
|
||||
QCommandLineOption helpOption = parser.addHelpOption();
|
||||
QCommandLineOption versionOption = parser.addVersionOption();
|
||||
|
@ -95,6 +96,7 @@ int main(int argc, char** argv)
|
|||
parser.addOption(pwstdinOption);
|
||||
parser.addOption(debugInfoOption);
|
||||
parser.addOption(allowScreenCaptureOption);
|
||||
parser.addOption(startMinimized);
|
||||
|
||||
parser.process(app);
|
||||
|
||||
|
@ -207,7 +209,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
// start minimized if configured
|
||||
if (config()->get(Config::GUI_MinimizeOnStartup).toBool()) {
|
||||
if (parser.isSet(startMinimized) || config()->get(Config::GUI_MinimizeOnStartup).toBool()) {
|
||||
mainWindow.hideWindow();
|
||||
} else {
|
||||
mainWindow.bringToFront();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue