← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~themuso/indicator-datetime/accessible-desc into lp:indicator-datetime

 

Luke Yelavich has proposed merging lp:~themuso/indicator-datetime/accessible-desc into lp:indicator-datetime.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)

For more details, see:
https://code.launchpad.net/~themuso/indicator-datetime/accessible-desc/+merge/49747
-- 
https://code.launchpad.net/~themuso/indicator-datetime/accessible-desc/+merge/49747
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/indicator-datetime.c'
--- src/indicator-datetime.c	2011-02-09 03:37:50 +0000
+++ src/indicator-datetime.c	2011-02-15 01:04:17 +0000
@@ -166,6 +166,7 @@
 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     (IndicatorDatetime * self);
@@ -203,6 +204,7 @@
 
 	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,
@@ -621,6 +623,11 @@
 	if (ltime == NULL) {
 		g_debug("Error getting local time");
 		gtk_label_set_label(self->priv->label, _("Error getting time"));
+		g_signal_emit(G_OBJECT(self),
+		              INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID,
+		              0,
+		              (IndicatorObjectEntry *)indicator_object_get_entries(INDICATOR_OBJECT(self))->data,
+		              TRUE);
 		return NULL;
 	}
 
@@ -642,6 +649,12 @@
 		self->priv->idle_measure = g_idle_add(idle_measure, io);
 	}
 
+	g_signal_emit(G_OBJECT(self),
+	              INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID,
+	              0,
+	              (IndicatorObjectEntry *)indicator_object_get_entries(INDICATOR_OBJECT(self))->data,
+	              TRUE);
+
 	return ltime;
 }
 
@@ -1313,3 +1326,16 @@
 
 	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;
+}


Follow ups