From 850354edbdf921d811ebe9c9bae5d98fbd8789f9 Mon Sep 17 00:00:00 2001 From: Emmanuel Milou <manu@manu-eeepc.(none)> Date: Wed, 10 Jun 2009 11:30:26 -0400 Subject: [PATCH] [#1214] Enable / Disable history --- sflphone-client-gnome/src/config/configwindow.c | 5 +++-- sflphone-client-gnome/src/contacts/calllist.c | 9 ++++++--- sflphone-client-gnome/src/contacts/calltree.c | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sflphone-client-gnome/src/config/configwindow.c b/sflphone-client-gnome/src/config/configwindow.c index b4254dd1df..3e4a512e41 100644 --- a/sflphone-client-gnome/src/config/configwindow.c +++ b/sflphone-client-gnome/src/config/configwindow.c @@ -196,6 +196,9 @@ static void history_enabled_cb (GtkWidget *widget) { history_enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); gtk_widget_set_sensitive (GTK_WIDGET (history_value), history_enabled); + + // Toggle it through D-Bus + dbus_set_history_enabled (); } @@ -743,8 +746,6 @@ void save_configuration_parameters (void) { // History config dbus_set_history_limit (history_limit); - // Toggle it through D-Bus - dbus_set_history_enabled (); } diff --git a/sflphone-client-gnome/src/contacts/calllist.c b/sflphone-client-gnome/src/contacts/calllist.c index cee442837c..3573e0194c 100644 --- a/sflphone-client-gnome/src/contacts/calllist.c +++ b/sflphone-client-gnome/src/contacts/calllist.c @@ -80,9 +80,12 @@ calllist_reset (calltab_t* tab) void calllist_add_history_entry (callable_obj_t *obj) { - // TODO Check if history is enabled - g_queue_push_tail (history->callQueue, (gpointer *) obj); - calltree_add_call (history, obj); + int state = dbus_get_history_enabled (); + if (state == 1) + { + g_queue_push_tail (history->callQueue, (gpointer *) obj); + calltree_add_call (history, obj); + } } void diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c index 88bbc4a32c..2884216f74 100644 --- a/sflphone-client-gnome/src/contacts/calltree.c +++ b/sflphone-client-gnome/src/contacts/calltree.c @@ -417,8 +417,8 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c) void calltree_add_history_entry (callable_obj_t * c) { - //if (calllist_get_size (history) > dbus_get_max_calls ()) - // return; + if (dbus_get_history_enabled () == 0) + return; GdkPixbuf *pixbuf=NULL; GtkTreeIter iter; -- GitLab