diff --git a/sflphone-client-gnome/src/contacts/history.c b/sflphone-client-gnome/src/contacts/history.c index c547ac0fcab219d4d1cb72c706e3c64773f69753..5ce53416f65c3120f79739d92033776cab2cba65 100644 --- a/sflphone-client-gnome/src/contacts/history.c +++ b/sflphone-client-gnome/src/contacts/history.c @@ -65,50 +65,46 @@ static GtkTreeModel* history_create_filter (GtkTreeModel* child) static gboolean history_is_visible (GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED) { - if (SHOW_SEARCHBAR) - { - GValue val, obj; + GValue val, obj; - callable_obj_t *history_entry = NULL; - gchar* text = NULL; - gchar* search = (gchar*)gtk_entry_get_text(GTK_ENTRY(history_searchbar_widget)); - memset (&val, 0, sizeof(val)); - memset (&obj, 0, sizeof(obj)); - - // Fetch the call description - gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 1, &val); - if(G_VALUE_HOLDS_STRING(&val)){ - text = (gchar *)g_value_get_string(&val); - } - - // Fetch the call type - gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 2, &obj); - if (G_VALUE_HOLDS_POINTER (&obj)){ - history_entry = (gpointer) g_value_get_pointer (&obj); - } + callable_obj_t *history_entry = NULL; + gchar* text = NULL; + gchar* search = (gchar*)gtk_entry_get_text(GTK_ENTRY(history_searchbar_widget)); + memset (&val, 0, sizeof(val)); + memset (&obj, 0, sizeof(obj)); + + // Fetch the call description + gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 1, &val); + if(G_VALUE_HOLDS_STRING(&val)){ + text = (gchar *)g_value_get_string(&val); + } + + // Fetch the call type + gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 2, &obj); + if (G_VALUE_HOLDS_POINTER (&obj)){ + history_entry = (gpointer) g_value_get_pointer (&obj); + } - if(text != NULL) + if(text != NULL) + { + if (history_entry) { - if (history_entry) + // Filter according to the type of call + // MISSED, INCOMING, OUTGOING, ALL + if ((int)get_current_history_search_type () == SEARCH_ALL) + return g_regex_match_simple(search, text, G_REGEX_CASELESS, 0); + else { - // Filter according to the type of call - // MISSED, INCOMING, OUTGOING, ALL - if ((int)get_current_history_search_type () == SEARCH_ALL) - return g_regex_match_simple(search, text, G_REGEX_CASELESS, 0); - else - { - // We need a match on the history_state_t and the current search type - return (history_entry->_history_state + 1) == (int)get_current_history_search_type () && - g_regex_match_simple(search, text, G_REGEX_CASELESS, 0); - } + // We need a match on the history_state_t and the current search type + return (history_entry->_history_state + 1) == (int)get_current_history_search_type () && + g_regex_match_simple(search, text, G_REGEX_CASELESS, 0); } } + } - // Clean up - g_value_unset (&val); - g_value_unset (&obj); + // Clean up + g_value_unset (&val); + g_value_unset (&obj); - return TRUE; - } return TRUE; } diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index 97ee5588913a567e7890461b4c387fe9025cdf20..9737e794dc3be665ca7f16e04624ea85f5c4da06 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -34,6 +34,8 @@ #include <actions.h> #include <string.h> +#define DEFAULT_DBUS_TIMEOUT 30000 + DBusGConnection * connection; DBusGProxy * callManagerProxy; DBusGProxy * configurationManagerProxy; @@ -389,6 +391,12 @@ dbus_connect () "errorAlert", G_TYPE_INT , G_TYPE_INVALID); dbus_g_proxy_connect_signal (configurationManagerProxy, "errorAlert", G_CALLBACK(error_alert), NULL, NULL); + + /* Defines a default timeout for the proxies */ + dbus_g_proxy_set_default_timeout(callManagerProxy, DEFAULT_DBUS_TIMEOUT); + dbus_g_proxy_set_default_timeout(instanceProxy, DEFAULT_DBUS_TIMEOUT); + dbus_g_proxy_set_default_timeout(configurationManagerProxy, DEFAULT_DBUS_TIMEOUT); + return TRUE; } diff --git a/sflphone-client-gnome/src/mainwindow.c b/sflphone-client-gnome/src/mainwindow.c index 9b987c66b1ac7652c90da6e7448fa70229fa72aa..d481473024f30dfcfc20cb8d4455417d554bfed5 100644 --- a/sflphone-client-gnome/src/mainwindow.c +++ b/sflphone-client-gnome/src/mainwindow.c @@ -197,21 +197,9 @@ create_main_window () gtk_box_pack_start (GTK_BOX (vbox), history->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_start (GTK_BOX (vbox), contacts->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - // gtk_box_pack_start (GTK_BOX (vbox), current_calls->searchbar, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - // gtk_box_pack_start (GTK_BOX (vbox), history->searchbar, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - // gtk_box_pack_start (GTK_BOX (vbox), contacts ->searchbar, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - gtk_box_pack_start (GTK_BOX (vbox), subvbox, FALSE /*expand*/, FALSE /*fill*/, 0 /*padding*/); - - // if( SHOW_SEARCHBAR ){ - // filterEntry = create_filter_entry(); - // gtk_box_pack_start (GTK_BOX (subvbox), filterEntry, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - // gtk_widget_show_all ( filterEntry ); - // } - - - if( SHOW_VOLUME ){ + if( SHOW_VOLUME ){ speaker_control = create_slider("speaker"); gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_widget_show_all (speaker_control); @@ -350,22 +338,6 @@ main_window_volume_controls( gboolean *state ){ } } -void -main_window_searchbar( gboolean *state UNUSED){ - if( !SHOW_SEARCHBAR ) - { - // filterEntry = create_filter_entry(); - // gtk_box_pack_start (GTK_BOX (subvbox), filterEntry, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - // gtk_widget_show_all (filterEntry); - // *state = TRUE; - } - else - { - // gtk_container_remove( GTK_CONTAINER(subvbox) , filterEntry ); - // *state = FALSE; - } -} - void statusbar_push_message(const gchar * message, guint id) { diff --git a/sflphone-client-gnome/src/mainwindow.h b/sflphone-client-gnome/src/mainwindow.h index bdf3c0af125353ceb8ffa9ba4f7894805b004746..77825fbb512b09a6b0cf45715b389a34079bfba9 100644 --- a/sflphone-client-gnome/src/mainwindow.h +++ b/sflphone-client-gnome/src/mainwindow.h @@ -90,8 +90,6 @@ void statusbar_push_message( const gchar* message , guint id ); */ void statusbar_pop_message( guint id ); -void main_window_searchbar( gboolean *state ); - //static gboolean //on_key_released (GtkWidget *widget, GdkEventKey *event, // gpointer user_data); diff --git a/sflphone-client-gnome/src/menus.c b/sflphone-client-gnome/src/menus.c index db443f2a523ac0b208115078f7789297c9dbf81a..a7b95b9723ba68a12b6efd06ea79400ac917b2d8 100644 --- a/sflphone-client-gnome/src/menus.c +++ b/sflphone-client-gnome/src/menus.c @@ -614,16 +614,7 @@ view_volume_controls (GtkImageMenuItem *imagemenuitem UNUSED, dbus_set_volume_controls( state ); } -/* - static void - view_searchbar (GtkImageMenuItem *imagemenuitem UNUSED, - void* foo UNUSED) - { - gboolean state; - main_window_searchbar( &state ); - dbus_set_searchbar( state ); - } - */ + GtkWidget * create_view_menu() { diff --git a/sflphone-client-gnome/src/sflphone_const.h b/sflphone-client-gnome/src/sflphone_const.h index f576ea22a2f459e2802ef330f8d5a91b47faa7cc..a98c08525b309fc23461d996cb7491327e5894ea 100644 --- a/sflphone-client-gnome/src/sflphone_const.h +++ b/sflphone-client-gnome/src/sflphone_const.h @@ -77,8 +77,6 @@ log4c_category_t* log4c_sfl_gtk_category; #define SHOW_DIALPAD ( dbus_get_dialpad() ) /** Show/Hide the volume controls */ #define SHOW_VOLUME ( dbus_get_volume_controls() ) -/** Show/Hide the dialpad */ -#define SHOW_SEARCHBAR ( dbus_get_searchbar() ) /** Show/Hide the alsa configuration panel */ #define SHOW_ALSA_CONF ( dbus_get_audio_manager() == ALSA )