aboutsummaryrefslogtreecommitdiff
path: root/src/dbus-menu-manager.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2010-08-18 15:51:01 +0200
committerSebastien Bacher <seb128@ubuntu.com>2010-08-18 15:51:01 +0200
commitb4d305f16bae6804dcf2acf8b9ecc4629807c150 (patch)
treedefa24d440ac7380e17acdee738674022001f6e2 /src/dbus-menu-manager.c
parent986fc648fc6544aaa3bb40a17e1345e0247a4b57 (diff)
downloadayatana-indicator-sound-b4d305f16bae6804dcf2acf8b9ecc4629807c150.tar.gz
ayatana-indicator-sound-b4d305f16bae6804dcf2acf8b9ecc4629807c150.tar.bz2
ayatana-indicator-sound-b4d305f16bae6804dcf2acf8b9ecc4629807c150.zip
Import upstream version 0.4.0
Diffstat (limited to 'src/dbus-menu-manager.c')
-rw-r--r--src/dbus-menu-manager.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/dbus-menu-manager.c b/src/dbus-menu-manager.c
index 4cd4a6b..6f0af9e 100644
--- a/src/dbus-menu-manager.c
+++ b/src/dbus-menu-manager.c
@@ -31,6 +31,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "sound-service-dbus.h"
#include "pulse-manager.h"
#include "slider-menu-item.h"
+#include "common-defs.h"
#include "dbus-shared-names.h"
@@ -74,13 +75,15 @@ DbusmenuMenuitem* dbus_menu_manager_setup()
return root_menuitem;
}
-/**
-teardown:
-**/
-void dbus_menu_manager_teardown()
+
+void dbus_menu_manager_update_volume(gdouble volume)
{
- //TODO tidy up dbus_interface and items!
+ GValue value = {0};
+ g_value_init(&value, G_TYPE_DOUBLE);
+ g_value_set_double(&value, volume);
+ dbusmenu_menuitem_property_set_value(DBUSMENU_MENUITEM(volume_slider_menuitem), DBUSMENU_VOLUME_MENUITEM_LEVEL, &value);
}
+
/**
update_pa_state:
@@ -102,7 +105,7 @@ void dbus_menu_manager_update_pa_state(gboolean pa_state, gboolean sink_availabl
// Emit the signals after the menus are setup/torn down
// preserve ordering !
sound_service_dbus_update_sink_availability(dbus_interface, sink_available);
- sound_service_dbus_update_sink_volume(dbus_interface, percent);
+ dbus_menu_manager_update_volume(percent);
sound_service_dbus_update_sink_mute(dbus_interface, sink_muted);
dbus_menu_manager_update_mute_ui(b_all_muted);
}
@@ -123,7 +126,6 @@ void dbus_menu_manager_update_mute_ui(gboolean incoming_mute_value)
/*-------------------------------------------------------------------------*/
// Private Methods
/*-------------------------------------------------------------------------*/
-
static void refresh_menu()
{
g_debug("in the refresh menu method");
@@ -172,7 +174,7 @@ Bring up the gnome volume preferences dialog
static void show_sound_settings_dialog (DbusmenuMenuitem *mi, gpointer user_data)
{
GError * error = NULL;
- if (!g_spawn_command_line_async("gnome-volume-control", &error) &&
+ if (!g_spawn_command_line_async("gnome-volume-control --page=applications", &error) &&
!g_spawn_command_line_async("xfce4-mixer", &error))
{
g_warning("Unable to show dialog: %s", error->message);