[gnome-shell: 98/136] dateMenu: Remove "Open Calendar" item
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell: 98/136] dateMenu: Remove "Open Calendar" item
- Date: Fri, 20 Feb 2015 16:44:23 +0000 (UTC)
commit 7d1382afd3c6703cbdb353b9b9792e0ebe1cfe7e
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Feb 5 17:13:31 2015 +0100
dateMenu: Remove "Open Calendar" item
This functionality is now available through the Events section
header in the message list, so we don't need a separate menu
item for it.
https://bugzilla.gnome.org/show_bug.cgi?id=744817
js/ui/dateMenu.js | 37 +------------------------------------
1 files changed, 1 insertions(+), 36 deletions(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index df277f3..dc6ea83 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -133,16 +133,12 @@ const DateMenuButton = new Lang.Class({
let separator = new PopupMenu.PopupSeparatorMenuItem();
vbox.add(separator.actor, { y_align: St.Align.END, expand: true, y_fill: false });
- this._openCalendarItem = new PopupMenu.PopupMenuItem(_("Open Calendar"));
- this._openCalendarItem.connect('activate', Lang.bind(this, this._onOpenCalendarActivate));
- vbox.add(this._openCalendarItem.actor, {y_align: St.Align.END, expand: true, y_fill: false});
-
this._openClocksItem = new PopupMenu.PopupMenuItem(_("Open Clocks"));
this._openClocksItem.connect('activate', Lang.bind(this, this._onOpenClocksActivate));
vbox.add(this._openClocksItem.actor, {y_align: St.Align.END, expand: true, y_fill: false});
Shell.AppSystem.get_default().connect('installed-changed',
- Lang.bind(this, this._appInstalledChanged));
+ Lang.bind(this, this._updateEventsVisibility));
// Done with hbox for calendar and event list
@@ -154,15 +150,8 @@ const DateMenuButton = new Lang.Class({
this._sessionUpdated();
},
- _appInstalledChanged: function() {
- this._calendarApp = undefined;
- this._updateEventsVisibility();
- },
-
_updateEventsVisibility: function() {
let visible = this._eventSource.hasCalendars;
- this._openCalendarItem.actor.visible = visible &&
- (this._getCalendarApp() != null);
this._openClocksItem.actor.visible = visible &&
(this._getClockApp() != null);
this._messageList.actor.visible = visible;
@@ -197,34 +186,10 @@ const DateMenuButton = new Lang.Class({
this._updateEventsVisibility();
},
- _getCalendarApp: function() {
- if (this._calendarApp !== undefined)
- return this._calendarApp;
-
- let apps = Gio.AppInfo.get_recommended_for_type('text/calendar');
- if (apps && (apps.length > 0)) {
- let app = Gio.AppInfo.get_default_for_type('text/calendar', false);
- let defaultInRecommended = apps.some(function(a) { return a.equal(app); });
- this._calendarApp = defaultInRecommended ? app : apps[0];
- } else {
- this._calendarApp = null;
- }
- return this._calendarApp;
- },
-
_getClockApp: function() {
return Shell.AppSystem.get_default().lookup_app('org.gnome.clocks.desktop');
},
- _onOpenCalendarActivate: function() {
- this.menu.close();
-
- let app = this._getCalendarApp();
- if (app.get_id() == 'evolution.desktop')
- app = Gio.DesktopAppInfo.new('evolution-calendar.desktop');
- app.launch([], global.create_app_launch_context(0, -1));
- },
-
_onOpenClocksActivate: function() {
this.menu.close();
let app = this._getClockApp();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]