From db05d665845a42de7cf5403893fe2b35e6fe450b Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Mon, 31 May 2021 10:36:38 -0400 Subject: [PATCH] Fixup code --- .../DatabaseSettingsWidgetEncryption.cpp | 7 +- .../DatabaseSettingsWidgetEncryption.ui | 857 +++++++++--------- 2 files changed, 457 insertions(+), 407 deletions(-) diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp b/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp index 28dfff9fb1..a84c1f57f8 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp +++ b/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp @@ -177,7 +177,6 @@ void DatabaseSettingsWidgetEncryption::loadKdfParameters() } auto kdf = m_db->kdf(); - Q_ASSERT(kdf); if (!kdf) { return; } @@ -384,7 +383,11 @@ void DatabaseSettingsWidgetEncryption::setAdvancedMode(bool advanced) if (advanced) { loadKdfParameters(); } else { - m_ui->compatibilitySelection->setCurrentIndex(m_db->kdf()->uuid() == KeePass2::KDF_AES_KDBX3 ? KDBX3 : KDBX4); + auto version = KDBX4; + if (m_db->kdf()) { + version = (m_db->kdf()->uuid() == KeePass2::KDF_AES_KDBX3) ? KDBX3 : KDBX4; + } + m_ui->compatibilitySelection->setCurrentIndex(version); } m_ui->advancedSettings->setVisible(advanced); diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.ui b/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.ui index 362f890386..6f16dcaca4 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.ui +++ b/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.ui @@ -6,122 +6,142 @@ 0 0 - 585 - 339 + 421 + 456 - + - - - - 0 - - - 0 - - - 0 - - - 0 + + + QFrame::NoFrame + + + QFrame::Plain + + + true + + + + + 0 + 0 + 403 + 438 + - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - - - Decryption Time: - - - - - - - ?? s - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Change existing decryption time - - - Change - - - - - - - - + + + 3 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + - - - Decryption time in seconds - - - 1 - - - 10 - - - 10 - - - Qt::Horizontal + + + 2 - - QSlider::TicksBelow - - - 5 - - + + + + + 75 + true + + + + Database format: + + + + + + + + 0 + 0 + + + + Unless you need to open your database with other programs, always use the latest format. + + + Database format + + + + + + + + true + + + + Format cannot be changed: Your database uses KDBX 4 features + + + true + + + + - + + + + + + 75 + true + + + + Decryption Time: + + + - + + + + 75 + true + + - ?? ms + ?? s - + Qt::Horizontal @@ -134,326 +154,353 @@ - + + + Change existing decryption time + - ? s + Change - - - - 0 - 0 - - - - Higher values offer more protection, but opening the database will take longer. - - - true - + + + + 6 + + + 0 + + + 6 + + + 9 + + + + + Decryption time in seconds + + + 1 + + + 10 + + + 10 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 5 + + + + + + + + + ?? ms + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + ? s + + + + + + + + + + 0 + 0 + + + + Higher values offer more protection, but opening the database will take longer. + + + true + + + + - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - - - - Database format: - - - - - - - - 0 - 0 - - - - Database format - - - - - - - - - This is only important if you need to use your database with other programs. - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 40 - - - - - - - - Advanced Settings - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 40 - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Encryption Algorithm: - - - - - - - - 0 - 0 - - - - Encryption algorithm - - - - AES: 256 Bit (default) + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 75 + true + - - - Twofish: 256 Bit + Advanced Settings - - - - - - - Key Derivation Function: - - - - - - - - 0 - 0 - - - - Key derivation function - - - - - - - Transform rounds: - - - - - - - - - - 150 - 0 - - - - - 150 - 16777215 - - - - Transform rounds - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - 1 - - - 1000000000 + + + + + + + 6 - - - - - - Qt::WheelFocus + + 6 - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Memory Usage: - - - - - - - - 150 - 0 - - - - - 150 - 16777215 - - - - Memory usage - - - 1 - - - 1048576 - - - - - - - Parallelism: - - - - - - - - 150 - 0 - - - - - 150 - 16777215 - - - - Parallelism - - - 1 - - - 128 - - - - + + + + Encryption Algorithm: + + + + + + + Memory Usage: + + + + + + + + 150 + 0 + + + + + 150 + 16777215 + + + + Memory usage + + + 1 + + + 1048576 + + + + + + + + 0 + 0 + + + + Key derivation function + + + + + + + + 0 + 0 + + + + Encryption algorithm + + + + AES: 256 Bit (default) + + + + + Twofish: 256 Bit + + + + + + + + + + + 150 + 0 + + + + + 150 + 16777215 + + + + Transform rounds + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 1 + + + 1000000000 + + + + + + + Qt::WheelFocus + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 150 + 0 + + + + + 150 + 16777215 + + + + Parallelism + + + 1 + + + 128 + + + + + + + Key Derivation Function: + + + + + + + Transform rounds: + + + + + + + Parallelism: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + - - - - Qt::Vertical - - - - 20 - 40 - - - -