Commit 0a6e00b6 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

Simplify widgets

parent 41ac872d
......@@ -718,23 +718,17 @@ GtkWidget* audiocodecs_box (account_t *a)
select_audio_manager (void)
DEBUG ("audio manager selected");
if (!SHOW_ALSA_CONF && !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (pulse))) {
dbus_set_audio_manager (ALSA);
DEBUG (" display alsa conf panel");
alsabox = alsa_box();
gtk_container_add (GTK_CONTAINER (alsa_conf) , alsabox);
gtk_widget_show (alsa_conf);
gtk_widget_set_sensitive (GTK_WIDGET (alsa_conf), TRUE);
gtk_action_set_sensitive (GTK_ACTION (volumeToggle), TRUE);
} else if (SHOW_ALSA_CONF && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (pulse))) {
dbus_set_audio_manager (PULSEAUDIO);
DEBUG (" remove alsa conf panel");
gtk_container_remove (GTK_CONTAINER (alsa_conf) , alsabox);
gtk_widget_hide (alsa_conf);
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (volumeToggle))) {
main_window_volume_controls (FALSE);
eel_gconf_set_integer (SHOW_VOLUME_CONTROLS, FALSE);
......@@ -742,8 +736,6 @@ select_audio_manager (void)
gtk_action_set_sensitive (GTK_ACTION (volumeToggle), FALSE);
} else {
DEBUG ("alsa conf panel...nothing");
......@@ -242,11 +242,11 @@ create_main_window ()
vbox = gtk_vbox_new (FALSE /*homogeneous*/, 0 /*spacing*/);
subvbox = gtk_vbox_new (FALSE /*homogeneous*/, 5 /*spacing*/);
create_menus (ui_manager, &widget);
widget = create_menus (ui_manager);
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/,
0 /*padding*/);
create_toolbar_actions (ui_manager, &widget);
widget = create_toolbar_actions (ui_manager);
// Do not override GNOME user settings
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/,
0 /*padding*/);
......@@ -1747,11 +1747,11 @@ create_waiting_icon()
return waiting_icon;
create_menus (GtkUIManager *ui_manager, GtkWidget **widget)
GtkWidget *
create_menus (GtkUIManager *ui_manager)
GtkWidget * menu_bar;
GtkAction *volumeToggle;
GtkWidget *menu_bar;
menu_bar = gtk_ui_manager_get_widget (ui_manager, "/MenuBar");
pickUpAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/PickUp");
......@@ -1767,21 +1767,19 @@ create_menus (GtkUIManager *ui_manager, GtkWidget **widget)
// Set the toggle buttons
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Dialpad")), eel_gconf_get_boolean (CONF_SHOW_DIALPAD));
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (volumeToggle), (gboolean) SHOW_VOLUME);
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);
/* Add the loading icon at the right of the toolbar. It is used for addressbook searches. */
waitingLayer = create_waiting_icon ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), waitingLayer);
*widget = menu_bar;
return menu_bar;
create_toolbar_actions (GtkUIManager *ui_manager, GtkWidget **widget)
GtkWidget *
create_toolbar_actions (GtkUIManager *ui_manager)
toolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions");
......@@ -1816,11 +1814,9 @@ create_toolbar_actions (GtkUIManager *ui_manager, GtkWidget **widget)
// Set the handler ID for the transfer
= g_signal_connect (G_OBJECT (transferToolbar), "toggled", G_CALLBACK (call_transfer_cb), NULL);
= g_signal_connect (G_OBJECT (recordWidget), "toggled", G_CALLBACK (call_record), NULL);
transfertButtonConnId = g_signal_connect (G_OBJECT (transferToolbar), "toggled", G_CALLBACK (call_transfer_cb), NULL);
recordButtonConnId = g_signal_connect (G_OBJECT (recordWidget), "toggled", G_CALLBACK (call_record), NULL);
active_calltree = current_calls;
*widget = toolbar;
return toolbar;
......@@ -39,7 +39,6 @@ guint holdConnId; //The hold_menu signal connection ID
GtkWidget *historyButton;
GtkWidget *contactButton;
GtkAction *volumeToggle;
GtkUIManager *uimanager_new (void);
......@@ -54,9 +53,9 @@ void show_popup_menu_history (GtkWidget *my_widget, GdkEventButton *event);
void show_popup_menu_contacts (GtkWidget *my_widget, GdkEventButton *event);
void create_menus (GtkUIManager *ui_manager, GtkWidget **widget);
GtkWidget *create_menus (GtkUIManager *ui_manager);
void create_toolbar_actions (GtkUIManager *ui_manager, GtkWidget **widget);
GtkWidget *create_toolbar_actions (GtkUIManager *ui_manager);
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