aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowSlotUI.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-11-26 19:57:56 +0000
committersaturneric <[email protected]>2024-11-26 20:07:41 +0000
commit673a3a13fac0b41124760bf44244ba0bb039e09f (patch)
treee3ecaf4ad7882c32dc38292b7abdb5bbd58afbb6 /src/ui/main_window/MainWindowSlotUI.cpp
parentfix: add ui status control for email operations (diff)
downloadGpgFrontend-673a3a13fac0b41124760bf44244ba0bb039e09f.tar.gz
GpgFrontend-673a3a13fac0b41124760bf44244ba0bb039e09f.zip
feat: support eml data decryption
Diffstat (limited to '')
-rw-r--r--src/ui/main_window/MainWindowSlotUI.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/ui/main_window/MainWindowSlotUI.cpp b/src/ui/main_window/MainWindowSlotUI.cpp
index 4a460005..105a2374 100644
--- a/src/ui/main_window/MainWindowSlotUI.cpp
+++ b/src/ui/main_window/MainWindowSlotUI.cpp
@@ -80,7 +80,10 @@ void MainWindow::slot_switch_menu_control_mode(int index) {
decrypt_act_->setDisabled(disable);
decrypt_verify_act_->setDisabled(disable);
- verify_email_by_eml_data_act_->setDisabled(disable);
+ if (Module::IsModuleActivate(kEmailModuleID)) {
+ verify_email_by_eml_data_act_->setDisabled(disable);
+ decrypt_email_by_eml_data_act_->setDisabled(disable);
+ }
redo_act_->setDisabled(disable);
undo_act_->setDisabled(disable);
@@ -186,7 +189,10 @@ void MainWindow::SlotUpdateCryptoMenuStatus(unsigned int type) {
decrypt_act_->setDisabled(true);
decrypt_verify_act_->setDisabled(true);
- verify_email_by_eml_data_act_->setDisabled(true);
+ if (Module::IsModuleActivate(kEmailModuleID)) {
+ verify_email_by_eml_data_act_->setDisabled(true);
+ decrypt_email_by_eml_data_act_->setDisabled(true);
+ }
// gnupg operations
if ((opera_type & MainWindow::OperationMenu::kVerify) != 0U) {
@@ -209,7 +215,8 @@ void MainWindow::SlotUpdateCryptoMenuStatus(unsigned int type) {
}
// email operations
- if ((opera_type & MainWindow::OperationMenu::kVerifyEMail) != 0U) {
+ if (Module::IsModuleActivate(kEmailModuleID) &&
+ (opera_type & MainWindow::OperationMenu::kVerifyEMail) != 0U) {
verify_email_by_eml_data_act_->setDisabled(false);
}
}
@@ -369,4 +376,15 @@ void MainWindow::slot_restart_gpg_components(bool) {
});
}
+void MainWindow::SlotGeneralDecryptEMail(bool) {
+ // if (edit_->SlotCurPageFileTreeView() != nullptr) {
+ // const auto* file_tree_view = edit_->SlotCurPageFileTreeView();
+ // const auto path = file_tree_view->GetSelected();
+
+ // const auto file_info = QFileInfo(path);
+ // if (file_info.isFile()) this->SlotFileVerify(path);
+ // }
+ if (edit_->SlotCurPageTextEdit() != nullptr) this->SlotDecryptEML();
+}
+
} // namespace GpgFrontend::UI