From 590f222de4abdf2aae4d2d8de6f9af25996a713e Mon Sep 17 00:00:00 2001 From: Saturneric Date: Mon, 6 Dec 2021 02:51:59 +0800 Subject: Improve UI 1. Support Key List Tab 2. File Hash Calculate 3. File Rename 4. Fix known bugs 5. Fix known ci issues. --- src/ui/FileEncryptionDialog.cpp | 63 ++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 26 deletions(-) (limited to 'src/ui/FileEncryptionDialog.cpp') 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); -- cgit v1.2.3 From 97d13004e4f1cb33941a9be57c7e7662e223890b Mon Sep 17 00:00:00 2001 From: Saturneric Date: Mon, 6 Dec 2021 23:58:23 +0800 Subject: Improve UI & Functions --- src/ui/FileEncryptionDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/FileEncryptionDialog.cpp') diff --git a/src/ui/FileEncryptionDialog.cpp b/src/ui/FileEncryptionDialog.cpp index 137d8555..aeba6497 100755 --- a/src/ui/FileEncryptionDialog.cpp +++ b/src/ui/FileEncryptionDialog.cpp @@ -267,7 +267,7 @@ void FileEncryptionDialog::slotExecuteAction() { GpgVerifyResult result = nullptr; auto error = BasicOperator::GetInstance().Verify(in_data, sign_data, result); - new VerifyDetailsDialog(this, mKeyList, error, std::move(result)); + new VerifyDetailsDialog(this, error, std::move(result)); return; } -- cgit v1.2.3