diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/datetime-service.c | 1 | ||||
-rw-r--r-- | src/indicator-datetime.c | 38 |
2 files changed, 39 insertions, 0 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c index 347fecb..d16837c 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -417,6 +417,7 @@ update_timezone_menu_items(gpointer user_data) { // Authentication function static gchar * auth_func (ECal *ecal, const gchar *prompt, const gchar *key, gpointer user_data) { + gboolean remember; // TODO: Is this useful? Should we be storing it somewhere? ESource *source = e_cal_get_source (ecal); gchar *auth_domain = e_source_get_duped_property (source, "auth-domain"); diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 54b4507..045ab78 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -170,6 +170,7 @@ static void indicator_datetime_dispose (GObject *object); static void indicator_datetime_finalize (GObject *object); static GtkLabel * get_label (IndicatorObject * io); static GtkMenu * get_menu (IndicatorObject * io); +static const gchar * get_accessible_desc (IndicatorObject * io); static GVariant * bind_enum_set (const GValue * value, const GVariantType * type, gpointer user_data); static gboolean bind_enum_get (GValue * value, GVariant * variant, gpointer user_data); static gchar * generate_format_string_now (IndicatorDatetime * self); @@ -208,6 +209,7 @@ indicator_datetime_class_init (IndicatorDatetimeClass *klass) io_class->get_label = get_label; io_class->get_menu = get_menu; + io_class->get_accessible_desc = get_accessible_desc; g_object_class_install_property (object_class, PROP_TIME_FORMAT, @@ -616,6 +618,27 @@ idle_measure (gpointer data) return FALSE; } +/* Updates the accessible description */ +static void +update_accessible_description (IndicatorDatetime * io) +{ + GList * entries = indicator_object_get_entries(INDICATOR_OBJECT(io)); + IndicatorObjectEntry * entry = (IndicatorObjectEntry *)entries->data; + + entry->accessible_desc = get_accessible_desc(INDICATOR_OBJECT(io)); + + g_signal_emit(G_OBJECT(io), + INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, + 0, + entry, + TRUE); + + g_list_free(entries); + + return; +} + +/* Updates the label to be the current time. */ static void set_label_to_time_in_zone (IndicatorDatetime * self, GtkLabel * label, GTimeZone * tz, const gchar * format, @@ -670,6 +693,8 @@ update_label (IndicatorDatetime * io, GDateTime ** datetime) self->priv->idle_measure = g_idle_add(idle_measure, io); } + update_accessible_description(io); + return; } @@ -1459,3 +1484,16 @@ get_menu (IndicatorObject * io) return GTK_MENU(self->priv->menu); } + +static const gchar * +get_accessible_desc (IndicatorObject * io) +{ + IndicatorDatetime * self = INDICATOR_DATETIME(io); + const gchar * name; + + if (self->priv->label != NULL) { + name = gtk_label_get_text(self->priv->label); + return name; + } + return NULL; +} |