diff options
author | saturneric <[email protected]> | 2024-11-26 10:55:40 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-11-26 10:55:40 +0000 |
commit | 83be6ce63a832890592f8cec9e2102663f0e8a36 (patch) | |
tree | 040ddd5f9e180eaf8f5ae2d2eea902ede2c94074 /src/ui/main_window/MainWindowFileSlotFunction.cpp | |
parent | feat: support verifying email through eml data (diff) | |
download | GpgFrontend-83be6ce63a832890592f8cec9e2102663f0e8a36.tar.gz GpgFrontend-83be6ce63a832890592f8cec9e2102663f0e8a36.zip |
feat: improve ui logic of email verification and make project structure better
Diffstat (limited to 'src/ui/main_window/MainWindowFileSlotFunction.cpp')
-rw-r--r-- | src/ui/main_window/MainWindowFileSlotFunction.cpp | 80 |
1 files changed, 38 insertions, 42 deletions
diff --git a/src/ui/main_window/MainWindowFileSlotFunction.cpp b/src/ui/main_window/MainWindowFileSlotFunction.cpp index 599fe4d6..12c06312 100644 --- a/src/ui/main_window/MainWindowFileSlotFunction.cpp +++ b/src/ui/main_window/MainWindowFileSlotFunction.cpp @@ -111,7 +111,7 @@ void MainWindow::SlotFileEncrypt(const QString& path) { result); result_analyse.Analyse(); - process_result_analyse(edit_, info_board_, result_analyse); + slot_result_analyse_show_helper(result_analyse); this->slot_refresh_current_file_view(); }); }); @@ -163,7 +163,7 @@ void MainWindow::SlotFileEncrypt(const QString& path) { m_key_list_->GetCurrentGpgContextChannel(), err, result); result_analyse.Analyse(); - process_result_analyse(edit_, info_board_, result_analyse); + slot_result_analyse_show_helper(result_analyse); this->slot_refresh_current_file_view(); }); }); @@ -237,7 +237,7 @@ void MainWindow::SlotDirectoryEncrypt(const QString& path) { result); result_analyse.Analyse(); - process_result_analyse(edit_, info_board_, result_analyse); + slot_result_analyse_show_helper(result_analyse); this->slot_refresh_current_file_view(); }); }); @@ -289,7 +289,7 @@ void MainWindow::SlotDirectoryEncrypt(const QString& path) { m_key_list_->GetCurrentGpgContextChannel(), err, result); result_analyse.Analyse(); - process_result_analyse(edit_, info_board_, result_analyse); + slot_result_analyse_show_helper(result_analyse); this->slot_refresh_current_file_view(); }); }); @@ -343,7 +343,7 @@ void MainWindow::SlotFileDecrypt(const QString& path) { m_key_list_->GetCurrentGpgContextChannel(), err, result); result_analyse.Analyse(); - process_result_analyse(edit_, info_board_, result_analyse); + slot_result_analyse_show_helper(result_analyse); this->slot_refresh_current_file_view(); }); }); @@ -396,7 +396,7 @@ void MainWindow::SlotArchiveDecrypt(const QString& path) { m_key_list_->GetCurrentGpgContextChannel(), err, result); result_analyse.Analyse(); - process_result_analyse(edit_, info_board_, result_analyse); + slot_result_analyse_show_helper(result_analyse); this->slot_refresh_current_file_view(); }); }); @@ -459,29 +459,29 @@ void MainWindow::SlotFileSign(const QString& path) { CommonUtils::WaitForOpera( this, tr("Signing"), [=](const OperaWaitingHd& op_hd) { GpgFileOpera::GetInstance(m_key_list_->GetCurrentGpgContextChannel()) - .SignFile( - {keys->begin(), keys->end()}, path, - !non_ascii_at_file_operation, sig_file_path, - [=](GpgError err, const DataObjectPtr& data_obj) { - // stop waiting - op_hd(); - - if (CheckGpgError(err) == GPG_ERR_USER_1 || - data_obj == nullptr || - !data_obj->Check<GpgSignResult>()) { - QMessageBox::critical(this, tr("Error"), - tr("Unknown error occurred")); - return; - } - - auto result = ExtractParams<GpgSignResult>(data_obj, 0); - auto result_analyse = GpgSignResultAnalyse( - m_key_list_->GetCurrentGpgContextChannel(), err, result); - result_analyse.Analyse(); - - process_result_analyse(edit_, info_board_, result_analyse); - this->slot_refresh_current_file_view(); - }); + .SignFile({keys->begin(), keys->end()}, path, + !non_ascii_at_file_operation, sig_file_path, + [=](GpgError err, const DataObjectPtr& data_obj) { + // stop waiting + op_hd(); + + if (CheckGpgError(err) == GPG_ERR_USER_1 || + data_obj == nullptr || + !data_obj->Check<GpgSignResult>()) { + QMessageBox::critical(this, tr("Error"), + tr("Unknown error occurred")); + return; + } + + auto result = ExtractParams<GpgSignResult>(data_obj, 0); + auto result_analyse = GpgSignResultAnalyse( + m_key_list_->GetCurrentGpgContextChannel(), err, + result); + result_analyse.Analyse(); + + slot_result_analyse_show_helper(result_analyse); + this->slot_refresh_current_file_view(); + }); }); } @@ -553,7 +553,7 @@ void MainWindow::SlotFileVerify(const QString& path) { m_key_list_->GetCurrentGpgContextChannel(), err, result); result_analyse.Analyse(); - process_result_analyse(edit_, info_board_, result_analyse); + slot_result_analyse_show_helper(result_analyse); if (!result_analyse.GetUnknownSignatures().isEmpty() && Module::IsModuleActivate(kKeyServerSyncModuleID)) { @@ -706,9 +706,8 @@ void MainWindow::SlotFileEncryptSign(const QString& path) { sign_result); sign_result_analyse.Analyse(); - process_result_analyse(edit_, info_board_, - encrypt_result_analyse, - sign_result_analyse); + slot_result_analyse_show_helper(encrypt_result_analyse, + sign_result_analyse); this->slot_refresh_current_file_view(); }); @@ -827,9 +826,8 @@ void MainWindow::SlotDirectoryEncryptSign(const QString& path) { sign_result); sign_result_analyse.Analyse(); - process_result_analyse(edit_, info_board_, - encrypt_result_analyse, - sign_result_analyse); + slot_result_analyse_show_helper(encrypt_result_analyse, + sign_result_analyse); this->slot_refresh_current_file_view(); }); @@ -893,9 +891,8 @@ void MainWindow::SlotFileDecryptVerify(const QString& path) { verify_result); verify_result_analyse.Analyse(); - process_result_analyse(edit_, info_board_, - decrypt_result_analyse, - verify_result_analyse); + slot_result_analyse_show_helper(decrypt_result_analyse, + verify_result_analyse); this->slot_refresh_current_file_view(); @@ -996,9 +993,8 @@ void MainWindow::SlotArchiveDecryptVerify(const QString& path) { verify_result); verify_result_analyse.Analyse(); - process_result_analyse(edit_, info_board_, - decrypt_result_analyse, - verify_result_analyse); + slot_result_analyse_show_helper(decrypt_result_analyse, + verify_result_analyse); // pause this feature // if (verify_result_analyse.GetStatus() == -2) { |