From 8f14fdc7325cb9635e3d92873baaa58f430fca01 Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 18 Apr 2025 17:54:54 +0200 Subject: feat: add more info check --- src/ui/UserInterfaceUtils.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/ui/UserInterfaceUtils.cpp') diff --git a/src/ui/UserInterfaceUtils.cpp b/src/ui/UserInterfaceUtils.cpp index 8d277ab4..ed76824a 100644 --- a/src/ui/UserInterfaceUtils.cpp +++ b/src/ui/UserInterfaceUtils.cpp @@ -167,16 +167,17 @@ void CommonUtils::RaiseMessageBox(QWidget *parent, GpgError err) { } } -void CommonUtils::RaiseFailureMessageBox(QWidget *parent, GpgError err) { +void CommonUtils::RaiseFailureMessageBox(QWidget *parent, GpgError err, + const QString &msg) { GpgErrorDesc desc = DescribeGpgErrCode(err); GpgErrorCode err_code = CheckGpgError2ErrCode(err); QMessageBox::critical(parent, tr("Failure"), - tr("Gpg Operation failed.\n\nError code: %1\nSource: " - " %2\nDescription: %3") - .arg(err_code) - .arg(desc.first) - .arg(desc.second)); + tr("Gpg Operation failed.") + "\n\n" + + tr("Error code: %1").arg(err_code) + "\n\n\n" + + tr("Source: %1").arg(desc.first) + "\n" + + tr("Description: %1").arg(desc.second) + "\n" + + tr("Error Message: %1").arg(msg)); } void CommonUtils::SlotImportKeys(QWidget *parent, int channel, -- cgit v1.2.3 From 502a43488d51c88be33d95be11ba8f160c2a3fd4 Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 18 Apr 2025 19:11:40 +0200 Subject: feat: add more basic env checks at init --- src/ui/UserInterfaceUtils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ui/UserInterfaceUtils.cpp') diff --git a/src/ui/UserInterfaceUtils.cpp b/src/ui/UserInterfaceUtils.cpp index ed76824a..b5747b9f 100644 --- a/src/ui/UserInterfaceUtils.cpp +++ b/src/ui/UserInterfaceUtils.cpp @@ -167,6 +167,14 @@ void CommonUtils::RaiseMessageBox(QWidget *parent, GpgError err) { } } +void CommonUtils::RaiseMessageBoxNotSupported(QWidget *parent) { + QMessageBox::warning( + parent, QObject::tr("Operation Not Supported"), + QObject::tr( + "The current GnuPG version is too low and does not support this " + "operation. Please upgrade your GnuPG version to continue.")); +} + void CommonUtils::RaiseFailureMessageBox(QWidget *parent, GpgError err, const QString &msg) { GpgErrorDesc desc = DescribeGpgErrCode(err); -- cgit v1.2.3 From d115562e6cb231356ef87a2ab86f4da1159a9e41 Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 18 Apr 2025 19:35:45 +0200 Subject: fix: issues found on macos --- src/ui/UserInterfaceUtils.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/ui/UserInterfaceUtils.cpp') diff --git a/src/ui/UserInterfaceUtils.cpp b/src/ui/UserInterfaceUtils.cpp index b5747b9f..dbc3f7e3 100644 --- a/src/ui/UserInterfaceUtils.cpp +++ b/src/ui/UserInterfaceUtils.cpp @@ -169,10 +169,9 @@ void CommonUtils::RaiseMessageBox(QWidget *parent, GpgError err) { void CommonUtils::RaiseMessageBoxNotSupported(QWidget *parent) { QMessageBox::warning( - parent, QObject::tr("Operation Not Supported"), - QObject::tr( - "The current GnuPG version is too low and does not support this " - "operation. Please upgrade your GnuPG version to continue.")); + parent, tr("Operation Not Supported"), + tr("The current GnuPG version is too low and does not support this " + "operation. Please upgrade your GnuPG version to continue.")); } void CommonUtils::RaiseFailureMessageBox(QWidget *parent, GpgError err, -- cgit v1.2.3