diff options
| author | 2021-12-17 07:06:30 -0500 | |
|---|---|---|
| committer | 2021-12-17 07:06:30 -0500 | |
| commit | 1fdc150116cad39aae5c5da407c3312b47a59e3a (patch) | |
| tree | 123c79a4d7ad2d45781ba03ce939f7539fb428d8 /Plugins/DbSqliteWx/dbsqlitewx.cpp | |
| parent | feda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff) | |
New upstream version 3.3.3+dfsg1.upstream/3.3.3+dfsg1
Diffstat (limited to 'Plugins/DbSqliteWx/dbsqlitewx.cpp')
| -rw-r--r-- | Plugins/DbSqliteWx/dbsqlitewx.cpp | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/Plugins/DbSqliteWx/dbsqlitewx.cpp b/Plugins/DbSqliteWx/dbsqlitewx.cpp index 42a8347..aa04a57 100644 --- a/Plugins/DbSqliteWx/dbsqlitewx.cpp +++ b/Plugins/DbSqliteWx/dbsqlitewx.cpp @@ -1,5 +1,6 @@ #include "dbsqlitewx.h"
#include "dbsqlitewxinstance.h"
+#include <QMap>
DbSqliteWx::DbSqliteWx()
{
@@ -12,15 +13,43 @@ QString DbSqliteWx::getLabel() const QList<DbPluginOption> DbSqliteWx::getOptionsList() const
{
+ static const QMap<QString, QVariant> ciphers = {
+ {"wxSQLite3: AES 128 Bit", "aes128cbc"},
+ {"wxSQLite3: AES 256 Bit", "aes256cbc"},
+ {"sqleet: ChaCha20-Poly1305", "chacha20"},
+ {"SQLCipher: AES 256 Bit", "sqlcipher"},
+ {"System.Data.SQLite: RC4", "rc4"}
+ };
+ static_qstring(defaultCipher, "aes256cbc");
+
QList<DbPluginOption> opts;
- DbPluginOption opt;
- opt.type = DbPluginOption::PASSWORD;
- opt.key = PASSWORD_OPT;
- opt.label = tr("Password (key)");
- opt.toolTip = tr("Leave empty to create or connect to decrypted database.");
- opt.placeholderText = tr("Encryption password");
- opts << opt;
+ DbPluginOption optPass;
+ optPass.type = DbPluginOption::PASSWORD;
+ optPass.key = PASSWORD_OPT;
+ optPass.label = tr("Password (key)");
+ optPass.toolTip = tr("Leave empty to create or connect to decrypted database.");
+ optPass.placeholderText = tr("Encryption password");
+ opts << optPass;
+
+ DbPluginOption optCipher;
+ optCipher.type = DbPluginOption::CHOICE;
+ optCipher.key = CIPHER_OPT;
+ optCipher.label = tr("Cipher");
+ optCipher.toolTip = tr("Cipher determines encryption algorithm used to encrypt the database.");
+ optCipher.choiceDataValues = ciphers;
+ optCipher.defaultValue = defaultCipher;
+ opts << optCipher;
+
+ DbPluginOption optPragmas;
+ optPragmas.type = DbPluginOption::SQL;
+ optPragmas.key = PRAGMAS_OPT;
+ optPragmas.label = tr("Cipher configuration (optional)");
+ optPragmas.toolTip = tr("PRAGMA statements to customize SQLite3 Multiple Ciphers configuration, such as KDF iterations, legacy mode, etc.\n"
+ "They will be executed upon each opening of the database.\n"
+ "See documentation for SQLite3 Multiple Ciphers for details.");
+ opts << optPragmas;
+
return opts;
}
|
