Commit fcb969ed authored by Julien Bonjean's avatar Julien Bonjean

Added search feature for eds

parent 9fc1e995
...@@ -234,7 +234,6 @@ gboolean sflphone_init() ...@@ -234,7 +234,6 @@ gboolean sflphone_init()
history = calltab_init(); history = calltab_init();
contacts = calltab_init(); contacts = calltab_init();
if(SHOW_SEARCHBAR) histfilter = create_filter(GTK_TREE_MODEL(history->store)); if(SHOW_SEARCHBAR) histfilter = create_filter(GTK_TREE_MODEL(history->store));
contactfilter = create_filter(GTK_TREE_MODEL(contacts->store));
init(); init();
account_list_init (); account_list_init ();
codec_list_init(); codec_list_init();
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
GtkTreeModel* histfilter; GtkTreeModel* histfilter;
GtkTreeModel* contactfilter;
calltab_t* calltab_init(); calltab_t* calltab_init();
......
...@@ -210,12 +210,14 @@ toggle_contacts(GtkToggleToolButton *toggle_tool_button UNUSED, ...@@ -210,12 +210,14 @@ toggle_contacts(GtkToggleToolButton *toggle_tool_button UNUSED,
GList *i; GList *i;
char ext[30]; char ext[30];
printf("EDS : %s\n",gtk_entry_get_text(GTK_ENTRY(filter_entry)));
// Reset previous results // Reset previous results
call_list_reset(contacts); call_list_reset(contacts);
reset_call_tree(contacts); reset_call_tree(contacts);
// Do a synchronized search // Do a synchronized search
results = search_sync ("j", 50); results = search_sync (gtk_entry_get_text(GTK_ENTRY(filter_entry)), 50);
if(results == NULL) if(results == NULL)
{ {
...@@ -253,8 +255,6 @@ toggle_contacts(GtkToggleToolButton *toggle_tool_button UNUSED, ...@@ -253,8 +255,6 @@ toggle_contacts(GtkToggleToolButton *toggle_tool_button UNUSED,
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view)); sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view));
g_signal_emit_by_name(sel, "changed"); g_signal_emit_by_name(sel, "changed");
toolbar_update_buttons(); toolbar_update_buttons();
//gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(contactfilter));
} }
static void static void
...@@ -933,6 +933,23 @@ update_call_tree_add (calltab_t* tab, call_t * c) ...@@ -933,6 +933,23 @@ update_call_tree_add (calltab_t* tab, call_t * c)
toolbar_update_buttons(); toolbar_update_buttons();
} }
void
refresh_tab(calltab_t* tab)
{
if(tab == contacts)
{
toggle_contacts(NULL, NULL);
}
else if (tab == history)
{
toggle_history(NULL, NULL);
}
else
{
toggle_current_calls(NULL, NULL);
}
}
void void
switch_tab(calltab_t* tab) switch_tab(calltab_t* tab)
{ {
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
GtkToolItem * historyButton; GtkToolItem * historyButton;
GtkToolItem * contactButton; GtkToolItem * contactButton;
GtkWidget * filter_entry;
calltab_t* active_calltree; calltab_t* active_calltree;
/** /**
* Create a new widget calltree * Create a new widget calltree
...@@ -73,4 +75,6 @@ GtkWidget * create_toolbar(); ...@@ -73,4 +75,6 @@ GtkWidget * create_toolbar();
void switch_tab( calltab_t* tab ); void switch_tab( calltab_t* tab );
void refresh_tab( calltab_t* tab );
#endif #endif
...@@ -77,7 +77,7 @@ AUTOMAKE = ${SHELL} /home/jbonjean/dev/Savoir.Faire.Linux/sflphone/missing --run ...@@ -77,7 +77,7 @@ AUTOMAKE = ${SHELL} /home/jbonjean/dev/Savoir.Faire.Linux/sflphone/missing --run
AWK = gawk AWK = gawk
CC = gcc CC = gcc
CCDEPMODE = depmode=gcc3 CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2 -g -Wall -O2 CFLAGS = -g -O2 -g -O2 -DDEBUG -Wall -Wextra
CPP = gcc -E CPP = gcc -E
CPPFLAGS = CPPFLAGS =
CYGPATH_W = echo CYGPATH_W = echo
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#include <historyfilter.h> #include <historyfilter.h>
#include <calltree.h> #include <calltree.h>
GtkWidget * filter_entry;
GtkTreeModel* GtkTreeModel*
create_filter(GtkTreeModel* child) create_filter(GtkTreeModel* child)
{ {
...@@ -58,7 +56,13 @@ is_visible(GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED) ...@@ -58,7 +56,13 @@ is_visible(GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED)
void void
filter_entry_changed(GtkEntry* entry UNUSED, gchar* arg1 UNUSED, gpointer data UNUSED) filter_entry_changed(GtkEntry* entry UNUSED, gchar* arg1 UNUSED, gpointer data UNUSED)
{ {
switch_tab(history); //printf("%s\n",gtk_entry_get_text(GTK_ENTRY(entry)));
if(active_calltree == current_calls)
switch_tab(contacts);
else
refresh_tab(active_calltree);
} }
void void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment