diff --git a/sflphone-client-gnome/src/config/audioconf.c b/sflphone-client-gnome/src/config/audioconf.c index ce85d94dea9343190aa00e5360259c7221f3c088..0d10ad09dad3879a96fb5590732aaf90f2b8d66b 100644 --- a/sflphone-client-gnome/src/config/audioconf.c +++ b/sflphone-client-gnome/src/config/audioconf.c @@ -631,6 +631,7 @@ select_audio_manager( void ) gtk_widget_show( alsa_conf ); gtk_widget_set_sensitive(GTK_WIDGET(alsa_conf), TRUE); gtk_widget_set_sensitive(GTK_WIDGET(pa_mute_widget), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (volumeToggle), TRUE); } else if( SHOW_ALSA_CONF && gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) )) { @@ -639,6 +640,7 @@ select_audio_manager( void ) gtk_container_remove( GTK_CONTAINER(alsa_conf) , alsabox ); gtk_widget_hide( alsa_conf ); gtk_widget_set_sensitive(GTK_WIDGET(pa_mute_widget), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (volumeToggle), FALSE); } else { DEBUG("alsa conf panel...nothing"); } diff --git a/sflphone-client-gnome/src/sflphone_const.h b/sflphone-client-gnome/src/sflphone_const.h index 09088573eaa5fa0adb0f0e4fe9e6ad0aa6dbd136..f12ed3f30c69bcabe02b79f0cc663f5d99f698b6 100644 --- a/sflphone-client-gnome/src/sflphone_const.h +++ b/sflphone-client-gnome/src/sflphone_const.h @@ -115,10 +115,10 @@ log4c_category_t* log4c_sfl_gtk_category; #define __POPUP_WINDOW ( dbus_popup_mode() ) /** Show/Hide the dialpad */ #define SHOW_DIALPAD ( dbus_get_dialpad() ) -/** Show/Hide the volume controls */ -#define SHOW_VOLUME ( dbus_get_volume_controls() ) /** Show/Hide the alsa configuration panel */ #define SHOW_ALSA_CONF ( dbus_get_audio_manager() == ALSA ) +/** Show/Hide the volume controls */ +#define SHOW_VOLUME (dbus_get_volume_controls() && SHOW_ALSA_CONF) /** Audio Managers */ #define ALSA 0 diff --git a/sflphone-client-gnome/src/ui.xml b/sflphone-client-gnome/src/ui.xml index 72b51160a1e691d1ac9a8da4772cd77c070aaa50..9e87507b7433d566f058e8fa9c334dd625ab223c 100644 --- a/sflphone-client-gnome/src/ui.xml +++ b/sflphone-client-gnome/src/ui.xml @@ -29,7 +29,7 @@ <menuitem action="Toolbar"/> <separator/> <menuitem action="Dialpad"/> - <menuitem action="VolumeControls"/> + <menuitem name="VolumeControlsToggle" action="VolumeControls"/> <separator/> <menuitem action="CallWindow"/> <menuitem action="History"/> diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c index 255e340d933f082ebf76c9396eb5014b6aee3be4..ec92ca548a5fd72a069219fee5495a5a356fecd5 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -1353,13 +1353,14 @@ GtkWidget* create_menus (GtkUIManager *ui_manager) recordAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/Record"); copyAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/EditMenu/Copy"); pasteAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/EditMenu/Paste"); + volumeToggle = gtk_ui_manager_get_widget (ui_manager, "/MenuBar/ViewMenu/VolumeControlsToggle"); // Set the toggle buttons gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Dialpad")), (gboolean)SHOW_DIALPAD); - gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/VolumeControls")), (gboolean) SHOW_VOLUME); + //gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/VolumeControls")), (gboolean) SHOW_VOLUME); - - // GtkWidget * newCallMenu; + gtk_widget_set_sensitive (GTK_WIDGET (volumeToggle), SHOW_ALSA_CONF); + gtk_widget_set_sensitive (GTK_WIDGET (gtk_ui_manager_get_widget (ui_manager, "/MenuBar/ViewMenu/Toolbar")), SHOW_ALSA_CONF); waitingLayer = create_waiting_icon (); gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), waitingLayer); diff --git a/sflphone-client-gnome/src/uimanager.h b/sflphone-client-gnome/src/uimanager.h index 3eeb42820a88ef2887c39e31307dd84a89471920..9958ddabb41d5c7aea553a068963ade853d49277 100644 --- a/sflphone-client-gnome/src/uimanager.h +++ b/sflphone-client-gnome/src/uimanager.h @@ -30,6 +30,8 @@ GtkWidget *historyButton; GtkWidget *contactButton; GtkWidget *currentCallsButton; +GtkWidget *volumeToggle; + gboolean uimanager_new (GtkUIManager**); G_END_DECLS