Commit fb1777eb authored by Martin Koller's avatar Martin Koller
Browse files

Don't block users work with a message box on download error

Instead of blocking users work with a MessageBox dialog, just display
the error via the KDE Notification framework.

BUG: 377553
REVIEW: 130074
parent 7a1fa2bc
......@@ -107,7 +107,8 @@ find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5ItemModels ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5WindowSystem ${KF5_VERSION} CONFIG REQUIRED)
find_packagE(KF5TextWidgets ${KF5_VERSION} CONFIG REQUIRED) # for KPluralHandlingSpinBox
find_package(KF5TextWidgets ${KF5_VERSION} CONFIG REQUIRED) # for KPluralHandlingSpinBox
find_package(KF5Notifications ${KF5_VERSION} CONFIG REQUIRED) # pop3
# KdepimLibs package
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
......
......@@ -45,6 +45,7 @@ target_link_libraries( akonadi_pop3_resource
KF5::Completion
KF5::WidgetsAddons
KF5::WindowSystem
KF5::Notifications
Qt5::DBus
)
......@@ -55,3 +56,4 @@ endif()
add_subdirectory( wizard )
install(TARGETS akonadi_pop3_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES akonadi_pop3_resource.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR})
[Global]
IconName=akonadi
Comment=POP3 Resource
[Event/mail-check-error]
Name=Error While Checking Mail
Comment=There was an error while checking for new mail
Action=Popup
......@@ -37,6 +37,7 @@
#include <kio/job.h>
#include <KPasswordDialog>
#include <KMessageBox>
#include <knotification.h>
#include <kwallet.h>
#include "pop3resource_debug.h"
......@@ -948,7 +949,8 @@ void POP3Resource::cancelSync(const QString &errorMessage, bool error)
cancelTask(errorMessage);
qCWarning(POP3RESOURCE_LOG) << "============== ERROR DURING POP3 SYNC ==========================";
qCWarning(POP3RESOURCE_LOG) << errorMessage;
KMessageBox::error(nullptr, errorMessage);
KNotification::event(QStringLiteral("mail-check-error"), name(), errorMessage.toHtmlEscaped(),
QString(), nullptr, KNotification::CloseOnTimeout, QStringLiteral("akonadi_pop3_resource"));
} else {
qCDebug(POP3RESOURCE_LOG) << "Canceled the sync, but no error.";
cancelTask();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment