diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-04-30 02:16:43 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-04-30 02:16:43 +0800 |
commit | 8d848e0e56a38c4da1d9c47ebe2ac3e7d0a7da39 (patch) | |
tree | 8b84648656eec372429a21410e7ea785338822e7 /addressbook | |
parent | 9a5cce66b1781608f1af25f017a8ee46373ad4d2 (diff) | |
download | gsoc2013-evolution-8d848e0e56a38c4da1d9c47ebe2ac3e7d0a7da39.tar.gz gsoc2013-evolution-8d848e0e56a38c4da1d9c47ebe2ac3e7d0a7da39.tar.zst gsoc2013-evolution-8d848e0e56a38c4da1d9c47ebe2ac3e7d0a7da39.zip |
Added e_card_phone_new e_card_delivery_address_new,
2000-04-29 Christopher James Lahey <clahey@helixcode.com>
* backend/ebook/e-card.c, backend/ebook/e-card.h: Added
e_card_phone_new e_card_delivery_address_new,
e_card_delivery_address_to_string, e_card_name_copy,
e_card_name_new, e_card_name_to_string, and made e_card_name_free
public. Removed some unused code.
* backend/pas/pas-backend-file.c: Fixed a warning.
* contact-editor/Makefile.am: Added e-contact-editor-fullname.[ch]
and fullname.glade. Added e-name libs and includes.
* contact-editor/e-contact-editor-fullname.c,
contact-editor/e-contact-editor-fullname.h,
contact-editor/fullname-strings.h, contact-editor/fullname.glade:
New dialog for editing the fields of a name separately.
* contact-editor/e-contact-editor.c,
contact-editor/e-contact-editor.h: Create an
EContactEditorFullname when you click on the Full Name button.
Maintain a parsed name at all times.
* gui/component/Makefile.am, gui/minicard/Makefile.am: Added
e-name libs.
svn path=/trunk/; revision=2683
Diffstat (limited to 'addressbook')
21 files changed, 1819 insertions, 88 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 4cacb9027f..6bdaa6c9ca 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,29 @@ +2000-04-29 Christopher James Lahey <clahey@helixcode.com> + + * backend/ebook/e-card.c, backend/ebook/e-card.h: Added + e_card_phone_new e_card_delivery_address_new, + e_card_delivery_address_to_string, e_card_name_copy, + e_card_name_new, e_card_name_to_string, and made e_card_name_free + public. Removed some unused code. + + * backend/pas/pas-backend-file.c: Fixed a warning. + + * contact-editor/Makefile.am: Added e-contact-editor-fullname.[ch] + and fullname.glade. Added e-name libs and includes. + + * contact-editor/e-contact-editor-fullname.c, + contact-editor/e-contact-editor-fullname.h, + contact-editor/fullname-strings.h, contact-editor/fullname.glade: + New dialog for editing the fields of a name separately. + + * contact-editor/e-contact-editor.c, + contact-editor/e-contact-editor.h: Create an + EContactEditorFullname when you click on the Full Name button. + Maintain a parsed name at all times. + + * gui/component/Makefile.am, gui/minicard/Makefile.am: Added + e-name libs. + 2000-04-28 Larry Ewing <lewing@helixcode.com> * backend/pas/pas-book-factory.c (register_factory): fix the diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c index 1b27ed164e..eea5c16dc1 100644 --- a/addressbook/backend/ebook/e-card.c +++ b/addressbook/backend/ebook/e-card.c @@ -62,7 +62,6 @@ static void e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void assign_string(VObject *vobj, char **string); -static void e_card_name_free(ECardName *name); char *e_v_object_get_child_value(VObject *vobj, char *name); static ECardDate e_card_date_from_string (char *str); @@ -772,12 +771,23 @@ e_card_class_init (ECardClass *klass) object_class->set_arg = e_card_set_arg; } +ECardPhone * +e_card_phone_new (void) +{ + ECardPhone *newphone = g_new(ECardPhone, 1); + + newphone->number = NULL; + newphone->flags = 0; + + return newphone; +} + void e_card_phone_free (ECardPhone *phone) { if ( phone ) { - if ( phone->number ) - g_free(phone->number); + g_free(phone->number); + g_free(phone); } } @@ -794,24 +804,35 @@ e_card_phone_copy (const ECardPhone *phone) return NULL; } +ECardDeliveryAddress * +e_card_delivery_address_new (void) +{ + ECardDeliveryAddress *newaddr = g_new(ECardDeliveryAddress, 1); + + newaddr->po = NULL; + newaddr->ext = NULL; + newaddr->street = NULL; + newaddr->city = NULL; + newaddr->region = NULL; + newaddr->code = NULL; + newaddr->country = NULL; + newaddr->flags = 0; + + return newaddr; +} + void e_card_delivery_address_free (ECardDeliveryAddress *addr) { if ( addr ) { - if ( addr->po ) - g_free(addr->po); - if ( addr->ext ) - g_free(addr->ext); - if ( addr->street ) - g_free(addr->street); - if ( addr->city ) - g_free(addr->city); - if ( addr->region ) - g_free(addr->region); - if ( addr->code ) - g_free(addr->code); - if ( addr->country ) - g_free(addr->country); + g_free(addr->po); + g_free(addr->ext); + g_free(addr->street); + g_free(addr->city); + g_free(addr->region); + g_free(addr->code); + g_free(addr->country); + g_free(addr); } } @@ -834,12 +855,66 @@ e_card_delivery_address_copy (const ECardDeliveryAddress *addr) return NULL; } +char * +e_card_delivery_address_to_string(const ECardDeliveryAddress *addr) +{ + char *strings[4], **stringptr = strings; + char *line1, *line22, *line2; + char *final; + if (addr->po && *addr->po) + *(stringptr++) = addr->po; + if (addr->street && *addr->street) + *(stringptr++) = addr->street; + if (addr->ext && *addr->ext) + *(stringptr++) = addr->ext; + *stringptr = NULL; + line1 = g_strjoinv(" ", strings); + stringptr = strings; + if (addr->region && *addr->region) + *(stringptr++) = addr->region; + if (addr->code && *addr->code) + *(stringptr++) = addr->code; + *stringptr = NULL; + line22 = g_strjoinv(" ", strings); + stringptr = strings; + if (addr->city && *addr->city) + *(stringptr++) = addr->city; + if (line22 && *line22) + *(stringptr++) = line22; + *stringptr = NULL; + line2 = g_strjoinv(", ", strings); + stringptr = strings; + if (line1 && *line1) + *(stringptr++) = line1; + if (line2 && *line2) + *(stringptr++) = line2; + if (addr->country && *addr->country) + *(stringptr++) = addr->country; + *stringptr = NULL; + final = g_strjoinv("\n", strings); + g_free(line1); + g_free(line22); + g_free(line2); + return final; +} + +ECardAddrLabel * +e_card_address_label_new (void) +{ + ECardAddrLabel *newaddr = g_new(ECardAddrLabel, 1); + + newaddr->data = NULL; + newaddr->flags = 0; + + return newaddr; +} + void e_card_address_label_free (ECardAddrLabel *addr) { if ( addr ) { - if ( addr->data ) - g_free(addr->data); + g_free(addr->data); + g_free(addr); } } @@ -856,6 +931,69 @@ e_card_address_label_copy (const ECardAddrLabel *addr) return NULL; } +ECardName *e_card_name_new(void) +{ + ECardName *newname = g_new(ECardName, 1); + + newname->prefix = NULL; + newname->given = NULL; + newname->additional = NULL; + newname->family = NULL; + newname->suffix = NULL; + + return newname; +} + +void +e_card_name_free(ECardName *name) +{ + if (name) { + if ( name->prefix ) + g_free(name->prefix); + if ( name->given ) + g_free(name->given); + if ( name->additional ) + g_free(name->additional); + if ( name->family ) + g_free(name->family); + if ( name->suffix ) + g_free(name->suffix); + g_free ( name ); + } +} + +ECardName * +e_card_name_copy(const ECardName *name) +{ + ECardName *newname = g_new(ECardName, 1); + + newname->prefix = g_strdup(name->prefix); + newname->given = g_strdup(name->given); + newname->additional = g_strdup(name->additional); + newname->family = g_strdup(name->family); + newname->suffix = g_strdup(name->suffix); + + return newname; +} + +char * +e_card_name_to_string(const ECardName *name) +{ + char *strings[6], **stringptr = strings; + if (name->prefix && *name->prefix) + *(stringptr++) = name->prefix; + if (name->given && *name->given) + *(stringptr++) = name->given; + if (name->additional && *name->additional) + *(stringptr++) = name->additional; + if (name->family && *name->family) + *(stringptr++) = name->family; + if (name->suffix && *name->suffix) + *(stringptr++) = name->suffix; + *stringptr = NULL; + return g_strjoinv(" ", strings); +} + /* * ECard lifecycle management and vCard loading/saving. */ @@ -1215,18 +1353,6 @@ e_card_str_free (CardStrProperty *sp) } static void -e_card_name_free (CardName *name) -{ - g_free (name->family); - g_free (name->given); - g_free (name->additional); - g_free (name->prefix); - g_free (name->suffix); - - e_card_prop_free (name->prop); -} - -static void e_card_photo_free (CardPhoto *photo) { g_free (photo->data); @@ -2688,24 +2814,6 @@ e_card_date_from_string (char *str) return date; } -static void -e_card_name_free(ECardName *name) -{ - if ( name ) { - if ( name->prefix ) - g_free(name->prefix); - if ( name->given ) - g_free(name->given); - if ( name->additional ) - g_free(name->additional); - if ( name->family ) - g_free(name->family); - if ( name->suffix ) - g_free(name->suffix); - g_free ( name ); - } -} - char * e_v_object_get_child_value(VObject *vobj, char *name) { diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h index 1c48376dca..c42db15461 100644 --- a/addressbook/backend/ebook/e-card.h +++ b/addressbook/backend/ebook/e-card.h @@ -64,9 +64,6 @@ struct _ECard { char *fburl; /* Free Busy URL */ #if 0 - ECardOrg *org; /* The person's organization. */ - - char *role; /* The person's role w/in his org */ ECardPhoto *logo; /* This person's org's logo. */ ECardPhoto *photo; /* A photo of the person. */ @@ -78,8 +75,6 @@ struct _ECard { char *categories; /* A list of the categories to which this card belongs. */ - char *comment; /* An unstructured comment string. */ - ECardSound *sound; ECardKey *key; /* The person's public key. */ @@ -88,7 +83,6 @@ struct _ECard { char *mailer; /* The user's mailer. */ - char *uid; /* This card's unique identifier. */ ECardRev *rev; /* The time this card was last modified. */ @@ -109,31 +103,25 @@ char *e_card_get_vcard (ECard *card); ECard *e_card_duplicate (ECard *card); +ECardPhone *e_card_phone_new (void); void e_card_phone_free (ECardPhone *phone); ECardPhone *e_card_phone_copy (const ECardPhone *phone); + +ECardDeliveryAddress *e_card_delivery_address_new (void); void e_card_delivery_address_free (ECardDeliveryAddress *addr); ECardDeliveryAddress *e_card_delivery_address_copy (const ECardDeliveryAddress *addr); +char *e_card_delivery_address_to_string (const ECardDeliveryAddress *addr); + +ECardAddrLabel *e_card_address_label_new (void); void e_card_address_label_free (ECardAddrLabel *addr); ECardAddrLabel *e_card_address_label_copy (const ECardAddrLabel *addr); +ECardName *e_card_name_new (void); +void e_card_name_free(ECardName *name); +ECardName *e_card_name_copy (const ECardName *name); +char *e_card_name_to_string(const ECardName *name); /* Standard Gtk function */ GtkType e_card_get_type (void); - -#if 0 -void e_card_free (ECard *crd); -void e_card_prop_free (CardProperty prop); -CardProperty e_card_prop_empty (void); -int e_card_check_prop (CardProperty prop); -GList *e_card_load (GList *crdlist, char *fname); -void e_card_save (ECard *crd, FILE *fp); -char *e_card_to_vobj_string (ECard *card); -char *e_card_to_string (ECard *card); - -char *e_card_bday_str (ECardDate bday); -char *e_card_timezn_str (ECardTimeZone timezn); -char *e_card_geopos_str (ECardGeoPos geopos); -#endif - #endif /* ! __E_CARD_H__ */ diff --git a/addressbook/backend/pas/pas-book-factory.c b/addressbook/backend/pas/pas-book-factory.c index 93030447a7..77cc269f19 100644 --- a/addressbook/backend/pas/pas-book-factory.c +++ b/addressbook/backend/pas/pas-book-factory.c @@ -350,7 +350,7 @@ register_factory (CORBA_Object obj) g_message ("pas_book_factory_activate: Exception " "registering PASBookFactory!\n"); CORBA_exception_free (&ev); - return; + return FALSE; } CORBA_exception_free (&ev); diff --git a/addressbook/contact-editor/Makefile.am b/addressbook/contact-editor/Makefile.am index 0a8b3a8489..a8fc308314 100644 --- a/addressbook/contact-editor/Makefile.am +++ b/addressbook/contact-editor/Makefile.am @@ -13,6 +13,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/addressbook/ \ -I$(top_srcdir)/addressbook/backend \ + -I$(top_srcdir)/addressbook/ename \ -DEVOLUTION_IMAGES=\""$(imagesdir)"\" \ -DG_LOG_DOMAIN=\"contact-editor\" @@ -20,6 +21,8 @@ noinst_LIBRARIES = \ libecontacteditor.a libecontacteditor_a_SOURCES = \ + e-contact-editor-fullname.c \ + e-contact-editor-fullname.h \ e-contact-editor.c \ e-contact-editor.h @@ -31,6 +34,7 @@ contact_editor_test_SOURCES = \ contact_editor_test_LDADD = \ $(top_builddir)/addressbook/backend/ebook/libebook.la \ + $(top_builddir)/addressbook/ename/libename.la \ $(top_builddir)/libversit/libversit.la \ $(GNOMEGNORBA_LIBS) \ -lbonobo \ @@ -41,4 +45,5 @@ contact_editor_test_LDADD = \ gladedir = $(datadir)/evolution/glade glade_DATA = \ - contact-editor.glade + contact-editor.glade \ + fullname.glade diff --git a/addressbook/contact-editor/e-contact-editor-fullname.c b/addressbook/contact-editor/e-contact-editor-fullname.c new file mode 100644 index 0000000000..1b37280dc1 --- /dev/null +++ b/addressbook/contact-editor/e-contact-editor-fullname.c @@ -0,0 +1,214 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * e-contact-editor-fullname.c + * Copyright (C) 2000 Helix Code, Inc. + * Author: Chris Lahey <clahey@helixcode.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include <config.h> +#include <gnome.h> +#include <e-contact-editor-fullname.h> + +static void e_contact_editor_fullname_init (EContactEditorFullname *card); +static void e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass); +static void e_contact_editor_fullname_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); +static void e_contact_editor_fullname_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); +static void e_contact_editor_fullname_destroy (GtkObject *object); + +static void fill_in_info(EContactEditorFullname *editor); +static void extract_info(EContactEditorFullname *editor); + +static GnomeDialogClass *parent_class = NULL; + +/* The arguments we take */ +enum { + ARG_0, + ARG_NAME +}; + +GtkType +e_contact_editor_fullname_get_type (void) +{ + static GtkType contact_editor_fullname_type = 0; + + if (!contact_editor_fullname_type) + { + static const GtkTypeInfo contact_editor_fullname_info = + { + "EContactEditorFullname", + sizeof (EContactEditorFullname), + sizeof (EContactEditorFullnameClass), + (GtkClassInitFunc) e_contact_editor_fullname_class_init, + (GtkObjectInitFunc) e_contact_editor_fullname_init, + /* reserved_1 */ NULL, + /* reserved_2 */ NULL, + (GtkClassInitFunc) NULL, + }; + + contact_editor_fullname_type = gtk_type_unique (gnome_dialog_get_type (), &contact_editor_fullname_info); + } + + return contact_editor_fullname_type; +} + +static void +e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass) +{ + GtkObjectClass *object_class; + GnomeDialogClass *dialog_class; + + object_class = (GtkObjectClass*) klass; + dialog_class = (GnomeDialogClass *) klass; + + parent_class = gtk_type_class (gnome_dialog_get_type ()); + + gtk_object_add_arg_type ("EContactEditorFullname::name", GTK_TYPE_POINTER, + GTK_ARG_READWRITE, ARG_NAME); + + object_class->set_arg = e_contact_editor_fullname_set_arg; + object_class->get_arg = e_contact_editor_fullname_get_arg; + object_class->destroy = e_contact_editor_fullname_destroy; +} + +static void +e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullname) +{ + GladeXML *gui; + GtkWidget *widget; + + gnome_dialog_append_button ( GNOME_DIALOG(e_contact_editor_fullname), + GNOME_STOCK_BUTTON_OK); + + gnome_dialog_append_button ( GNOME_DIALOG(e_contact_editor_fullname), + GNOME_STOCK_BUTTON_CANCEL); + + gtk_window_set_policy(GTK_WINDOW(e_contact_editor_fullname), TRUE, TRUE, FALSE); + + e_contact_editor_fullname->name = NULL; + gui = glade_xml_new (EVOLUTION_GLADEDIR "/fullname.glade", NULL); + e_contact_editor_fullname->gui = gui; + + widget = glade_xml_get_widget(gui, "vbox-checkfullname"); + gtk_widget_ref(widget); + gtk_container_remove(GTK_CONTAINER(widget->parent), widget); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (e_contact_editor_fullname)->vbox), widget, TRUE, TRUE, 0); + gtk_widget_unref(widget); +} + +void +e_contact_editor_fullname_destroy (GtkObject *object) +{ + EContactEditorFullname *e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME(object); + + if (e_contact_editor_fullname->gui) + gtk_object_unref(GTK_OBJECT(e_contact_editor_fullname->gui)); + e_card_name_free(e_contact_editor_fullname->name); +} + +GtkWidget* +e_contact_editor_fullname_new (ECardName *name) +{ + GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_contact_editor_fullname_get_type ())); + gtk_object_set (GTK_OBJECT(widget), + "name", name, + NULL); + return widget; +} + +static void +e_contact_editor_fullname_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +{ + EContactEditorFullname *e_contact_editor_fullname; + + e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME (o); + + switch (arg_id){ + case ARG_NAME: + if (e_contact_editor_fullname->name) + e_card_name_free(e_contact_editor_fullname->name); + e_contact_editor_fullname->name = e_card_name_copy(GTK_VALUE_POINTER (*arg)); + fill_in_info(e_contact_editor_fullname); + break; + } +} + +static void +e_contact_editor_fullname_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +{ + EContactEditorFullname *e_contact_editor_fullname; + + e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME (object); + + switch (arg_id) { + case ARG_NAME: + extract_info(e_contact_editor_fullname); + GTK_VALUE_POINTER (*arg) = e_card_name_copy(e_contact_editor_fullname->name); + break; + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + +static void +fill_in_field(EContactEditorFullname *editor, char *field, char *string) +{ + GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field)); + if (entry) { + if (string) + gtk_entry_set_text(entry, string); + else + gtk_entry_set_text(entry, ""); + } +} + +static void +fill_in_info(EContactEditorFullname *editor) +{ + ECardName *name = editor->name; + if (name) { + fill_in_field(editor, "entry-title", name->prefix); + fill_in_field(editor, "entry-first", name->given); + fill_in_field(editor, "entry-middle", name->additional); + fill_in_field(editor, "entry-last", name->family); + fill_in_field(editor, "entry-suffix", name->suffix); + } +} + +static char * +extract_field(EContactEditorFullname *editor, char *field) +{ + GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field)); + if (entry) + return g_strdup(gtk_entry_get_text(entry)); + else + return NULL; +} + +static void +extract_info(EContactEditorFullname *editor) +{ + ECardName *name = editor->name; + if (!name) + name = e_card_name_new(); + name->prefix = extract_field(editor, "entry-title" ); + name->given = extract_field(editor, "entry-first" ); + name->additional = extract_field(editor, "entry-middle"); + name->family = extract_field(editor, "entry-last" ); + name->suffix = extract_field(editor, "entry-suffix"); +} diff --git a/addressbook/contact-editor/e-contact-editor-fullname.h b/addressbook/contact-editor/e-contact-editor-fullname.h new file mode 100644 index 0000000000..409ffc72d0 --- /dev/null +++ b/addressbook/contact-editor/e-contact-editor-fullname.h @@ -0,0 +1,75 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* e-contact-editor-fullname.h + * Copyright (C) 2000 Helix Code, Inc. + * Author: Chris Lahey <clahey@helixcode.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef __E_CONTACT_EDITOR_FULLNAME_H__ +#define __E_CONTACT_EDITOR_FULLNAME_H__ + +#include <gnome.h> +#include <glade/glade.h> +#include <ebook/e-card.h> + +#ifdef __cplusplus +extern "C" { +#pragma } +#endif /* __cplusplus */ + +/* EContactEditorFullname - A dialog displaying information about a contact. + * + * The following arguments are available: + * + * name type read/write description + * -------------------------------------------------------------------------------- + * name ECardName * RW The card currently being edited. Returns a copy. + */ + +#define E_CONTACT_EDITOR_FULLNAME_TYPE (e_contact_editor_fullname_get_type ()) +#define E_CONTACT_EDITOR_FULLNAME(obj) (GTK_CHECK_CAST ((obj), E_CONTACT_EDITOR_FULLNAME_TYPE, EContactEditorFullname)) +#define E_CONTACT_EDITOR_FULLNAME_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_CONTACT_EDITOR_FULLNAME_TYPE, EContactEditorFullnameClass)) +#define E_IS_CONTACT_EDITOR_FULLNAME(obj) (GTK_CHECK_TYPE ((obj), E_CONTACT_EDITOR_FULLNAME_TYPE)) +#define E_IS_CONTACT_EDITOR_FULLNAME_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_CONTACT_EDITOR_FULLNAME_TYPE)) + + +typedef struct _EContactEditorFullname EContactEditorFullname; +typedef struct _EContactEditorFullnameClass EContactEditorFullnameClass; + +struct _EContactEditorFullname +{ + GnomeDialog parent; + + /* item specific fields */ + ECardName *name; + GladeXML *gui; +}; + +struct _EContactEditorFullnameClass +{ + GnomeDialogClass parent_class; +}; + + +GtkWidget *e_contact_editor_fullname_new(ECardName *name); +GtkType e_contact_editor_fullname_get_type (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __E_CONTACT_EDITOR_FULLNAME_H__ */ diff --git a/addressbook/contact-editor/e-contact-editor.c b/addressbook/contact-editor/e-contact-editor.c index 5665e0d217..a8bc443200 100644 --- a/addressbook/contact-editor/e-contact-editor.c +++ b/addressbook/contact-editor/e-contact-editor.c @@ -1,4 +1,3 @@ - /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * e-contact-editor.c @@ -24,6 +23,8 @@ #include <config.h> #include <gnome.h> #include "e-contact-editor.h" +#include <e-name-western.h> +#include <e-contact-editor-fullname.h> static void e_contact_editor_init (EContactEditor *card); static void e_contact_editor_class_init (EContactEditorClass *klass); @@ -211,9 +212,7 @@ phone_entry_changed (GtkWidget *widget, EContactEditor *editor) g_free(editor->phone[editor->phone_choice[which - 1]]->number); editor->phone[editor->phone_choice[which - 1]]->number = NULL; } else { - editor->phone[editor->phone_choice[which - 1]] = g_new(ECardPhone, 1); - editor->phone[editor->phone_choice[which - 1]]->number = NULL; - editor->phone[editor->phone_choice[which - 1]]->flags = 0; + editor->phone[editor->phone_choice[which - 1]] = e_card_phone_new(); } editor->phone[editor->phone_choice[which - 1]]->number = g_strdup(string); set_fields(editor); @@ -252,15 +251,41 @@ address_text_changed (GtkWidget *widget, EContactEditor *editor) g_free(editor->address[editor->address_choice]->data); editor->address[editor->address_choice]->data = NULL; } else { - editor->address[editor->address_choice] = g_new(ECardAddrLabel, 1); - editor->address[editor->address_choice]->data = NULL; - editor->address[editor->address_choice]->flags = 0; + editor->address[editor->address_choice] = e_card_address_label_new(); } editor->address[editor->address_choice]->data = g_strdup(string); g_free(string); } static void +name_entry_changed (GtkWidget *widget, EContactEditor *editor) +{ + char *string; + ECardName *name; + GtkEntry *entry = GTK_ENTRY(widget); + ENameWestern *western; + + name = editor->name; + if (name) + e_card_name_free(name); + + name = e_card_name_new(); + + string = gtk_entry_get_text(entry); + western = e_name_western_parse (string); + + name->prefix = g_strdup (western->prefix); + name->given = g_strdup (western->first ); + name->additional = g_strdup (western->middle); + name->family = g_strdup (western->last ); + name->suffix = g_strdup (western->suffix); + + e_name_western_free(western); + + editor->name = name; +} + +static void set_entry_changed_signal_phone(EContactEditor *editor, char *id) { GtkWidget *widget = glade_xml_get_widget(editor->gui, id); @@ -282,6 +307,32 @@ set_entry_changed_signals(EContactEditor *editor) widget = glade_xml_get_widget(editor->gui, "text-address"); gtk_signal_connect(GTK_OBJECT(widget), "changed", address_text_changed, editor); + widget = glade_xml_get_widget(editor->gui, "entry-fullname"); + gtk_signal_connect(GTK_OBJECT(widget), "changed", + name_entry_changed, editor); +} + +static void +full_name_clicked(GtkWidget *button, EContactEditor *editor) +{ + GnomeDialog *dialog = GNOME_DIALOG(e_contact_editor_fullname_new(editor->name)); + int result; + gtk_widget_show(GTK_WIDGET(dialog)); + gnome_dialog_close_hides (dialog, TRUE); + result = gnome_dialog_run_and_close (dialog); + if (result == 0) { + ECardName *name; + char *full_name; + gtk_object_get(GTK_OBJECT(dialog), + "name", &name, + NULL); + full_name = e_card_name_to_string(name); + gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(editor->gui, "entry-fullname")), full_name); + g_free(full_name); + e_card_name_free(editor->name); + editor->name = e_card_name_copy(name); + } + gtk_object_unref(GTK_OBJECT(dialog)); } static void @@ -302,6 +353,9 @@ e_contact_editor_init (EContactEditor *e_contact_editor) _replace_buttons(e_contact_editor); set_entry_changed_signals(e_contact_editor); + gtk_signal_connect(GTK_OBJECT(glade_xml_get_widget(e_contact_editor->gui, "button-fullname")), "clicked", + full_name_clicked, e_contact_editor); + gtk_object_get(GTK_OBJECT(glade_xml_get_widget(gui, "text-comments")), "vadjustment", &adjustment, NULL); @@ -317,6 +371,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) e_contact_editor->email_list = NULL; e_contact_editor->phone_list = NULL; e_contact_editor->address_list = NULL; + e_contact_editor->name = NULL; for (i = 0; i < E_CONTACT_EDITOR_PHONE_ID_LAST; i++) { e_contact_editor->phone[i] = NULL; @@ -784,6 +839,7 @@ fill_in_info(EContactEditor *editor) if (card) { char *file_as; char *fname; + ECardName *name; ECardList *address_list; ECardList *phone_list; ECardList *email_list; @@ -811,6 +867,7 @@ fill_in_info(EContactEditor *editor) gtk_object_get(GTK_OBJECT(card), "file_as", &file_as, + "name", &name, "full_name", &fname, "address_label", &address_list, "phone", &phone_list, @@ -837,6 +894,8 @@ fill_in_info(EContactEditor *editor) if (fname) gtk_editable_insert_text(editable, fname, strlen(fname), &position); + + position = 0; editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-file-as")); gtk_editable_delete_text(editable, 0, -1); diff --git a/addressbook/contact-editor/e-contact-editor.h b/addressbook/contact-editor/e-contact-editor.h index 394d136eed..fa31e73bde 100644 --- a/addressbook/contact-editor/e-contact-editor.h +++ b/addressbook/contact-editor/e-contact-editor.h @@ -113,6 +113,8 @@ struct _EContactEditor ECardPhone *phone[E_CONTACT_EDITOR_PHONE_ID_LAST]; char *email[E_CONTACT_EDITOR_EMAIL_ID_LAST]; ECardAddrLabel *address[E_CONTACT_EDITOR_ADDRESS_ID_LAST]; + + ECardName *name; EContactEditorEmailId email_choice; EContactEditorPhoneId phone_choice[4]; diff --git a/addressbook/contact-editor/fullname-strings.h b/addressbook/contact-editor/fullname-strings.h new file mode 100644 index 0000000000..cd6b118547 --- /dev/null +++ b/addressbook/contact-editor/fullname-strings.h @@ -0,0 +1,25 @@ +/* + * Translatable strings file generated by Glade. + * Add this file to your project's POTFILES.in. + * DO NOT compile it as part of your application. + */ + +gchar *s = N_("Check Full Name"); +gchar *s = N_("Title:"); +gchar *s = N_("First:"); +gchar *s = N_("Middle:"); +gchar *s = N_("Last:"); +gchar *s = N_("Suffix:"); +gchar *s = N_("\n" + "Mr.\n" + "Mrs.\n" + "Dr.\n" + ""); +gchar *s = N_("\n" + "Senior\n" + "Junior\n" + "II\n" + "III\n" + "Esquire\n" + ""); +gchar *s = N_("Show this again when name is incomplete or unclear"); diff --git a/addressbook/contact-editor/fullname.glade b/addressbook/contact-editor/fullname.glade new file mode 100644 index 0000000000..3f1fc58a50 --- /dev/null +++ b/addressbook/contact-editor/fullname.glade @@ -0,0 +1,421 @@ +<?xml version="1.0"?> +<GTK-Interface> + +<project> + <name>fullname</name> + <program_name>fullname</program_name> + <directory></directory> + <source_directory>src</source_directory> + <pixmaps_directory>pixmaps</pixmaps_directory> + <language>C</language> + <gnome_support>True</gnome_support> + <gettext_support>True</gettext_support> + <use_widget_names>True</use_widget_names> + <output_main_file>False</output_main_file> + <output_support_files>False</output_support_files> + <output_build_files>False</output_build_files> + <output_translatable_strings>True</output_translatable_strings> + <translatable_strings_file>fullname-strings.h</translatable_strings_file> +</project> + +<widget> + <class>GnomeDialog</class> + <name>dialog-checkfullname</name> + <visible>False</visible> + <title>Check Full Name</title> + <type>GTK_WINDOW_TOPLEVEL</type> + <position>GTK_WIN_POS_NONE</position> + <modal>True</modal> + <allow_shrink>True</allow_shrink> + <allow_grow>True</allow_grow> + <auto_shrink>False</auto_shrink> + <auto_close>False</auto_close> + <hide_on_close>False</hide_on_close> + + <widget> + <class>GtkVBox</class> + <child_name>GnomeDialog:vbox</child_name> + <name>vbox-container</name> + <homogeneous>False</homogeneous> + <spacing>8</spacing> + <child> + <padding>4</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkHButtonBox</class> + <child_name>GnomeDialog:action_area</child_name> + <name>hbuttonbox1</name> + <layout_style>GTK_BUTTONBOX_END</layout_style> + <spacing>8</spacing> + <child_min_width>85</child_min_width> + <child_min_height>27</child_min_height> + <child_ipad_x>7</child_ipad_x> + <child_ipad_y>0</child_ipad_y> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + <pack>GTK_PACK_END</pack> + </child> + + <widget> + <class>GtkButton</class> + <name>button1</name> + <can_default>True</can_default> + <can_focus>True</can_focus> + <stock_button>GNOME_STOCK_BUTTON_OK</stock_button> + </widget> + + <widget> + <class>GtkButton</class> + <name>button2</name> + <can_default>True</can_default> + <can_focus>True</can_focus> + <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button> + </widget> + </widget> + + <widget> + <class>GtkVBox</class> + <name>vbox-checkfullname</name> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkTable</class> + <name>table1</name> + <border_width>8</border_width> + <rows>5</rows> + <columns>3</columns> + <homogeneous>False</homogeneous> + <row_spacing>6</row_spacing> + <column_spacing>21</column_spacing> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkAccelLabel</class> + <name>accellabel1</name> + <label>Title:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkAccelLabel</class> + <name>accellabel2</name> + <label>First:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkAccelLabel</class> + <name>accellabel3</name> + <label>Middle:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkAccelLabel</class> + <name>accellabel4</name> + <label>Last:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkAccelLabel</class> + <name>accellabel5</name> + <label>Suffix:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>4</top_attach> + <bottom_attach>5</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkCombo</class> + <name>combo-title</name> + <value_in_list>False</value_in_list> + <ok_if_empty>True</ok_if_empty> + <case_sensitive>False</case_sensitive> + <use_arrows>True</use_arrows> + <use_arrows_always>False</use_arrows_always> + <items> +Mr. +Mrs. +Dr. +</items> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + + <widget> + <class>GtkEntry</class> + <child_name>GtkCombo:entry</child_name> + <name>entry-title</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + </widget> + </widget> + + <widget> + <class>GtkCombo</class> + <name>combo-suffix</name> + <value_in_list>False</value_in_list> + <ok_if_empty>True</ok_if_empty> + <case_sensitive>False</case_sensitive> + <use_arrows>True</use_arrows> + <use_arrows_always>False</use_arrows_always> + <items> +Senior +Junior +II +III +Esquire +</items> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>4</top_attach> + <bottom_attach>5</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + + <widget> + <class>GtkEntry</class> + <child_name>GtkCombo:entry</child_name> + <name>entry-suffix</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + </widget> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry-first</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>3</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry-middle</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>3</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry-last</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>3</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + </widget> + + <widget> + <class>GtkVBox</class> + <name>vbox3</name> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkCheckButton</class> + <name>checkbutton-showagain</name> + <can_focus>True</can_focus> + <label>Show this again when name is incomplete or unclear</label> + <active>False</active> + <draw_indicator>True</draw_indicator> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + </widget> + </widget> + </widget> +</widget> + +</GTK-Interface> diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am index 9e72319d03..38eb1a0c38 100644 --- a/addressbook/gui/component/Makefile.am +++ b/addressbook/gui/component/Makefile.am @@ -30,6 +30,7 @@ evolution_addressbook_LDADD = \ $(top_builddir)/widgets/e-text/libetext.a \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/addressbook/backend/ebook/libebook.la \ + $(top_builddir)/addressbook/ename/libename.la \ $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \ $(top_builddir)/libversit/libversit.la diff --git a/addressbook/gui/contact-editor/Makefile.am b/addressbook/gui/contact-editor/Makefile.am index 0a8b3a8489..a8fc308314 100644 --- a/addressbook/gui/contact-editor/Makefile.am +++ b/addressbook/gui/contact-editor/Makefile.am @@ -13,6 +13,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/addressbook/ \ -I$(top_srcdir)/addressbook/backend \ + -I$(top_srcdir)/addressbook/ename \ -DEVOLUTION_IMAGES=\""$(imagesdir)"\" \ -DG_LOG_DOMAIN=\"contact-editor\" @@ -20,6 +21,8 @@ noinst_LIBRARIES = \ libecontacteditor.a libecontacteditor_a_SOURCES = \ + e-contact-editor-fullname.c \ + e-contact-editor-fullname.h \ e-contact-editor.c \ e-contact-editor.h @@ -31,6 +34,7 @@ contact_editor_test_SOURCES = \ contact_editor_test_LDADD = \ $(top_builddir)/addressbook/backend/ebook/libebook.la \ + $(top_builddir)/addressbook/ename/libename.la \ $(top_builddir)/libversit/libversit.la \ $(GNOMEGNORBA_LIBS) \ -lbonobo \ @@ -41,4 +45,5 @@ contact_editor_test_LDADD = \ gladedir = $(datadir)/evolution/glade glade_DATA = \ - contact-editor.glade + contact-editor.glade \ + fullname.glade diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c new file mode 100644 index 0000000000..1b37280dc1 --- /dev/null +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -0,0 +1,214 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * e-contact-editor-fullname.c + * Copyright (C) 2000 Helix Code, Inc. + * Author: Chris Lahey <clahey@helixcode.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include <config.h> +#include <gnome.h> +#include <e-contact-editor-fullname.h> + +static void e_contact_editor_fullname_init (EContactEditorFullname *card); +static void e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass); +static void e_contact_editor_fullname_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); +static void e_contact_editor_fullname_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); +static void e_contact_editor_fullname_destroy (GtkObject *object); + +static void fill_in_info(EContactEditorFullname *editor); +static void extract_info(EContactEditorFullname *editor); + +static GnomeDialogClass *parent_class = NULL; + +/* The arguments we take */ +enum { + ARG_0, + ARG_NAME +}; + +GtkType +e_contact_editor_fullname_get_type (void) +{ + static GtkType contact_editor_fullname_type = 0; + + if (!contact_editor_fullname_type) + { + static const GtkTypeInfo contact_editor_fullname_info = + { + "EContactEditorFullname", + sizeof (EContactEditorFullname), + sizeof (EContactEditorFullnameClass), + (GtkClassInitFunc) e_contact_editor_fullname_class_init, + (GtkObjectInitFunc) e_contact_editor_fullname_init, + /* reserved_1 */ NULL, + /* reserved_2 */ NULL, + (GtkClassInitFunc) NULL, + }; + + contact_editor_fullname_type = gtk_type_unique (gnome_dialog_get_type (), &contact_editor_fullname_info); + } + + return contact_editor_fullname_type; +} + +static void +e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass) +{ + GtkObjectClass *object_class; + GnomeDialogClass *dialog_class; + + object_class = (GtkObjectClass*) klass; + dialog_class = (GnomeDialogClass *) klass; + + parent_class = gtk_type_class (gnome_dialog_get_type ()); + + gtk_object_add_arg_type ("EContactEditorFullname::name", GTK_TYPE_POINTER, + GTK_ARG_READWRITE, ARG_NAME); + + object_class->set_arg = e_contact_editor_fullname_set_arg; + object_class->get_arg = e_contact_editor_fullname_get_arg; + object_class->destroy = e_contact_editor_fullname_destroy; +} + +static void +e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullname) +{ + GladeXML *gui; + GtkWidget *widget; + + gnome_dialog_append_button ( GNOME_DIALOG(e_contact_editor_fullname), + GNOME_STOCK_BUTTON_OK); + + gnome_dialog_append_button ( GNOME_DIALOG(e_contact_editor_fullname), + GNOME_STOCK_BUTTON_CANCEL); + + gtk_window_set_policy(GTK_WINDOW(e_contact_editor_fullname), TRUE, TRUE, FALSE); + + e_contact_editor_fullname->name = NULL; + gui = glade_xml_new (EVOLUTION_GLADEDIR "/fullname.glade", NULL); + e_contact_editor_fullname->gui = gui; + + widget = glade_xml_get_widget(gui, "vbox-checkfullname"); + gtk_widget_ref(widget); + gtk_container_remove(GTK_CONTAINER(widget->parent), widget); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (e_contact_editor_fullname)->vbox), widget, TRUE, TRUE, 0); + gtk_widget_unref(widget); +} + +void +e_contact_editor_fullname_destroy (GtkObject *object) +{ + EContactEditorFullname *e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME(object); + + if (e_contact_editor_fullname->gui) + gtk_object_unref(GTK_OBJECT(e_contact_editor_fullname->gui)); + e_card_name_free(e_contact_editor_fullname->name); +} + +GtkWidget* +e_contact_editor_fullname_new (ECardName *name) +{ + GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_contact_editor_fullname_get_type ())); + gtk_object_set (GTK_OBJECT(widget), + "name", name, + NULL); + return widget; +} + +static void +e_contact_editor_fullname_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +{ + EContactEditorFullname *e_contact_editor_fullname; + + e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME (o); + + switch (arg_id){ + case ARG_NAME: + if (e_contact_editor_fullname->name) + e_card_name_free(e_contact_editor_fullname->name); + e_contact_editor_fullname->name = e_card_name_copy(GTK_VALUE_POINTER (*arg)); + fill_in_info(e_contact_editor_fullname); + break; + } +} + +static void +e_contact_editor_fullname_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +{ + EContactEditorFullname *e_contact_editor_fullname; + + e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME (object); + + switch (arg_id) { + case ARG_NAME: + extract_info(e_contact_editor_fullname); + GTK_VALUE_POINTER (*arg) = e_card_name_copy(e_contact_editor_fullname->name); + break; + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + +static void +fill_in_field(EContactEditorFullname *editor, char *field, char *string) +{ + GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field)); + if (entry) { + if (string) + gtk_entry_set_text(entry, string); + else + gtk_entry_set_text(entry, ""); + } +} + +static void +fill_in_info(EContactEditorFullname *editor) +{ + ECardName *name = editor->name; + if (name) { + fill_in_field(editor, "entry-title", name->prefix); + fill_in_field(editor, "entry-first", name->given); + fill_in_field(editor, "entry-middle", name->additional); + fill_in_field(editor, "entry-last", name->family); + fill_in_field(editor, "entry-suffix", name->suffix); + } +} + +static char * +extract_field(EContactEditorFullname *editor, char *field) +{ + GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field)); + if (entry) + return g_strdup(gtk_entry_get_text(entry)); + else + return NULL; +} + +static void +extract_info(EContactEditorFullname *editor) +{ + ECardName *name = editor->name; + if (!name) + name = e_card_name_new(); + name->prefix = extract_field(editor, "entry-title" ); + name->given = extract_field(editor, "entry-first" ); + name->additional = extract_field(editor, "entry-middle"); + name->family = extract_field(editor, "entry-last" ); + name->suffix = extract_field(editor, "entry-suffix"); +} diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.h b/addressbook/gui/contact-editor/e-contact-editor-fullname.h new file mode 100644 index 0000000000..409ffc72d0 --- /dev/null +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.h @@ -0,0 +1,75 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* e-contact-editor-fullname.h + * Copyright (C) 2000 Helix Code, Inc. + * Author: Chris Lahey <clahey@helixcode.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef __E_CONTACT_EDITOR_FULLNAME_H__ +#define __E_CONTACT_EDITOR_FULLNAME_H__ + +#include <gnome.h> +#include <glade/glade.h> +#include <ebook/e-card.h> + +#ifdef __cplusplus +extern "C" { +#pragma } +#endif /* __cplusplus */ + +/* EContactEditorFullname - A dialog displaying information about a contact. + * + * The following arguments are available: + * + * name type read/write description + * -------------------------------------------------------------------------------- + * name ECardName * RW The card currently being edited. Returns a copy. + */ + +#define E_CONTACT_EDITOR_FULLNAME_TYPE (e_contact_editor_fullname_get_type ()) +#define E_CONTACT_EDITOR_FULLNAME(obj) (GTK_CHECK_CAST ((obj), E_CONTACT_EDITOR_FULLNAME_TYPE, EContactEditorFullname)) +#define E_CONTACT_EDITOR_FULLNAME_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_CONTACT_EDITOR_FULLNAME_TYPE, EContactEditorFullnameClass)) +#define E_IS_CONTACT_EDITOR_FULLNAME(obj) (GTK_CHECK_TYPE ((obj), E_CONTACT_EDITOR_FULLNAME_TYPE)) +#define E_IS_CONTACT_EDITOR_FULLNAME_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_CONTACT_EDITOR_FULLNAME_TYPE)) + + +typedef struct _EContactEditorFullname EContactEditorFullname; +typedef struct _EContactEditorFullnameClass EContactEditorFullnameClass; + +struct _EContactEditorFullname +{ + GnomeDialog parent; + + /* item specific fields */ + ECardName *name; + GladeXML *gui; +}; + +struct _EContactEditorFullnameClass +{ + GnomeDialogClass parent_class; +}; + + +GtkWidget *e_contact_editor_fullname_new(ECardName *name); +GtkType e_contact_editor_fullname_get_type (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __E_CONTACT_EDITOR_FULLNAME_H__ */ diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 5665e0d217..a8bc443200 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -1,4 +1,3 @@ - /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * e-contact-editor.c @@ -24,6 +23,8 @@ #include <config.h> #include <gnome.h> #include "e-contact-editor.h" +#include <e-name-western.h> +#include <e-contact-editor-fullname.h> static void e_contact_editor_init (EContactEditor *card); static void e_contact_editor_class_init (EContactEditorClass *klass); @@ -211,9 +212,7 @@ phone_entry_changed (GtkWidget *widget, EContactEditor *editor) g_free(editor->phone[editor->phone_choice[which - 1]]->number); editor->phone[editor->phone_choice[which - 1]]->number = NULL; } else { - editor->phone[editor->phone_choice[which - 1]] = g_new(ECardPhone, 1); - editor->phone[editor->phone_choice[which - 1]]->number = NULL; - editor->phone[editor->phone_choice[which - 1]]->flags = 0; + editor->phone[editor->phone_choice[which - 1]] = e_card_phone_new(); } editor->phone[editor->phone_choice[which - 1]]->number = g_strdup(string); set_fields(editor); @@ -252,15 +251,41 @@ address_text_changed (GtkWidget *widget, EContactEditor *editor) g_free(editor->address[editor->address_choice]->data); editor->address[editor->address_choice]->data = NULL; } else { - editor->address[editor->address_choice] = g_new(ECardAddrLabel, 1); - editor->address[editor->address_choice]->data = NULL; - editor->address[editor->address_choice]->flags = 0; + editor->address[editor->address_choice] = e_card_address_label_new(); } editor->address[editor->address_choice]->data = g_strdup(string); g_free(string); } static void +name_entry_changed (GtkWidget *widget, EContactEditor *editor) +{ + char *string; + ECardName *name; + GtkEntry *entry = GTK_ENTRY(widget); + ENameWestern *western; + + name = editor->name; + if (name) + e_card_name_free(name); + + name = e_card_name_new(); + + string = gtk_entry_get_text(entry); + western = e_name_western_parse (string); + + name->prefix = g_strdup (western->prefix); + name->given = g_strdup (western->first ); + name->additional = g_strdup (western->middle); + name->family = g_strdup (western->last ); + name->suffix = g_strdup (western->suffix); + + e_name_western_free(western); + + editor->name = name; +} + +static void set_entry_changed_signal_phone(EContactEditor *editor, char *id) { GtkWidget *widget = glade_xml_get_widget(editor->gui, id); @@ -282,6 +307,32 @@ set_entry_changed_signals(EContactEditor *editor) widget = glade_xml_get_widget(editor->gui, "text-address"); gtk_signal_connect(GTK_OBJECT(widget), "changed", address_text_changed, editor); + widget = glade_xml_get_widget(editor->gui, "entry-fullname"); + gtk_signal_connect(GTK_OBJECT(widget), "changed", + name_entry_changed, editor); +} + +static void +full_name_clicked(GtkWidget *button, EContactEditor *editor) +{ + GnomeDialog *dialog = GNOME_DIALOG(e_contact_editor_fullname_new(editor->name)); + int result; + gtk_widget_show(GTK_WIDGET(dialog)); + gnome_dialog_close_hides (dialog, TRUE); + result = gnome_dialog_run_and_close (dialog); + if (result == 0) { + ECardName *name; + char *full_name; + gtk_object_get(GTK_OBJECT(dialog), + "name", &name, + NULL); + full_name = e_card_name_to_string(name); + gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(editor->gui, "entry-fullname")), full_name); + g_free(full_name); + e_card_name_free(editor->name); + editor->name = e_card_name_copy(name); + } + gtk_object_unref(GTK_OBJECT(dialog)); } static void @@ -302,6 +353,9 @@ e_contact_editor_init (EContactEditor *e_contact_editor) _replace_buttons(e_contact_editor); set_entry_changed_signals(e_contact_editor); + gtk_signal_connect(GTK_OBJECT(glade_xml_get_widget(e_contact_editor->gui, "button-fullname")), "clicked", + full_name_clicked, e_contact_editor); + gtk_object_get(GTK_OBJECT(glade_xml_get_widget(gui, "text-comments")), "vadjustment", &adjustment, NULL); @@ -317,6 +371,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) e_contact_editor->email_list = NULL; e_contact_editor->phone_list = NULL; e_contact_editor->address_list = NULL; + e_contact_editor->name = NULL; for (i = 0; i < E_CONTACT_EDITOR_PHONE_ID_LAST; i++) { e_contact_editor->phone[i] = NULL; @@ -784,6 +839,7 @@ fill_in_info(EContactEditor *editor) if (card) { char *file_as; char *fname; + ECardName *name; ECardList *address_list; ECardList *phone_list; ECardList *email_list; @@ -811,6 +867,7 @@ fill_in_info(EContactEditor *editor) gtk_object_get(GTK_OBJECT(card), "file_as", &file_as, + "name", &name, "full_name", &fname, "address_label", &address_list, "phone", &phone_list, @@ -837,6 +894,8 @@ fill_in_info(EContactEditor *editor) if (fname) gtk_editable_insert_text(editable, fname, strlen(fname), &position); + + position = 0; editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-file-as")); gtk_editable_delete_text(editable, 0, -1); diff --git a/addressbook/gui/contact-editor/e-contact-editor.h b/addressbook/gui/contact-editor/e-contact-editor.h index 394d136eed..fa31e73bde 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.h +++ b/addressbook/gui/contact-editor/e-contact-editor.h @@ -113,6 +113,8 @@ struct _EContactEditor ECardPhone *phone[E_CONTACT_EDITOR_PHONE_ID_LAST]; char *email[E_CONTACT_EDITOR_EMAIL_ID_LAST]; ECardAddrLabel *address[E_CONTACT_EDITOR_ADDRESS_ID_LAST]; + + ECardName *name; EContactEditorEmailId email_choice; EContactEditorPhoneId phone_choice[4]; diff --git a/addressbook/gui/contact-editor/fullname-strings.h b/addressbook/gui/contact-editor/fullname-strings.h new file mode 100644 index 0000000000..cd6b118547 --- /dev/null +++ b/addressbook/gui/contact-editor/fullname-strings.h @@ -0,0 +1,25 @@ +/* + * Translatable strings file generated by Glade. + * Add this file to your project's POTFILES.in. + * DO NOT compile it as part of your application. + */ + +gchar *s = N_("Check Full Name"); +gchar *s = N_("Title:"); +gchar *s = N_("First:"); +gchar *s = N_("Middle:"); +gchar *s = N_("Last:"); +gchar *s = N_("Suffix:"); +gchar *s = N_("\n" + "Mr.\n" + "Mrs.\n" + "Dr.\n" + ""); +gchar *s = N_("\n" + "Senior\n" + "Junior\n" + "II\n" + "III\n" + "Esquire\n" + ""); +gchar *s = N_("Show this again when name is incomplete or unclear"); diff --git a/addressbook/gui/contact-editor/fullname.glade b/addressbook/gui/contact-editor/fullname.glade new file mode 100644 index 0000000000..3f1fc58a50 --- /dev/null +++ b/addressbook/gui/contact-editor/fullname.glade @@ -0,0 +1,421 @@ +<?xml version="1.0"?> +<GTK-Interface> + +<project> + <name>fullname</name> + <program_name>fullname</program_name> + <directory></directory> + <source_directory>src</source_directory> + <pixmaps_directory>pixmaps</pixmaps_directory> + <language>C</language> + <gnome_support>True</gnome_support> + <gettext_support>True</gettext_support> + <use_widget_names>True</use_widget_names> + <output_main_file>False</output_main_file> + <output_support_files>False</output_support_files> + <output_build_files>False</output_build_files> + <output_translatable_strings>True</output_translatable_strings> + <translatable_strings_file>fullname-strings.h</translatable_strings_file> +</project> + +<widget> + <class>GnomeDialog</class> + <name>dialog-checkfullname</name> + <visible>False</visible> + <title>Check Full Name</title> + <type>GTK_WINDOW_TOPLEVEL</type> + <position>GTK_WIN_POS_NONE</position> + <modal>True</modal> + <allow_shrink>True</allow_shrink> + <allow_grow>True</allow_grow> + <auto_shrink>False</auto_shrink> + <auto_close>False</auto_close> + <hide_on_close>False</hide_on_close> + + <widget> + <class>GtkVBox</class> + <child_name>GnomeDialog:vbox</child_name> + <name>vbox-container</name> + <homogeneous>False</homogeneous> + <spacing>8</spacing> + <child> + <padding>4</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkHButtonBox</class> + <child_name>GnomeDialog:action_area</child_name> + <name>hbuttonbox1</name> + <layout_style>GTK_BUTTONBOX_END</layout_style> + <spacing>8</spacing> + <child_min_width>85</child_min_width> + <child_min_height>27</child_min_height> + <child_ipad_x>7</child_ipad_x> + <child_ipad_y>0</child_ipad_y> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + <pack>GTK_PACK_END</pack> + </child> + + <widget> + <class>GtkButton</class> + <name>button1</name> + <can_default>True</can_default> + <can_focus>True</can_focus> + <stock_button>GNOME_STOCK_BUTTON_OK</stock_button> + </widget> + + <widget> + <class>GtkButton</class> + <name>button2</name> + <can_default>True</can_default> + <can_focus>True</can_focus> + <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button> + </widget> + </widget> + + <widget> + <class>GtkVBox</class> + <name>vbox-checkfullname</name> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkTable</class> + <name>table1</name> + <border_width>8</border_width> + <rows>5</rows> + <columns>3</columns> + <homogeneous>False</homogeneous> + <row_spacing>6</row_spacing> + <column_spacing>21</column_spacing> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkAccelLabel</class> + <name>accellabel1</name> + <label>Title:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkAccelLabel</class> + <name>accellabel2</name> + <label>First:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkAccelLabel</class> + <name>accellabel3</name> + <label>Middle:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkAccelLabel</class> + <name>accellabel4</name> + <label>Last:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkAccelLabel</class> + <name>accellabel5</name> + <label>Suffix:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>4</top_attach> + <bottom_attach>5</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkCombo</class> + <name>combo-title</name> + <value_in_list>False</value_in_list> + <ok_if_empty>True</ok_if_empty> + <case_sensitive>False</case_sensitive> + <use_arrows>True</use_arrows> + <use_arrows_always>False</use_arrows_always> + <items> +Mr. +Mrs. +Dr. +</items> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + + <widget> + <class>GtkEntry</class> + <child_name>GtkCombo:entry</child_name> + <name>entry-title</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + </widget> + </widget> + + <widget> + <class>GtkCombo</class> + <name>combo-suffix</name> + <value_in_list>False</value_in_list> + <ok_if_empty>True</ok_if_empty> + <case_sensitive>False</case_sensitive> + <use_arrows>True</use_arrows> + <use_arrows_always>False</use_arrows_always> + <items> +Senior +Junior +II +III +Esquire +</items> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>4</top_attach> + <bottom_attach>5</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + + <widget> + <class>GtkEntry</class> + <child_name>GtkCombo:entry</child_name> + <name>entry-suffix</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + </widget> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry-first</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>3</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry-middle</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>3</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry-last</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>3</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + </widget> + + <widget> + <class>GtkVBox</class> + <name>vbox3</name> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkCheckButton</class> + <name>checkbutton-showagain</name> + <can_focus>True</can_focus> + <label>Show this again when name is incomplete or unclear</label> + <active>False</active> + <draw_indicator>True</draw_indicator> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + </widget> + </widget> + </widget> +</widget> + +</GTK-Interface> diff --git a/addressbook/gui/minicard/Makefile.am b/addressbook/gui/minicard/Makefile.am index 54da3de4d0..83cf28c2af 100644 --- a/addressbook/gui/minicard/Makefile.am +++ b/addressbook/gui/minicard/Makefile.am @@ -50,6 +50,7 @@ minicard_test_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/addressbook/backend/ebook/libebook.la \ $(top_builddir)/libversit/libversit.la \ + $(top_builddir)/addressbook/ename/libename.la \ $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \ $(top_builddir)/widgets/e-text/libetext.a @@ -64,6 +65,7 @@ reflow_test_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/addressbook/backend/ebook/libebook.la \ $(top_builddir)/libversit/libversit.la \ + $(top_builddir)/addressbook/ename/libename.la \ $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \ $(top_builddir)/widgets/e-text/libetext.a @@ -78,5 +80,6 @@ minicard_view_test_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/addressbook/backend/ebook/libebook.la \ $(top_builddir)/libversit/libversit.la \ + $(top_builddir)/addressbook/ename/libename.la \ $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \ $(top_builddir)/widgets/e-text/libetext.a diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am index 54da3de4d0..83cf28c2af 100644 --- a/addressbook/gui/widgets/Makefile.am +++ b/addressbook/gui/widgets/Makefile.am @@ -50,6 +50,7 @@ minicard_test_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/addressbook/backend/ebook/libebook.la \ $(top_builddir)/libversit/libversit.la \ + $(top_builddir)/addressbook/ename/libename.la \ $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \ $(top_builddir)/widgets/e-text/libetext.a @@ -64,6 +65,7 @@ reflow_test_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/addressbook/backend/ebook/libebook.la \ $(top_builddir)/libversit/libversit.la \ + $(top_builddir)/addressbook/ename/libename.la \ $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \ $(top_builddir)/widgets/e-text/libetext.a @@ -78,5 +80,6 @@ minicard_view_test_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/addressbook/backend/ebook/libebook.la \ $(top_builddir)/libversit/libversit.la \ + $(top_builddir)/addressbook/ename/libename.la \ $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \ $(top_builddir)/widgets/e-text/libetext.a |