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
This commit is contained in:
parent
084f7a36b1
commit
35fcd16992
@ -173,6 +173,10 @@ const DateMenuButton = new Lang.Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_getEventSource: function() {
|
||||||
|
return new Calendar.DBusEventSource();
|
||||||
|
},
|
||||||
|
|
||||||
_setEventSource: function(eventSource) {
|
_setEventSource: function(eventSource) {
|
||||||
if (this._eventSource)
|
if (this._eventSource)
|
||||||
this._eventSource.destroy();
|
this._eventSource.destroy();
|
||||||
@ -190,7 +194,7 @@ const DateMenuButton = new Lang.Class({
|
|||||||
let eventSource;
|
let eventSource;
|
||||||
let showEvents = Main.sessionMode.showCalendarEvents;
|
let showEvents = Main.sessionMode.showCalendarEvents;
|
||||||
if (showEvents) {
|
if (showEvents) {
|
||||||
eventSource = new Calendar.DBusEventSource();
|
eventSource = this._getEventSource();
|
||||||
} else {
|
} else {
|
||||||
eventSource = new Calendar.EmptyEventSource();
|
eventSource = new Calendar.EmptyEventSource();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user