[gnome-shell] messageTray: Summarize notifications when messages queue up



commit 34606c0a8ca5d8fc0344ef65f7924362111aabc9
Author: Devyani Kota <divs passion 18 gmail com>
Date:   Tue Oct 21 17:15:31 2014 +0530

    messageTray: Summarize notifications when messages queue up
    
    It is really annoying for the user to acknowledge multiple notifications
    when they queue up. So, to prevent a notification flood that has to be
    handled by the user one-by-one, a summarized-notification feature is
    added which leaves a single summarized-notification for the user,
    replacing multiple notifications if the number exceeds 1, which they may
    or may not acknowledge. When this summarized-notification is acknowledged,
    the message-tray is opened where they can view the notifications that were
    summarized. This helps the user concentrate on his primary task
    simultaneously informing them about the new notifications.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702460

 js/ui/messageTray.js |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index cedb410..ad7c5c8 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -2432,8 +2432,22 @@ const MessageTray = new Lang.Class({
             if (shouldShowNotification && nextNotification) {
                 let limited = this._busy || Main.layoutManager.bottomMonitor.inFullscreen;
                 let showNextNotification = (!limited || nextNotification.forFeedback || 
nextNotification.urgency == Urgency.CRITICAL);
-                if (showNextNotification)
-                    this._showNotification();
+                if (showNextNotification) {
+                    let len = this._notificationQueue.length;
+                    if (len > 1) {
+                        this._notificationQueue.length = 0;
+                        let source = new SystemNotificationSource();
+                        this.add(source);
+                        let notification = new Notification(source, ngettext("%d new message", "%d new 
messages", len).format(len));
+                        notification.setTransient(true);
+                        notification.connect('clicked', Lang.bind(this, function() {
+                            this.openTray();
+                        }));
+                        source.notify(notification);
+                    } else {
+                        this._showNotification();
+                    }
+                }
             }
         } else if (this._notificationState == State.SHOWN) {
             let expired = (this._userActiveWhileNotificationShown &&


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