diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-04-17 04:28:13 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-04-17 04:28:13 +0800 |
commit | a35d86361dbbf29c3b7da3a481c77c6a876ae8f4 (patch) | |
tree | 79a784b7f0a5272341c60890ecafe75be47d5b40 /addressbook/gui/component/select-names/e-select-names-model.c | |
parent | a8d2769cabc1889fd35e97d8494b824d06c0cde1 (diff) | |
download | gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar.gz gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar.bz2 gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar.lz gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar.xz gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar.zst gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.zip |
Added.
2001-04-16 Jon Trowbridge <trow@ximian.com>
* backend/ebook/e-destination.c (e_destination_get_name): Added.
* gui/component/select-names/e-select-names.c
(real_add_address_cb): Use e_select_names_model_append. It's
nicer.
* gui/component/select-names/e-select-names-model.c
(e_select_names_model_append): Added.
* gui/component/select-names/e-select-names-completion.c
(book_query_process_card_list): Filter out completion matches that
don't have an associated e-mail address.
(book_query_score): Give a bonus to the primary address, so that
it always comes up first in the completion results.
* gui/component/e-address-popup.c (e_address_popup_refresh_names):
Convert utf8 strings into gtk strings before displaying.
svn path=/trunk/; revision=9390
Diffstat (limited to 'addressbook/gui/component/select-names/e-select-names-model.c')
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names-model.c | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-model.c b/addressbook/gui/component/select-names/e-select-names-model.c index 59d7bc7c24..1baf729b3e 100644 --- a/addressbook/gui/component/select-names/e-select-names-model.c +++ b/addressbook/gui/component/select-names/e-select-names-model.c @@ -355,7 +355,22 @@ e_select_names_model_changed (ESelectNamesModel *model) g_free (model->priv->addr_text); model->priv->addr_text = NULL; - gtk_signal_emit(GTK_OBJECT(model), e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED]); +#if 0 + { + GList *i = model->priv->data; + gint j = 0; + g_print ("ESelectNamesModel state:\n"); + while (i) { + EDestination *dest = (EDestination *) i->data; + g_print ("%d: %s <%s>\n", j, e_destination_get_string (dest), e_destination_get_email (dest)); + i = g_list_next (i); + ++j; + } + g_print ("\n"); + } +#endif + + gtk_signal_emit (GTK_OBJECT(model), e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED]); } void @@ -375,6 +390,20 @@ e_select_names_model_insert (ESelectNamesModel *model, gint index, EDestination } void +e_select_names_model_append (ESelectNamesModel *model, EDestination *dest) +{ + g_return_if_fail (model && E_IS_SELECT_NAMES_MODEL (model)); + g_return_if_fail (dest && E_IS_DESTINATION (dest)); + + model->priv->data = g_list_append (model->priv->data, dest); + + gtk_object_ref (GTK_OBJECT (dest)); + gtk_object_sink (GTK_OBJECT (dest)); + + e_select_names_model_changed (model); +} + +void e_select_names_model_replace (ESelectNamesModel *model, gint index, EDestination *dest) { GList *node; @@ -518,8 +547,16 @@ e_select_names_model_text_pos (ESelectNamesModel *model, gint pos, gint *index, while (iter != NULL) { len = e_destination_get_strlen (E_DESTINATION (iter->data)); - if (sp <= pos && pos <= sp + len + adj) +#if 0 + g_print ("text_pos: %d %d %d %d\n", len, sp, pos, adj); +#endif + + if (sp <= pos && pos <= sp + len + adj) { +#if 0 + g_print ("breaking\n"); +#endif break; + } sp += len + adj + 1; adj = 1; @@ -532,9 +569,16 @@ e_select_names_model_text_pos (ESelectNamesModel *model, gint pos, gint *index, ++sp; /* skip past "magic space" */ if (iter == NULL) { +#if 0 + g_print ("text_pos ended NULL\n"); +#endif i = -1; sp = -1; len = 0; + } else { +#if 0 + g_print ("text_pos got index %d\n", i); +#endif } if (index) |