diff options
author | Saturneric <[email protected]> | 2021-12-06 05:58:52 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-12-06 06:13:25 +0000 |
commit | b86aa03e5f6061f73389ef17cddf694e8a88f035 (patch) | |
tree | 81516b808e3e262819c6ada934c1c60b752ffc14 /src/ui/FileEncryptionDialog.cpp | |
parent | Improve CI (diff) | |
parent | Merge pull request #27 from saturneric/develop-ui (diff) | |
download | GpgFrontend-b86aa03e5f6061f73389ef17cddf694e8a88f035.tar.gz GpgFrontend-b86aa03e5f6061f73389ef17cddf694e8a88f035.zip |
Merge branch 'develop' of github.com:saturneric/GpgFrontend into develop-ci
Diffstat (limited to 'src/ui/FileEncryptionDialog.cpp')
-rwxr-xr-x | src/ui/FileEncryptionDialog.cpp | 63 |
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); |