aboutsummaryrefslogtreecommitdiff
path: root/src/volume-widget.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-09-14 18:21:02 +0100
committerConor Curran <conor.curran@canonical.com>2010-09-14 18:21:02 +0100
commit484518d33c44914196f85c19b92f3fac07d1b2e0 (patch)
tree7d7322dbcdba2987b5c515377ecee1daec032876 /src/volume-widget.c
parentedb20cb04d9f977c7ddf70f6edc707546e2997c0 (diff)
downloadayatana-indicator-sound-484518d33c44914196f85c19b92f3fac07d1b2e0.tar.gz
ayatana-indicator-sound-484518d33c44914196f85c19b92f3fac07d1b2e0.tar.bz2
ayatana-indicator-sound-484518d33c44914196f85c19b92f3fac07d1b2e0.zip
indicator should handle any service problems gracefully
Diffstat (limited to 'src/volume-widget.c')
-rw-r--r--src/volume-widget.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/volume-widget.c b/src/volume-widget.c
index 5e7cf9f..1cfdcc4 100644
--- a/src/volume-widget.c
+++ b/src/volume-widget.c
@@ -61,6 +61,7 @@ static void volume_widget_parent_changed (GtkWidget *widget, gpointer user_data)
G_DEFINE_TYPE (VolumeWidget, volume_widget, G_TYPE_OBJECT);
+
static void
volume_widget_class_init (VolumeWidgetClass *klass)
{
@@ -201,8 +202,6 @@ volume_widget_update(VolumeWidget* self, gdouble update)
dbusmenu_menuitem_handle_event (priv->twin_item, "update", &value, 0);
}
-
-
GtkWidget*
volume_widget_get_ido_slider(VolumeWidget* self)
{
@@ -234,6 +233,24 @@ volume_widget_slider_released(GtkWidget *widget, gpointer user_data)
priv->grabbed = FALSE;
}
+void
+volume_widget_tidy_up (GtkWidget *widget)
+{
+ VolumeWidget* mitem = VOLUME_WIDGET(widget);
+ VolumeWidgetPrivate * priv = VOLUME_WIDGET_GET_PRIVATE(mitem);
+ gtk_widget_destroy (priv->ido_volume_slider);
+}
+
+gdouble
+volume_widget_get_current_volume ( GtkWidget *widget )
+{
+ VolumeWidget* mitem = VOLUME_WIDGET(widget);
+ VolumeWidgetPrivate * priv = VOLUME_WIDGET_GET_PRIVATE(mitem);
+ gdouble vol = g_value_get_double ( dbusmenu_menuitem_property_get_value( priv->twin_item,
+ DBUSMENU_VOLUME_MENUITEM_LEVEL));
+ return vol;
+}
+
/**
* volume_widget_new:
* @returns: a new #VolumeWidget.