aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-datetime.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-10-04 07:56:59 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-10-04 07:56:59 -0500
commitf1c8a718fe10143ad64f7df6d59b60a514b3f6a1 (patch)
treed0559fe52091c30a14ad207e0963fdcf2ee478ee /src/indicator-datetime.c
parent3f6591ab927a4313f7623904a4a0d75533fa021f (diff)
parent938d25fd79ce9fed522c1fc7233aaa0c95120b38 (diff)
downloadayatana-indicator-datetime-f1c8a718fe10143ad64f7df6d59b60a514b3f6a1.tar.gz
ayatana-indicator-datetime-f1c8a718fe10143ad64f7df6d59b60a514b3f6a1.tar.bz2
ayatana-indicator-datetime-f1c8a718fe10143ad64f7df6d59b60a514b3f6a1.zip
get i-datetime's use of the EDS 3.5 API working.
Diffstat (limited to 'src/indicator-datetime.c')
-rw-r--r--src/indicator-datetime.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 2356c6d..9546664 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -268,18 +268,26 @@ indicator_datetime_class_init (IndicatorDatetimeClass *klass)
static void
menu_visible_notfy_cb(GtkWidget * menu, G_GNUC_UNUSED GParamSpec *pspec, gpointer user_data)
{
+ GtkWidget * w;
+ GtkCalendar * calendar;
IndicatorDatetime * self = INDICATOR_DATETIME(user_data);
GDateTime *datetime;
- gint y, m, d;
+ gint cur_y, cur_m, cur_d;
+ guint cal_y, cal_m, cal_d;
g_debug("notify visible signal received");
+ /* set the calendar to today's date */
datetime = g_date_time_new_now_local ();
- g_date_time_get_ymd (datetime, &y, &m, &d);
+ g_date_time_get_ymd (datetime, &cur_y, &cur_m, &cur_d);
g_date_time_unref (datetime);
-
- // Set the calendar to todays date
- ido_calendar_menu_item_set_date (self->priv->ido_calendar, y, m-1, d);
+ w = ido_calendar_menu_item_get_calendar (self->priv->ido_calendar);
+ calendar = GTK_CALENDAR(w);
+ gtk_calendar_get_date (calendar, &cal_y, &cal_m, &cal_d);
+ if ((cur_y != cal_y) || (cur_m-1 != cal_m))
+ gtk_calendar_select_month (calendar, cur_m-1, cur_y); /* (cur_m is 1-based) */
+ if (cur_d != cal_d)
+ gtk_calendar_select_day (calendar, cur_d);
/* Update in case date was changed outside of indicator-datetime */
update_label(self, NULL);