diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2011-02-24 11:30:23 -0500 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2011-02-24 11:30:23 -0500 |
commit | 4eea1b645a81b5fa99963b3d9c8353a545b68232 (patch) | |
tree | 9b3351ecfd515a759ee426c748741cc9dfec058d /src/volume-widget.c | |
parent | 4e7c1ace33165d7a658c1ee5f688ab1e4d8ca01a (diff) | |
parent | d3690d4cb191711ae77abb3b599d1a02b7fcd1df (diff) | |
download | ayatana-indicator-sound-4eea1b645a81b5fa99963b3d9c8353a545b68232.tar.gz ayatana-indicator-sound-4eea1b645a81b5fa99963b3d9c8353a545b68232.tar.bz2 ayatana-indicator-sound-4eea1b645a81b5fa99963b3d9c8353a545b68232.zip |
releasing version 0.6.1-0ubuntu1
Diffstat (limited to 'src/volume-widget.c')
-rw-r--r-- | src/volume-widget.c | 23 |
1 files changed, 21 insertions, 2 deletions
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; } |