From 61cc4ed27fd75315736407eac0932a3b297c9872 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Sat, 23 Jul 2022 20:18:23 +0800 Subject: [PATCH] feat(ui): add tab to show gnupg info --- gpgfrontend.qrc | 1 + resource/icons/gnupg.png | Bin 0 -> 7198 bytes src/core/GpgContext.cpp | 5 ++- src/core/GpgInfo.h | 1 + src/ui/dialog/help/AboutDialog.cpp | 23 +++++----- src/ui/dialog/help/GnupgTab.cpp | 66 ++++++++++++++++++++++++++++ src/ui/dialog/help/GnupgTab.h | 53 ++++++++++++++++++++++ src/ui/main_window/MainWindow.h | 1 + src/ui/main_window/MainWindowUI.cpp | 9 +++- 9 files changed, 147 insertions(+), 12 deletions(-) create mode 100644 resource/icons/gnupg.png create mode 100644 src/ui/dialog/help/GnupgTab.cpp create mode 100644 src/ui/dialog/help/GnupgTab.h diff --git a/gpgfrontend.qrc b/gpgfrontend.qrc index f034cf37..7f4a9c68 100644 --- a/gpgfrontend.qrc +++ b/gpgfrontend.qrc @@ -41,6 +41,7 @@ resource/icons/format-line-spacing-double.png resource/icons/format-line-spacing-normal.png resource/icons/format-line-spacing-triple.png + resource/icons/gnupg.png resource/icons/gpgfrontend.png resource/icons/importance.png resource/icons/importkey_editor.png diff --git a/resource/icons/gnupg.png b/resource/icons/gnupg.png new file mode 100644 index 0000000000000000000000000000000000000000..2a209e216a7f03c5b68ff12e07e272ad3438a476 GIT binary patch literal 7198 zcmV+(9O2`MP)aAYuQny~0DyV2x)LW?mC7B7JC?X)rmTk^+|Ck^o znRk+zc_)*E^Zk6HOejP-GZXP5QJgCNYE)DV-whD2JVC0Ur;{&BX2%{#bW8ncq3SW+9BZl z8leoxajEqN!Xp^xMe;Yj#jGQmJGC2JI~Hj?5_L`n`5x$qIJLe2D%rF)Xy>^smcC8; zf)$7yh3Er7VVu&>5xoPWw^C6O?oe7C-iIc0IO_O;3BV}OTpa0-%67zTMV6$nF@;NCAOz!vGg616Rcq53eexTySg4VCs9$d0)SBX+bF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pgContext.cpp b/src/core/GpgContext.cpp index 7e656dfb..28857d32 100644 --- a/src/core/GpgContext.cpp +++ b/src/core/GpgContext.cpp @@ -93,7 +93,9 @@ GpgContext::GpgContext(const GpgContextInitArgs &args) : args_(args) { : engine_info->file_name) << std::string(engine_info->home_dir == nullptr ? "null" - : engine_info->home_dir); + : engine_info->home_dir) + << std::string(engine_info->version ? "null" + : engine_info->version); switch (engine_info->protocol) { case GPGME_PROTOCOL_OpenPGP: @@ -110,6 +112,7 @@ GpgContext::GpgContext(const GpgContextInitArgs &args) : args_(args) { info_.GpgConfPath = engine_info->file_name; break; case GPGME_PROTOCOL_ASSUAN: + info_.AssuanPath = engine_info->file_name; break; case GPGME_PROTOCOL_G13: break; diff --git a/src/core/GpgInfo.h b/src/core/GpgInfo.h index 71c5f9a9..d0453b9f 100644 --- a/src/core/GpgInfo.h +++ b/src/core/GpgInfo.h @@ -42,6 +42,7 @@ class GpgInfo { std::string DatabasePath; ///< std::string GnupgVersion; ///< std::string GpgConfPath; ///< + std::string AssuanPath; ///< std::string CMSPath; ///< std::string GpgMEVersion; ///< }; diff --git a/src/ui/dialog/help/AboutDialog.cpp b/src/ui/dialog/help/AboutDialog.cpp index 7612d9d9..6b6e4356 100644 --- a/src/ui/dialog/help/AboutDialog.cpp +++ b/src/ui/dialog/help/AboutDialog.cpp @@ -31,6 +31,7 @@ #include "GpgFrontendBuildInfo.h" #include "core/function/GlobalSettingStation.h" #include "core/thread/TaskRunnerGetter.h" +#include "ui/dialog/help/GnupgTab.h" #include "ui/thread/VersionCheckTask.h" namespace GpgFrontend::UI { @@ -39,27 +40,29 @@ AboutDialog::AboutDialog(int defaultIndex, QWidget* parent) : GeneralDialog(typeid(AboutDialog).name(), parent) { this->setWindowTitle(QString(_("About")) + " " + qApp->applicationName()); - auto* tabWidget = new QTabWidget; - auto* infoTab = new InfoTab(); - auto* translatorsTab = new TranslatorsTab(); + auto* tab_widget = new QTabWidget; + auto* info_tab = new InfoTab(); + auto* gnupg_tab = new GnupgTab(); + auto* translators_tab = new TranslatorsTab(); update_tab_ = new UpdateTab(); - tabWidget->addTab(infoTab, _("About Software")); - tabWidget->addTab(translatorsTab, _("Translators")); - tabWidget->addTab(update_tab_, _("Update")); + tab_widget->addTab(info_tab, _("About GpgFrontend")); + tab_widget->addTab(gnupg_tab, _("GnuPG")); + tab_widget->addTab(translators_tab, _("Translators")); + tab_widget->addTab(update_tab_, _("Update")); - connect(tabWidget, &QTabWidget::currentChanged, this, + connect(tab_widget, &QTabWidget::currentChanged, this, [&](int index) { LOG(INFO) << "Current Index" << index; }); - if (defaultIndex < tabWidget->count() && defaultIndex >= 0) { - tabWidget->setCurrentIndex(defaultIndex); + if (defaultIndex < tab_widget->count() && defaultIndex >= 0) { + tab_widget->setCurrentIndex(defaultIndex); } auto* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); connect(buttonBox, &QDialogButtonBox::accepted, this, &AboutDialog::close); auto* mainLayout = new QVBoxLayout; - mainLayout->addWidget(tabWidget); + mainLayout->addWidget(tab_widget); mainLayout->addWidget(buttonBox); setLayout(mainLayout); diff --git a/src/ui/dialog/help/GnupgTab.cpp b/src/ui/dialog/help/GnupgTab.cpp new file mode 100644 index 00000000..48787987 --- /dev/null +++ b/src/ui/dialog/help/GnupgTab.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2022. Saturneric + * + * This file is part of GpgFrontend. + * + * GpgFrontend is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GpgFrontend is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GpgFrontend. If not, see . + * + * The initial version of the source code is inherited from + * the gpg4usb project, which is under GPL-3.0-or-later. + * + * All the source code of GpgFrontend was modified and released by + * Saturneric starting on May 12, 2021. + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +// +// Created by eric on 2022/7/23. +// + +#include "GnupgTab.h" + +GpgFrontend::UI::GnupgTab::GnupgTab(QWidget* parent) : QWidget(parent) { + GpgContext& ctx = GpgContext::GetInstance(); + auto info = ctx.GetInfo(); + + auto* pixmap = new QPixmap(":gnupg.png"); + auto* text = new QString( + "

" + QString(_("GnuPG")) + "

" + "
" + + QString(_("GnuPG Version")) + ": " + + QString::fromStdString(info.GnupgVersion) + "
" + + "
" + +"
" + "
" + + QString(_("GpgME Version")) + ": " + + QString::fromStdString(info.GpgMEVersion) + "


" + + "

" + QString(_("PATHs")) + "

" + QString(_("GpgConf")) + ": " + + QString::fromStdString(info.GpgConfPath) + "
" + + QString(_("GnuPG")) + ": " + QString::fromStdString(info.AppPath) + + "
" + QString(_("CMS")) + ": " + + QString::fromStdString(info.CMSPath) + "
"); + + auto* layout = new QGridLayout(); + auto* pixmapLabel = new QLabel(); + pixmapLabel->setPixmap(*pixmap); + layout->addWidget(pixmapLabel, 0, 0, 1, -1, Qt::AlignCenter); + auto* aboutLabel = new QLabel(); + aboutLabel->setText(*text); + aboutLabel->setWordWrap(true); + aboutLabel->setOpenExternalLinks(true); + layout->addWidget(aboutLabel, 1, 0, 1, -1); + layout->addItem( + new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed), 2, 1, + 1, 1); + + setLayout(layout); +} diff --git a/src/ui/dialog/help/GnupgTab.h b/src/ui/dialog/help/GnupgTab.h new file mode 100644 index 00000000..4fc7ff22 --- /dev/null +++ b/src/ui/dialog/help/GnupgTab.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2022. Saturneric + * + * This file is part of GpgFrontend. + * + * GpgFrontend is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GpgFrontend is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GpgFrontend. If not, see . + * + * The initial version of the source code is inherited from + * the gpg4usb project, which is under GPL-3.0-or-later. + * + * All the source code of GpgFrontend was modified and released by + * Saturneric starting on May 12, 2021. + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +// +// Created by eric on 2022/7/23. +// + +#ifndef GPGFRONTEND_GNUPGTAB_H +#define GPGFRONTEND_GNUPGTAB_H + +#include "core/GpgContext.h" +#include "ui/GpgFrontendUI.h" + +namespace GpgFrontend::UI{ +class GnupgTab: public QWidget { + Q_OBJECT + public: + /** + * @brief Construct a new Info Tab object + * + * @param parent + */ + explicit GnupgTab(QWidget* parent = nullptr); +}; +} + + + +#endif // GPGFRONTEND_GNUPGTAB_H diff --git a/src/ui/main_window/MainWindow.h b/src/ui/main_window/MainWindow.h index 8f3c46e1..b31e2fcb 100644 --- a/src/ui/main_window/MainWindow.h +++ b/src/ui/main_window/MainWindow.h @@ -387,6 +387,7 @@ class MainWindow : public GeneralMainWindow { QAction* about_act_{}; ///< Action to open about dialog QAction* check_update_act_{}; ///< Action to open about dialog QAction* translate_act_{}; ///< Action to open about dialog + QAction* gnupg_act_{}; ///< Action to open about dialog QAction* open_settings_act_{}; ///< Action to open settings dialog QAction* show_key_details_act_{}; ///< Action to open key-details dialog QAction* start_wizard_act_{}; ///< Action to open the wizard diff --git a/src/ui/main_window/MainWindowUI.cpp b/src/ui/main_window/MainWindowUI.cpp index 7d798c8b..1470b731 100644 --- a/src/ui/main_window/MainWindowUI.cpp +++ b/src/ui/main_window/MainWindowUI.cpp @@ -251,11 +251,17 @@ void MainWindow::create_actions() { connect(about_act_, &QAction::triggered, this, [=]() { new AboutDialog(0, this); }); + gnupg_act_ = new QAction(_("GnuPG"), this); + gnupg_act_->setIcon(QIcon(":help.png")); + gnupg_act_->setToolTip(_("Information about Gnupg")); + connect(gnupg_act_, &QAction::triggered, this, + [=]() { new AboutDialog(1, this); }); + translate_act_ = new QAction(_("Translate"), this); translate_act_->setIcon(QIcon(":help.png")); translate_act_->setToolTip(_("Information about translation")); connect(translate_act_, &QAction::triggered, this, - [=]() { new AboutDialog(1, this); }); + [=]() { new AboutDialog(2, this); }); /* * Check Update Menu @@ -377,6 +383,7 @@ void MainWindow::create_menus() { help_menu_->addSeparator(); help_menu_->addAction(check_update_act_); help_menu_->addAction(translate_act_); + help_menu_->addAction(gnupg_act_); help_menu_->addAction(about_act_); }