diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-02-04 14:23:07 -0800 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-02-04 14:23:07 -0800 |
commit | 376fe0533e28a5fedca53c4ac154dd9a86e0c6e4 (patch) | |
tree | 270d51542015d99d19f76a5d1c5898fed9bb3432 /src/sound-service.c | |
parent | 9099e09f7a3e60da031bdd48b69f07d283d6d599 (diff) | |
download | ayatana-indicator-sound-376fe0533e28a5fedca53c4ac154dd9a86e0c6e4.tar.gz ayatana-indicator-sound-376fe0533e28a5fedca53c4ac154dd9a86e0c6e4.tar.bz2 ayatana-indicator-sound-376fe0533e28a5fedca53c4ac154dd9a86e0c6e4.zip |
merged in dbarth's gnome volume control work
Diffstat (limited to 'src/sound-service.c')
-rw-r--r-- | src/sound-service.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sound-service.c b/src/sound-service.c index 5fe074c..7cf065c 100644 --- a/src/sound-service.c +++ b/src/sound-service.c @@ -55,7 +55,17 @@ static gboolean idle_routine (gpointer data) { return FALSE; } + +static void show_sound_settings_dialog (DbusmenuMenuitem *mi, gpointer user_data) +{ + GError * error = NULL; + if (!g_spawn_command_line_async("gnome-volume-control", &error)) + { + g_warning("Unable to show dialog: %s", error->message); + g_error_free(error); + } +} /** Build the DBus menu items. For now Mute all/Unmute is the only available option **/ @@ -72,6 +82,16 @@ static void rebuild_sound_menu(DbusmenuMenuitem *root, SoundServiceDbus *service volume_slider_menuitem = slider_menu_item_new(b_sink_available, volume_percent); dbusmenu_menuitem_child_append(root, mute_all_menuitem); dbusmenu_menuitem_child_append(root, DBUSMENU_MENUITEM(volume_slider_menuitem)); + + DbusmenuMenuitem *separator = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); + dbusmenu_menuitem_child_append(root, separator); + DbusmenuMenuitem *settings_mi = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(settings_mi, DBUSMENU_MENUITEM_PROP_LABEL, + _("Sound Preferences...")); + dbusmenu_menuitem_child_append(root, settings_mi); + g_signal_connect(G_OBJECT(settings_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, + G_CALLBACK(show_sound_settings_dialog), NULL); } static void set_global_mute() |