From 9b900c5b16d25da9595b832f210ce19d3f77be62 Mon Sep 17 00:00:00 2001 From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> Date: Fri, 2 Jul 2010 11:13:06 -0400 Subject: [PATCH] [#2833] gconf: display volume controls --- sflphone-client-gnome/src/config/audioconf.c | 2 +- sflphone-client-gnome/src/dbus/dbus.c | 26 -------------------- sflphone-client-gnome/src/dbus/dbus.h | 12 --------- sflphone-client-gnome/src/sflphone_const.h | 3 ++- sflphone-client-gnome/src/uimanager.c | 2 +- 5 files changed, 4 insertions(+), 41 deletions(-) diff --git a/sflphone-client-gnome/src/config/audioconf.c b/sflphone-client-gnome/src/config/audioconf.c index bab96d27e7..d27b64d2f2 100644 --- a/sflphone-client-gnome/src/config/audioconf.c +++ b/sflphone-client-gnome/src/config/audioconf.c @@ -767,7 +767,7 @@ select_audio_manager( void ) if (gtk_toggle_action_get_active ( GTK_TOGGLE_ACTION (volumeToggle))) { main_window_volume_controls(FALSE); - dbus_set_volume_controls (FALSE); + eel_gconf_set_integer (SHOW_VOLUME_CONTROLS, FALSE); gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (volumeToggle), FALSE); } gtk_action_set_sensitive (GTK_ACTION (volumeToggle), FALSE); diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index ac3ec7cb14..a14d089e5a 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -1726,32 +1726,6 @@ dbus_set_searchbar() } } -int -dbus_get_volume_controls() -{ - int state; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_volume_controls( - configurationManagerProxy, &state, &error); - if (error) - { - g_error_free(error); - } - return state; -} - -void -dbus_set_volume_controls(gboolean display) -{ - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_volume_controls( - configurationManagerProxy, display, &error); - if (error) - { - g_error_free(error); - } -} - void dbus_join_participant(const gchar* sel_callID, const gchar* drag_callID) { diff --git a/sflphone-client-gnome/src/dbus/dbus.h b/sflphone-client-gnome/src/dbus/dbus.h index e7fce25dbf..2ebdceae5e 100644 --- a/sflphone-client-gnome/src/dbus/dbus.h +++ b/sflphone-client-gnome/src/dbus/dbus.h @@ -414,18 +414,6 @@ void dbus_set_searchbar( ); */ int dbus_get_searchbar( void ); -/** - * ConfigurationManager - Set the volume controls visible or not - */ -void dbus_set_volume_controls (gboolean display); - -/** - * ConfigurationManager - Tells if the user wants to display the volume controls or not - * @return int 1 if the controls have to be displayed - * 0 otherwise - */ -int dbus_get_volume_controls( void ); - /** * ConfigurationManager - Configure the start-up option * At startup, SFLphone can be displayed or start hidden in the system tray diff --git a/sflphone-client-gnome/src/sflphone_const.h b/sflphone-client-gnome/src/sflphone_const.h index a0020b8fa4..c675713d2a 100644 --- a/sflphone-client-gnome/src/sflphone_const.h +++ b/sflphone-client-gnome/src/sflphone_const.h @@ -140,7 +140,7 @@ log4c_category_t* log4c_sfl_gtk_category; /** 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) +#define SHOW_VOLUME (eel_gconf_get_integer (SHOW_VOLUME_CONTROLS) && SHOW_ALSA_CONF) /** Audio Managers */ #define ALSA 0 @@ -187,6 +187,7 @@ log4c_category_t* log4c_sfl_gtk_category; #define CONF_MAIN_WINDOW_POSITION_Y CONF_PREFIX "/state/window_position_y" /** Show/Hide the dialpad */ #define CONF_SHOW_DIALPAD CONF_PREFIX "/state/dialpad" +#define SHOW_VOLUME_CONTROLS CONF_PREFIX "/state/volume_controls" #define NOTIFY_ALL CONF_PREFIX "/state/notify_all" #endif diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c index 6812ba62ef..d5ed013e54 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -353,7 +353,7 @@ volume_bar_cb(GtkToggleAction *togglemenuitem, gpointer user_data) return; main_window_volume_controls(toggled); if (toggled || SHOW_VOLUME) - dbus_set_volume_controls(toggled); + eel_gconf_set_integer (SHOW_VOLUME_CONTROLS, toggled); } static void -- GitLab