diff options
-rwxr-xr-x | configure | 22 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rwxr-xr-x | ltmain.sh | 4 | ||||
-rw-r--r-- | po/POTFILES.in | 1 | ||||
-rw-r--r-- | src/indicator-sound.c | 18 | ||||
-rw-r--r-- | src/volume-widget.c | 23 | ||||
-rw-r--r-- | src/volume-widget.h | 3 |
7 files changed, 57 insertions, 20 deletions
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for indicator-sound 0.6.0. +# Generated by GNU Autoconf 2.67 for indicator-sound 0.6.1. # # Report bugs to <conor.curran@canonical.com>. # @@ -761,8 +761,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='indicator-sound' PACKAGE_TARNAME='indicator-sound' -PACKAGE_VERSION='0.6.0' -PACKAGE_STRING='indicator-sound 0.6.0' +PACKAGE_VERSION='0.6.1' +PACKAGE_STRING='indicator-sound 0.6.1' PACKAGE_BUGREPORT='conor.curran@canonical.com' PACKAGE_URL='' @@ -1564,7 +1564,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures indicator-sound 0.6.0 to adapt to many kinds of systems. +\`configure' configures indicator-sound 0.6.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1634,7 +1634,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of indicator-sound 0.6.0:";; + short | recursive ) echo "Configuration of indicator-sound 0.6.1:";; esac cat <<\_ACEOF @@ -1767,7 +1767,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -indicator-sound configure 0.6.0 +indicator-sound configure 0.6.1 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2136,7 +2136,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by indicator-sound $as_me 0.6.0, which was +It was created by indicator-sound $as_me 0.6.1, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2956,7 +2956,7 @@ fi # Define the identity of the package. PACKAGE=indicator-sound - VERSION=0.6.0 + VERSION=0.6.1 cat >>confdefs.h <<_ACEOF @@ -12124,7 +12124,7 @@ AM_BACKSLASH='\' ########################### GTK_REQUIRED_VERSION=2.12 -INDICATOR_REQUIRED_VERSION=0.3.15 +INDICATOR_REQUIRED_VERSION=0.3.19 DBUSMENUGTK_REQUIRED_VERSION=0.3.9 POLKIT_REQUIRED_VERSION=0.92 PULSE_AUDIO_REQUIRED_VERSION=0.9.19 @@ -14349,7 +14349,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by indicator-sound $as_me 0.6.0, which was +This file was extended by indicator-sound $as_me 0.6.1, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14415,7 +14415,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -indicator-sound config.status 0.6.0 +indicator-sound config.status 0.6.1 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index b1864dc..064a581 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(indicator-sound, 0.6.0, conor.curran@canonical.com) +AC_INIT(indicator-sound, 0.6.1, conor.curran@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-sound, 0.6.0) +AM_INIT_AUTOMAKE(indicator-sound, 0.6.1) AM_MAINTAINER_MODE @@ -28,7 +28,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) ########################### GTK_REQUIRED_VERSION=2.12 -INDICATOR_REQUIRED_VERSION=0.3.15 +INDICATOR_REQUIRED_VERSION=0.3.19 DBUSMENUGTK_REQUIRED_VERSION=0.3.9 POLKIT_REQUIRED_VERSION=0.92 PULSE_AUDIO_REQUIRED_VERSION=0.9.19 @@ -65,7 +65,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1 +# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu2 # automake: $automake_version # autoconf: $autoconf_version # @@ -73,7 +73,7 @@ PROGRAM=ltmain.sh PACKAGE=libtool -VERSION="2.2.6b Debian-2.2.6b-2ubuntu1" +VERSION="2.2.6b Debian-2.2.6b-2ubuntu2" TIMESTAMP="" package_revision=1.3017 diff --git a/po/POTFILES.in b/po/POTFILES.in index 9cceace..2f68d1a 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,3 +1,4 @@ [encoding: UTF-8] +src/indicator-sound.c src/mute-menu-item.c src/sound-service-dbus.c diff --git a/src/indicator-sound.c b/src/indicator-sound.c index 2466550..4980ab8 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -20,6 +20,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <math.h> #include <glib.h> #include <glib-object.h> +#include <glib/gi18n.h> #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> #include <libdbusmenu-gtk/menu.h> @@ -66,6 +67,7 @@ G_DEFINE_TYPE (IndicatorSound, indicator_sound, INDICATOR_OBJECT_TYPE); static GtkLabel * get_label (IndicatorObject * io); static GtkImage * get_icon (IndicatorObject * io); static GtkMenu * get_menu (IndicatorObject * io); +static const gchar * get_accessible_desc (IndicatorObject * io); static void indicator_sound_scroll (IndicatorObject* io, gint delta, IndicatorScrollDirection direction); @@ -121,6 +123,7 @@ indicator_sound_class_init (IndicatorSoundClass *klass) io_class->get_label = get_label; io_class->get_image = get_icon; io_class->get_menu = get_menu; + io_class->get_accessible_desc = get_accessible_desc; io_class->scroll = indicator_sound_scroll; } @@ -214,6 +217,19 @@ get_menu (IndicatorObject * io) return GTK_MENU(menu); } +static const gchar * +get_accessible_desc (IndicatorObject * io) +{ + IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(io); + + if (priv->volume_widget != NULL){ + return g_strdup_printf(_("Volume (%'.0f%%)"), volume_widget_get_current_volume(priv->volume_widget)); + } + + return NULL; +} + + static void connection_changed (IndicatorServiceManager * sm, gboolean connected, @@ -389,8 +405,8 @@ new_volume_slider_widget(DbusmenuMenuitem * newitem, g_return_val_if_fail(DBUSMENU_IS_MENUITEM(newitem), FALSE); g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE); - volume_widget = volume_widget_new (newitem); io = g_object_get_data (G_OBJECT (client), "indicator"); + volume_widget = volume_widget_new (newitem, io); IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(INDICATOR_SOUND (io)); priv->volume_widget = volume_widget; diff --git a/src/volume-widget.c b/src/volume-widget.c index ceebec5..be97994 100644 --- a/src/volume-widget.c +++ b/src/volume-widget.c @@ -37,6 +37,7 @@ struct _VolumeWidgetPrivate DbusmenuMenuitem* twin_item; GtkWidget* ido_volume_slider; gboolean grabbed; + IndicatorObject* indicator; }; #define VOLUME_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VOLUME_WIDGET_TYPE, VolumeWidgetPrivate)) @@ -137,6 +138,14 @@ volume_widget_property_update( DbusmenuMenuitem* item, gchar* property, gdouble update = g_variant_get_double (value); //g_debug("volume-widget - update level with value %f", update); gtk_range_set_value(range, update); + + GList *entry = indicator_object_get_entries(priv->indicator); + g_signal_emit(G_OBJECT(priv->indicator), + INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, + 0, + entry->data, + TRUE); + g_list_free(entry); } } } @@ -156,6 +165,14 @@ volume_widget_set_twin_item(VolumeWidget* self, GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider); GtkRange *range = (GtkRange*)slider; gtk_range_set_value(range, initial_level); + + GList *entry = indicator_object_get_entries(priv->indicator); + g_signal_emit(G_OBJECT(priv->indicator), + INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, + 0, + entry->data, + TRUE); + g_list_free(entry); } static gboolean @@ -251,10 +268,12 @@ volume_widget_get_current_volume ( GtkWidget *widget ) * volume_widget_new: * @returns: a new #VolumeWidget. **/ -GtkWidget* -volume_widget_new(DbusmenuMenuitem *item) +GtkWidget* +volume_widget_new(DbusmenuMenuitem *item, IndicatorObject* io) { GtkWidget* widget = g_object_new(VOLUME_WIDGET_TYPE, NULL); + VolumeWidgetPrivate* priv = VOLUME_WIDGET_GET_PRIVATE(VOLUME_WIDGET(widget)); + priv->indicator = io; volume_widget_set_twin_item((VolumeWidget*)widget, item); return widget; } diff --git a/src/volume-widget.h b/src/volume-widget.h index 072cfde..50ef377 100644 --- a/src/volume-widget.h +++ b/src/volume-widget.h @@ -22,6 +22,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <glib.h> #include <glib-object.h> #include <libdbusmenu-gtk/menuitem.h> +#include <libindicator/indicator-object.h> G_BEGIN_DECLS @@ -44,7 +45,7 @@ struct _VolumeWidget { }; GType volume_widget_get_type (void) G_GNUC_CONST; -GtkWidget* volume_widget_new(DbusmenuMenuitem* twin_item); +GtkWidget* volume_widget_new(DbusmenuMenuitem *item, IndicatorObject* io); GtkWidget* volume_widget_get_ido_slider(VolumeWidget* self); void volume_widget_update(VolumeWidget* self, gdouble update); void volume_widget_tidy_up (GtkWidget *widget); |