Commit 6a9ec135 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

[#1970] Volume controls disable when using pulseaudio

parent b0256c5e
...@@ -631,7 +631,8 @@ select_audio_manager( void ) ...@@ -631,7 +631,8 @@ 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);
gtk_action_set_sensitive (GTK_ACTION (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) ))
{ {
...@@ -640,7 +641,13 @@ select_audio_manager( void ) ...@@ -640,7 +641,13 @@ 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); if (gtk_toggle_action_get_active ( GTK_TOGGLE_ACTION (volumeToggle)))
{
main_window_volume_controls(FALSE);
dbus_set_volume_controls (FALSE);
gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (volumeToggle), FALSE);
}
gtk_action_set_sensitive (GTK_ACTION (volumeToggle), FALSE);
} else { } else {
DEBUG("alsa conf panel...nothing"); DEBUG("alsa conf panel...nothing");
} }
......
...@@ -183,8 +183,7 @@ create_main_window () ...@@ -183,8 +183,7 @@ create_main_window ()
ret = uimanager_new (&ui_manager); ret = uimanager_new (&ui_manager);
if (!ret) if (!ret)
{ {
//show_error_dialog (GTK_WINDOW (window), error->message, ERROR ("Could not load xml GUI\n");
// _("Could not load ui.xml. The program may be not properly installed"));
g_error_free (error); g_error_free (error);
exit (1); exit (1);
} }
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
<menuitem action="Toolbar"/> <menuitem action="Toolbar"/>
<separator/> <separator/>
<menuitem action="Dialpad"/> <menuitem action="Dialpad"/>
<menuitem name="VolumeControlsToggle" action="VolumeControls"/> <!--menuitem name="VolumeControlsToggle" action="VolumeControls"/-->
<menuitem action="VolumeControls"/>
<separator/> <separator/>
<menuitem action="CallWindow"/> <menuitem action="CallWindow"/>
<menuitem action="History"/> <menuitem action="History"/>
......
...@@ -350,15 +350,18 @@ void update_actions() ...@@ -350,15 +350,18 @@ void update_actions()
static void volume_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data) static void volume_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data)
{ {
gboolean toggled = gtk_toggle_action_get_active (togglemenuitem); gboolean toggled = gtk_toggle_action_get_active (togglemenuitem);
g_print ("%i\n", toggled);
main_window_volume_controls(toggled); main_window_volume_controls(toggled);
dbus_set_volume_controls(toggled); if (toggled || SHOW_VOLUME)
dbus_set_volume_controls(toggled);
} }
static void dialpad_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data) static void dialpad_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data)
{ {
gboolean toggled = gtk_toggle_action_get_active (togglemenuitem); gboolean toggled = gtk_toggle_action_get_active (togglemenuitem);
main_window_dialpad(toggled); main_window_dialpad(toggled);
dbus_set_dialpad(toggled); if (toggled || SHOW_DIALPAD)
dbus_set_dialpad(toggled);
} }
static void help_contents_cb (GtkAction *action) static void help_contents_cb (GtkAction *action)
...@@ -1353,14 +1356,16 @@ GtkWidget* create_menus (GtkUIManager *ui_manager) ...@@ -1353,14 +1356,16 @@ 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"); volumeToggle = gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/VolumeControls");
// 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 (volumeToggle), (gboolean) SHOW_VOLUME);
gtk_widget_set_sensitive (GTK_WIDGET (volumeToggle), SHOW_ALSA_CONF); gtk_action_set_sensitive (GTK_ACTION (volumeToggle), SHOW_ALSA_CONF);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_ui_manager_get_widget (ui_manager, "/MenuBar/ViewMenu/Toolbar")), SHOW_ALSA_CONF);
// Disable it right now
gtk_action_set_sensitive (GTK_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Toolbar")), FALSE);
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,7 +30,7 @@ GtkWidget *historyButton; ...@@ -30,7 +30,7 @@ GtkWidget *historyButton;
GtkWidget *contactButton; GtkWidget *contactButton;
GtkWidget *currentCallsButton; GtkWidget *currentCallsButton;
GtkWidget *volumeToggle; GtkAction *volumeToggle;
gboolean uimanager_new (GtkUIManager**); gboolean uimanager_new (GtkUIManager**);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment