From 165dad49ccada35cdff74ae9692e9b5f6ec43a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 7 Nov 2011 04:07:52 +0100 Subject: Indicator-sound: Added the "indicator-sound" name hint. --- src/indicator-sound.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/indicator-sound.c b/src/indicator-sound.c index 7c72900..ee90647 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -74,6 +74,7 @@ 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 const gchar * get_name_hint (IndicatorObject * io); static void indicator_sound_scroll (IndicatorObject * io, IndicatorObjectEntry * entry, gint delta, IndicatorScrollDirection direction); @@ -133,6 +134,7 @@ indicator_sound_class_init (IndicatorSoundClass *klass) io_class->get_image = get_icon; io_class->get_menu = get_menu; io_class->get_accessible_desc = get_accessible_desc; + io_class->get_name_hint = get_name_hint; io_class->entry_scrolled = indicator_sound_scroll; io_class->secondary_activate = indicator_sound_middle_click; } @@ -241,6 +243,10 @@ get_accessible_desc (IndicatorObject * io) return NULL; } +static const gchar * get_name_hint (IndicatorObject * io) +{ + return "indicator-sound"; +} static void connection_changed (IndicatorServiceManager * sm, -- cgit v1.2.3 From 108af6c38c4723a2d911cdb0c980d0b71140164b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 8 Nov 2011 22:59:16 +0100 Subject: Fix memory leak caused by updating the accessible description value The accessible description string was duplicated every time that was updated, and never free'd. This commit fixes this. --- src/indicator-sound.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/indicator-sound.c b/src/indicator-sound.c index ee90647..8e2cb1a 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -54,6 +54,7 @@ struct _IndicatorSoundPrivate GList* transport_widgets_list; GDBusProxy *dbus_proxy; SoundStateManager* state_manager; + gchar *cached_accessible_desc; }; #define INDICATOR_SOUND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_SOUND_TYPE, IndicatorSoundPrivate)) @@ -154,6 +155,7 @@ indicator_sound_init (IndicatorSound *self) GList* t_list = NULL; priv->transport_widgets_list = t_list; priv->state_manager = g_object_new (SOUND_TYPE_STATE_MANAGER, NULL); + priv->cached_accessible_desc = NULL; g_signal_connect ( G_OBJECT(self->service), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, @@ -170,17 +172,23 @@ indicator_sound_dispose (GObject *object) g_object_unref(G_OBJECT(self->service)); self->service = NULL; } - g_list_free ( priv->transport_widgets_list ); + g_list_free (priv->transport_widgets_list); G_OBJECT_CLASS (indicator_sound_parent_class)->dispose (object); - return; } static void indicator_sound_finalize (GObject *object) { + IndicatorSound * self = INDICATOR_SOUND(object); + IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(self); + + if (priv->cached_accessible_desc) { + g_free (priv->cached_accessible_desc); + priv->cached_accessible_desc = NULL; + } + G_OBJECT_CLASS (indicator_sound_parent_class)->finalize (object); - return; } static GtkLabel * @@ -236,16 +244,19 @@ 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)); + if (priv->volume_widget != NULL) { + gchar *old_desc = priv->cached_accessible_desc; + priv->cached_accessible_desc = g_strdup_printf(_("Volume (%'.0f%%)"), volume_widget_get_current_volume (priv->volume_widget)); + g_free (old_desc); + return priv->cached_accessible_desc; } return NULL; } -static const gchar * get_name_hint (IndicatorObject * io) +static const gchar *get_name_hint (IndicatorObject * io) { - return "indicator-sound"; + return PACKAGE_NAME; } static void -- cgit v1.2.3 From f497b26cef11458a013d8ad2189534963a62cf19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 8 Nov 2011 23:16:35 +0100 Subject: Better code to fix the memory leak caused by the accessible string Now everythig is done on update_accessible_desc --- src/indicator-sound.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/indicator-sound.c b/src/indicator-sound.c index 8e2cb1a..80d9ce0 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -54,7 +54,7 @@ struct _IndicatorSoundPrivate GList* transport_widgets_list; GDBusProxy *dbus_proxy; SoundStateManager* state_manager; - gchar *cached_accessible_desc; + gchar *accessible_desc; }; #define INDICATOR_SOUND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_SOUND_TYPE, IndicatorSoundPrivate)) @@ -155,7 +155,7 @@ indicator_sound_init (IndicatorSound *self) GList* t_list = NULL; priv->transport_widgets_list = t_list; priv->state_manager = g_object_new (SOUND_TYPE_STATE_MANAGER, NULL); - priv->cached_accessible_desc = NULL; + priv->accessible_desc = NULL; g_signal_connect ( G_OBJECT(self->service), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, @@ -183,9 +183,9 @@ indicator_sound_finalize (GObject *object) IndicatorSound * self = INDICATOR_SOUND(object); IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(self); - if (priv->cached_accessible_desc) { - g_free (priv->cached_accessible_desc); - priv->cached_accessible_desc = NULL; + if (priv->accessible_desc) { + g_free (priv->accessible_desc); + priv->accessible_desc = NULL; } G_OBJECT_CLASS (indicator_sound_parent_class)->finalize (object); @@ -243,15 +243,7 @@ static const gchar * get_accessible_desc (IndicatorObject * io) { IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(io); - - if (priv->volume_widget != NULL) { - gchar *old_desc = priv->cached_accessible_desc; - priv->cached_accessible_desc = g_strdup_printf(_("Volume (%'.0f%%)"), volume_widget_get_current_volume (priv->volume_widget)); - g_free (old_desc); - return priv->cached_accessible_desc; - } - - return NULL; + return priv->accessible_desc; } static const gchar *get_name_hint (IndicatorObject * io) @@ -742,7 +734,7 @@ static void indicator_sound_middle_click (IndicatorObject * io, IndicatorObjectEntry * entry, guint time, gpointer data) { - IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(INDICATOR_SOUND (io)); + IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(io); g_return_if_fail (priv); mute_widget_toggle(priv->mute_widget); @@ -751,9 +743,23 @@ indicator_sound_middle_click (IndicatorObject * io, IndicatorObjectEntry * entry void update_accessible_desc (IndicatorObject * io) { + IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(io); GList *entries = indicator_object_get_entries(io); IndicatorObjectEntry * entry = (IndicatorObjectEntry *)entries->data; - entry->accessible_desc = get_accessible_desc(io); + + gchar *old_desc = priv->accessible_desc; + + if (priv->volume_widget) { + priv->accessible_desc = g_strdup_printf(_("Volume (%'.0f%%)"), + volume_widget_get_current_volume (priv->volume_widget)); + } + else { + priv->accessible_desc = NULL; + } + + entry->accessible_desc = priv->accessible_desc; + g_free (old_desc); + g_signal_emit(G_OBJECT(io), INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, 0, -- cgit v1.2.3 From 9272abc2956c822f25f88aaae1c20f06c0540559 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 16 Nov 2011 18:11:20 +0000 Subject: fix the collision detection --- src/transport-widget.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transport-widget.c b/src/transport-widget.c index c535e00..2d1a7f2 100644 --- a/src/transport-widget.c +++ b/src/transport-widget.c @@ -561,15 +561,15 @@ transport_widget_collision_detection ( gint x, { TransportAction event = TRANSPORT_ACTION_NO_ACTION; - if (x > 67 && x < 112 + if (x > 57 && x < 102 && y > 12 && y < 40){ event = TRANSPORT_ACTION_PREVIOUS; } - else if (x > 111 && x < 153 + else if (x > 101 && x < 143 && y > 5 && y < 47){ event = TRANSPORT_ACTION_PLAY_PAUSE; } - else if (x > 152 && x < 197 + else if (x > 142 && x < 187 && y > 12 && y < 40){ event = TRANSPORT_ACTION_NEXT; } -- cgit v1.2.3 From 15b78696682283776aac8cb93a6477fec3ef330c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 17 Nov 2011 03:08:15 +0100 Subject: Don't show the notify-osd notification on scroll, when the menu is mapped Future versions of unity-panel-service should support scroll events when the indicators menus are mapped, this would lead to an inconsistency in indicator-sound. In fact both the slider and the notify osd would be shown. This commit fixes this potential issue, disabling notify-osd notifications when the indicator-sound menu is mapped. --- src/indicator-sound.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/indicator-sound.c b/src/indicator-sound.c index 7c72900..0c4f740 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -718,7 +718,8 @@ indicator_sound_scroll (IndicatorObject * io, IndicatorObjectEntry * entry, //g_debug("indicator-sound-scroll - update slider with value %f", value); volume_widget_update(VOLUME_WIDGET(priv->volume_widget), value, "scroll updates"); - sound_state_manager_show_notification (priv->state_manager, value); + if (!gtk_widget_get_mapped(GTK_WIDGET (entry->menu))) + sound_state_manager_show_notification (priv->state_manager, value); } static void -- cgit v1.2.3 From 04da26d934e7804d925cea11fc9b2700d5f274d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Ball=C3=B3?= Date: Wed, 23 Nov 2011 02:41:35 +0100 Subject: Do not check for gconf --- configure.ac | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/configure.ac b/configure.ac index 5ee885a..e36dfad 100644 --- a/configure.ac +++ b/configure.ac @@ -89,16 +89,6 @@ AC_SUBST(APPLET_LIBS) AC_SUBST(SOUNDSERVICE_CFLAGS) AC_SUBST(SOUNDSERVICE_LIBS) -AC_PATH_PROG(GCONFTOOL, gconftool-2) -dnl Specify the gconf configuration source, -dnl default to xml::$(sysconfdir)/gconf/gconf.xml.defaults - -AM_GCONF_SOURCE_2 - -PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.0) -AC_SUBST(GCONF_CFLAGS) -AC_SUBST(GCONF_LIBS) - ########################### # Check to see if we're local ########################### -- cgit v1.2.3 From be80e257f60d48a8892abdd70d405f67aea45636 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 1 Dec 2011 17:19:30 +0000 Subject: fixes lp #886339 --- src/indicator-sound.c | 6 ++++-- src/volume-widget.c | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/indicator-sound.c b/src/indicator-sound.c index f45d926..b953449 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -419,6 +419,9 @@ new_volume_slider_widget(DbusmenuMenuitem * newitem, } volume_widget = volume_widget_new (newitem, io); priv->volume_widget = volume_widget; + // Don't forget to set the accessible desc. + update_accessible_desc (io); + GtkWidget* ido_slider_widget = volume_widget_get_ido_slider(VOLUME_WIDGET(priv->volume_widget)); @@ -759,8 +762,7 @@ update_accessible_desc (IndicatorObject * io) } entry->accessible_desc = priv->accessible_desc; - g_free (old_desc); - + g_free (old_desc); g_signal_emit(G_OBJECT(io), INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, 0, diff --git a/src/volume-widget.c b/src/volume-widget.c index e8e7bae..f2bf6ed 100644 --- a/src/volume-widget.c +++ b/src/volume-widget.c @@ -195,7 +195,6 @@ volume_widget_set_twin_item(VolumeWidget* self, initial_level = 0; } gtk_range_set_value(range, initial_level); - update_accessible_desc(priv->indicator); } static gboolean -- cgit v1.2.3 From 13810cb4d5c5c6c88977a25a89538e473a92297d Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 1 Dec 2011 17:44:13 +0000 Subject: bumped for 0792 release --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index e36dfad..37da03d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(indicator-sound, 0.7.9.1, conor.curran@canonical.com) +AC_INIT(indicator-sound, 0.7.9.2, conor.curran@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-sound, 0.7.9.1) +AM_INIT_AUTOMAKE(indicator-sound, 0.7.9.2) AM_MAINTAINER_MODE -- cgit v1.2.3 From 048fe88d783124358184248e33100caf9d6af82d Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 1 Dec 2011 18:32:22 +0000 Subject: bumped to .8 for precise releases --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 37da03d..0e88562 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(indicator-sound, 0.7.9.2, conor.curran@canonical.com) +AC_INIT(indicator-sound, 0.8.0.0, conor.curran@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-sound, 0.7.9.2) +AM_INIT_AUTOMAKE(indicator-sound, 0.8.0.0) AM_MAINTAINER_MODE -- cgit v1.2.3