From ffefff6c6ed10c9992c9de7fa4f99a30f1f99901 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 25 Jan 2018 13:53:53 +0100 Subject: Only display one error when failing to send a mail. --- framework/qml/Notifications.qml | 1 + framework/src/sinkfabric.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'framework') diff --git a/framework/qml/Notifications.qml b/framework/qml/Notifications.qml index 18f2a68a..1593f416 100644 --- a/framework/qml/Notifications.qml +++ b/framework/qml/Notifications.qml @@ -28,5 +28,6 @@ Item { property string loginError: "loginError" property string hostNotFoundError: "hostNotFoundError" property string connectionError: "connectionError" + property string transmissionError: "transmissionError" } diff --git a/framework/src/sinkfabric.cpp b/framework/src/sinkfabric.cpp index 897534b9..58ddae83 100644 --- a/framework/src/sinkfabric.cpp +++ b/framework/src/sinkfabric.cpp @@ -152,8 +152,10 @@ public: QVariantMap message; if (notification.type == Sink::Notification::Warning) { message["type"] = "warning"; + message["resource"] = QString{notification.resource}; if (notification.code == Sink::ApplicationDomain::TransmissionError) { message["message"] = QObject::tr("Failed to send message."); + message["subtype"] = "transmissionError"; } else { return; } @@ -186,7 +188,8 @@ public: message["message"] = QObject::tr("No credentials available."); break; default: - message["message"] = QObject::tr("An unknown error occurred."); + //Ignore unknown errors, they are not going to help. + return; } Fabric::Fabric{}.postMessage("errorNotification", message); } else if (notification.type == Sink::Notification::Info) { -- cgit v1.2.3