[gnome-shell/wip/fmuellner/notification-redux: 50/128] calendar: TMP: Hack in notification support



commit 0820a6ebedd7fb7db10fa38015ed11fbe273696f
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 13 00:09:58 2015 +0100

    calendar: TMP: Hack in notification support

 js/ui/calendar.js |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index cc3117c..400439b 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -1039,7 +1039,7 @@ const NotificationListEntry = new Lang.Class({
     Extends: MessageListEntry,
 
     _init: function(notification) {
-        let params = { gicon: notification.icon || notification.getIcon() };
+        let params = { gicon: notification.icon || notification.source.getIcon() };
         if (!this._noDate)
             params.time = new Date();
 
@@ -1204,7 +1204,17 @@ const NotificationSection = new Lang.Class({
     },
 
     _onNotificationAdded: function(source, notification) {
-        let gicon = notification._icon ? notification._icon.gicon : source.getIcon();
+        //let gicon = notification._icon ? notification._icon.gicon : source.getIcon();
+        let gicon = null;
+        if (notification._iconBin.child)
+            gicon = notification._iconBin.child.gicon;
+
+        if (!gicon)
+            try {
+                gicon = source.getIcon();
+            } catch(e) {
+            }
+
         let body = '';
         if (notification.bannerBodyText) {
             body = notification.bannerBodyMarkup ? notification.bannerBodyText
@@ -1259,6 +1269,13 @@ const NotificationSection = new Lang.Class({
             this._showBanner();
     },
 
+    showTestBanner: function() {
+        let notification = new Notification(new Source('Test', 'dialog-info-symbolic'),
+                                            "Test notification",
+                                            "This is a small test notification with a lengthy body to test 
expanding of banners; something's wrong in the tray but seems to work here, no idea what's going on ...");
+        this.addNotification(notification);
+    },
+
     _showBanner: function() {
         let notification = this._notificationQueue.shift();
 


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