[gnome-shell/wip/fmuellner/notification-redux: 71/128] messageTray: Emit change notifications for unseenCount



commit 9d65c4473808ade3cf33fdfa3f157edf76a99ef8
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Feb 14 02:33:54 2015 +0100

    messageTray: Emit change notifications for unseenCount

 js/ui/messageTray.js |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 0c96bd5..7a7a2bb 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -512,7 +512,7 @@ const Notification = new Lang.Class({
         this.forFeedback = false;
         this.expanded = false;
         this.focused = false;
-        this.acknowledged = false;
+        this._acknowledged = false;
         this._destroyed = false;
         this._customContent = false;
         this.bannerBodyText = null;
@@ -797,6 +797,17 @@ const Notification = new Lang.Class({
         return this.addButton(button, callback);
     },
 
+    get acknowledged() {
+        return this._acknowledged;
+    },
+
+    set acknowledged(v) {
+        if (this._acknowledged == v)
+            return;
+        this._acknowledged = v;
+        this.emit('acknowledged-changed');
+    },
+
     setUrgency: function(urgency) {
         this.urgency = urgency;
     },
@@ -1137,6 +1148,7 @@ const Source = new Lang.Class({
             this.notifications.shift().destroy(NotificationDestroyedReason.EXPIRED);
 
         notification.connect('destroy', Lang.bind(this, this._onNotificationDestroy));
+        notification.connect('acknowledged-changed', Lang.bind(this, this.countUpdated));
         this.notifications.push(notification);
         this.emit('notification-added', notification);
 


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