Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setting for number of recent files #8239

Merged
merged 1 commit into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions share/translations/keepassxc_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@
<source>Remember last typed entry for:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source> recent files</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApplicationSettingsWidgetSecurity</name>
Expand Down
3 changes: 3 additions & 0 deletions src/gui/ApplicationSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ void ApplicationSettingsWidget::loadSettings()
m_generalUi->singleInstanceCheckBox->setChecked(config()->get(Config::SingleInstance).toBool());
m_generalUi->launchAtStartup->setChecked(osUtils->isLaunchAtStartupEnabled());
m_generalUi->rememberLastDatabasesCheckBox->setChecked(config()->get(Config::RememberLastDatabases).toBool());
m_generalUi->rememberLastDatabasesSpinbox->setValue(config()->get(Config::NumberOfRememberedLastDatabases).toInt());
m_generalUi->rememberLastKeyFilesCheckBox->setChecked(config()->get(Config::RememberLastKeyFiles).toBool());
m_generalUi->openPreviousDatabasesOnStartupCheckBox->setChecked(
config()->get(Config::OpenPreviousDatabasesOnStartup).toBool());
Expand Down Expand Up @@ -336,6 +337,7 @@ void ApplicationSettingsWidget::saveSettings()

config()->set(Config::SingleInstance, m_generalUi->singleInstanceCheckBox->isChecked());
config()->set(Config::RememberLastDatabases, m_generalUi->rememberLastDatabasesCheckBox->isChecked());
config()->set(Config::NumberOfRememberedLastDatabases, m_generalUi->rememberLastDatabasesSpinbox->value());
config()->set(Config::RememberLastKeyFiles, m_generalUi->rememberLastKeyFilesCheckBox->isChecked());
config()->set(Config::OpenPreviousDatabasesOnStartup,
m_generalUi->openPreviousDatabasesOnStartupCheckBox->isChecked());
Expand Down Expand Up @@ -520,6 +522,7 @@ void ApplicationSettingsWidget::rememberDatabasesToggled(bool checked)
m_generalUi->openPreviousDatabasesOnStartupCheckBox->setChecked(false);
}

m_generalUi->rememberLastDatabasesSpinbox->setEnabled(checked);
m_generalUi->rememberLastKeyFilesCheckBox->setEnabled(checked);
m_generalUi->openPreviousDatabasesOnStartupCheckBox->setEnabled(checked);
}
Expand Down
59 changes: 50 additions & 9 deletions src/gui/ApplicationSettingsWidgetGeneral.ui
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,47 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="rememberLastDatabasesCheckBox">
<property name="text">
<string>Remember previously used databases</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QCheckBox" name="rememberLastDatabasesCheckBox">
<property name="text">
<string>Remember previously used databases</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="rememberLastDatabasesSpinbox">
<property name="suffix">
<string> recent files</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>25</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="rememberDbSubLayout_2">
Expand Down Expand Up @@ -1231,6 +1264,7 @@
<tabstop>systrayMinimizeOnStartup</tabstop>
<tabstop>minimizeAfterUnlockCheckBox</tabstop>
<tabstop>rememberLastDatabasesCheckBox</tabstop>
<tabstop>rememberLastDatabasesSpinbox</tabstop>
<tabstop>openPreviousDatabasesOnStartupCheckBox</tabstop>
<tabstop>rememberLastKeyFilesCheckBox</tabstop>
<tabstop>checkForUpdatesOnStartupCheckBox</tabstop>
Expand All @@ -1240,8 +1274,12 @@
<tabstop>autoSaveAfterEveryChangeCheckBox</tabstop>
<tabstop>autoSaveOnExitCheckBox</tabstop>
<tabstop>autoSaveNonDataChangesCheckBox</tabstop>
<tabstop>autoReloadOnChangeCheckBox</tabstop>
<tabstop>backupBeforeSaveCheckBox</tabstop>
<tabstop>backupFilePath</tabstop>
<tabstop>backupFilePathPicker</tabstop>
<tabstop>useAlternativeSaveCheckBox</tabstop>
<tabstop>alternativeSaveComboBox</tabstop>
<tabstop>useGroupIconOnEntryCreationCheckBox</tabstop>
<tabstop>minimizeOnOpenUrlCheckBox</tabstop>
<tabstop>hideWindowOnCopyCheckBox</tabstop>
Expand All @@ -1250,8 +1288,8 @@
<tabstop>faviconTimeoutSpinBox</tabstop>
<tabstop>languageComboBox</tabstop>
<tabstop>toolButtonStyleComboBox</tabstop>
<tabstop>monospaceNotesCheckBox</tabstop>
<tabstop>toolbarMovableCheckBox</tabstop>
<tabstop>monospaceNotesCheckBox</tabstop>
<tabstop>minimizeOnCloseCheckBox</tabstop>
<tabstop>systrayShowCheckBox</tabstop>
<tabstop>trayIconAppearance</tabstop>
Expand All @@ -1260,7 +1298,10 @@
<tabstop>autoTypeEntryTitleMatchCheckBox</tabstop>
<tabstop>autoTypeEntryURLMatchCheckBox</tabstop>
<tabstop>autoTypeAskCheckBox</tabstop>
<tabstop>autoTypeHideExpiredEntryCheckBox</tabstop>
<tabstop>autoTypeRelockDatabaseCheckBox</tabstop>
<tabstop>autoTypeShortcutWidget</tabstop>
<tabstop>autoTypeRetypeTimeSpinBox</tabstop>
<tabstop>autoTypeStartDelaySpinBox</tabstop>
<tabstop>autoTypeDelaySpinBox</tabstop>
</tabstops>
Expand Down