diff options
author | Ted Gould <ted@gould.cx> | 2011-04-04 10:51:22 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-04-04 10:51:22 -0500 |
commit | 16b7cebba26682bc62c9378148f4fdbc183e0315 (patch) | |
tree | b6813258c4f39050d1d344c607c4856c7661400f | |
parent | 3802e410132c68c8914df1d427d63ce3937b6288 (diff) | |
parent | 3bcb5d1ba9bf9890dd52d81cd35496d5d97b34a0 (diff) | |
download | ayatana-indicator-datetime-16b7cebba26682bc62c9378148f4fdbc183e0315.tar.gz ayatana-indicator-datetime-16b7cebba26682bc62c9378148f4fdbc183e0315.tar.bz2 ayatana-indicator-datetime-16b7cebba26682bc62c9378148f4fdbc183e0315.zip |
Ensure the calendar is correctly shown
-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 7f14e74..ac1fa10 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; |