diff --git a/sflphone-client-gnome/src/config/preferencesdialog.c b/sflphone-client-gnome/src/config/preferencesdialog.c index 2302202db520bd7a162852bb204d17008de66acd..5ab5e71a5eee65b2bf1312fd1d41361aa0efcb51 100644 --- a/sflphone-client-gnome/src/config/preferencesdialog.c +++ b/sflphone-client-gnome/src/config/preferencesdialog.c @@ -82,15 +82,17 @@ set_md5_hash_cb (GtkWidget *widget UNUSED, gpointer data UNUSED) static void start_hidden (void) { - dbus_start_hidden (); + gboolean currentstate = eel_gconf_get_integer (START_HIDDEN); + eel_gconf_set_integer (START_HIDDEN, !currentstate); } static void set_popup_mode (GtkWidget *widget, gpointer *userdata) { - if (dbus_popup_mode () || gtk_toggle_button_get_active ( - GTK_TOGGLE_BUTTON (widget))) - dbus_switch_popup_mode (); + gboolean currentstate = eel_gconf_get_integer (POPUP_ON_CALL); + if (currentstate || gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { + eel_gconf_set_integer (POPUP_ON_CALL, !currentstate); + } } void @@ -193,16 +195,19 @@ create_general_settings () gtk_table_attach (GTK_TABLE(table), neverpopupwindow, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - // Toggle according to the user configuration - dbus_popup_mode () ? gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON (popupwindow), TRUE) : gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON (neverpopupwindow), TRUE); + // Toggle according to the user configuration + eel_gconf_get_integer (POPUP_ON_CALL) ? gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (popupwindow), + TRUE) : + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (neverpopupwindow), + TRUE); starthidden = gtk_check_button_new_with_mnemonic ( _("Hide SFLphone window on _startup")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(starthidden), - dbus_is_start_hidden ()); + eel_gconf_get_integer (START_HIDDEN)); g_signal_connect(G_OBJECT (starthidden) , "clicked" , G_CALLBACK( start_hidden ) , NULL); gtk_table_attach (GTK_TABLE(table), starthidden, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index a953d06141c3b56df0a419cb5ee5f2acefc8dbd3..7871ab44dddb6f51730673266172b9bce335bbb0 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -1914,58 +1914,6 @@ dbus_get_history_limit(void) return (guint) days; } -void -dbus_start_hidden(void) -{ - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_start_hidden( - configurationManagerProxy, &error); - if (error) - { - g_error_free(error); - } -} - -int -dbus_is_start_hidden(void) -{ - GError* error = NULL; - int state; - org_sflphone_SFLphone_ConfigurationManager_is_start_hidden( - configurationManagerProxy, &state, &error); - if (error) - { - g_error_free(error); - } - return state; -} - -int -dbus_popup_mode(void) -{ - GError* error = NULL; - int state; - org_sflphone_SFLphone_ConfigurationManager_popup_mode( - configurationManagerProxy, &state, &error); - if (error) - { - g_error_free(error); - } - return state; -} - -void -dbus_switch_popup_mode(void) -{ - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_switch_popup_mode( - configurationManagerProxy, &error); - if (error) - { - g_error_free(error); - } -} - void dbus_set_audio_manager(int api) { diff --git a/sflphone-client-gnome/src/dbus/dbus.h b/sflphone-client-gnome/src/dbus/dbus.h index 5c81b6a9b1684dc49fc34ef1903c8859d92c2a5e..04b954354292d557cc80eceb9665460a5e1b26a3 100644 --- a/sflphone-client-gnome/src/dbus/dbus.h +++ b/sflphone-client-gnome/src/dbus/dbus.h @@ -414,12 +414,6 @@ void dbus_set_searchbar( ); */ int dbus_get_searchbar( void ); -/** - * ConfigurationManager - Configure the start-up option - * At startup, SFLphone can be displayed or start hidden in the system tray - */ -void dbus_start_hidden( void ); - /** * ConfigurationManager - Gives the maximum number of days the user wants to have in the history * @return double The maximum number of days @@ -435,27 +429,6 @@ void dbus_set_history_enabled (void); gchar* dbus_get_history_enabled (void); -/** - * ConfigurationManager - Configure the start-up option - * @return int 1 if SFLphone should start in the system tray - * 0 otherwise - */ -int dbus_is_start_hidden( void ); - -/** - * ConfigurationManager - Configure the popup behaviour - * When SFLphone is in the system tray, you can configure when it popups - * Never or only on incoming calls - */ -void dbus_switch_popup_mode( void ); - -/** - * ConfigurationManager - Configure the popup behaviour - * @return int 1 if it should popup on incoming calls - * 0 if it should never popups - */ -int dbus_popup_mode( void ); - /** * ConfigurationManager - Returns the selected audio manager * @return int 0 ALSA diff --git a/sflphone-client-gnome/src/main.c b/sflphone-client-gnome/src/main.c index f534eda00d716f49df75a763d1bab837edfeb797..38cb5cd3f7a05b423116e4727294c168277a414d 100644 --- a/sflphone-client-gnome/src/main.c +++ b/sflphone-client-gnome/src/main.c @@ -121,7 +121,7 @@ main (int argc, char *argv[]) create_main_window (); - if (eel_gconf_get_integer (SHOW_STATUSICON) && dbus_is_start_hidden ()) + if (eel_gconf_get_integer (SHOW_STATUSICON) && eel_gconf_get_integer (START_HIDDEN)) { gtk_widget_hide (GTK_WIDGET( get_main_window() )); set_minimized (TRUE); diff --git a/sflphone-client-gnome/src/sflphone_const.h b/sflphone-client-gnome/src/sflphone_const.h index 58fb9f76750a8889489ea57b6eb67010ea0e2d8b..cd041400cdf3382f2b39edb5314ed1b9e5db21c5 100644 --- a/sflphone-client-gnome/src/sflphone_const.h +++ b/sflphone-client-gnome/src/sflphone_const.h @@ -136,7 +136,7 @@ log4c_category_t* log4c_sfl_gtk_category; /** Tells if the main window is reduced to the system tray or not */ #define MINIMIZED TRUE /** Behaviour of the main window on incoming calls */ -#define __POPUP_WINDOW ( dbus_popup_mode() ) +#define __POPUP_WINDOW (eel_gconf_get_integer (POPUP_ON_CALL)) /** Show/Hide the alsa configuration panel */ #define SHOW_ALSA_CONF ( dbus_get_audio_manager() == ALSA ) /** Show/Hide the volume controls */ @@ -190,5 +190,7 @@ log4c_category_t* log4c_sfl_gtk_category; #define SHOW_VOLUME_CONTROLS CONF_PREFIX "/state/volume_controls" #define SHOW_STATUSICON CONF_PREFIX "/state/statusicon" #define NOTIFY_ALL CONF_PREFIX "/state/notify_all" +#define START_HIDDEN CONF_PREFIX "/state/start_hidden" +#define POPUP_ON_CALL CONF_PREFIX "/state/popup" #endif diff --git a/sflphone-client-gnome/src/statusicon.c b/sflphone-client-gnome/src/statusicon.c index 3d4e3a724f81a6df3746c10c2b9609b22ee96710..72511091f05e8591ce022a2b64984329715c2dd3 100644 --- a/sflphone-client-gnome/src/statusicon.c +++ b/sflphone-client-gnome/src/statusicon.c @@ -204,7 +204,6 @@ statusicon_set_tooltip() g_free(tip); } - } void