[gnome-shell] dateMenu: Allow extensions to add custom calendar sources



commit 35fcd1699200b6f5033dbc1fc32ea5732610e2bc
Author: Eskild Hustvedt <code zerodogg org>
Date:   Wed Mar 21 08:59:39 2012 +0100

    dateMenu: Allow extensions to add custom calendar sources
    
    Splits instantiation of the event source into a separate method,
    allowing extensions to subclass the DateMenuButton and provide its
    own calendar source.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672500

 js/ui/dateMenu.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index 4bf22b4..c46938a 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -173,6 +173,10 @@ const DateMenuButton = new Lang.Class({
         }
     },
 
+    _getEventSource: function() {
+        return new Calendar.DBusEventSource();
+    },
+
     _setEventSource: function(eventSource) {
         if (this._eventSource)
             this._eventSource.destroy();
@@ -190,7 +194,7 @@ const DateMenuButton = new Lang.Class({
         let eventSource;
         let showEvents = Main.sessionMode.showCalendarEvents;
         if (showEvents) {
-            eventSource = new Calendar.DBusEventSource();
+            eventSource = this._getEventSource();
         } else {
             eventSource = new Calendar.EmptyEventSource();
         }


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