Skip to content
Snippets Groups Projects
Commit 460e89ca authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

[#1970] Disable volume controls when using pulseaudio

parent f54d4220
Branches
Tags
No related merge requests found
...@@ -631,6 +631,7 @@ select_audio_manager( void ) ...@@ -631,6 +631,7 @@ select_audio_manager( void )
gtk_widget_show( alsa_conf ); gtk_widget_show( alsa_conf );
gtk_widget_set_sensitive(GTK_WIDGET(alsa_conf), TRUE); 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(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) )) else if( SHOW_ALSA_CONF && gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) ))
{ {
...@@ -639,6 +640,7 @@ select_audio_manager( void ) ...@@ -639,6 +640,7 @@ select_audio_manager( void )
gtk_container_remove( GTK_CONTAINER(alsa_conf) , alsabox ); gtk_container_remove( GTK_CONTAINER(alsa_conf) , alsabox );
gtk_widget_hide( alsa_conf ); gtk_widget_hide( alsa_conf );
gtk_widget_set_sensitive(GTK_WIDGET(pa_mute_widget), TRUE); gtk_widget_set_sensitive(GTK_WIDGET(pa_mute_widget), TRUE);
gtk_widget_set_sensitive (GTK_WIDGET (volumeToggle), FALSE);
} else { } else {
DEBUG("alsa conf panel...nothing"); DEBUG("alsa conf panel...nothing");
} }
......
...@@ -115,10 +115,10 @@ log4c_category_t* log4c_sfl_gtk_category; ...@@ -115,10 +115,10 @@ log4c_category_t* log4c_sfl_gtk_category;
#define __POPUP_WINDOW ( dbus_popup_mode() ) #define __POPUP_WINDOW ( dbus_popup_mode() )
/** Show/Hide the dialpad */ /** Show/Hide the dialpad */
#define SHOW_DIALPAD ( dbus_get_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 */ /** Show/Hide the alsa configuration panel */
#define SHOW_ALSA_CONF ( dbus_get_audio_manager() == ALSA ) #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 */ /** Audio Managers */
#define ALSA 0 #define ALSA 0
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<menuitem action="Toolbar"/> <menuitem action="Toolbar"/>
<separator/> <separator/>
<menuitem action="Dialpad"/> <menuitem action="Dialpad"/>
<menuitem action="VolumeControls"/> <menuitem name="VolumeControlsToggle" action="VolumeControls"/>
<separator/> <separator/>
<menuitem action="CallWindow"/> <menuitem action="CallWindow"/>
<menuitem action="History"/> <menuitem action="History"/>
......
...@@ -1353,13 +1353,14 @@ GtkWidget* create_menus (GtkUIManager *ui_manager) ...@@ -1353,13 +1353,14 @@ GtkWidget* create_menus (GtkUIManager *ui_manager)
recordAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/Record"); recordAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/Record");
copyAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/EditMenu/Copy"); copyAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/EditMenu/Copy");
pasteAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/EditMenu/Paste"); 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 // 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/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);
gtk_widget_set_sensitive (GTK_WIDGET (volumeToggle), SHOW_ALSA_CONF);
// GtkWidget * newCallMenu; gtk_widget_set_sensitive (GTK_WIDGET (gtk_ui_manager_get_widget (ui_manager, "/MenuBar/ViewMenu/Toolbar")), SHOW_ALSA_CONF);
waitingLayer = create_waiting_icon (); waitingLayer = create_waiting_icon ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), waitingLayer); gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), waitingLayer);
......
...@@ -30,6 +30,8 @@ GtkWidget *historyButton; ...@@ -30,6 +30,8 @@ GtkWidget *historyButton;
GtkWidget *contactButton; GtkWidget *contactButton;
GtkWidget *currentCallsButton; GtkWidget *currentCallsButton;
GtkWidget *volumeToggle;
gboolean uimanager_new (GtkUIManager**); gboolean uimanager_new (GtkUIManager**);
G_END_DECLS G_END_DECLS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment