aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-04-04 09:46:34 +0100
committerConor Curran <conor.curran@canonical.com>2011-04-04 09:46:34 +0100
commitd265dea2d8208e83053f1c3694a7889146513f1b (patch)
treee510106c1a52e602d2c516dee5efebb82da8cd4b
parent73827ae57eb2027121e71a85af1858cc59fd5943 (diff)
parent0a3977efd6bec63c3223d6d4973945caf7588031 (diff)
downloadayatana-indicator-sound-d265dea2d8208e83053f1c3694a7889146513f1b.tar.gz
ayatana-indicator-sound-d265dea2d8208e83053f1c3694a7889146513f1b.tar.bz2
ayatana-indicator-sound-d265dea2d8208e83053f1c3694a7889146513f1b.zip
ensure that there are no visual traces of the service crashing
-rw-r--r--src/indicator-sound.c15
-rw-r--r--src/sound-service-dbus.c13
2 files changed, 19 insertions, 9 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 042bf89..5002463 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));
@@ -452,6 +459,12 @@ new_voip_slider_widget (DbusmenuMenuitem * newitem,
io = g_object_get_data (G_OBJECT (client), "indicator");
IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(INDICATOR_SOUND (io));
+ if (priv->voip_widget != NULL){
+ voip_input_widget_tidy_up (priv->voip_widget);
+ gtk_widget_destroy (priv->voip_widget);
+ priv->voip_widget = NULL;
+ }
+
voip_widget = voip_input_widget_new (newitem);
priv->voip_widget = voip_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