Skip to content
Snippets Groups Projects
Commit fcb969ed authored by Julien Bonjean's avatar Julien Bonjean
Browse files

Added search feature for eds

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