From 3feccd8c20fdd464521369678195af32ac067125 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sat, 29 May 2004 04:43:04 +0000 Subject: call e_select_names_model_load_contacts after setting 2004-05-28 Chris Toshok * gui/component/select-names/e-select-names-bonobo.c (entry_set_property_fn): call e_select_names_model_load_contacts after setting text/addresses/destinations. * gui/component/select-names/e-select-names-model.c (name_and_email_simple_query_cb): new function, ripped from the 1.4 e-destination stuff. (book_opened): new function, fire off eab_name_and_email_query for each item in our model (that doesn't represent a contact already). (e_select_names_model_load_contacts): new function, open the default addressbook (yeah yeah, i know we should open something different/more.) (e_select_names_cancel_contacts_load): new (unimplemented, and how do we implement it?) function. * gui/component/select-names/e-select-names-model.h: add prototypes for e_select_names_model_load_contacts and e_select_names_cancel_contacts_load. * gui/component/select-names/e-select-names.c (set_book): call get_query_string and set the book and query in a single call to g_object_set, just because we can/should. (update_query): reimplement in terms of get_query_string. (get_query_string): new function, build up the query string. * gui/component/select-names/Makefile.am (INCLUDES): add $(top_srcdir)/addressbook/util to INCLUDES. svn path=/trunk/; revision=26129 --- .../gui/component/select-names/e-select-names.c | 27 +++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'addressbook/gui/component/select-names/e-select-names.c') diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index cdf5628caa..158abd0755 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -47,10 +47,11 @@ #include #include "e-util/e-sexp.h" -static void e_select_names_init (ESelectNames *names); -static void e_select_names_class_init (ESelectNamesClass *klass); -static void e_select_names_dispose (GObject *object); -static void update_query (GtkWidget *widget, ESelectNames *e_select_names); +static void e_select_names_init (ESelectNames *names); +static void e_select_names_class_init (ESelectNamesClass *klass); +static void e_select_names_dispose (GObject *object); +static void update_query (GtkWidget *widget, ESelectNames *e_select_names); +static char *get_query_string (ESelectNames *e_select_names); static void sync_table_and_models (ESelectNamesModel *triggering_model, ESelectNames *esl); @@ -120,10 +121,12 @@ search_result (EABModel *model, EBookViewStatus status, ESelectNames *esn) static void set_book(EBook *book, EBookStatus status, ESelectNames *esn) { + char *query_str = get_query_string (esn); g_object_set(esn->model, "book", book, + "query", query_str, NULL); - update_query (NULL, esn); + g_free (query_str); g_object_unref(book); g_object_unref(esn->model); g_object_unref(esn); @@ -342,8 +345,8 @@ source_selected (ESourceOptionMenu *menu, ESource *source, ESelectNames *e_selec e_select_names_config_set_last_completion_book (e_source_peek_uid (source)); } -static void -update_query (GtkWidget *widget, ESelectNames *e_select_names) +static char * +get_query_string (ESelectNames *e_select_names) { char *category = ""; const char *search = ""; @@ -376,12 +379,20 @@ update_query (GtkWidget *widget, ESelectNames *e_select_names) query = q_array[0]; } query_str = e_book_query_to_string (query); + e_book_query_unref (query); + return query_str; +} + + +static void +update_query (GtkWidget *widget, ESelectNames *e_select_names) +{ + char *query_str = get_query_string (e_select_names); printf ("query_str = %s\n", query_str); g_object_set (e_select_names->model, "query", query_str, NULL); g_free (query_str); - e_book_query_unref (query); } static void -- cgit