diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-17 14:18:17 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-17 14:18:17 +0100 |
commit | feb1ea5739e2e33c4debcdd21a176f15991a64e5 (patch) | |
tree | 29b990b26d1bdc2b9ad0d69db96d337cbe164373 /framework/notifications/notificationhandler.cpp | |
parent | 106c84b5540e54741f41c62ea224e783a756297f (diff) | |
download | kube-feb1ea5739e2e33c4debcdd21a176f15991a64e5.tar.gz kube-feb1ea5739e2e33c4debcdd21a176f15991a64e5.zip |
React to more specific notifications
Diffstat (limited to 'framework/notifications/notificationhandler.cpp')
-rw-r--r-- | framework/notifications/notificationhandler.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
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) | |||
44 | qWarning() << "Received notification: " << notification; | 44 | qWarning() << "Received notification: " << notification; |
45 | if (notification.type == Sink::Notification::Warning) { | 45 | if (notification.type == Sink::Notification::Warning) { |
46 | n.mType = Notification::Warning; | 46 | n.mType = Notification::Warning; |
47 | n.mMessage = notification.message; | 47 | if (notification.code == Sink::Notification::TransmissionFailed) { |
48 | n.mMessage = "Failed to send message."; | ||
49 | } else { | ||
50 | return; | ||
51 | } | ||
48 | } else if (notification.type == Sink::Notification::Status) { | 52 | } else if (notification.type == Sink::Notification::Status) { |
49 | if (notification.code == Sink::ApplicationDomain::ErrorStatus) { | 53 | if (notification.code == Sink::ApplicationDomain::ErrorStatus) { |
50 | //A resource entered error status | 54 | //A resource entered error status |
51 | n.mType = Notification::Warning; | 55 | n.mType = Notification::Warning; |
52 | n.mMessage = notification.message; | 56 | n.mMessage = "A resource experienced an error."; |
57 | } else { | ||
58 | return; | ||
53 | } | 59 | } |
54 | } else if (notification.type == Sink::Notification::Info) { | 60 | } else if (notification.type == Sink::Notification::Info) { |
55 | n.mType = Notification::Info; | 61 | n.mType = Notification::Info; |
56 | n.mMessage = notification.message; | 62 | if (notification.code == Sink::Notification::TransmissionSucceeded) { |
63 | n.mMessage = "A message has been sent."; | ||
64 | } else { | ||
65 | return; | ||
66 | } | ||
57 | } else { | 67 | } else { |
58 | return; | 68 | return; |
59 | } | 69 | } |