diff options
| author | Conor Curran <conor.curran@canonical.com> | 2011-02-24 15:38:08 +0000 |
|---|---|---|
| committer | Conor Curran <conor.curran@canonical.com> | 2011-02-24 15:38:08 +0000 |
| commit | e875afacb717a55953d29746bff148e4d3083db0 (patch) | |
| tree | 4e1e31d13c1ac538beff9c0f46059dc8fb2955a1 /src/volume-widget.c | |
| parent | fec38bea8091cc778bdbb236ed4c854b9cdcb34d (diff) | |
| parent | 3cf118604d0ed973ac4cad4499ac8bed8d000360 (diff) | |
| download | ayatana-indicator-sound-e875afacb717a55953d29746bff148e4d3083db0.tar.gz ayatana-indicator-sound-e875afacb717a55953d29746bff148e4d3083db0.tar.bz2 ayatana-indicator-sound-e875afacb717a55953d29746bff148e4d3083db0.zip | |
merge Luke's work
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; } |
