aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.gitea/workflows/develop-qt5.yml4
-rw-r--r--.gitea/workflows/develop-qt6.yml4
-rw-r--r--gpgfrontend.qrc2
-rw-r--r--resource/lfs/icons/upgrade.pngbin0 -> 3526 bytes
-rw-r--r--resource/lfs/icons/warning-filling.pngbin0 -> 6158 bytes
-rw-r--r--src/cmd.cpp31
-rw-r--r--src/core/utils/GpgUtils.cpp2
-rw-r--r--src/main.cpp4
-rw-r--r--src/ui/main_window/MainWindowSlotFunction.cpp17
9 files changed, 49 insertions, 15 deletions
diff --git a/.gitea/workflows/develop-qt5.yml b/.gitea/workflows/develop-qt5.yml
index 42fff721..5ffe14ce 100644
--- a/.gitea/workflows/develop-qt5.yml
+++ b/.gitea/workflows/develop-qt5.yml
@@ -27,12 +27,12 @@ name: Develop CI Qt5
on:
push:
- branches: [main, develop, "dev/**"]
+ branches: ["dev/**"]
paths-ignore:
- "resource/lfs/locale/**"
- "**.md"
pull_request:
- branches: [main, develop, "dev/**"]
+ branches: ["dev/**"]
paths-ignore:
- "resource/lfs/locale/**"
- "**.md"
diff --git a/.gitea/workflows/develop-qt6.yml b/.gitea/workflows/develop-qt6.yml
index 3790c426..f3ac980f 100644
--- a/.gitea/workflows/develop-qt6.yml
+++ b/.gitea/workflows/develop-qt6.yml
@@ -27,12 +27,12 @@ name: Develop CI Qt6
on:
push:
- branches: [main, develop, "dev/**"]
+ branches: ["dev/**"]
paths-ignore:
- "resource/lfs/locale/**"
- "**.md"
pull_request:
- branches: [main, develop, "dev/**"]
+ branches: ["dev/**"]
paths-ignore:
- "resource/lfs/locale/**"
- "**.md"
diff --git a/gpgfrontend.qrc b/gpgfrontend.qrc
index dea3c3f6..51f5b2b7 100644
--- a/gpgfrontend.qrc
+++ b/gpgfrontend.qrc
@@ -106,6 +106,8 @@
<file alias="email-check.png">resource/lfs/icons/email-check.png</file>
<file alias="email-open.png">resource/lfs/icons/email-open.png</file>
<file alias="export-email.png">resource/lfs/icons/export-email.png</file>
+ <file alias="warning-filling.png">resource/lfs/icons/warning-filling.png</file>
+ <file alias="upgrade.png">resource/lfs/icons/upgrade.png</file>
</qresource>
<qresource prefix="/test/key">
<file alias="pv1.key">resource/lfs/test/data/pv1.key</file>
diff --git a/resource/lfs/icons/upgrade.png b/resource/lfs/icons/upgrade.png
new file mode 100644
index 00000000..b82f9900
--- /dev/null
+++ b/resource/lfs/icons/upgrade.png
Binary files differ
diff --git a/resource/lfs/icons/warning-filling.png b/resource/lfs/icons/warning-filling.png
new file mode 100644
index 00000000..44956dab
--- /dev/null
+++ b/resource/lfs/icons/warning-filling.png
Binary files differ
diff --git a/src/cmd.cpp b/src/cmd.cpp
index 2ab0b323..b8de7d4c 100644
--- a/src/cmd.cpp
+++ b/src/cmd.cpp
@@ -171,18 +171,35 @@ auto PrintEnvInfo() -> int {
}
auto ParseLogLevel(const QString& log_level) -> int {
+ // default value
+ if (log_level == "none") return 0;
+
if (log_level == "debug") {
QLoggingCategory::setFilterRules(
- "core.debug=true\nui.debug=true\ntest.debug=true\nmodule.debug=true");
+ "core.debug=true\n"
+ "ui.debug=true\n"
+ "module.debug=true\n"
+ "test.debug=true");
} else if (log_level == "info") {
QLoggingCategory::setFilterRules(
- "*.debug=false\ncore.info=true\nui.info=true\ntest.info="
- "true\nmodule.info=true");
- } else if (log_level == "warning") {
- QLoggingCategory::setFilterRules("*.debug=false\n*.info=false\n");
- } else if (log_level == "critical") {
+ "*.debug=false\n"
+ "core.info=true\n"
+ "ui.info=true\n"
+ "module.info=true\n"
+ "test.debug=true");
+ } else if (log_level == "warn") {
+ QLoggingCategory::setFilterRules(
+ "*.debug=false\n"
+ "*.info=false\n"
+ "core.warning=true\n"
+ "ui.warning=true\n"
+ "module.warning=true\n"
+ "test.warning=true\n");
+ } else if (log_level == "error") {
QLoggingCategory::setFilterRules(
- "*.debug=false\n*.info=false\n*.warning=false\n");
+ "*.debug=false\n"
+ "*.info=false\n"
+ "*.warning=false");
} else {
qWarning() << "unknown log level: " << log_level;
}
diff --git a/src/core/utils/GpgUtils.cpp b/src/core/utils/GpgUtils.cpp
index 957b8910..29b150bd 100644
--- a/src/core/utils/GpgUtils.cpp
+++ b/src/core/utils/GpgUtils.cpp
@@ -185,6 +185,8 @@ auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseInfos()
#else
gpg_key_database_info_cache.reserve(
static_cast<qsizetype>(context_index_list.size()));
+ std::fill_n(std::back_inserter(gpg_key_database_info_cache),
+ context_index_list.size(), KeyDatabaseInfo{});
#endif
for (auto& context_index : context_index_list) {
diff --git a/src/main.cpp b/src/main.cpp
index 040269fb..926c15ab 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -81,9 +81,7 @@ auto main(int argc, char* argv[]) -> int {
{{"v", "version"}, "show version information"},
{{"t", "test"}, "run all unit test cases"},
{{"e", "environment"}, "show environment information"},
- {{"l", "log-level"},
- "set log level (trace, debug, info, warn, error)",
- "debug"},
+ {{"l", "log-level"}, "set log level (debug, info, warn, error)", "none"},
});
parser.process(*ctx->GetApp());
diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp
index b2b73d96..f214efbd 100644
--- a/src/ui/main_window/MainWindowSlotFunction.cpp
+++ b/src/ui/main_window/MainWindowSlotFunction.cpp
@@ -290,6 +290,8 @@ void MainWindow::SlotOpenFile(const QString& path) {
}
void MainWindow::slot_version_upgrade_notify() {
+ if (!Module::IsModuleActivate(kVersionCheckingModuleID)) return;
+
auto is_loading_done = Module::RetrieveRTValueTypedOrDefault<>(
kVersionCheckingModuleID, "version.loading_done", false);
if (!is_loading_done) {
@@ -323,6 +325,13 @@ void MainWindow::slot_version_upgrade_notify() {
statusBar()->showMessage(
tr("GpgFrontend Upgradeable (New Version: %1).").arg(latest_version),
30000);
+
+ auto* b = new QToolButton();
+ b->setToolButtonStyle(Qt::ToolButtonIconOnly);
+ b->setIcon(QIcon(":/icons/upgrade.png"));
+ connect(b, &QPushButton::clicked,
+ [=]() { (new AboutDialog(tr("Update"), this))->show(); });
+ statusBar()->addPermanentWidget(b);
} else if (is_current_a_withdrawn_version) {
auto response = QMessageBox::warning(
this, tr("Withdrawn Version"),
@@ -338,13 +347,19 @@ void MainWindow::slot_version_upgrade_notify() {
QDesktopServices::openUrl(
QUrl("https://github.com/saturneric/GpgFrontend/releases/latest"));
}
-
} else if (!is_current_version_released) {
statusBar()->showMessage(
tr("This may be a BETA Version (Latest Stable Version: %1).")
.arg(latest_version),
30000);
+ auto* b = new QToolButton();
+ b->setToolButtonStyle(Qt::ToolButtonIconOnly);
+ b->setIcon(QIcon(":/icons/warning-filling.png"));
+ connect(b, &QPushButton::clicked,
+ [=]() { (new AboutDialog(tr("Update"), this))->show(); });
+ statusBar()->addPermanentWidget(b);
+
} else if (is_git_commit_hash_mismatch) {
QMessageBox::information(
this, tr("Commit Hash Mismatch"),