aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-01-29 16:32:17 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-01-29 16:32:17 -0600
commit3fb7488a68b75ea89b507d70240322a2d8d00de0 (patch)
tree89343d8e8214125bdf15adf73ecdbd9d8f44ab01
parent131f7512975e3e0e1363cb787834abee5b79b4e5 (diff)
parentcbb15a8fefaf70b03434b055cf41185c4009fb10 (diff)
downloadayatana-indicator-datetime-3fb7488a68b75ea89b507d70240322a2d8d00de0.tar.gz
ayatana-indicator-datetime-3fb7488a68b75ea89b507d70240322a2d8d00de0.tar.bz2
ayatana-indicator-datetime-3fb7488a68b75ea89b507d70240322a2d8d00de0.zip
sync with trunk
-rw-r--r--src/service.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c
index 746ced9..7176ef1 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1359,6 +1359,21 @@ on_set_location (GSimpleAction * a G_GNUC_UNUSED,
g_free (zone);
}
+static void
+on_calendar_active_changed (GSimpleAction *action G_GNUC_UNUSED,
+ GVariant *state,
+ gpointer user_data)
+{
+ IndicatorDatetimeService *self = user_data;
+
+ /* reset the date when the menu is shown */
+ if (g_variant_get_boolean (state) && self->priv->calendar_date)
+ {
+ g_clear_pointer (&self->priv->calendar_date, g_date_time_unref);
+ update_calendar_action_state (self);
+ }
+}
+
/***
****
***/
@@ -1431,6 +1446,7 @@ create_menu (IndicatorDatetimeService * self, int profile)
g_menu_item_set_attribute (header, "x-canonical-type",
"s", "com.canonical.indicator.root");
g_menu_item_set_submenu (header, G_MENU_MODEL (submenu));
+ g_menu_item_set_attribute (header, "submenu-action", "s", "indicator.calendar-active");
g_object_unref (submenu);
/* add header to the menu */
@@ -1586,7 +1602,8 @@ init_gactions (IndicatorDatetimeService * self)
{ "activate-phone-clock-app", on_phone_clock_activated },
{ "activate-planner", on_activate_planner, "x", NULL },
{ "activate-appointment", on_activate_appointment, "s", NULL },
- { "set-location", on_set_location, "s" }
+ { "set-location", on_set_location, "s" },
+ { "calendar-active", NULL, NULL, "false", on_calendar_active_changed }
};
p->actions = g_simple_action_group_new ();