From 8bc85d4a79b0a503bf036e3a5460b9d25d4e53d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 28 Jul 2011 20:06:24 +0200 Subject: [PATCH] main: Add Main.notify() for simple system messages ... similar to Main.notifyError(), but don't duplicate the message on stderr/in the log. https://bugzilla.gnome.org/show_bug.cgi?id=652718 --- js/ui/main.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/js/ui/main.js b/js/ui/main.js index 195d3cbbe..5cde5410d 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -420,6 +420,19 @@ function loadTheme() { themeContext.set_theme (theme); } +/** + * notify: + * @msg: A message + * @details: Additional information + */ +function notify(msg, details) { + let source = new MessageTray.SystemNotificationSource(); + messageTray.add(source); + let notification = new MessageTray.Notification(source, msg, details); + notification.setTransient(true); + source.notify(notification); +} + /** * notifyError: * @msg: An error message @@ -434,11 +447,7 @@ function notifyError(msg, details) { else log("error: " + msg) - let source = new MessageTray.SystemNotificationSource(); - messageTray.add(source); - let notification = new MessageTray.Notification(source, msg, details); - notification.setTransient(true); - source.notify(notification); + notify(msg, details); } /**