Add checkbox to allow minimize after database unlock.

Default option is set to off
This commit is contained in:
Frederic Linus Schulz 2019-08-12 19:31:37 +02:00 committed by Jonathan White
parent 018e9f30be
commit 0a3b19edf2
4 changed files with 13 additions and 0 deletions

View File

@ -193,6 +193,7 @@ void Config::init(const QString& fileName)
m_defaults.insert("MinimizeOnOpenUrl", false);
m_defaults.insert("HideWindowOnCopy", false);
m_defaults.insert("MinimizeOnCopy", true);
m_defaults.insert("MinimizeAfterUnlock", false);
m_defaults.insert("DropToBackgroundOnCopy", false);
m_defaults.insert("UseGroupIconOnEntryCreation", false);
m_defaults.insert("AutoTypeEntryTitleMatch", true);

View File

@ -183,6 +183,7 @@ void ApplicationSettingsWidget::loadSettings()
m_generalUi->backupBeforeSaveCheckBox->setChecked(config()->get("BackupBeforeSave").toBool());
m_generalUi->useAtomicSavesCheckBox->setChecked(config()->get("UseAtomicSaves").toBool());
m_generalUi->autoReloadOnChangeCheckBox->setChecked(config()->get("AutoReloadOnChange").toBool());
m_generalUi->minimizeAfterUnlockCheckBox->setChecked(config()->get("MinimizeAfterUnlock").toBool());
m_generalUi->minimizeOnOpenUrlCheckBox->setChecked(config()->get("MinimizeOnOpenUrl").toBool());
m_generalUi->hideWindowOnCopyCheckBox->setChecked(config()->get("HideWindowOnCopy").toBool());
m_generalUi->minimizeOnCopyRadioButton->setChecked(config()->get("MinimizeOnCopy").toBool());
@ -293,6 +294,7 @@ void ApplicationSettingsWidget::saveSettings()
config()->set("BackupBeforeSave", m_generalUi->backupBeforeSaveCheckBox->isChecked());
config()->set("UseAtomicSaves", m_generalUi->useAtomicSavesCheckBox->isChecked());
config()->set("AutoReloadOnChange", m_generalUi->autoReloadOnChangeCheckBox->isChecked());
config()->set("MinimizeAfterUnlock", m_generalUi->minimizeAfterUnlockCheckBox->isChecked());
config()->set("MinimizeOnOpenUrl", m_generalUi->minimizeOnOpenUrlCheckBox->isChecked());
config()->set("HideWindowOnCopy", m_generalUi->hideWindowOnCopyCheckBox->isChecked());
config()->set("MinimizeOnCopy", m_generalUi->minimizeOnCopyRadioButton->isChecked());

View File

@ -56,6 +56,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="minimizeAfterUnlockCheckBox">
<property name="text">
<string>Minimize window after unlocking database</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="rememberLastDatabasesCheckBox">
<property name="text">

View File

@ -911,6 +911,9 @@ void DatabaseWidget::loadDatabase(bool accepted)
m_fileWatcher->restart();
m_saveAttempts = 0;
emit databaseUnlocked();
if (config()->get("MinimizeAfterUnlock").toBool()) {
window()->showMinimized();
}
} else {
m_fileWatcher->stop();
if (m_databaseOpenWidget->database()) {