[gnome-shell] main: Add Main.notify() for simple system messages



commit 8bc85d4a79b0a503bf036e3a5460b9d25d4e53d2
Author: Florian MÃllner <fmuellner gnome org>
Date:   Thu Jul 28 20:06:24 2011 +0200

    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 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index 195d3cb..5cde541 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -421,6 +421,19 @@ function loadTheme() {
 }
 
 /**
+ * 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
  * @details: Additional information
@@ -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);
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]