diff --git a/sflphone-client-gnome/src/config/preferencesdialog.c b/sflphone-client-gnome/src/config/preferencesdialog.c index 01be2abd630bcbc1aaac1139cb545c601e2cffea..b4295eea0cf46b6452e7d481e69d67dbd84cbb3a 100644 --- a/sflphone-client-gnome/src/config/preferencesdialog.c +++ b/sflphone-client-gnome/src/config/preferencesdialog.c @@ -96,7 +96,8 @@ set_popup_mode (GtkWidget *widget, gpointer *userdata) void set_notif_level () { - dbus_set_notify (); + gboolean current_state = eel_gconf_get_integer (NOTIFY_ALL); + eel_gconf_set_integer (NOTIFY_ALL, !current_state); } static void @@ -161,7 +162,7 @@ create_general_settings () // Notification All notifAll = gtk_check_button_new_with_mnemonic (_("_Enable notifications")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(notifAll), dbus_get_notify ()); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(notifAll), eel_gconf_get_integer (NOTIFY_ALL)); g_signal_connect(G_OBJECT( notifAll ) , "clicked" , G_CALLBACK( set_notif_level ) , NULL ); gtk_table_attach (GTK_TABLE(table), notifAll, 0, 1, 0, 1, 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 a5273a2ee07f01d5f1b6c76d593646535d5ac459..ac3ec7cb14c4182de071a02a86bb2c372223ba73 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -1992,44 +1992,6 @@ dbus_switch_popup_mode(void) } } -void -dbus_set_notify(void) -{ - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_notify( - configurationManagerProxy, &error); - if (error) - { - g_error_free(error); - } -} - -guint -dbus_get_notify(void) -{ - gint level; - GError* error = NULL; - if (!org_sflphone_SFLphone_ConfigurationManager_get_notify( - configurationManagerProxy, &level, &error)) - { - if (error->domain == DBUS_GERROR && error->code - == DBUS_GERROR_REMOTE_EXCEPTION) - { - ERROR ("Caught remote method (get_notify) exception %s: %s", dbus_g_error_get_name(error), error->message); - } - else - { - ERROR ("Error while calling get_notify: %s", error->message); - } - g_error_free(error); - return 0; - } - else - { - return (guint) level; - } -} - 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 bf497ff5a4873900611f498efee80d7def886ea4..e7fce25dbfe200f6acf3e400b1972ea9a3de14b3 100644 --- a/sflphone-client-gnome/src/dbus/dbus.h +++ b/sflphone-client-gnome/src/dbus/dbus.h @@ -482,18 +482,6 @@ int dbus_get_audio_manager( void ); */ void dbus_set_audio_manager( int api ); -/** - * ConfigurationManager - Configure the notification level - * @return int 0 disable - * 1 enable - */ -guint dbus_get_notify( void ); - -/** - * ConfigurationManager - Configure the notification level - */ -void dbus_set_notify( void ); - /** * ConfigurationManager - Start a tone when a new call is open and no numbers have been dialed * @param start 1 to start diff --git a/sflphone-client-gnome/src/sflnotify.c b/sflphone-client-gnome/src/sflnotify.c index 5ac960e0035e7a08de0eddfed880998281e3b8b7..4a2f000cfa3704fc045981d386ce5cd7f2a29c36 100644 --- a/sflphone-client-gnome/src/sflnotify.c +++ b/sflphone-client-gnome/src/sflnotify.c @@ -36,7 +36,7 @@ void create_new_gnome_notification (gchar *title, gchar *body, NotifyUrgency urg { GnomeNotification *_notif; - if( dbus_get_notify()){ + if (eel_gconf_get_integer (NOTIFY_ALL)){ _notif = g_new0 (GnomeNotification, 1); diff --git a/sflphone-client-gnome/src/sflphone_const.h b/sflphone-client-gnome/src/sflphone_const.h index 2432c50f90fd4726b7fa93816942c7cf7e777ca5..a0020b8fa43c5ecef0a524da2b96844223b3d6a2 100644 --- a/sflphone-client-gnome/src/sflphone_const.h +++ b/sflphone-client-gnome/src/sflphone_const.h @@ -187,5 +187,6 @@ 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 NOTIFY_ALL CONF_PREFIX "/state/notify_all" #endif