[gnome-shell/wip/fmuellner/notification-redux+sass: 132/207] calendar: TMP: Hack in notification support



commit eee14dee7f41b4d1e6f2dc2511b4282987f3398f
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 99fd8c6..50bbe53 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]