mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-27 00:09:53 -05:00
Fix plural handling in KDF settings
This commit is contained in:
parent
527868a6b3
commit
7cc3d911ba
@ -57,6 +57,9 @@ DatabaseSettingsWidget::DatabaseSettingsWidget(QWidget* parent)
|
||||
connect(m_uiEncryption->transformBenchmarkButton, SIGNAL(clicked()), SLOT(transformRoundsBenchmark()));
|
||||
connect(m_uiEncryption->kdfComboBox, SIGNAL(currentIndexChanged(int)), SLOT(kdfChanged(int)));
|
||||
|
||||
connect(m_uiEncryption->memorySpinBox, SIGNAL(valueChanged(int)), this, SLOT(memoryChanged(int)));
|
||||
connect(m_uiEncryption->parallelismSpinBox, SIGNAL(valueChanged(int)), this, SLOT(parallelismChanged(int)));
|
||||
|
||||
m_ui->categoryList->addCategory(tr("General"), FilePath::instance()->icon("categories", "preferences-other"));
|
||||
m_ui->categoryList->addCategory(tr("Encryption"), FilePath::instance()->icon("actions", "document-encrypt"));
|
||||
m_ui->stackedWidget->addWidget(m_uiGeneralPage);
|
||||
@ -121,7 +124,7 @@ void DatabaseSettingsWidget::load(Database* db)
|
||||
kdfChanged(kdfIndex);
|
||||
}
|
||||
|
||||
// properly initialize parallelism spin box (may be overwritten by actual KDF values)
|
||||
m_uiEncryption->memorySpinBox->setValue(64);
|
||||
m_uiEncryption->parallelismSpinBox->setValue(QThread::idealThreadCount());
|
||||
|
||||
// Setup kdf parameters
|
||||
@ -289,3 +292,21 @@ void DatabaseSettingsWidget::kdfChanged(int index)
|
||||
|
||||
transformRoundsBenchmark();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update memory spin box suffix on value change.
|
||||
*/
|
||||
void DatabaseSettingsWidget::memoryChanged(int value)
|
||||
{
|
||||
m_uiEncryption->memorySpinBox->setSuffix(
|
||||
tr(" MiB", "Abbreviation for Mebibytes (KDF settings)", value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update parallelism spin box suffix on value change.
|
||||
*/
|
||||
void DatabaseSettingsWidget::parallelismChanged(int value)
|
||||
{
|
||||
m_uiEncryption->parallelismSpinBox->setSuffix(
|
||||
tr(" thread(s)", "Threads for parallel execution (KDF settings)", value));
|
||||
}
|
||||
|
@ -54,6 +54,8 @@ private slots:
|
||||
void reject();
|
||||
void transformRoundsBenchmark();
|
||||
void kdfChanged(int index);
|
||||
void memoryChanged(int value);
|
||||
void parallelismChanged(int value);
|
||||
|
||||
private:
|
||||
void truncateHistories();
|
||||
|
@ -139,18 +139,12 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> MB</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1048576</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>64</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
@ -174,9 +168,6 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> thread</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
|
Loading…
Reference in New Issue
Block a user