From e3550c53b92297fdaa84105c3fa9fd5b69d98e83 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 25 Mar 2011 11:12:52 +0000 Subject: defensive touches to update state method --- src/sound-service-dbus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 1b9d29e..ea96e6a 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -237,6 +237,12 @@ sound_service_dbus_update_sound_state (SoundServiceDbus* self, GError * error = NULL; + if (priv->connection == NULL || + g_dbus_connection_is_closed (priv->connection) == TRUE){ + g_warning ("sound_service_dbus_update_sound_state - connection no good !!"); + return; + } + g_debug ("emitting state signal with value %i", (int)new_state); g_dbus_connection_emit_signal( priv->connection, NULL, -- cgit v1.2.3 From 2053d2450e61d17f27ab47f67624b14dd4829589 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 25 Mar 2011 11:21:28 +0000 Subject: defensive touches to update state method --- src/sound-service-dbus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index ea96e6a..2f7e32c 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -252,9 +252,8 @@ sound_service_dbus_update_sound_state (SoundServiceDbus* self, v_output, &error ); if (error != NULL) { - g_error("Unable to emit signal 'sinkinputwhilemuted' because : %s", error->message); + g_error("Unable to emit signal because : %s", error->message); g_error_free(error); - return; } } -- cgit v1.2.3 From d6d917b02d2eff0855446d35da278a6f701a05c5 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 25 Mar 2011 11:34:52 +0000 Subject: g_critical not a g_error --- src/sound-service-dbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 2f7e32c..27de893 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -239,7 +239,7 @@ sound_service_dbus_update_sound_state (SoundServiceDbus* self, if (priv->connection == NULL || g_dbus_connection_is_closed (priv->connection) == TRUE){ - g_warning ("sound_service_dbus_update_sound_state - connection no good !!"); + g_critical ("sound_service_dbus_update_sound_state - connection no good !!"); return; } @@ -252,7 +252,7 @@ sound_service_dbus_update_sound_state (SoundServiceDbus* self, v_output, &error ); if (error != NULL) { - g_error("Unable to emit signal because : %s", error->message); + g_critical ("Unable to emit signal because : %s", error->message); g_error_free(error); } } -- cgit v1.2.3 From e1da450841a9a01883422dc1ff249ef3863eaee8 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 25 Mar 2011 11:55:49 +0000 Subject: more visibility on possible errors --- src/sound-service-dbus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 27de893..dc1fd94 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -239,7 +239,8 @@ sound_service_dbus_update_sound_state (SoundServiceDbus* self, if (priv->connection == NULL || g_dbus_connection_is_closed (priv->connection) == TRUE){ - g_critical ("sound_service_dbus_update_sound_state - connection no good !!"); + g_critical ("sound_service_dbus_update_sound_state - connection is %s !!", + priv->connection == NULL? "NULL" : "closed"); return; } -- cgit v1.2.3 From 037c5de036bcfa2cdd1ab2b151346e48ffda5445 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 29 Mar 2011 11:05:52 +0100 Subject: changed another error to a warning, tidied a few things --- src/mpris2-controller.vala | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 94c52c0..07ac9a2 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -45,19 +45,19 @@ public class Mpris2Controller : GLib.Object this.player = Bus.get_proxy_sync ( BusType.SESSION, this.owner.dbus_name, "/org/mpris/MediaPlayer2" ); + this.properties_interface = Bus.get_proxy_sync ( BusType.SESSION, + "org.freedesktop.Properties.PropertiesChanged", + "/org/mpris/MediaPlayer2" ); + this.properties_interface.PropertiesChanged.connect ( property_changed_cb ); if ( this.owner.use_playlists == true ){ this.playlists = Bus.get_proxy_sync ( BusType.SESSION, this.owner.dbus_name, "/org/mpris/MediaPlayer2" ); this.playlists.PlaylistChanged.connect (on_playlistdetails_changed); } - this.properties_interface = Bus.get_proxy_sync ( BusType.SESSION, - "org.freedesktop.Properties.PropertiesChanged", - "/org/mpris/MediaPlayer2" ); - this.properties_interface.PropertiesChanged.connect ( property_changed_cb ); } catch (IOError e) { - error("Problems connecting to the session bus - %s", e.message); + warning("Problems connecting to the session bus - %s", e.message); } } @@ -68,7 +68,7 @@ public class Mpris2Controller : GLib.Object //debug("properties-changed for interface %s and owner %s", interface_source, this.owner.dbus_name); if ( changed_properties == null || interface_source.has_prefix ( MPRIS_PREFIX ) == false ){ - warning("Property-changed hash is null or this is an interface that doesn't concerns us"); + warning("Property-changed hash is null or this is an interface that doesn't concern us"); return; } Variant? play_v = changed_properties.lookup("PlaybackStatus"); @@ -124,6 +124,7 @@ public class Mpris2Controller : GLib.Object private GLib.HashTable? clean_metadata() { GLib.HashTable changed_updates = this.player.Metadata; + Variant? artist_v = this.player.Metadata.lookup("xesam:artist"); if(artist_v != null){ Variant? v_artists = this.player.Metadata.lookup("xesam:artist"); -- cgit v1.2.3 From 2ae5e15affcad3bca3b1b0443cd4ad511e065d50 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 29 Mar 2011 11:43:34 +0100 Subject: changed to a critical as I think this would be more appropriate here --- src/mpris2-controller.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 07ac9a2..04ceb88 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -57,7 +57,7 @@ public class Mpris2Controller : GLib.Object } } catch (IOError e) { - warning("Problems connecting to the session bus - %s", e.message); + critical("Problems connecting to the session bus - %s", e.message); } } -- cgit v1.2.3 From 0a3977efd6bec63c3223d6d4973945caf7588031 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 1 Apr 2011 13:59:32 +0100 Subject: make sure that even if the service crashes there are no visual indications on the indicator (i.e. no two slider scenario ) --- src/indicator-sound.c | 9 ++++++++- src/sound-service-dbus.c | 13 +++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/indicator-sound.c b/src/indicator-sound.c index 042bf89..626f3b8 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -137,6 +137,7 @@ indicator_sound_init (IndicatorSound *self) IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(self); priv->volume_widget = NULL; + priv->voip_widget = NULL; priv->dbus_proxy = NULL; GList* t_list = NULL; priv->transport_widgets_list = t_list; @@ -407,8 +408,14 @@ new_volume_slider_widget(DbusmenuMenuitem * newitem, g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE); 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)); + + if (priv->volume_widget != NULL){ + volume_widget_tidy_up (priv->volume_widget); + gtk_widget_destroy (priv->volume_widget); + priv->volume_widget = NULL; + } + volume_widget = volume_widget_new (newitem, io); priv->volume_widget = volume_widget; GtkWidget* ido_slider_widget = volume_widget_get_ido_slider(VOLUME_WIDGET(priv->volume_widget)); diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index dc1fd94..a22e648 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -164,13 +164,10 @@ sound_service_dbus_build_sound_menu ( SoundServiceDbus* self, { SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self); - // Mute button - // TODO this additions should be fixed position, i.e. add via position and not just append - // be explicit as it is fixed. - dbusmenu_menuitem_child_append (priv->root_menuitem, mute_item); - dbusmenu_menuitem_child_append (priv->root_menuitem, slider_item); - g_debug ("just about to add the slider %i", DBUSMENU_IS_MENUITEM(slider_item)); - dbusmenu_menuitem_child_append (priv->root_menuitem, voip_input_menu_item); + // Mute, Volume and Voip widgets + dbusmenu_menuitem_child_add_position (priv->root_menuitem, mute_item, 0); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, slider_item, 1); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, voip_input_menu_item, 2); // Separator DbusmenuMenuitem* separator = dbusmenu_menuitem_new(); @@ -178,7 +175,7 @@ sound_service_dbus_build_sound_menu ( SoundServiceDbus* self, dbusmenu_menuitem_property_set (separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); - dbusmenu_menuitem_child_append(priv->root_menuitem, separator); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, separator, 3); g_object_unref (separator); // Sound preferences dialog -- cgit v1.2.3 From 15c7802a9f753b0d06e7690ae24402644cd12bfe Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 4 Apr 2011 11:55:31 +0100 Subject: tweaked to handle banshee desktop name change now that is finally in natty --- configure.ac | 4 ++-- data/com.canonical.indicators.sound.gschema.xml | 2 +- src/player-controller.vala | 4 ++-- src/settings-manager.vala | 3 +++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index ac460cb..b628136 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(indicator-sound, 0.6.5.1, conor.curran@canonical.com) +AC_INIT(indicator-sound, 0.6.6.1, conor.curran@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-sound, 0.6.5.1) +AM_INIT_AUTOMAKE(indicator-sound, 0.6.6.1) AM_MAINTAINER_MODE diff --git a/data/com.canonical.indicators.sound.gschema.xml b/data/com.canonical.indicators.sound.gschema.xml index 1e08269..dc63bcb 100644 --- a/data/com.canonical.indicators.sound.gschema.xml +++ b/data/com.canonical.indicators.sound.gschema.xml @@ -11,7 +11,7 @@ A list of applications which at some point have registered with the sound menu - [ 'banshee-1' ] + [ 'banshee' ] Each media player which abides by the MPRIS2 spec will automatically appear in the menu. This array should contain the desktop file names (minus .desktop suffix) of applications which diff --git a/src/player-controller.vala b/src/player-controller.vala index 86dfe9b..20479d9 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -150,12 +150,12 @@ public class PlayerController : GLib.Object playlists_menuitem.root_item.property_set_bool (MENUITEM_PROP_VISIBLE, false ); this.custom_items[widget_order.TRANSPORT].property_set_bool (MENUITEM_PROP_VISIBLE, - this.app_info.get_id() == "banshee-1.desktop"); + this.app_info.get_id() == "banshee.desktop"); return; } this.custom_items[widget_order.METADATA].property_set_bool (MENUITEM_PROP_VISIBLE, this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format())); - if (this.app_info.get_id() == "banshee-1.desktop"){ + if (this.app_info.get_id() == "banshee.desktop"){ TransportMenuitem transport = this.custom_items[widget_order.TRANSPORT] as TransportMenuitem; transport.handle_cached_action(); } diff --git a/src/settings-manager.vala b/src/settings-manager.vala index 7acc3b1..1b99cbc 100644 --- a/src/settings-manager.vala +++ b/src/settings-manager.vala @@ -41,6 +41,9 @@ public class SettingsManager : GLib.Object var interested = this.settings.get_strv ("interested-media-players"); var list = new ArrayList(); foreach(var s in interested){ + if (s == "banshee-1"){ + s = "banshee"; + } if (s in list) continue; if (s in blacklisted) continue; list.add(s); -- cgit v1.2.3