aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--ChangeLog33
-rwxr-xr-xconfigure4
-rw-r--r--configure.ac4
-rw-r--r--src/indicator-messages.c44
5 files changed, 82 insertions, 4 deletions
diff --git a/AUTHORS b/AUTHORS
index f00e868..908c6ee 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -6,6 +6,7 @@
James Westby
Kees Cook
Ken VanDine
+ Luke Yelavich
Michael Terry
Sebstien Bacher
Ted Gould
diff --git a/ChangeLog b/ChangeLog
index d01c3a4..b2f99f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,38 @@
# Generated by Makefile. Do not edit.
+2011-02-17 Ted Gould <ted@gould.cx>
+
+ 0.3.92
+
+2011-02-17 Ted Gould <ted@gould.cx>
+
+ Support for accessiable descriptions of the indicator
+
+2011-02-17 Ted Gould <ted@gould.cx>
+
+ Removing an unneeded strdup
+
+2011-02-17 Ted Gould <ted@gould.cx>
+
+ Updating libindicator required version
+
+2011-02-17 Ted Gould <ted@gould.cx>
+
+ Updating the description when we signal that it's changed
+
+2011-02-17 Luke Yelavich <luke.yelavich@canonical.com>
+
+ Store entry data in a variable so it can be freed after signaling an
+ accessible description change, preventing a memory leak.
+
+2011-02-17 Luke Yelavich <luke.yelavich@canonical.com>
+
+ No need to use g_strdup, the variable is a const
+
+2011-02-14 Luke Yelavich <luke.yelavich@canonical.com>
+
+ Add accessible description support
+
2011-01-27 Ted Gould <ted@gould.cx>
0.3.91
diff --git a/configure b/configure
index cc58d3a..d8b67dd 100755
--- a/configure
+++ b/configure
@@ -2845,7 +2845,7 @@ fi
# Define the identity of the package.
PACKAGE=indicator-messages
- VERSION=0.3.91
+ VERSION=0.3.92
cat >>confdefs.h <<_ACEOF
@@ -11958,7 +11958,7 @@ GTK_REQUIRED_VERSION=2.12
GIO_UNIX_REQUIRED_VERSION=2.18
PANEL_REQUIRED_VERSION=2.0.0
INDICATE_REQUIRED_VERSION=0.4.90
-INDICATOR_REQUIRED_VERSION=0.3.5
+INDICATOR_REQUIRED_VERSION=0.3.19
DBUSMENUGTK_REQUIRED_VERSION=0.3.94
diff --git a/configure.ac b/configure.ac
index 721805e..962b6f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ AC_INIT(src/indicator-messages.c)
AC_PREREQ(2.53)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(indicator-messages, 0.3.91)
+AM_INIT_AUTOMAKE(indicator-messages, 0.3.92)
AM_MAINTAINER_MODE
@@ -39,7 +39,7 @@ GTK_REQUIRED_VERSION=2.12
GIO_UNIX_REQUIRED_VERSION=2.18
PANEL_REQUIRED_VERSION=2.0.0
INDICATE_REQUIRED_VERSION=0.4.90
-INDICATOR_REQUIRED_VERSION=0.3.5
+INDICATOR_REQUIRED_VERSION=0.3.19
DBUSMENUGTK_REQUIRED_VERSION=0.3.94
PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index 8a94a85..ed6caa6 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -23,6 +23,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <string.h>
#include <glib.h>
#include <glib-object.h>
+#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <libdbusmenu-gtk/menu.h>
#include <libdbusmenu-gtk/menuitem.h>
@@ -52,6 +53,7 @@ typedef struct _IndicatorMessagesClass IndicatorMessagesClass;
struct _IndicatorMessagesClass {
IndicatorObjectClass parent_class;
+ void (*update_a11y_desc) (IndicatorServiceManager * service, gpointer * user_data);
};
struct _IndicatorMessages {
@@ -71,6 +73,8 @@ static GDBusProxy * icon_proxy = NULL;
static GtkSizeGroup * indicator_right_group = NULL;
static GDBusNodeInfo * bus_node_info = NULL;
static GDBusInterfaceInfo * bus_interface_info = NULL;
+static const gchar * accessible_desc = NULL;
+static IndicatorObject * indicator = NULL;
/* Prototypes */
static void indicator_messages_class_init (IndicatorMessagesClass *klass);
@@ -79,12 +83,34 @@ static void indicator_messages_dispose (GObject *object);
static void indicator_messages_finalize (GObject *object);
static GtkImage * get_icon (IndicatorObject * io);
static GtkMenu * get_menu (IndicatorObject * io);
+static const gchar * get_accessible_desc (IndicatorObject * io);
static void connection_change (IndicatorServiceManager * sm,
gboolean connected,
gpointer user_data);
G_DEFINE_TYPE (IndicatorMessages, indicator_messages, INDICATOR_OBJECT_TYPE);
+static void
+update_a11y_desc (void)
+{
+ g_return_if_fail(IS_INDICATOR_MESSAGES(indicator));
+
+ GList *entries = indicator_object_get_entries(indicator);
+ IndicatorObjectEntry * entry = (IndicatorObjectEntry *)entries->data;
+
+ entry->accessible_desc = get_accessible_desc(indicator);
+
+ g_signal_emit(G_OBJECT(indicator),
+ INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID,
+ 0,
+ entry,
+ TRUE);
+
+ g_list_free(entries);
+
+ return;
+}
+
/* Initialize the one-timers */
static void
indicator_messages_class_init (IndicatorMessagesClass *klass)
@@ -98,6 +124,7 @@ indicator_messages_class_init (IndicatorMessagesClass *klass)
io_class->get_image = get_icon;
io_class->get_menu = get_menu;
+ io_class->get_accessible_desc = get_accessible_desc;
if (bus_node_info == NULL) {
GError * error = NULL;
@@ -131,6 +158,8 @@ indicator_messages_init (IndicatorMessages *self)
self->service = indicator_service_manager_new_version(INDICATOR_MESSAGES_DBUS_NAME, 1);
g_signal_connect(self->service, INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_change), self);
+ indicator = INDICATOR_OBJECT(self);
+
return;
}
@@ -172,8 +201,10 @@ proxy_signal (GDBusProxy * proxy, const gchar * sender, const gchar * signal, GV
if (g_strcmp0("AttentionChanged", signal) == 0) {
if (prop) {
indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages-new");
+ accessible_desc = _("New Messages");
} else {
indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages");
+ accessible_desc = _("Messages");
}
} else if (g_strcmp0("IconChanged", signal) == 0) {
if (prop) {
@@ -185,6 +216,8 @@ proxy_signal (GDBusProxy * proxy, const gchar * sender, const gchar * signal, GV
g_warning("Unknown signal %s", signal);
}
+ update_a11y_desc();
+
return;
}
@@ -205,10 +238,14 @@ attention_cb (GObject * object, GAsyncResult * ares, gpointer user_data)
if (prop) {
indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages-new");
+ accessible_desc = _("New Messages");
} else {
indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages");
+ accessible_desc = _("Messages");
}
+ update_a11y_desc();
+
return;
}
@@ -705,3 +742,10 @@ get_menu (IndicatorObject * io)
return GTK_MENU(menu);
}
+
+/* Returns the accessible description of the indicator */
+static const gchar *
+get_accessible_desc (IndicatorObject * io)
+{
+ return accessible_desc;
+}