From 09365bf01c61dd2a28eee92fd332c2b6ca82ce2b Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Thu, 26 Jul 2001 05:46:37 +0000 Subject: Removed some debugging chatter. 2001-07-26 Jon Trowbridge * backend/ebook/e-card.c: Removed some debugging chatter. * gui/component/select-names/e-select-names-manager.c (e_select_names_manager_create_entry): Store the completion handler in the entry's object data. * gui/component/select-names/e-select-names-bonobo.c (entry_get_property_fn): Added support for getting "destinations" and "allow_contact_lists" properties. (entry_set_property_fn): Added support for setting "destinations" and "allow_contact_lists" properties. (impl_SelectNames_get_entry_for_section): Added definitions for "destinations" and "allow_contact_lists" properties. * gui/component/select-names/e-select-names-completion.c (e_select_names_completion_get_match_contact_lists): Added. (e_select_names_completion_set_match_contact_lists): Added. Controls whether contact lists are offered as options during completion. (book_query_process_card_list): Check if match_contact_lists is set before (duh!) matching on a contact list. (e_select_names_completion_init): Set match_contact_lists to TRUE by default. 2001-07-26 Jon Trowbridge * e-msg-composer-hdrs.c (set_recipients): Get "destinations", rather than "text" from the entry_widget. (The getters/setters in the control have been made more symmetric.) svn path=/trunk/; revision=11422 --- addressbook/ChangeLog | 26 +++++++++ addressbook/backend/ebook/e-card.c | 1 - .../component/select-names/e-select-names-bonobo.c | 68 ++++++++++++++++++---- .../select-names/e-select-names-completion.c | 38 +++++++++--- .../select-names/e-select-names-completion.h | 3 + .../select-names/e-select-names-manager.c | 2 + 6 files changed, 116 insertions(+), 22 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 252425b7bf..74fb850a97 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,29 @@ +2001-07-26 Jon Trowbridge + + * backend/ebook/e-card.c: Removed some debugging chatter. + + * gui/component/select-names/e-select-names-manager.c + (e_select_names_manager_create_entry): Store the completion + handler in the entry's object data. + + * gui/component/select-names/e-select-names-bonobo.c + (entry_get_property_fn): Added support for getting "destinations" + and "allow_contact_lists" properties. + (entry_set_property_fn): Added support for setting "destinations" + and "allow_contact_lists" properties. + (impl_SelectNames_get_entry_for_section): Added definitions for + "destinations" and "allow_contact_lists" properties. + + * gui/component/select-names/e-select-names-completion.c + (e_select_names_completion_get_match_contact_lists): Added. + (e_select_names_completion_set_match_contact_lists): Added. + Controls whether contact lists are offered as options during + completion. + (book_query_process_card_list): Check if match_contact_lists + is set before (duh!) matching on a contact list. + (e_select_names_completion_init): Set match_contact_lists + to TRUE by default. + 2001-07-25 Chris Toshok * backend/pas/pas-backend-ldap.c (func_contains): change the way diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c index 53ba425a48..9700f60ce7 100644 --- a/addressbook/backend/ebook/e-card.c +++ b/addressbook/backend/ebook/e-card.c @@ -611,7 +611,6 @@ e_card_get_vobject (ECard *card) if (tmp == NULL) tmp = card->id; if (tmp) { - g_message ("unique string = [%s]", tmp); addPropValue (vobj, VCUniqueStringProp, tmp); } diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.c b/addressbook/gui/component/select-names/e-select-names-bonobo.c index 428826f7fe..d2e4ab5b00 100644 --- a/addressbook/gui/component/select-names/e-select-names-bonobo.c +++ b/addressbook/gui/component/select-names/e-select-names-bonobo.c @@ -37,9 +37,9 @@ #include "Evolution-Addressbook-SelectNames.h" #include "e-select-names-manager.h" - #include "e-select-names-model.h" #include "e-select-names-text-model.h" +#include "e-select-names-completion.h" @@ -53,6 +53,8 @@ struct _ESelectNamesBonoboPrivate { enum _EntryPropertyID { ENTRY_PROPERTY_ID_TEXT, + ENTRY_PROPERTY_ID_DESTINATIONS, + ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS, ENTRY_PROPERTY_ID_ENTRY_CHANGED }; typedef enum _EntryPropertyID EntryPropertyID; @@ -74,21 +76,36 @@ entry_get_property_fn (BonoboPropertyBag *bag, switch (arg_id) { case ENTRY_PROPERTY_ID_TEXT: + BONOBO_ARG_SET_STRING (arg, e_entry_get_text (E_ENTRY (w))); + break; + + case ENTRY_PROPERTY_ID_DESTINATIONS: { - ESelectNamesTextModel *text_model; ESelectNamesModel *model; + model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model")); + g_assert (model != NULL); - gtk_object_get(GTK_OBJECT(w), - "model", &text_model, - NULL); - gtk_object_get(GTK_OBJECT(text_model), - "source", &model, - NULL); text = e_select_names_model_export_destinationv (model); BONOBO_ARG_SET_STRING (arg, text); g_free (text); } break; + + case ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS: + { + ESelectNamesCompletion *comp; + comp = E_SELECT_NAMES_COMPLETION (gtk_object_get_data (GTK_OBJECT (w), "completion_handler")); + g_assert (comp != NULL); + + BONOBO_ARG_SET_BOOLEAN (arg, e_select_names_completion_get_match_contact_lists (comp)); + break; + } + + case ENTRY_PROPERTY_ID_ENTRY_CHANGED: + /* This is a read-only property. */ + g_assert_not_reached (); + break; + default: break; } @@ -101,19 +118,40 @@ entry_set_property_fn (BonoboPropertyBag *bag, CORBA_Environment *ev, gpointer user_data) { - GtkWidget *widget; + GtkWidget *w; - widget = GTK_WIDGET (user_data); + w = GTK_WIDGET (user_data); switch (arg_id) { case ENTRY_PROPERTY_ID_TEXT: - e_entry_set_text (E_ENTRY (widget), BONOBO_ARG_GET_STRING (arg)); + e_entry_set_text (E_ENTRY (w), BONOBO_ARG_GET_STRING (arg)); break; + case ENTRY_PROPERTY_ID_DESTINATIONS: + { + ESelectNamesModel *model; + model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model")); + g_assert (model != NULL); + + e_select_names_model_import_destinationv (model, BONOBO_ARG_GET_STRING (arg)); + break; + } + + case ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS: + { + ESelectNamesCompletion *comp; + comp = E_SELECT_NAMES_COMPLETION (gtk_object_get_data (GTK_OBJECT (w), "completion_handler")); + g_assert (comp != NULL); + + e_select_names_completion_set_match_contact_lists (comp, BONOBO_ARG_GET_BOOLEAN (arg)); + break; + } + case ENTRY_PROPERTY_ID_ENTRY_CHANGED: - gtk_object_set_data (GTK_OBJECT (widget), "entry_property_id_changed", GUINT_TO_POINTER (1)); + gtk_object_set_data (GTK_OBJECT (w), "entry_property_id_changed", GUINT_TO_POINTER (1)); break; + default: break; } @@ -224,6 +262,12 @@ impl_SelectNames_get_entry_for_section (PortableServer_Servant servant, bonobo_property_bag_add (property_bag, "text", ENTRY_PROPERTY_ID_TEXT, BONOBO_ARG_STRING, NULL, NULL, BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE); + bonobo_property_bag_add (property_bag, "destinations", ENTRY_PROPERTY_ID_DESTINATIONS, + BONOBO_ARG_STRING, NULL, NULL, + BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE); + bonobo_property_bag_add (property_bag, "allow_contact_lists", ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS, + BONOBO_ARG_BOOLEAN, NULL, NULL, + BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE); bonobo_property_bag_add (property_bag, "entry_changed", ENTRY_PROPERTY_ID_ENTRY_CHANGED, BONOBO_ARG_BOOLEAN, NULL, NULL, BONOBO_PROPERTY_WRITEABLE); diff --git a/addressbook/gui/component/select-names/e-select-names-completion.c b/addressbook/gui/component/select-names/e-select-names-completion.c index 2590a8515b..e75f964b4c 100644 --- a/addressbook/gui/component/select-names/e-select-names-completion.c +++ b/addressbook/gui/component/select-names/e-select-names-completion.c @@ -62,6 +62,7 @@ struct _ESelectNamesCompletionPrivate { gchar *cached_query_text; GList *cached_cards; + gboolean match_contact_lists; gboolean primary_only; }; @@ -543,16 +544,20 @@ book_query_process_card_list (ESelectNamesCompletion *comp, const GList *cards) if (e_card_evolution_list (card)) { - EDestination *dest = e_destination_new (); - ECompletionMatch *match; - e_destination_set_card (dest, card, 0); - match = book_query_score (comp, dest); - if (match && match->score > 0) { - e_completion_found_match (E_COMPLETION (comp), match); - } else { - e_completion_match_unref (match); + if (comp->priv->match_contact_lists) { + + EDestination *dest = e_destination_new (); + ECompletionMatch *match; + e_destination_set_card (dest, card, 0); + match = book_query_score (comp, dest); + if (match && match->score > 0) { + e_completion_found_match (E_COMPLETION (comp), match); + } else { + e_completion_match_unref (match); + } + gtk_object_unref (GTK_OBJECT (dest)); + } - gtk_object_unref (GTK_OBJECT (dest)); } else if (card->email) { gint i; @@ -715,6 +720,7 @@ static void e_select_names_completion_init (ESelectNamesCompletion *comp) { comp->priv = g_new0 (struct _ESelectNamesCompletionPrivate, 1); + comp->priv->match_contact_lists = TRUE; } static void @@ -1154,3 +1160,17 @@ e_select_names_completion_new (EBook *book, ESelectNamesModel *model) return E_COMPLETION (comp); } +gboolean +e_select_names_completion_get_match_contact_lists (ESelectNamesCompletion *comp) +{ + g_return_val_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp), FALSE); + return comp->priv->match_contact_lists; +} + + +void +e_select_names_completion_set_match_contact_lists (ESelectNamesCompletion *comp, gboolean x) +{ + g_return_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp)); + comp->priv->match_contact_lists = x; +} diff --git a/addressbook/gui/component/select-names/e-select-names-completion.h b/addressbook/gui/component/select-names/e-select-names-completion.h index 1f3de5ea3d..cfa496ca69 100644 --- a/addressbook/gui/component/select-names/e-select-names-completion.h +++ b/addressbook/gui/component/select-names/e-select-names-completion.h @@ -59,6 +59,9 @@ GtkType e_select_names_completion_get_type (void); ECompletion *e_select_names_completion_new (EBook *, ESelectNamesModel *); +gboolean e_select_names_completion_get_match_contact_lists (ESelectNamesCompletion *); +void e_select_names_completion_set_match_contact_lists (ESelectNamesCompletion *, gboolean); + END_GNOME_DECLS #endif /* E_SELECT_NAMES_COMPLETION_H */ diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c index b255942d08..4481438327 100644 --- a/addressbook/gui/component/select-names/e-select-names-manager.c +++ b/addressbook/gui/component/select-names/e-select-names-manager.c @@ -400,6 +400,8 @@ e_select_names_manager_create_entry (ESelectNamesManager *manager, const char *i comp = e_select_names_completion_new (NULL, section->model); /* NULL == use local addressbook */ e_entry_enable_completion_full (eentry, comp, 50, completion_handler); + gtk_object_set_data (GTK_OBJECT (eentry), "completion_handler", comp); + gtk_object_set(GTK_OBJECT(eentry), "model", model, "editable", TRUE, -- cgit v1.2.3