diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-02-20 06:49:18 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-02-20 06:49:18 +0800 |
commit | d369e177b199c4c798f0b6ad8972951d8586bcd9 (patch) | |
tree | 492dd3459df5e78e6709e7879a70011f4f729012 /addressbook/gui/component/select-names/e-select-names-model.c | |
parent | 54105acd4e5283899c1659e64e41341eec8d667c (diff) | |
download | gsoc2013-evolution-d369e177b199c4c798f0b6ad8972951d8586bcd9.tar gsoc2013-evolution-d369e177b199c4c798f0b6ad8972951d8586bcd9.tar.gz gsoc2013-evolution-d369e177b199c4c798f0b6ad8972951d8586bcd9.tar.bz2 gsoc2013-evolution-d369e177b199c4c798f0b6ad8972951d8586bcd9.tar.lz gsoc2013-evolution-d369e177b199c4c798f0b6ad8972951d8586bcd9.tar.xz gsoc2013-evolution-d369e177b199c4c798f0b6ad8972951d8586bcd9.tar.zst gsoc2013-evolution-d369e177b199c4c798f0b6ad8972951d8586bcd9.zip |
When creating the entry, open up an ebook (corresponding to the local
2001-02-19 Jon Trowbridge <trow@ximian.com>
* gui/component/select-names/e-select-names-manager.c
(e_select_names_manager_create_entry): When creating the entry,
open up an ebook (corresponding to the local addressbook) and make
the entry use an EAddressCompletion.
(completion_handler): Added; this is the actual completion
handler, which manipulates the entry when the user selects
something from the drop-down.
* gui/component/select-names/e-select-names-model.c: Various hacks
by clahey to unbreak e_select_names_model_add_item,
e_select_names_model_replace_item (which I added) and
e_select_names_model_remove_item.
* gui/component/select-names/e-select-names-text-model.c
(e_select_names_text_model_obj_count,
e_select_names_text_model_get_nth_obj): Make chunks of text that
correspond to ECards in the ESelectNamesModel be embedded objects.
(e_select_names_text_model_activate_obj): On activation, pop up a
contact editor for the embedded object's card.
(e_select_names_text_model_model_changed): Fixed to work with
ETextModel API changes.
(e_select_names_text_model_set_text): Make const correct.
(e_select_names_text_model_insert): Make const correct.
(e_select_names_text_model_insert_length): Make const correct.
* backend/ebook/e-address-completion.h,
backend/ebook/e-address-completion.c: Added. EAddressCompletion
is a derived class of ECompletion that does asynchronous address
lookups for completions.
svn path=/trunk/; revision=8282
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 | 36 |
1 files changed, 34 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 0bbbe588a6..735840d2b3 100644 --- a/addressbook/gui/component/select-names/e-select-names-model.c +++ b/addressbook/gui/component/select-names/e-select-names-model.c @@ -420,13 +420,45 @@ e_select_names_model_replace (ESelectNamesModel *model, gtk_object_unref(GTK_OBJECT(iterator)); } +static void +esnm_add_item_real (ESelectNamesModel *model, + EIterator *iterator, /* NULL for at the beginning. */ + gboolean before, + ESelectNamesModelData *data) +{ + if (iterator == NULL) + iterator = e_list_get_iterator(model->data); + else + gtk_object_ref(GTK_OBJECT(iterator)); + + e_iterator_insert(iterator, data, before); + + gtk_object_unref(GTK_OBJECT(iterator)); +} + +static void +esnm_remove_item_real (ESelectNamesModel *model, + EIterator *iterator) +{ + e_iterator_delete(iterator); +} void e_select_names_model_add_item (ESelectNamesModel *model, EIterator *iterator, /* NULL for at the beginning. */ ESelectNamesModelData *data) { - e_iterator_insert(iterator, data, FALSE); + esnm_add_item_real(model, iterator, FALSE, data); + e_select_names_model_changed(model); +} + +void +e_select_names_model_replace_item (ESelectNamesModel *model, + EIterator *iterator, + ESelectNamesModelData *data) +{ + esnm_remove_item_real(model, iterator); + esnm_add_item_real(model, iterator, FALSE, data); e_select_names_model_changed(model); } @@ -434,7 +466,7 @@ void e_select_names_model_remove_item (ESelectNamesModel *model, EIterator *iterator) { - e_iterator_delete(iterator); + esnm_remove_item_real(model, iterator); e_select_names_model_changed(model); } |