aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/FileEncryptionDialog.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-12-05 18:51:59 +0000
committerSaturneric <[email protected]>2021-12-05 19:00:26 +0000
commit590f222de4abdf2aae4d2d8de6f9af25996a713e (patch)
tree4108a6205fb517a694d65b3044f7369f32b43862 /src/ui/FileEncryptionDialog.cpp
parentAdd Submodules & Update & Fixed (diff)
downloadGpgFrontend-590f222de4abdf2aae4d2d8de6f9af25996a713e.tar.gz
GpgFrontend-590f222de4abdf2aae4d2d8de6f9af25996a713e.zip
Improve UI
1. Support Key List Tab 2. File Hash Calculate 3. File Rename 4. Fix known bugs 5. Fix known ci issues.
Diffstat (limited to 'src/ui/FileEncryptionDialog.cpp')
-rwxr-xr-xsrc/ui/FileEncryptionDialog.cpp63
1 files changed, 37 insertions, 26 deletions
diff --git a/src/ui/FileEncryptionDialog.cpp b/src/ui/FileEncryptionDialog.cpp
index 3e1e9b9a..137d8555 100755
--- a/src/ui/FileEncryptionDialog.cpp
+++ b/src/ui/FileEncryptionDialog.cpp
@@ -86,32 +86,43 @@ FileEncryptionDialog::FileEncryptionDialog(KeyIdArgsListPtr keyList,
groupBox1->setLayout(gLayout);
/*Setup KeyList*/
- mKeyList = new KeyList(
- KeyListRow::ONLY_SECRET_KEY,
- KeyListColumn::NAME | KeyListColumn::EmailAddress | KeyListColumn::Usage);
- if (mAction == Verify)
- mKeyList->setFilter([](const GpgKey& key) -> bool {
- if (key.disabled() || key.expired() || key.revoked())
- return false;
- else
- return true;
- });
-
- if (mAction == Encrypt)
- mKeyList->setFilter([](const GpgKey& key) -> bool {
- if (!key.CanEncrActual())
- return false;
- else
- return true;
- });
-
- if (mAction == Sign)
- mKeyList->setFilter([](const GpgKey& key) -> bool {
- if (!key.CanSignActual())
- return false;
- else
- return true;
- });
+
+ if (mAction == Verify) {
+ mKeyList =
+ new KeyList(KeyListRow::ONLY_SECRET_KEY,
+ KeyListColumn::NAME | KeyListColumn::EmailAddress |
+ KeyListColumn::Usage,
+ [](const GpgKey& key) -> bool {
+ if (key.disabled() || key.expired() || key.revoked())
+ return false;
+ else
+ return true;
+ });
+ }
+
+ if (mAction == Encrypt) {
+ mKeyList = new KeyList(KeyListRow::ONLY_SECRET_KEY,
+ KeyListColumn::NAME | KeyListColumn::EmailAddress |
+ KeyListColumn::Usage,
+ [](const GpgKey& key) -> bool {
+ if (!key.CanEncrActual())
+ return false;
+ else
+ return true;
+ });
+ }
+
+ if (mAction == Encrypt) {
+ mKeyList = new KeyList(KeyListRow::ONLY_SECRET_KEY,
+ KeyListColumn::NAME | KeyListColumn::EmailAddress |
+ KeyListColumn::Usage,
+ [](const GpgKey& key) -> bool {
+ if (!key.CanSignActual())
+ return false;
+ else
+ return true;
+ });
+ }
if (mAction == Decrypt) mKeyList->setDisabled(true);