Merge pull request #1419 from keepassxreboot/feature/compression

Add compression options to database settings
This commit is contained in:
Janek Bevendorff 2018-01-24 10:18:09 +01:00 committed by GitHub
commit 6e2500385c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 9 deletions

View File

@ -79,6 +79,8 @@ void DatabaseSettingsWidget::load(Database* db)
m_uiGeneral->dbDescriptionEdit->setText(meta->description()); m_uiGeneral->dbDescriptionEdit->setText(meta->description());
m_uiGeneral->recycleBinEnabledCheckBox->setChecked(meta->recycleBinEnabled()); m_uiGeneral->recycleBinEnabledCheckBox->setChecked(meta->recycleBinEnabled());
m_uiGeneral->defaultUsernameEdit->setText(meta->defaultUserName()); m_uiGeneral->defaultUsernameEdit->setText(meta->defaultUserName());
m_uiGeneral->compressionCheckbox->setChecked(m_db->compressionAlgo() != Database::CompressionNone);
if (meta->historyMaxItems() > -1) { if (meta->historyMaxItems() > -1) {
m_uiGeneral->historyMaxItemsSpinBox->setValue(meta->historyMaxItems()); m_uiGeneral->historyMaxItemsSpinBox->setValue(meta->historyMaxItems());
m_uiGeneral->historyMaxItemsCheckBox->setChecked(true); 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(); Metadata* meta = m_db->metadata();
meta->setName(m_uiGeneral->dbNameEdit->text()); meta->setName(m_uiGeneral->dbNameEdit->text());

View File

@ -26,9 +26,6 @@
<property name="text"> <property name="text">
<string>Database name:</string> <string>Database name:</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
@ -39,9 +36,6 @@
<property name="text"> <property name="text">
<string>Database description:</string> <string>Database description:</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
@ -52,9 +46,6 @@
<property name="text"> <property name="text">
<string>Default username:</string> <string>Default username:</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
@ -134,6 +125,25 @@
</layout> </layout>
</widget> </widget>
</item> </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> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">