diff options
author | Dylan McCall <dylanmccall@ubuntu.com> | 2011-04-03 16:48:20 -0700 |
---|---|---|
committer | Dylan McCall <dylanmccall@ubuntu.com> | 2011-04-03 16:48:20 -0700 |
commit | 3bcb5d1ba9bf9890dd52d81cd35496d5d97b34a0 (patch) | |
tree | 9e6e7aad83e6f4844fc24bfa532f79ee80d2eef8 | |
parent | e45dba38faf7ea699cdd8cf9f2b1bd6a6fe6642a (diff) | |
download | ayatana-indicator-datetime-3bcb5d1ba9bf9890dd52d81cd35496d5d97b34a0.tar.gz ayatana-indicator-datetime-3bcb5d1ba9bf9890dd52d81cd35496d5d97b34a0.tar.bz2 ayatana-indicator-datetime-3bcb5d1ba9bf9890dd52d81cd35496d5d97b34a0.zip |
Follow show-calendar setting regardless of whether Evolution is present (LP: #748772)
Visibility of upcoming events is no longer tied to show-calendar setting.
-rw-r--r-- | src/datetime-service.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c index 1ddaa4d..4c3bb94 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -439,18 +439,16 @@ static gboolean check_for_calendar (gpointer user_data) { g_return_val_if_fail (calendar != NULL, FALSE); - // Always enable the calendar even if it does nothing - dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); - dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + + dbusmenu_menuitem_property_set_bool(date, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); gchar *evo = g_find_program_in_path("evolution"); if (evo != NULL) { g_debug("Found the calendar application: %s", evo); - - dbusmenu_menuitem_property_set_bool(date, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); + g_signal_connect (G_OBJECT(date), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, - G_CALLBACK (activate_cb), "evolution -c calendar"); - + G_CALLBACK (activate_cb), "evolution -c calendar"); + events_separator = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set(events_separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); dbusmenu_menuitem_child_add_position(root, events_separator, 2); @@ -478,8 +476,16 @@ check_for_calendar (gpointer user_data) g_free(evo); } else { g_debug("Unable to find calendar app."); - dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); dbusmenu_menuitem_property_set_bool(add_appointment, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + dbusmenu_menuitem_property_set_bool(events_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + } + + if (g_settings_get_boolean(conf, SETTINGS_SHOW_CALENDAR_S)) { + dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); + dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + } else { + dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); + dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); } return FALSE; |