From feb1ea5739e2e33c4debcdd21a176f15991a64e5 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 17 Mar 2017 14:18:17 +0100 Subject: React to more specific notifications --- framework/notifications/notificationhandler.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'framework') diff --git a/framework/notifications/notificationhandler.cpp b/framework/notifications/notificationhandler.cpp index 23aa3da1..7fa392f0 100644 --- a/framework/notifications/notificationhandler.cpp +++ b/framework/notifications/notificationhandler.cpp @@ -44,16 +44,26 @@ void NotificationHandler::notify(const Sink::Notification ¬ification) qWarning() << "Received notification: " << notification; if (notification.type == Sink::Notification::Warning) { n.mType = Notification::Warning; - n.mMessage = notification.message; + if (notification.code == Sink::Notification::TransmissionFailed) { + n.mMessage = "Failed to send message."; + } else { + return; + } } else if (notification.type == Sink::Notification::Status) { if (notification.code == Sink::ApplicationDomain::ErrorStatus) { //A resource entered error status n.mType = Notification::Warning; - n.mMessage = notification.message; + n.mMessage = "A resource experienced an error."; + } else { + return; } } else if (notification.type == Sink::Notification::Info) { n.mType = Notification::Info; - n.mMessage = notification.message; + if (notification.code == Sink::Notification::TransmissionSucceeded) { + n.mMessage = "A message has been sent."; + } else { + return; + } } else { return; } -- cgit v1.2.3