diff options
author | Saturn&Eric <[email protected]> | 2024-05-11 17:18:36 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-11 17:18:36 +0000 |
commit | f909f2c4c35b187eb165ec5545e35d54c6d92bf3 (patch) | |
tree | 428fe9e63ecae6bb93be6f20cd2b1ee9b29ffd8d /src/ui/main_window/MainWindow.cpp | |
parent | Merge pull request #145 from jermanuts/jermanuts-wizard-links-update (diff) | |
parent | fix: remove qt5compat and redirect dll output path of modules (diff) | |
download | GpgFrontend-f909f2c4c35b187eb165ec5545e35d54c6d92bf3.tar.gz GpgFrontend-f909f2c4c35b187eb165ec5545e35d54c6d92bf3.zip |
Merge pull request #148 from saturneric/develop
Develop 2.1.3.1
Diffstat (limited to '')
-rw-r--r-- | src/ui/main_window/MainWindow.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/ui/main_window/MainWindow.cpp b/src/ui/main_window/MainWindow.cpp index a7bd63d8..c50cfc5e 100644 --- a/src/ui/main_window/MainWindow.cpp +++ b/src/ui/main_window/MainWindow.cpp @@ -31,13 +31,12 @@ #include "core/function/CacheManager.h" #include "core/function/CoreSignalStation.h" #include "core/function/GlobalSettingStation.h" -#include "core/function/gpg/GpgAdvancedOperator.h" #include "core/model/GpgPassphraseContext.h" +#include "core/model/SettingsObject.h" #include "core/module/ModuleManager.h" #include "ui/UISignalStation.h" #include "ui/main_window/GeneralMainWindow.h" -#include "ui/struct/SettingsObject.h" -#include "ui/struct/settings/KeyServerSO.h" +#include "ui/struct/settings_object/KeyServerSO.h" #include "ui/widgets/KeyList.h" #include "ui/widgets/TextEdit.h" @@ -120,7 +119,7 @@ void MainWindow::Init() noexcept { m_key_list_->AddMenuAction(copy_key_default_uid_to_clipboard_act_); m_key_list_->AddMenuAction(copy_key_id_to_clipboard_act_); m_key_list_->AddMenuAction(set_owner_trust_of_key_act_); - m_key_list_->AddMenuAction(add_key_2_favourtie_act_); + m_key_list_->AddMenuAction(add_key_2_favourite_act_); m_key_list_->AddMenuAction(remove_key_from_favourtie_act_); m_key_list_->AddSeparator(); @@ -131,13 +130,12 @@ void MainWindow::Init() noexcept { edit_->CurTextPage()->setFocus(); Module::ListenRTPublishEvent( - this, "com.bktus.gpgfrontend.module.integrated.version-checking", - "version.loading_done", + this, kVersionCheckingModuleID, "version.loading_done", [=](Module::Namespace, Module::Key, int, std::any) { GF_UI_LOG_DEBUG( - "versionchecking version.loading_done changed, calling slot " + "version-checking version.loading_done changed, calling slot " "version upgrade"); - this->slot_version_upgrade_nofity(); + this->slot_version_upgrade_notify(); }); // loading process is done @@ -149,7 +147,7 @@ void MainWindow::Init() noexcept { // check if need to open wizard window auto settings = GlobalSettingStation::GetInstance().GetSettings(); - bool show_wizard = settings.value("wizard/show_wizard", true).toBool(); + auto show_wizard = settings.value("wizard/show_wizard", true).toBool(); if (show_wizard) slot_start_wizard(); } catch (...) { @@ -196,7 +194,7 @@ void MainWindow::recover_editor_unsaved_pages_from_cache() { bool first = true; - QJsonArray unsaved_page_array = json_data.array(); + auto unsaved_page_array = json_data.array(); for (const auto &value_ref : unsaved_page_array) { if (!value_ref.isObject()) continue; auto unsaved_page_json = value_ref.toObject(); @@ -206,8 +204,8 @@ void MainWindow::recover_editor_unsaved_pages_from_cache() { continue; } - QString title = unsaved_page_json["title"].toString(); - QString content = unsaved_page_json["content"].toString(); + auto title = unsaved_page_json["title"].toString(); + auto content = unsaved_page_json["content"].toString(); GF_UI_LOG_DEBUG( "recovering unsaved page from cache, page title: {}, content size", @@ -247,9 +245,6 @@ void MainWindow::closeEvent(QCloseEvent *event) { CacheManager::GetInstance().SaveDurableCache( "editor_unsaved_pages", QJsonDocument(QJsonArray()), true); - // clear password from memory - // GpgContext::GetInstance().clearPasswordCache(); - // call parent GeneralMainWindow::closeEvent(event); } |