Add compression option to database settings

This commit is contained in:
Janek Bevendorff 2018-01-23 21:03:19 +01:00
parent 50beac2baf
commit 75d2895db6
2 changed files with 23 additions and 0 deletions

View File

@ -79,6 +79,8 @@ void DatabaseSettingsWidget::load(Database* db)
m_uiGeneral->dbDescriptionEdit->setText(meta->description());
m_uiGeneral->recycleBinEnabledCheckBox->setChecked(meta->recycleBinEnabled());
m_uiGeneral->defaultUsernameEdit->setText(meta->defaultUserName());
m_uiGeneral->compressionCheckbox->setChecked(m_db->compressionAlgo() != Database::CompressionNone);
if (meta->historyMaxItems() > -1) {
m_uiGeneral->historyMaxItemsSpinBox->setValue(meta->historyMaxItems());
m_uiGeneral->historyMaxItemsCheckBox->setChecked(true);
@ -168,6 +170,8 @@ void DatabaseSettingsWidget::save()
}
}
m_db->setCompressionAlgo(m_uiGeneral->compressionCheckbox->isChecked() ? Database::CompressionGZip : Database::CompressionNone);
Metadata* meta = m_db->metadata();
meta->setName(m_uiGeneral->dbNameEdit->text());

View File

@ -134,6 +134,25 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Additional Database Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="compressionCheckbox">
<property name="text">
<string>Enable &amp;compression (recommended)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">