diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2015-07-19 22:46:16 +0200 |
---|---|---|
committer | Anne Jan Brouwer <brouwer@annejan.com> | 2015-07-19 22:46:16 +0200 |
commit | 9744ac5c9fb24036b2a5fa43ac39ccf8ce8a57d5 (patch) | |
tree | c3842fc712a2c681ef80b81648ef753221438d78 /mainwindow.cpp | |
parent | 07ef048b5d13a0b2a41ed36c945ab9885b19fd24 (diff) |
Start minimized fixes https://github.com/IJHack/qtpass/issues/69
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r-- | mainwindow.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index 25d5e5ac..7b6152ec 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -217,9 +217,14 @@ bool MainWindow::checkConfig() { useTrayIcon = settings.value("useTrayIcon").toBool(); hideOnClose = settings.value("hideOnClose").toBool(); + startMinimized = settings.value("startMinimized").toBool(); if (useTrayIcon && tray == NULL) { initTrayIcon(); + if (freshStart && startMinimized) { + // since we are still in constructor, can't directly hide + QTimer::singleShot(10*autoclearSeconds, this, SLOT(hide())); + } } else if (!useTrayIcon && tray != NULL) { destroyTrayIcon(); } @@ -347,6 +352,7 @@ void MainWindow::config() { d->addGPGId(addGPGId); d->useTrayIcon(useTrayIcon); d->hideOnClose(hideOnClose); + d->startMinimized(startMinimized); d->setProfiles(profiles, profile); d->useGit(useGit); d->setPwgenPath(pwgenExecutable); @@ -371,6 +377,7 @@ void MainWindow::config() { addGPGId = d->addGPGId(); useTrayIcon = d->useTrayIcon(); hideOnClose = d->hideOnClose(); + startMinimized = d->startMinimized(); profiles = d->getProfiles(); useGit = d->useGit(); pwgenExecutable = d->getPwgenPath(); @@ -395,6 +402,7 @@ void MainWindow::config() { settings.setValue("addGPGId", addGPGId ? "true" : "false"); settings.setValue("useTrayIcon", useTrayIcon ? "true" : "false"); settings.setValue("hideOnClose", hideOnClose ? "true" : "false"); + settings.setValue("startMinimized", startMinimized ? "true" : "false"); settings.setValue("useGit", useGit ? "true" : "false"); settings.setValue("pwgenExecutable", pwgenExecutable); settings.setValue("usePwgen", usePwgen ? "true" : "false"); |