diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-07-02 12:54:22 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-07-02 12:54:22 +0800 |
commit | 353946a818a6e373773cdfcad543e9d6b65f042d (patch) | |
tree | 6121196565997a1abd8a32cde021fd900070c12e /addressbook/gui/component | |
parent | e6191dc02e287a768ac8574499673d157397d079 (diff) | |
download | gsoc2013-evolution-353946a818a6e373773cdfcad543e9d6b65f042d.tar.gz gsoc2013-evolution-353946a818a6e373773cdfcad543e9d6b65f042d.tar.zst gsoc2013-evolution-353946a818a6e373773cdfcad543e9d6b65f042d.zip |
Added related_contacts field.
2001-07-02 Christopher James Lahey <clahey@ximian.com>
* backend/ebook/e-card.c, backend/ebook/e-card.h: Added
related_contacts field.
* gui/component/select-names/e-select-names-model.c,
gui/component/select-names/e-select-names-model.h
(e_select_names_model_import_destinationv): Added this function.
* gui/contact-editor/contact-editor.glade: Replaced the entry here
for related contacts with a table which is filled in in the C code.
* gui/contact-editor/e-contact-editor.c,
gui/contact-editor/e-contact-editor.h (add_lists): Added a select
names entry here for the related contacts field.
* gui/widgets/Makefile.am: Removed all the test programs here
since there are circular dependencies now.
svn path=/trunk/; revision=10666
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names-model.c | 81 | ||||
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names-model.h | 2 |
2 files changed, 56 insertions, 27 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 d562b40a64..8c10aa6035 100644 --- a/addressbook/gui/component/select-names/e-select-names-model.c +++ b/addressbook/gui/component/select-names/e-select-names-model.c @@ -202,6 +202,34 @@ e_select_names_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) } } + +static void +e_select_names_model_changed (ESelectNamesModel *model) +{ + g_free (model->priv->text); + model->priv->text = NULL; + + g_free (model->priv->addr_text); + model->priv->addr_text = NULL; + +#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]); +} + /** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/ ESelectNamesModel * @@ -342,6 +370,32 @@ e_select_names_model_export_destinationv (ESelectNamesModel *model) return str; } +static +void send_changed (EDestination *dest, ECard *card, gpointer closure) +{ + ESelectNamesModel *model = closure; + e_select_names_model_changed (model); +} + +void +e_select_names_model_import_destinationv (ESelectNamesModel *model, + gchar *destinationv) +{ + EDestination **destv; + gint i; + + g_return_if_fail (model && E_IS_SELECT_NAMES_MODEL (model)); + + destv = e_destination_importv (destinationv); + + e_select_names_model_delete_all (model); + for (i = 0; destv[i]; i++) { + e_destination_use_card (destv[i], send_changed, model); + e_select_names_model_append (model, destv[i]); + } + g_free (destv); +} + ECard * e_select_names_model_get_card (ESelectNamesModel *model, gint index) { @@ -370,33 +424,6 @@ e_select_names_model_get_string (ESelectNamesModel *model, gint index) return dest ? e_destination_get_string (dest) : ""; } -static void -e_select_names_model_changed (ESelectNamesModel *model) -{ - g_free (model->priv->text); - model->priv->text = NULL; - - g_free (model->priv->addr_text); - model->priv->addr_text = NULL; - -#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 e_select_names_model_insert (ESelectNamesModel *model, gint index, EDestination *dest) { diff --git a/addressbook/gui/component/select-names/e-select-names-model.h b/addressbook/gui/component/select-names/e-select-names-model.h index 417ec7abb1..989a829223 100644 --- a/addressbook/gui/component/select-names/e-select-names-model.h +++ b/addressbook/gui/component/select-names/e-select-names-model.h @@ -52,6 +52,8 @@ const gchar *e_select_names_model_get_address_text (ESelectNamesModel *model); gint e_select_names_model_count (ESelectNamesModel *model); const EDestination *e_select_names_model_get_destination (ESelectNamesModel *model, gint index); gchar *e_select_names_model_export_destinationv (ESelectNamesModel *model); +void e_select_names_model_import_destinationv (ESelectNamesModel *model, + gchar *destinationv); ECard *e_select_names_model_get_card (ESelectNamesModel *model, gint index); const gchar *e_select_names_model_get_string (ESelectNamesModel *model, gint index); |