Merge lp:~cjcurran/indicator-sound/graceful-crashing into lp:~indicator-applet-developers/indicator-sound/trunk_3

Proposed by Conor Curran on 2011-04-01
Status: Merged
Approved by: Conor Curran on 2011-04-01
Approved revision: 236
Merged at revision: 236
Proposed branch: lp:~cjcurran/indicator-sound/graceful-crashing
Merge into: lp:~indicator-applet-developers/indicator-sound/trunk_3
Diff against target: 58 lines (+13/-9)
2 files modified
src/indicator-sound.c (+8/-1)
src/sound-service-dbus.c (+5/-8)
To merge this branch: bzr merge lp:~cjcurran/indicator-sound/graceful-crashing
Reviewer Review Type Date Requested Status
David Barth 2011-04-01 Approve on 2011-04-01
Review via email: mp+55970@code.launchpad.net

Description of the change

Ensures that if the service crashes the slider count should remain at 0

To post a comment you must log in.
David Barth (dbarth) wrote :

Looks like a safe change

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/indicator-sound.c'
2--- src/indicator-sound.c 2011-03-21 13:04:13 +0000
3+++ src/indicator-sound.c 2011-04-01 16:35:40 +0000
4@@ -137,6 +137,7 @@
5
6 IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(self);
7 priv->volume_widget = NULL;
8+ priv->voip_widget = NULL;
9 priv->dbus_proxy = NULL;
10 GList* t_list = NULL;
11 priv->transport_widgets_list = t_list;
12@@ -407,8 +408,14 @@
13 g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE);
14
15 io = g_object_get_data (G_OBJECT (client), "indicator");
16+ IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(INDICATOR_SOUND (io));
17+
18+ if (priv->volume_widget != NULL){
19+ volume_widget_tidy_up (priv->volume_widget);
20+ gtk_widget_destroy (priv->volume_widget);
21+ priv->volume_widget = NULL;
22+ }
23 volume_widget = volume_widget_new (newitem, io);
24- IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(INDICATOR_SOUND (io));
25 priv->volume_widget = volume_widget;
26
27 GtkWidget* ido_slider_widget = volume_widget_get_ido_slider(VOLUME_WIDGET(priv->volume_widget));
28
29=== modified file 'src/sound-service-dbus.c'
30--- src/sound-service-dbus.c 2011-03-25 11:55:49 +0000
31+++ src/sound-service-dbus.c 2011-04-01 16:35:40 +0000
32@@ -164,13 +164,10 @@
33 {
34 SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self);
35
36- // Mute button
37- // TODO this additions should be fixed position, i.e. add via position and not just append
38- // be explicit as it is fixed.
39- dbusmenu_menuitem_child_append (priv->root_menuitem, mute_item);
40- dbusmenu_menuitem_child_append (priv->root_menuitem, slider_item);
41- g_debug ("just about to add the slider %i", DBUSMENU_IS_MENUITEM(slider_item));
42- dbusmenu_menuitem_child_append (priv->root_menuitem, voip_input_menu_item);
43+ // Mute, Volume and Voip widgets
44+ dbusmenu_menuitem_child_add_position (priv->root_menuitem, mute_item, 0);
45+ dbusmenu_menuitem_child_add_position (priv->root_menuitem, slider_item, 1);
46+ dbusmenu_menuitem_child_add_position (priv->root_menuitem, voip_input_menu_item, 2);
47
48 // Separator
49 DbusmenuMenuitem* separator = dbusmenu_menuitem_new();
50@@ -178,7 +175,7 @@
51 dbusmenu_menuitem_property_set (separator,
52 DBUSMENU_MENUITEM_PROP_TYPE,
53 DBUSMENU_CLIENT_TYPES_SEPARATOR);
54- dbusmenu_menuitem_child_append(priv->root_menuitem, separator);
55+ dbusmenu_menuitem_child_add_position (priv->root_menuitem, separator, 3);
56 g_object_unref (separator);
57
58 // Sound preferences dialog

Subscribers

People subscribed via source and target branches