[gnome-shell/wip/fmuellner/notification-redux: 75/88] calendar: Acknowledge seen notifications



commit 840be7fd6711b7293764ed15d7a45c6ebf8217c3
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Feb 14 03:48:34 2015 +0100

    calendar: Acknowledge seen notifications

 js/ui/calendar.js |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index 647affa..fe3bff0 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -1249,6 +1249,8 @@ const NotificationSection = new Lang.Class({
 
         global.screen.connect('in-fullscreen-changed', Lang.bind(this, this._checkQueue));
 
+        this.actor.connect('notify::mapped', Lang.bind(this, this._onMapped));
+
         Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
         this._sessionUpdated();
     },
@@ -1291,6 +1293,7 @@ const NotificationSection = new Lang.Class({
             this.removeMessage(listEntry, this.actor.mapped);
         }));
         listEntry.connect('close', function() { notification.destroy(); });
+        listEntry.notification = notification;
         let listChild = this.addMessage(listEntry, this.actor.mapped);
         // TODO: Keep URGENT notifications on top
         this._list.set_child_below_sibling(listChild, null);
@@ -1303,6 +1306,14 @@ const NotificationSection = new Lang.Class({
         this._sources.delete(source);
     },
 
+    _onMapped: function() {
+        if (!this.actor.mapped)
+            return;
+        this._messages.forEach(function(m) {
+            m.notification.acknowledged = true;
+        });
+    },
+
     addNotification: function(notification) {
         let listEntry = new NotificationListEntry(notification);
         // TODO: Keep URGENT notifications on top


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