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

[#1970] Volume controls disable when using pulseaudio

parent b0256c5e
Branches
Tags
No related merge requests found
......@@ -631,7 +631,8 @@ 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);
gtk_action_set_sensitive (GTK_ACTION (volumeToggle), TRUE);
}
else if( SHOW_ALSA_CONF && gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) ))
{
......@@ -640,7 +641,13 @@ 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);
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 {
DEBUG("alsa conf panel...nothing");
}
......
......@@ -183,8 +183,7 @@ create_main_window ()
ret = uimanager_new (&ui_manager);
if (!ret)
{
//show_error_dialog (GTK_WINDOW (window), error->message,
// _("Could not load ui.xml. The program may be not properly installed"));
ERROR ("Could not load xml GUI\n");
g_error_free (error);
exit (1);
}
......
......@@ -29,7 +29,8 @@
<menuitem action="Toolbar"/>
<separator/>
<menuitem action="Dialpad"/>
<menuitem name="VolumeControlsToggle" action="VolumeControls"/>
<!--menuitem name="VolumeControlsToggle" action="VolumeControls"/-->
<menuitem action="VolumeControls"/>
<separator/>
<menuitem action="CallWindow"/>
<menuitem action="History"/>
......
......@@ -350,15 +350,18 @@ void update_actions()
static void volume_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data)
{
gboolean toggled = gtk_toggle_action_get_active (togglemenuitem);
g_print ("%i\n", 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)
{
gboolean toggled = gtk_toggle_action_get_active (togglemenuitem);
main_window_dialpad(toggled);
dbus_set_dialpad(toggled);
if (toggled || SHOW_DIALPAD)
dbus_set_dialpad(toggled);
}
static void help_contents_cb (GtkAction *action)
......@@ -1353,14 +1356,16 @@ 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");
volumeToggle = gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/VolumeControls");
// 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/Dialpad")), (gboolean) SHOW_DIALPAD);
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (volumeToggle), (gboolean) SHOW_VOLUME);
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);
gtk_action_set_sensitive (GTK_ACTION (volumeToggle), 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 ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), waitingLayer);
......
......@@ -30,7 +30,7 @@ GtkWidget *historyButton;
GtkWidget *contactButton;
GtkWidget *currentCallsButton;
GtkWidget *volumeToggle;
GtkAction *volumeToggle;
gboolean uimanager_new (GtkUIManager**);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment