aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindow.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-18 17:56:51 +0000
committersaturneric <[email protected]>2025-04-18 17:56:51 +0000
commita7ea8e6de4bb205d2a3783d5cb9bde8bee0086b9 (patch)
tree54838273836a155033d33b246ec4a4200291825b /src/ui/main_window/MainWindow.cpp
parentfix: issues found by testing (diff)
parentfix: spelling mistake on project config by nightly build (diff)
downloadGpgFrontend-a7ea8e6de4bb205d2a3783d5cb9bde8bee0086b9.tar.gz
GpgFrontend-a7ea8e6de4bb205d2a3783d5cb9bde8bee0086b9.zip
Merge branch 'develop'
Diffstat (limited to 'src/ui/main_window/MainWindow.cpp')
-rw-r--r--src/ui/main_window/MainWindow.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/ui/main_window/MainWindow.cpp b/src/ui/main_window/MainWindow.cpp
index 104f54d8..8c8fd55e 100644
--- a/src/ui/main_window/MainWindow.cpp
+++ b/src/ui/main_window/MainWindow.cpp
@@ -31,6 +31,8 @@
#include "core/function/GlobalSettingStation.h"
#include "core/model/SettingsObject.h"
#include "core/module/ModuleManager.h"
+#include "core/utils/CommonUtils.h"
+#include "core/utils/GpgUtils.h"
#include "ui/UISignalStation.h"
#include "ui/main_window/GeneralMainWindow.h"
#include "ui/struct/settings_object/AppearanceSO.h"
@@ -115,6 +117,25 @@ void MainWindow::Init() noexcept {
&UISignalStation::SignalMainWindowOpenFile, this,
&MainWindow::SlotOpenFile);
+#if !(defined(_WIN32) || defined(WIN32))
+ connect(this, &MainWindow::SignalLoaded, this, [=]() {
+ QTimer::singleShot(3000, [self = QPointer<MainWindow>(this)]() {
+ if (self != nullptr && DecidePinentry().isEmpty() && !IsFlatpakENV()) {
+ QMessageBox::warning(
+ self, tr("GUI Pinentry Not Found"),
+ tr("No suitable *graphical* Pinentry program was found on your "
+ "system.\n\n"
+ "Please install a GUI-based Pinentry (e.g., 'pinentry-qt', "
+ "'pinentry-gnome3', or 'pinentry-mac' on macOS).\n\n"
+ "Without a GUI Pinentry, GnuPG cannot prompt you for "
+ "passwords or passphrases.\n\n"
+ "After installing it, please restart GpgFrontend. The "
+ "configuration file will be updated automatically."));
+ }
+ });
+ });
+#endif
+
popup_menu_ = new QMenu(this);
popup_menu_->addAction(append_selected_keys_act_);
@@ -152,7 +173,6 @@ void MainWindow::Init() noexcept {
// loading process is done
emit SignalLoaded();
Module::TriggerEvent("APPLICATION_LOADED");
-
} catch (...) {
LOG_W() << tr("Critical error occur while loading GpgFrontend.");
QMessageBox::critical(