diff --git a/src/gui/DatabaseSettingsWidget.cpp b/src/gui/DatabaseSettingsWidget.cpp
index 464f2822b..b47bacca3 100644
--- a/src/gui/DatabaseSettingsWidget.cpp
+++ b/src/gui/DatabaseSettingsWidget.cpp
@@ -61,8 +61,9 @@ void DatabaseSettingsWidget::load(Database* db)
m_ui->historyMaxItemsSpinBox->setValue(Metadata::DefaultHistoryMaxItems);
m_ui->historyMaxItemsCheckBox->setChecked(false);
}
- if (meta->historyMaxSize() > -1) {
- m_ui->historyMaxSizeSpinBox->setValue(meta->historyMaxSize());
+ int historyMaxSizeMiB = qRound(meta->historyMaxSize() / qreal(1048576));
+ if (historyMaxSizeMiB > 0) {
+ m_ui->historyMaxSizeSpinBox->setValue(historyMaxSizeMiB);
m_ui->historyMaxSizeCheckBox->setChecked(true);
}
else {
@@ -90,7 +91,7 @@ void DatabaseSettingsWidget::save()
meta->setHistoryMaxItems(-1);
}
if (m_ui->historyMaxSizeCheckBox->isChecked()) {
- meta->setHistoryMaxSize(m_ui->historyMaxSizeSpinBox->value());
+ meta->setHistoryMaxSize(m_ui->historyMaxSizeSpinBox->value() * 1048576);
}
else {
meta->setHistoryMaxSize(-1);
diff --git a/src/gui/DatabaseSettingsWidget.ui b/src/gui/DatabaseSettingsWidget.ui
index 34ef01524..118d5ab03 100644
--- a/src/gui/DatabaseSettingsWidget.ui
+++ b/src/gui/DatabaseSettingsWidget.ui
@@ -80,25 +80,8 @@
- -
-
-
- -
-
-
- History max size:
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -107,6 +90,12 @@
0
+
+ MiB
+
+
+ 1
+
2000000000
@@ -114,22 +103,8 @@
- -
-
-
- History max items:
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -172,6 +147,23 @@
+ -
+
+
+ Max. history items:
+
+
+
+ -
+
+
+ Max. history size:
+
+
+
+ -
+
+
-