mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-11 00:13:03 -04:00
DatabaseSettingsWidget improvements.
Merge checkboxes with labels. Set max. history size in MiB instead of bytes.
This commit is contained in:
parent
fef931392f
commit
f1ad94b472
2 changed files with 27 additions and 34 deletions
|
@ -61,8 +61,9 @@ void DatabaseSettingsWidget::load(Database* db)
|
||||||
m_ui->historyMaxItemsSpinBox->setValue(Metadata::DefaultHistoryMaxItems);
|
m_ui->historyMaxItemsSpinBox->setValue(Metadata::DefaultHistoryMaxItems);
|
||||||
m_ui->historyMaxItemsCheckBox->setChecked(false);
|
m_ui->historyMaxItemsCheckBox->setChecked(false);
|
||||||
}
|
}
|
||||||
if (meta->historyMaxSize() > -1) {
|
int historyMaxSizeMiB = qRound(meta->historyMaxSize() / qreal(1048576));
|
||||||
m_ui->historyMaxSizeSpinBox->setValue(meta->historyMaxSize());
|
if (historyMaxSizeMiB > 0) {
|
||||||
|
m_ui->historyMaxSizeSpinBox->setValue(historyMaxSizeMiB);
|
||||||
m_ui->historyMaxSizeCheckBox->setChecked(true);
|
m_ui->historyMaxSizeCheckBox->setChecked(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -90,7 +91,7 @@ void DatabaseSettingsWidget::save()
|
||||||
meta->setHistoryMaxItems(-1);
|
meta->setHistoryMaxItems(-1);
|
||||||
}
|
}
|
||||||
if (m_ui->historyMaxSizeCheckBox->isChecked()) {
|
if (m_ui->historyMaxSizeCheckBox->isChecked()) {
|
||||||
meta->setHistoryMaxSize(m_ui->historyMaxSizeSpinBox->value());
|
meta->setHistoryMaxSize(m_ui->historyMaxSizeSpinBox->value() * 1048576);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
meta->setHistoryMaxSize(-1);
|
meta->setHistoryMaxSize(-1);
|
||||||
|
|
|
@ -80,25 +80,8 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="QCheckBox" name="recycleBinEnabledCheckBox"/>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0">
|
|
||||||
<widget class="QLabel" name="historyMaxSizeLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>History max size:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="1">
|
<item row="7" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="historyMaxSizeCheckBox">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="historyMaxSizeSpinBox">
|
<widget class="QSpinBox" name="historyMaxSizeSpinBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -107,6 +90,12 @@
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string> MiB</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>2000000000</number>
|
<number>2000000000</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -114,22 +103,8 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
|
||||||
<widget class="QLabel" name="historyMaxItemsLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>History max items:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
<item row="6" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="historyMaxItemsCheckBox">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="historyMaxItemsSpinBox">
|
<widget class="QSpinBox" name="historyMaxItemsSpinBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -172,6 +147,23 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QCheckBox" name="historyMaxItemsCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Max. history items:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QCheckBox" name="historyMaxSizeCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Max. history size:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QCheckBox" name="recycleBinEnabledCheckBox"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue