diff --git a/sflphone-client-gnome/src/config/preferencesdialog.c b/sflphone-client-gnome/src/config/preferencesdialog.c index b4295eea0cf46b6452e7d481e69d67dbd84cbb3a..2302202db520bd7a162852bb204d17008de66acd 100644 --- a/sflphone-client-gnome/src/config/preferencesdialog.c +++ b/sflphone-client-gnome/src/config/preferencesdialog.c @@ -136,8 +136,8 @@ void showstatusicon_cb (GtkWidget *widget, gpointer data) { currentstatus ? show_status_icon () : hide_status_icon (); - // Update through D-Bus - dbus_enable_status_icon (currentstatus ? "true" : "false"); + // Update through D-Bus + eel_gconf_set_integer (SHOW_STATUSICON, currentstatus); } @@ -146,7 +146,7 @@ create_general_settings () { GtkWidget *ret, *notifAll, *trayItem, *frame, *checkBoxWidget, *label, *table; - gboolean statusicon = FALSE; + gboolean statusicon; // Load history configuration history_load_configuration (); @@ -172,10 +172,8 @@ create_general_settings () 1); gtk_box_pack_start (GTK_BOX(ret), frame, FALSE, FALSE, 0); - if (g_strcasecmp (dbus_is_status_icon_enabled (), "true") == 0) - statusicon = TRUE; - else - statusicon = FALSE; + // Whether or not displaying an icon in the system tray + statusicon = eel_gconf_get_integer (SHOW_STATUSICON); showstatusicon = gtk_check_button_new_with_mnemonic ( _("Show SFLphone in the system tray")); diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index a14d089e5a70f3b058ed2f69251232482b33316c..a953d06141c3b56df0a419cb5ee5f2acefc8dbd3 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -2615,32 +2615,3 @@ dbus_set_shortcuts(GHashTable * shortcuts) } } - -void dbus_enable_status_icon (const gchar *value) { - - GError *error = NULL; - - org_sflphone_SFLphone_ConfigurationManager_enable_status_icon (configurationManagerProxy, value, &error); - - if (error != NULL) { - ERROR ("Failed to call enable_status_icon on ConfigurationManager: %s", - error->message); - g_error_free (error); - } -} - -gchar* dbus_is_status_icon_enabled (void) { - - GError *error = NULL; - gchar *value = NULL; - - org_sflphone_SFLphone_ConfigurationManager_is_status_icon_enabled (configurationManagerProxy, &value, &error); - - if (error != NULL) { - ERROR ("Failed to call is_status_icon_enabled on ConfigurationManager: %s", - error->message); - g_error_free (error); - } - return value; -} - diff --git a/sflphone-client-gnome/src/dbus/dbus.h b/sflphone-client-gnome/src/dbus/dbus.h index 2ebdceae5e59f16e9c9616bc5eed604607a89d5f..5c81b6a9b1684dc49fc34ef1903c8859d92c2a5e 100644 --- a/sflphone-client-gnome/src/dbus/dbus.h +++ b/sflphone-client-gnome/src/dbus/dbus.h @@ -615,7 +615,4 @@ void dbus_set_window_position_y (const guint posy); GHashTable* dbus_get_shortcuts(void); void dbus_set_shortcuts(GHashTable * shortcuts); -void dbus_enable_status_icon (const gchar*); -gchar* dbus_is_status_icon_enabled (void); - #endif diff --git a/sflphone-client-gnome/src/main.c b/sflphone-client-gnome/src/main.c index 6ab9d8c8329698041ee2e5b4144393ec7ae11d87..f534eda00d716f49df75a763d1bab837edfeb797 100644 --- a/sflphone-client-gnome/src/main.c +++ b/sflphone-client-gnome/src/main.c @@ -72,7 +72,6 @@ main (int argc, char *argv[]) { // Handle logging int i; - gboolean statusicon = FALSE; // Startup logging startup_logging (); @@ -117,13 +116,12 @@ main (int argc, char *argv[]) if (sflphone_init ()) { - if (g_strcasecmp (dbus_is_status_icon_enabled (), "true") == 0) - statusicon = TRUE; + if (eel_gconf_get_integer (SHOW_STATUSICON)) + show_status_icon (); - if (statusicon) show_status_icon (); create_main_window (); - if (statusicon && dbus_is_start_hidden ()) + if (eel_gconf_get_integer (SHOW_STATUSICON) && dbus_is_start_hidden ()) { gtk_widget_hide (GTK_WIDGET( get_main_window() )); set_minimized (TRUE); diff --git a/sflphone-client-gnome/src/mainwindow.c b/sflphone-client-gnome/src/mainwindow.c index 147526c143a913fef4e7cfa32a02fe231ec5591d..cf3ca817572c8c3fb16dfeaa2846c31a24459755 100644 --- a/sflphone-client-gnome/src/mainwindow.c +++ b/sflphone-client-gnome/src/mainwindow.c @@ -84,7 +84,7 @@ static gboolean window_configure_cb (GtkWidget *win, GdkEventConfigure *event) { on_delete (GtkWidget * widget UNUSED, gpointer data UNUSED) { - if (g_strcasecmp (dbus_is_status_icon_enabled (), "true") == 0) { + if (eel_gconf_get_integer (SHOW_STATUSICON)) { 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 c675713d2a88128d574abf277b83b3a6f5b444cb..58fb9f76750a8889489ea57b6eb67010ea0e2d8b 100644 --- a/sflphone-client-gnome/src/sflphone_const.h +++ b/sflphone-client-gnome/src/sflphone_const.h @@ -188,6 +188,7 @@ log4c_category_t* log4c_sfl_gtk_category; /** Show/Hide the dialpad */ #define CONF_SHOW_DIALPAD CONF_PREFIX "/state/dialpad" #define SHOW_VOLUME_CONTROLS CONF_PREFIX "/state/volume_controls" +#define SHOW_STATUSICON CONF_PREFIX "/state/statusicon" #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 d5ed013e54934dab092e5ac5b942a278342ad77c..1b185e2d80b74b5f78b41e30bb4c6addb73acb94 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -430,7 +430,7 @@ static void call_minimize(void * foo UNUSED) { - if (g_strcasecmp (dbus_is_status_icon_enabled (), "true") == 0) { + if (eel_gconf_get_integer (SHOW_STATUSICON)) { gtk_widget_hide(GTK_WIDGET( get_main_window() )); set_minimized(TRUE); }