[gnome-shell] messageTray: add SystemNotificationSource, moved from overview.js



commit 7322a4e4ef9077ceb9ffd4be9f626e550d241b98
Author: Dan Winship <danw gnome org>
Date:   Tue Nov 30 10:47:28 2010 -0500

    messageTray: add SystemNotificationSource, moved from overview.js
    
    Move the overview's "System Information" source here, so it can be
    used by non-overview code as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=635089

 js/ui/messageTray.js |   27 +++++++++++++++++++++++++++
 js/ui/overview.js    |   27 +--------------------------
 po/POTFILES.in       |    1 +
 3 files changed, 29 insertions(+), 26 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index da8f7e8..4188225 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -18,6 +18,9 @@ const BoxPointer = imports.ui.boxpointer;
 const Params = imports.misc.params;
 const Utils = imports.misc.utils;
 
+const Gettext = imports.gettext.domain('gnome-shell');
+const _ = Gettext.gettext;
+
 const ANIMATION_TIME = 0.2;
 const NOTIFICATION_TIMEOUT = 4;
 const SUMMARY_TIMEOUT = 1;
@@ -1743,3 +1746,27 @@ MessageTray.prototype = {
         }
     }
 };
+
+function SystemNotificationSource() {
+    this._init();
+}
+
+SystemNotificationSource.prototype = {
+    __proto__:  Source.prototype,
+
+    _init: function() {
+        Source.prototype._init.call(this, _("System Information"));
+
+        this._setSummaryIcon(this.createNotificationIcon());
+    },
+
+    createNotificationIcon: function() {
+        return new St.Icon({ icon_name: 'dialog-information',
+                             icon_type: St.IconType.SYMBOLIC,
+                             icon_size: this.ICON_SIZE });
+    },
+
+    _notificationClicked: function() {
+        this.destroy();
+    }
+};
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 1d6e6ab..08641ae 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -31,33 +31,8 @@ const ANIMATION_TIME = 0.25;
 // We split the screen vertically between the dash and the view selector.
 const DASH_SPLIT_FRACTION = 0.1;
 
-
 const DND_WINDOW_SWITCH_TIMEOUT = 1250;
 
-function Source() {
-    this._init();
-}
-
-Source.prototype = {
-    __proto__:  MessageTray.Source.prototype,
-
-    _init: function() {
-        MessageTray.Source.prototype._init.call(this,
-                                                "System Information");
-        this._setSummaryIcon(this.createNotificationIcon());
-    },
-
-    createNotificationIcon: function() {
-        return new St.Icon({ icon_name: 'dialog-information',
-                             icon_type: St.IconType.SYMBOLIC,
-                             icon_size: this.ICON_SIZE });
-    },
-
-    _notificationClicked: function() {
-        this.destroy();
-    }
-}
-
 function ShellInfo() {
     this._init();
 }
@@ -79,7 +54,7 @@ ShellInfo.prototype = {
 
     setMessage: function(text, undoCallback, undoLabel) {
         if (this._source == null) {
-            this._source = new Source();
+            this._source = new MessageTray.SystemNotificationSource();
             this._source.connect('destroy', Lang.bind(this,
                 function() {
                     this._source = null;
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 5ac0ba7..cb9c39f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -6,6 +6,7 @@ js/ui/appFavorites.js
 js/ui/dash.js
 js/ui/docDisplay.js
 js/ui/lookingGlass.js
+js/ui/messageTray.js
 js/ui/overview.js
 js/ui/panel.js
 js/ui/placeDisplay.js



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