diff options
Diffstat (limited to 'src/ui/dialog/help')
-rw-r--r-- | src/ui/dialog/help/AboutDialog.cpp | 31 | ||||
-rw-r--r-- | src/ui/dialog/help/AboutDialog.h | 3 | ||||
-rw-r--r-- | src/ui/dialog/help/GnupgTab.cpp | 16 |
3 files changed, 28 insertions, 22 deletions
diff --git a/src/ui/dialog/help/AboutDialog.cpp b/src/ui/dialog/help/AboutDialog.cpp index e1fa3535..cd577f89 100644 --- a/src/ui/dialog/help/AboutDialog.cpp +++ b/src/ui/dialog/help/AboutDialog.cpp @@ -42,14 +42,23 @@ AboutDialog::AboutDialog(int defaultIndex, QWidget* parent) auto* tab_widget = new QTabWidget; auto* info_tab = new InfoTab(); - auto* gnupg_tab = new GnupgTab(); auto* translators_tab = new TranslatorsTab(); - update_tab_ = new UpdateTab(); tab_widget->addTab(info_tab, tr("About GpgFrontend")); - tab_widget->addTab(gnupg_tab, tr("GnuPG")); + + if (Module::IsModuleAcivate("com.bktus.gpgfrontend.module." + "integrated.gnupg_info_gathering")) { + auto* gnupg_tab = new GnupgTab(); + tab_widget->addTab(gnupg_tab, tr("GnuPG")); + } + tab_widget->addTab(translators_tab, tr("Translators")); - tab_widget->addTab(update_tab_, tr("Update")); + + if (Module::IsModuleAcivate("com.bktus.gpgfrontend.module." + "integrated.version_checking")) { + auto* update_tab = new UpdateTab(); + tab_widget->addTab(update_tab, tr("Update")); + } connect(tab_widget, &QTabWidget::currentChanged, this, [&](int index) { GF_UI_LOG_DEBUG("current index: {}", index); }); @@ -189,12 +198,12 @@ void UpdateTab::showEvent(QShowEvent* event) { GF_UI_LOG_DEBUG("loading version loading info from rt"); auto is_loading_done = Module::RetrieveRTValueTypedOrDefault<>( - "com.bktus.gpgfrontend.module.integrated.version-checking", + "com.bktus.gpgfrontend.module.integrated.version_checking", "version.loading_done", false); if (!is_loading_done) { Module::ListenRTPublishEvent( - this, "com.bktus.gpgfrontend.module.integrated.version-checking", + this, "com.bktus.gpgfrontend.module.integrated.version_checking", "version.loading_done", [=](Module::Namespace, Module::Key, int, std::any) { GF_UI_LOG_DEBUG( @@ -213,7 +222,7 @@ void UpdateTab::slot_show_version_status() { this->pb_->setHidden(true); auto is_loading_done = Module::RetrieveRTValueTypedOrDefault<>( - "com.bktus.gpgfrontend.module.integrated.version-checking", + "com.bktus.gpgfrontend.module.integrated.version_checking", "version.loading_done", false); if (!is_loading_done) { @@ -222,19 +231,19 @@ void UpdateTab::slot_show_version_status() { } auto is_need_upgrade = Module::RetrieveRTValueTypedOrDefault<>( - "com.bktus.gpgfrontend.module.integrated.version-checking", + "com.bktus.gpgfrontend.module.integrated.version_checking", "version.need_upgrade", false); auto is_current_a_withdrawn_version = Module::RetrieveRTValueTypedOrDefault<>( - "com.bktus.gpgfrontend.module.integrated.version-checking", + "com.bktus.gpgfrontend.module.integrated.version_checking", "version.current_a_withdrawn_version", false); auto is_current_version_released = Module::RetrieveRTValueTypedOrDefault<>( - "com.bktus.gpgfrontend.module.integrated.version-checking", + "com.bktus.gpgfrontend.module.integrated.version_checking", "version.current_version_released", false); auto latest_version = Module::RetrieveRTValueTypedOrDefault<>( - "com.bktus.gpgfrontend.module.integrated.version-checking", + "com.bktus.gpgfrontend.module.integrated.version_checking", "version.latest_version", QString{}); latest_version_label_->setText("<center><b>" + diff --git a/src/ui/dialog/help/AboutDialog.h b/src/ui/dialog/help/AboutDialog.h index b7871a29..86576123 100644 --- a/src/ui/dialog/help/AboutDialog.h +++ b/src/ui/dialog/help/AboutDialog.h @@ -129,9 +129,6 @@ class AboutDialog : public GeneralDialog { * @param ev */ void showEvent(QShowEvent* ev) override; - - private: - UpdateTab* update_tab_; ///< }; } // namespace GpgFrontend::UI diff --git a/src/ui/dialog/help/GnupgTab.cpp b/src/ui/dialog/help/GnupgTab.cpp index 1aceed1a..5d3f21aa 100644 --- a/src/ui/dialog/help/GnupgTab.cpp +++ b/src/ui/dialog/help/GnupgTab.cpp @@ -115,7 +115,7 @@ void GpgFrontend::UI::GnupgTab::process_software_info() { QString::fromStdString(fmt::format("Version: {}", gnupg_version))); auto components = Module::ListRTChildKeys( - "com.bktus.gpgfrontend.module.integrated.gnupg-info-gathering", + "com.bktus.gpgfrontend.module.integrated.gnupg_info_gathering", "gnupg.components"); GF_UI_LOG_DEBUG("got gnupg components from rt, size: {}", components.size()); @@ -124,7 +124,7 @@ void GpgFrontend::UI::GnupgTab::process_software_info() { int row = 0; for (auto& component : components) { auto component_info_json_bytes = Module::RetrieveRTValueTypedOrDefault( - "com.bktus.gpgfrontend.module.integrated.gnupg-info-gathering", + "com.bktus.gpgfrontend.module.integrated.gnupg_info_gathering", QString("gnupg.components.%1").arg(component), QByteArray{}); GF_UI_LOG_DEBUG("got gnupg component {} info from rt", component); @@ -171,7 +171,7 @@ void GpgFrontend::UI::GnupgTab::process_software_info() { ui_->componentDetailsTable->resizeColumnsToContents(); auto directories = Module::ListRTChildKeys( - "com.bktus.gpgfrontend.module.integrated.gnupg-info-gathering", + "com.bktus.gpgfrontend.module.integrated.gnupg_info_gathering", QString("gnupg.dirs")); ui_->directoriesDetailsTable->setRowCount(directories.size()); @@ -179,7 +179,7 @@ void GpgFrontend::UI::GnupgTab::process_software_info() { row = 0; for (auto& dir : directories) { const auto dir_path = Module::RetrieveRTValueTypedOrDefault( - "com.bktus.gpgfrontend.module.integrated.gnupg-info-gathering", + "com.bktus.gpgfrontend.module.integrated.gnupg_info_gathering", QString("gnupg.dirs.%1").arg(dir), QString{}); if (dir_path.isEmpty()) continue; @@ -201,12 +201,12 @@ void GpgFrontend::UI::GnupgTab::process_software_info() { row = 0; for (auto& component : components) { auto options = Module::ListRTChildKeys( - "com.bktus.gpgfrontend.module.integrated.gnupg-info-gathering", + "com.bktus.gpgfrontend.module.integrated.gnupg_info_gathering", QString("gnupg.components.%1.options").arg(component)); for (auto& option : options) { const auto option_info_json = QJsonDocument::fromJson(Module::RetrieveRTValueTypedOrDefault( - "com.bktus.gpgfrontend.module.integrated.gnupg-info-gathering", + "com.bktus.gpgfrontend.module.integrated.gnupg_info_gathering", QString("gnupg.components.%1.options.%2") .arg(component) .arg(option), @@ -228,12 +228,12 @@ void GpgFrontend::UI::GnupgTab::process_software_info() { QString configuration_group; for (auto& component : components) { auto options = Module::ListRTChildKeys( - "com.bktus.gpgfrontend.module.integrated.gnupg-info-gathering", + "com.bktus.gpgfrontend.module.integrated.gnupg_info_gathering", QString("gnupg.components.%1.options").arg(component)); for (auto& option : options) { auto option_info_json_bytes = Module::RetrieveRTValueTypedOrDefault( - "com.bktus.gpgfrontend.module.integrated.gnupg-info-gathering", + "com.bktus.gpgfrontend.module.integrated.gnupg_info_gathering", QString("gnupg.components.%1.options.%2").arg(component).arg(option), QByteArray{}); GF_UI_LOG_DEBUG("got gnupg component's option {} info from rt, info: {}", |