From 6fd5b82ca0c15cb641eb0f7aa427a6989b0f1344 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Mon, 3 Jul 2000 23:03:45 +0000 Subject: Removed e-card-iterator.c, e-card-iterator.h, e-card-list-iterator.c, 2000-07-03 Christopher James Lahey * backend/ebook/Makefile.am: Removed e-card-iterator.c, e-card-iterator.h, e-card-list-iterator.c, e-card-list-iterator.h, e-card-list.c, e-card-list.h. * backend/ebook/e-card-iterator.c, backend/ebook/e-card-iterator.h, backend/ebook/e-card-list-iterator.c, backend/ebook/e-card-list-iterator.h, backend/ebook/e-card-list.c, backend/ebook/e-card-list.h: Removed in favor or versions without the -card in the e-util directory since these classes are not specific to cards at all. * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h, backend/ebook/e-card.c, backend/ebook/e-card.h, backend/ebook/load-pine-addressbook.c, backend/ebook/test-card.c, backend/pas/pas-backend-file.c: Changed the references to e-card-list.c and friends to e-list.c and friends. * contact-editor/e-contact-editor.c: Added #include to fix a warning. * gui/component/Makefile.am: Moved a number of classes associated with the select-names object to the new select-names directory. * gui/component/addressbook.c: Changed the reference to e-select-names.h. * gui/component/e-select-names.c, gui/component/e-select-names.h, gui/component/select-names.glade, gui/component/select-names.glade.h: Moved these files into select-names/. * gui/component/select-names/.cvsignore, gui/component/select-names/Makefile.am, gui/component/select-names/e-select-names-manager.c, gui/component/select-names/e-select-names-manager.h, gui/component/select-names/e-select-names-model.c, gui/component/select-names/e-select-names-model.h, gui/component/select-names/e-select-names-table-model.c, gui/component/select-names/e-select-names-table-model.h, gui/component/select-names/e-select-names-text-model.c, gui/component/select-names/e-select-names-text-model.h, gui/component/select-names/e-select-names.c, gui/component/select-names/e-select-names.h, gui/component/select-names/recipient.glade, gui/component/select-names/select-names.glade, gui/component/select-names/select-names.glade.h: New files for select names dialog (e-select-names.c, e-select-names.h, select-names.glade, select-names.glade.h and recipient.glade moved from gui/component/.) svn path=/trunk/; revision=3876 --- addressbook/gui/component/Makefile.am | 24 +- addressbook/gui/component/addressbook.c | 2 +- addressbook/gui/component/e-select-names.c | 344 --------------------- addressbook/gui/component/e-select-names.h | 86 ------ addressbook/gui/component/select-names.glade | 245 --------------- addressbook/gui/component/select-names.glade.h | 10 - addressbook/gui/component/select-names/.cvsignore | 7 + addressbook/gui/component/select-names/Makefile.am | 48 +++ .../select-names/e-select-names-manager.c | 90 ++++-- .../select-names/e-select-names-manager.h | 25 +- .../component/select-names/e-select-names-model.c | 200 ++++++++++++ .../component/select-names/e-select-names-model.h | 67 ++++ .../select-names/e-select-names-table-model.c | 157 ++++++++++ .../select-names/e-select-names-table-model.h | 42 +++ .../select-names/e-select-names-text-model.c | 263 ++++++++++++++++ .../select-names/e-select-names-text-model.h | 44 +++ .../gui/component/select-names/e-select-names.c | 344 +++++++++++++++++++++ .../gui/component/select-names/e-select-names.h | 86 ++++++ .../gui/component/select-names/recipient.glade | 61 ++++ .../gui/component/select-names/select-names.glade | 245 +++++++++++++++ .../component/select-names/select-names.glade.h | 10 + addressbook/gui/contact-editor/e-contact-editor.c | 1 + 22 files changed, 1673 insertions(+), 728 deletions(-) delete mode 100644 addressbook/gui/component/e-select-names.c delete mode 100644 addressbook/gui/component/e-select-names.h delete mode 100644 addressbook/gui/component/select-names.glade delete mode 100644 addressbook/gui/component/select-names.glade.h create mode 100644 addressbook/gui/component/select-names/.cvsignore create mode 100644 addressbook/gui/component/select-names/Makefile.am create mode 100644 addressbook/gui/component/select-names/e-select-names-model.c create mode 100644 addressbook/gui/component/select-names/e-select-names-model.h create mode 100644 addressbook/gui/component/select-names/e-select-names-table-model.c create mode 100644 addressbook/gui/component/select-names/e-select-names-table-model.h create mode 100644 addressbook/gui/component/select-names/e-select-names-text-model.c create mode 100644 addressbook/gui/component/select-names/e-select-names-text-model.h create mode 100644 addressbook/gui/component/select-names/e-select-names.c create mode 100644 addressbook/gui/component/select-names/e-select-names.h create mode 100644 addressbook/gui/component/select-names/recipient.glade create mode 100644 addressbook/gui/component/select-names/select-names.glade create mode 100644 addressbook/gui/component/select-names/select-names.glade.h (limited to 'addressbook/gui') diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am index ade764904b..f4776e3dd1 100644 --- a/addressbook/gui/component/Makefile.am +++ b/addressbook/gui/component/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = select-names + CPPFLAGS = \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" @@ -26,21 +28,20 @@ bin_PROGRAMS = \ evolution-addressbook evolution_addressbook_SOURCES = \ - e-ldap-server-dialog.c \ - e-ldap-server-dialog.h \ - e-addressbook-model.c \ - e-addressbook-model.h \ - e-cardlist-model.c \ - e-cardlist-model.h \ - e-select-names.c \ - e-select-names.h \ addressbook-component.c \ addressbook-component.h \ addressbook-factory.c \ addressbook.c \ - addressbook.h + addressbook.h \ + e-addressbook-model.c \ + e-addressbook-model.h \ + e-cardlist-model.c \ + e-cardlist-model.h \ + e-ldap-server-dialog.c \ + e-ldap-server-dialog.h evolution_addressbook_LDADD = \ + select-names/libeselectnames.la \ $(top_builddir)/shell/libeshell.a \ $(EXTRA_GNOME_LIBS) \ $(BONOBO_HTML_GNOME_LIBS) \ @@ -66,14 +67,13 @@ gnorba_DATA = addressbook.gnorba endif gladedir = $(datadir)/evolution/glade -glade_DATA = ldap-server-dialog.glade ldap-server-dialog.glade.h alphabet.glade select-names.glade +glade_DATA = ldap-server-dialog.glade ldap-server-dialog.glade.h alphabet.glade EXTRA_DIST = \ $(glade_DATA) \ addressbook.gnorba \ addressbook.oafinfo \ - alphabet.glade.h \ - select-names.glade.h + alphabet.glade.h if ENABLE_PURIFY PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index c080e35e5e..710a3b756d 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include "e-contact-editor.h" #include "e-contact-save-as.h" #include "e-ldap-server-dialog.h" diff --git a/addressbook/gui/component/e-select-names.c b/addressbook/gui/component/e-select-names.c deleted file mode 100644 index 5cb68a7f92..0000000000 --- a/addressbook/gui/component/e-select-names.c +++ /dev/null @@ -1,344 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* e-select-names.c - * Copyright (C) 2000 Helix Code, Inc. - * Author: Chris Lahey - * - * 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 -#include -#include "e-select-names.h" -#include -#include -#include -#include -#include -#include - -static void e_select_names_init (ESelectNames *card); -static void e_select_names_class_init (ESelectNamesClass *klass); -static void e_select_names_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void e_select_names_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void e_select_names_destroy (GtkObject *object); - -static GnomeDialogClass *parent_class = NULL; -#define PARENT_TYPE gnome_dialog_get_type() - -/* The arguments we take */ -enum { - ARG_0, - ARG_BOOK, - ARG_QUERY, -}; - -typedef struct { - char *title; - ETableModel *model; - ESelectNames *names; -} ESelectNamesChild; - -GtkType -e_select_names_get_type (void) -{ - static GtkType type = 0; - - if (!type) { - static const GtkTypeInfo info = - { - "ESelectNames", - sizeof (ESelectNames), - sizeof (ESelectNamesClass), - (GtkClassInitFunc) e_select_names_class_init, - (GtkObjectInitFunc) e_select_names_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - type = gtk_type_unique (PARENT_TYPE, &info); - } - - return type; -} - -static void -e_select_names_class_init (ESelectNamesClass *klass) -{ - GtkObjectClass *object_class; - - object_class = (GtkObjectClass*) klass; - - parent_class = gtk_type_class (PARENT_TYPE); - - gtk_object_add_arg_type ("ESelectNames::book", GTK_TYPE_OBJECT, - GTK_ARG_READWRITE, ARG_BOOK); - gtk_object_add_arg_type ("ESelectNames::query", GTK_TYPE_STRING, - GTK_ARG_READWRITE, ARG_QUERY); - - object_class->set_arg = e_select_names_set_arg; - object_class->get_arg = e_select_names_get_arg; - object_class->destroy = e_select_names_destroy; -} - -#define SPEC " \ - \ - 0 \ - 2 \ - \ - \ -" - -GtkWidget *e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2); - -static void -set_book(EBook *book, EBookStatus status, ETableModel *model) -{ - gtk_object_set(GTK_OBJECT(model), - "book", book, - NULL); - gtk_object_unref(GTK_OBJECT(book)); -} - -GtkWidget * -e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2) -{ - ETableModel *model; - ETableHeader *header; - ECell *cell_left_just; - EBook *book; - GtkWidget *table; - char *filename; - char *uri; - - model = e_addressbook_model_new(); - cell_left_just = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); - - header = e_table_header_new (); - e_table_header_add_column (header, e_table_col_new (0, "Full Name", 1.0, 20, cell_left_just, - g_str_compare, TRUE), 0); - - book = e_book_new(); - gtk_object_ref(GTK_OBJECT(model)); - gtk_object_ref(GTK_OBJECT(book)); - filename = gnome_util_prepend_user_home("evolution/local/Contacts/addressbook.db"); - uri = g_strdup_printf("file://%s", filename); - e_book_load_uri(book, uri, (EBookCallback) set_book, model); - g_free(uri); - g_free(filename); - table = e_table_new (header, model, SPEC); - gtk_object_set_data(GTK_OBJECT(table), "model", model); - return table; -} - -static void -set_current_selection(ETable *table, int row, ESelectNames *names) -{ - names->currently_selected = row; -} - -static void -e_select_names_init (ESelectNames *e_select_names) -{ - GladeXML *gui; - GtkWidget *widget; - - gui = glade_xml_new (EVOLUTION_GLADEDIR "/select-names.glade", NULL); - e_select_names->gui = gui; - - e_select_names->children = g_hash_table_new(g_str_hash, g_str_equal); - e_select_names->child_count = 0; - - widget = glade_xml_get_widget(gui, "table-top"); - if (!widget) { - return; - } - gtk_widget_ref(widget); - gtk_widget_unparent(widget); - gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(e_select_names)->vbox), widget, TRUE, TRUE, 0); - gtk_widget_unref(widget); - - gnome_dialog_append_buttons(GNOME_DIALOG(e_select_names), - GNOME_STOCK_BUTTON_OK, - GNOME_STOCK_BUTTON_CANCEL, - NULL); - - e_select_names->table = E_TABLE(glade_xml_get_widget(gui, "table-source")); - e_select_names->model = gtk_object_get_data(GTK_OBJECT(e_select_names->table), "model"); - - e_select_names->currently_selected = -1; - - gtk_signal_connect(GTK_OBJECT(e_select_names->table), "cursor_change", - GTK_SIGNAL_FUNC(set_current_selection), e_select_names); -} - -static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESelectNames *e_select_names) -{ - g_free(child->title); - gtk_object_unref(GTK_OBJECT(child->model)); - g_free(key); -} - -static void -e_select_names_destroy (GtkObject *object) { - ESelectNames *e_select_names = E_SELECT_NAMES(object); - - gtk_object_unref(GTK_OBJECT(e_select_names->gui)); - g_hash_table_foreach(e_select_names->children, (GHFunc) e_select_names_child_free, e_select_names); - g_hash_table_destroy(e_select_names->children); -} - -GtkWidget* -e_select_names_new (void) -{ - GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_select_names_get_type ())); - return widget; -} - -static void -e_select_names_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) -{ - ESelectNames *editor; - - editor = E_SELECT_NAMES (o); - - switch (arg_id){ - default: - return; - } -} - -static void -e_select_names_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - ESelectNames *e_select_names; - - e_select_names = E_SELECT_NAMES (object); - - switch (arg_id) { - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - -static void -button_clicked(GtkWidget *button, ESelectNamesChild *child) -{ - ESelectNames *names = child->names; - int row = names->currently_selected; - if (row != -1) { - ECard *card = e_addressbook_model_get_card(E_ADDRESSBOOK_MODEL(names->model), row); - e_cardlist_model_add(E_CARDLIST_MODEL(child->model), &card, 1); - gtk_object_unref(GTK_OBJECT(card)); - } -} - -void -e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id) -{ - ESelectNamesChild *child; - GtkWidget *button; - GtkWidget *alignment; - GtkTable *table; - char *label; - - ETableModel *model; - GtkWidget *etable; - ETableHeader *header; - ECell *cell_left_just; - - if (g_hash_table_lookup(e_select_names->children, id)) { - return; - } - - table = GTK_TABLE(glade_xml_get_widget (e_select_names->gui, "table-recipients")); - - child = g_new(ESelectNamesChild, 1); - - child->names = e_select_names; - - e_select_names->child_count++; - - alignment = gtk_alignment_new(0, 0, 1, 0); - label = g_strdup_printf("%s ->", _(name)); - button = gtk_button_new_with_label(label); - g_free(label); - gtk_container_add(GTK_CONTAINER(alignment), button); - gtk_widget_show_all(alignment); - gtk_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC(button_clicked), child); - gtk_table_attach(table, alignment, - 0, 1, - e_select_names->child_count, - e_select_names->child_count + 1, - GTK_FILL, GTK_FILL, - 0, 0); - - model = e_cardlist_model_new(); - header = e_table_header_new (); - cell_left_just = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); - e_table_header_add_column (header, e_table_col_new (0, "Full Name", 1.0, 20, cell_left_just, - g_str_compare, TRUE), 0); - etable = e_table_new (header, model, SPEC); - - child->model = model; - gtk_object_ref(GTK_OBJECT(child->model)); - - gtk_widget_show(etable); - - gtk_table_attach(table, etable, - 1, 2, - e_select_names->child_count, - e_select_names->child_count + 1, - GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, - 0, 0); -} - -static void * -card_copy(const void *value, void *closure) -{ - gtk_object_ref(GTK_OBJECT(value)); - return (void *)value; -} - -static void -card_free(void *value, void *closure) -{ - gtk_object_unref(GTK_OBJECT(value)); -} - -ECardList * -e_select_names_get_section(ESelectNames *e_select_names, char *id) -{ - ESelectNamesChild *child; - int i; - int rows; - ECardList *list; - - child = g_hash_table_lookup(e_select_names->children, id); - if (!child) - return NULL; - rows = e_table_model_row_count(child->model); - - list = e_card_list_new(card_copy, card_free, NULL); - for (i = 0; i < rows; i++) { - ECard *card = e_cardlist_model_get(E_CARDLIST_MODEL(child->model), i); - e_card_list_append(list, card); - gtk_object_unref(GTK_OBJECT(card)); - } - return list; -} diff --git a/addressbook/gui/component/e-select-names.h b/addressbook/gui/component/e-select-names.h deleted file mode 100644 index 23780e2cf5..0000000000 --- a/addressbook/gui/component/e-select-names.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* e-select-names.h - * Copyright (C) 2000 Helix Code, Inc. - * Author: Chris Lahey - * - * 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_SELECT_NAMES_H__ -#define __E_SELECT_NAMES_H__ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -/* ESelectNames - A dialog displaying information about a contact. - * - * The following arguments are available: - * - * name type read/write description - * -------------------------------------------------------------------------------- - */ - -#define E_SELECT_NAMES_TYPE (e_select_names_get_type ()) -#define E_SELECT_NAMES(obj) (GTK_CHECK_CAST ((obj), E_SELECT_NAMES_TYPE, ESelectNames)) -#define E_SELECT_NAMES_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_SELECT_NAMES_TYPE, ESelectNamesClass)) -#define E_IS_SELECT_NAMES(obj) (GTK_CHECK_TYPE ((obj), E_SELECT_NAMES_TYPE)) -#define E_IS_SELECT_NAMES_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_SELECT_NAMES_TYPE)) - - -typedef struct _ESelectNames ESelectNames; -typedef struct _ESelectNamesClass ESelectNamesClass; - -struct _ESelectNames -{ - GnomeDialog parent; - - /* item specific fields */ - GladeXML *gui; - - GHashTable *children; /* Of type char * to ESelectNamesChild */ - int child_count; - ETable *table; - ETableModel *model; - int currently_selected; -}; - -struct _ESelectNamesClass -{ - GnomeDialogClass parent_class; -}; - - -GtkWidget *e_select_names_new (void); -GtkType e_select_names_get_type (void); -void e_select_names_add_section (ESelectNames *e_select_names, - char *name, - char *id); -/* Returns a ref counted list of addresses. */ -ECardList *e_select_names_get_section (ESelectNames *e_select_names, - char *id); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* __E_SELECT_NAMES_H__ */ diff --git a/addressbook/gui/component/select-names.glade b/addressbook/gui/component/select-names.glade deleted file mode 100644 index 46da911228..0000000000 --- a/addressbook/gui/component/select-names.glade +++ /dev/null @@ -1,245 +0,0 @@ - - - - - Select-names - select-names - - src - pixmaps - C - True - True - False - False - False - True - select-names.glade.h - - - - GnomeDialog - dialog-top - False - Select Names - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False - False - False - - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button1 - True - True - GNOME_STOCK_BUTTON_OK - - - - GtkButton - button3 - True - True - GNOME_STOCK_BUTTON_CANCEL - - - - - GtkTable - table-top - 3 - 2 - False - 6 - 6 - - 0 - True - True - - - - GtkHBox - hbox1 - False - 4 - - 0 - 1 - 1 - 2 - 0 - 0 - True - False - False - False - True - True - - - - GtkEntry - entry-find - True - True - True - True - 0 - - - 0 - True - True - - - - - GtkButton - button-find - True - - - 0 - False - False - - - - - - GtkAccelLabel - accellabel1 - - GTK_JUSTIFY_LEFT - False - 0 - 0 - 0 - 0 - - 0 - 1 - 0 - 1 - 0 - 0 - True - False - False - False - True - True - - - - - Custom - table-source - e_addressbook_create_ebook_table - 0 - 0 - Sat, 10 Jun 2000 22:02:57 GMT - - 0 - 1 - 2 - 3 - 0 - 0 - True - True - False - False - True - True - - - - - GtkTable - table-recipients - 1 - 2 - False - 4 - 4 - - 1 - 2 - 2 - 3 - 0 - 0 - True - False - False - False - True - True - - - - GtkAccelLabel - accellabel2 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 1 - 2 - 0 - 1 - 0 - 0 - True - False - False - False - True - True - - - - - - - - diff --git a/addressbook/gui/component/select-names.glade.h b/addressbook/gui/component/select-names.glade.h deleted file mode 100644 index a21ddce689..0000000000 --- a/addressbook/gui/component/select-names.glade.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * 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_("Select Names"); -gchar *s = N_("Find..."); -gchar *s = N_("T_ype name or select from List:"); -gchar *s = N_("Message Recipients"); diff --git a/addressbook/gui/component/select-names/.cvsignore b/addressbook/gui/component/select-names/.cvsignore new file mode 100644 index 0000000000..d6c55c7345 --- /dev/null +++ b/addressbook/gui/component/select-names/.cvsignore @@ -0,0 +1,7 @@ +.deps +.libs +.pure +Makefile +Makefile.in +*.lo +*.la diff --git a/addressbook/gui/component/select-names/Makefile.am b/addressbook/gui/component/select-names/Makefile.am new file mode 100644 index 0000000000..4a1bbc4741 --- /dev/null +++ b/addressbook/gui/component/select-names/Makefile.am @@ -0,0 +1,48 @@ +CPPFLAGS = \ + -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" + +INCLUDES = \ + -DG_LOG_DOMAIN=\"evolution-addressbook\" \ + $(EXTRA_GNOME_CFLAGS) \ + $(GNOME_INCLUDEDIR) \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_srcdir)/shell \ + -I$(top_builddir)/shell \ + -I$(top_srcdir)/widgets/e-text \ + -I$(top_srcdir)/widgets/e-table \ + -I$(top_srcdir)/addressbook/gui/minicard \ + -I$(top_srcdir)/addressbook/contact-editor \ + -I$(top_srcdir)/addressbook/backend \ + -I$(top_builddir)/addressbook/backend \ + $(BONOBO_HTML_GNOME_CFLAGS) \ + -DEVOLUTION_VERSION=\""$(VERSION)"\" \ + -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ + -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \ + -DEVOLUTION_LOCALEDIR=\""$(datadir)/locale"\" \ + -DCAMEL_PROVIDERDIR=\""$(providerdir)"\" + +lib_LTLIBRARIES = libeselectnames.la + +libeselectnames_la_SOURCES = \ + e-select-names-entry.c \ + e-select-names-entry.h \ + e-select-names-manager.c \ + e-select-names-manager.h \ + e-select-names-model.c \ + e-select-names-model.h \ + e-select-names-table-model.c \ + e-select-names-table-model.h \ + e-select-names-text-model.c \ + e-select-names-text-model.h \ + e-select-names.c \ + e-select-names.h + + +gladedir = $(datadir)/evolution/glade +glade_DATA = select-names.glade + +EXTRA_DIST = \ + $(glade_DATA) \ + select-names.glade.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 28981cf018..01b94057d6 100644 --- a/addressbook/gui/component/select-names/e-select-names-manager.c +++ b/addressbook/gui/component/select-names/e-select-names-manager.c @@ -13,6 +13,10 @@ #include #include "e-select-names-manager.h" +#include "e-select-names-entry.h" +#include "e-select-names-model.h" +#include "e-select-names-text-model.h" +#include "widgets/e-text/e-entry.h" /* Object argument IDs */ enum { @@ -21,6 +25,12 @@ enum { }; +typedef struct { + char *id; + char *title; + ESelectNamesModel *model; +} ESelectNamesManagerSection; + static void e_select_names_manager_init (ESelectNamesManager *manager); static void e_select_names_manager_class_init (ESelectNamesManagerClass *klass); @@ -28,8 +38,6 @@ static void e_select_names_manager_destroy (GtkObject *object); static void e_select_names_manager_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void e_select_names_manager_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void fill_in_info(ESelectNamesManager *manager); - /** * e_select_names_manager_get_type: * @void: @@ -98,9 +106,10 @@ static void e_select_names_manager_destroy (GtkObject *object) { ESelectNamesManager *manager; - int i; manager = E_SELECT_NAMES_MANAGER (object); + + gtk_object_unref(GTK_OBJECT(manager->sections)); } @@ -114,7 +123,6 @@ e_select_names_manager_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) switch (arg_id) { case ARG_CARD: - fill_in_info(manager); break; default: return; @@ -131,11 +139,6 @@ e_select_names_manager_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) switch (arg_id) { case ARG_CARD: - e_select_names_manager_sync_card(manager); - if (manager->card) - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(manager->card); - else - GTK_VALUE_OBJECT (*arg) = NULL; break; default: arg->type = GTK_TYPE_INVALID; @@ -143,6 +146,26 @@ e_select_names_manager_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) } } +static void * +section_copy(const void *sec, void *data) +{ + const ESelectNamesManagerSection *section = sec; + ESelectNamesManagerSection *newsec; + + newsec = g_new(ESelectNamesManagerSection, 1); + newsec->id = g_strdup(section->id); + newsec->title = g_strdup(section->title); + return newsec; +} + +static void +section_free(void *sec, void *data) +{ + ESelectNamesManagerSection *section = sec; + g_free(section->id); + g_free(section->title); + g_free(section); +} /** * e_select_names_manager_init: @@ -150,22 +173,51 @@ e_select_names_manager_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) static void e_select_names_manager_init (ESelectNamesManager *manager) { + manager->sections = e_list_new(section_copy, section_free, manager); } -static void -fill_in_info(ESelectNamesManager *manager) +void e_select_names_manager_add_section (ESelectNamesManager *manager, + char *id, + char *title) { - ECard *card = manager->card; - if (card) { + ESelectNamesManagerSection *section; + + section = g_new(ESelectNamesManagerSection, 1); + section->id = g_strdup(id); + section->title = g_strdup(title); + e_list_append(manager->sections, section); + section_free(section, manager); +} +GtkWidget *e_select_names_manager_create_entry (ESelectNamesManager *manager, + char *id) +{ + GtkWidget *entry; + ETextModel *model; + EIterator *iterator; + iterator = e_list_get_iterator(manager->sections); + for (; e_iterator_is_valid(iterator); e_iterator_next(iterator)) { + const ESelectNamesManagerSection *section = e_iterator_get(iterator); + if (!strcmp(section->id, id)) { + entry = GTK_WIDGET(e_entry_new()); + model = e_select_names_text_model_new(section->model); + gtk_object_set(GTK_OBJECT(entry), + "model", model, + NULL); + return entry; + } } + return NULL; } -void -e_select_names_manager_sync_card(ESelectNamesManager *manager) +void e_select_names_manager_activate_dialog (ESelectNamesManager *manager, + char *id) { - ECard *card = manager->card; - if (card) { - fill_in_info(manager); - } +} + +/* Of type ECard */ +EList *e_select_names_manager_get_cards (ESelectNamesManager *manager, + char *id) +{ + return NULL; } diff --git a/addressbook/gui/component/select-names/e-select-names-manager.h b/addressbook/gui/component/select-names/e-select-names-manager.h index 5aba1d3295..600644f01a 100644 --- a/addressbook/gui/component/select-names/e-select-names-manager.h +++ b/addressbook/gui/component/select-names/e-select-names-manager.h @@ -12,6 +12,7 @@ #include #include #include +#include #define E_TYPE_SELECT_NAMES_MANAGER (e_select_names_manager_get_type ()) #define E_SELECT_NAMES_MANAGER(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManager)) @@ -24,26 +25,28 @@ typedef struct _ESelectNamesManagerClass ESelectNamesManagerClass; struct _ESelectNamesManager { GtkObject object; - + + EList *sections; }; struct _ESelectNamesManagerClass { GtkObjectClass parent_class; }; -ESelectNamesManager *e_select_names_manager_new (void); -void e_select_names_add_section (ESelectNamesManager *manager, - char *id); -GtkWidget *e_select_names_create_entry (ESelectNamesManager *manager, - char *id); -void e_select_names_activate_dialog (ESelectNamesManager *manager, - char *id); +ESelectNamesManager *e_select_names_manager_new (void); +void e_select_names_manager_add_section (ESelectNamesManager *manager, + char *id, + char *title); +GtkWidget *e_select_names_manager_create_entry (ESelectNamesManager *manager, + char *id); +void e_select_names_manager_activate_dialog (ESelectNamesManager *manager, + char *id); /* Of type ECard */ -ECardList *e_select_names_get_cards (ESelectNamesManager *manager, - char *id); +EList *e_select_names_manager_get_cards (ESelectNamesManager *manager, + char *id); /* Standard Gtk function */ -GtkType e_select_names_manager_get_type (void); +GtkType e_select_names_manager_get_type (void); #endif /* ! __E_SELECT_NAMES_MANAGER_H__ */ diff --git a/addressbook/gui/component/select-names/e-select-names-model.c b/addressbook/gui/component/select-names/e-select-names-model.c new file mode 100644 index 0000000000..8399136dd8 --- /dev/null +++ b/addressbook/gui/component/select-names/e-select-names-model.c @@ -0,0 +1,200 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Authors: + * Chris Lahey + * + * Copyright (C) 2000 Helix Code, Inc. + */ + +#include +#include +#include +#include +#include + +#include "e-select-names-model.h" + +enum { + E_SELECT_NAMES_MODEL_CHANGED, + E_SELECT_NAMES_MODEL_LAST_SIGNAL +}; + +static guint e_select_names_model_signals[E_SELECT_NAMES_MODEL_LAST_SIGNAL] = { 0 }; + +/* Object argument IDs */ +enum { + ARG_0, + ARG_CARD, +}; + +static void e_select_names_model_init (ESelectNamesModel *model); +static void e_select_names_model_class_init (ESelectNamesModelClass *klass); + +static void e_select_names_model_destroy (GtkObject *object); +static void e_select_names_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); +static void e_select_names_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); + +/** + * e_select_names_model_get_type: + * @void: + * + * Registers the &ESelectNamesModel class if necessary, and returns the type ID + * associated to it. + * + * Return value: The type ID of the &ESelectNamesModel class. + **/ +GtkType +e_select_names_model_get_type (void) +{ + static GtkType model_type = 0; + + if (!model_type) { + GtkTypeInfo model_info = { + "ESelectNamesModel", + sizeof (ESelectNamesModel), + sizeof (ESelectNamesModelClass), + (GtkClassInitFunc) e_select_names_model_class_init, + (GtkObjectInitFunc) e_select_names_model_init, + NULL, /* reserved_1 */ + NULL, /* reserved_2 */ + (GtkClassInitFunc) NULL + }; + + model_type = gtk_type_unique (gtk_object_get_type (), &model_info); + } + + return model_type; +} + +/** + * e_select_names_model_new: + * @VCard: a string in vCard format + * + * Returns: a new #ESelectNamesModel that wraps the @VCard. + */ +ESelectNamesModel * +e_select_names_model_new (void) +{ + ESelectNamesModel *model = E_SELECT_NAMES_MODEL(gtk_type_new(e_select_names_model_get_type())); + return model; +} + +static void +e_select_names_model_class_init (ESelectNamesModelClass *klass) +{ + GtkObjectClass *object_class; + + object_class = GTK_OBJECT_CLASS(klass); + + e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED] = + gtk_signal_new ("changed", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (ESelectNamesModelClass, changed), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + + gtk_object_class_add_signals (object_class, e_select_names_model_signals, E_SELECT_NAMES_MODEL_LAST_SIGNAL); + + gtk_object_add_arg_type ("ESelectNamesModel::card", + GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_CARD); + + klass->changed = NULL; + + object_class->destroy = e_select_names_model_destroy; + object_class->get_arg = e_select_names_model_get_arg; + object_class->set_arg = e_select_names_model_set_arg; +} + +/* + * ESelectNamesModel lifecycle management and vcard loading/saving. + */ + +static void +e_select_names_model_destroy (GtkObject *object) +{ + ESelectNamesModel *model; + + model = E_SELECT_NAMES_MODEL (object); + + gtk_object_unref(GTK_OBJECT(model->data)); +} + + +/* Set_arg handler for the model */ +static void +e_select_names_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +{ + ESelectNamesModel *model; + + model = E_SELECT_NAMES_MODEL (object); + + switch (arg_id) { + case ARG_CARD: + break; + default: + return; + } +} + +/* Get_arg handler for the model */ +static void +e_select_names_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +{ + ESelectNamesModel *model; + + model = E_SELECT_NAMES_MODEL (object); + + switch (arg_id) { + case ARG_CARD: + break; + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + +static void * +data_copy(const void *sec, void *data) +{ + const ESelectNamesModelData *section = sec; + ESelectNamesModelData *newsec; + + newsec = g_new(ESelectNamesModelData, 1); + newsec->type = section->type; + newsec->card = section->card; + if (newsec->card) + gtk_object_ref(GTK_OBJECT(newsec->card)); + newsec->string = g_strdup(section->string); + return newsec; +} + +static void +data_free(void *sec, void *data) +{ + ESelectNamesModelData *section = sec; + if (section->card) + gtk_object_unref(GTK_OBJECT(section->card)); + g_free(section->string); + g_free(section); +} + +/** + * e_select_names_model_init: + */ +static void +e_select_names_model_init (ESelectNamesModel *model) +{ + model->data = e_list_new(data_copy, data_free, model); +} + +/* Of type ECard */ +EList *e_select_names_model_get_cards (ESelectNamesModel *model) +{ + return NULL; +} + +EList *e_select_names_model_get_data (ESelectNamesModel *model) +{ + return model->data; +} diff --git a/addressbook/gui/component/select-names/e-select-names-model.h b/addressbook/gui/component/select-names/e-select-names-model.h new file mode 100644 index 0000000000..20c90818f7 --- /dev/null +++ b/addressbook/gui/component/select-names/e-select-names-model.h @@ -0,0 +1,67 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Authors: + * Chris Lahey + * + * Copyright (C) 2000 Helix Code, Inc. + */ + +#ifndef __E_SELECT_NAMES_MODEL_H__ +#define __E_SELECT_NAMES_MODEL_H__ + +#include +#include +#include +#include +#include + +#define E_TYPE_SELECT_NAMES_MODEL (e_select_names_model_get_type ()) +#define E_SELECT_NAMES_MODEL(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModel)) +#define E_SELECT_NAMES_MODEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModelClass)) +#define E_IS_SELECT_NAMES_MODEL(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SELECT_NAMES_MODEL)) +#define E_IS_SELECT_NAMES_MODEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MODEL)) + +typedef enum _ESelectNamesModelDataType ESelectNamesModelDataType; +typedef struct _ESelectNamesModelData ESelectNamesModelData; +typedef struct _ESelectNamesModel ESelectNamesModel; +typedef struct _ESelectNamesModelClass ESelectNamesModelClass; + +enum _ESelectNamesModelDataType { + E_SELECT_NAMES_MODEL_DATA_TYPE_CARD, + E_SELECT_NAMES_MODEL_DATA_TYPE_STRING_ADDRESS, + E_SELECT_NAMES_MODEL_DATA_TYPE_SEPARATION_MATERIAL, +}; + +struct _ESelectNamesModelData { + ESelectNamesModelDataType type; + ECard *card; + char *string; +}; + +struct _ESelectNamesModel { + GtkObject object; + + char *id; + char *title; + + EList *data; /* Of type ESelectNamesModelData. */ +}; + +struct _ESelectNamesModelClass { + GtkObjectClass parent_class; + + void (*changed) (ESelectNamesModel *model); +}; + +ESelectNamesModel *e_select_names_model_new (void); + +/* Of type ECard */ +EList *e_select_names_model_get_cards (ESelectNamesModel *model); + +/* Of type ESelectNamesModelData */ +EList *e_select_names_model_get_data (ESelectNamesModel *model); + +/* Standard Gtk function */ +GtkType e_select_names_model_get_type (void); + +#endif /* ! __E_SELECT_NAMES_MODEL_H__ */ diff --git a/addressbook/gui/component/select-names/e-select-names-table-model.c b/addressbook/gui/component/select-names/e-select-names-table-model.c new file mode 100644 index 0000000000..dc3edda5f9 --- /dev/null +++ b/addressbook/gui/component/select-names/e-select-names-table-model.c @@ -0,0 +1,157 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Authors: + * Chris Lahey + * + * Copyright (C) 2000 Helix Code, Inc. + */ + +#include +#include +#include +#include +#include + +#include "e-select-names-table-model.h" + +/* Object argument IDs */ +enum { + ARG_0, + ARG_SOURCE, +}; + +static void e_select_names_table_model_init (ESelectNamesTableModel *model); +static void e_select_names_table_model_class_init (ESelectNamesTableModelClass *klass); + +static void e_select_names_table_model_destroy (GtkObject *object); +static void e_select_names_table_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); +static void e_select_names_table_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); + +/** + * e_select_names_table_model_get_type: + * @void: + * + * Registers the &ESelectNamesTableModel class if necessary, and returns the type ID + * associated to it. + * + * Return value: The type ID of the &ESelectNamesTableModel class. + **/ +GtkType +e_select_names_table_model_get_type (void) +{ + static GtkType model_type = 0; + + if (!model_type) { + GtkTypeInfo model_info = { + "ESelectNamesTableModel", + sizeof (ESelectNamesTableModel), + sizeof (ESelectNamesTableModelClass), + (GtkClassInitFunc) e_select_names_table_model_class_init, + (GtkObjectInitFunc) e_select_names_table_model_init, + NULL, /* reserved_1 */ + NULL, /* reserved_2 */ + (GtkClassInitFunc) NULL + }; + + model_type = gtk_type_unique (e_table_model_get_type (), &model_info); + } + + return model_type; +} + +/** + * e_select_names_table_model_new: + * @VCard: a string in vCard format + * + * Returns: a new #ESelectNamesTableModel that wraps the @VCard. + */ +ETableModel * +e_select_names_table_model_new (ESelectNamesModel *source) +{ + ETableModel *model = E_TABLE_MODEL(gtk_type_new(e_select_names_table_model_get_type())); + gtk_object_set(GTK_OBJECT(model), + "source", source, + NULL); + return model; +} + +static void +e_select_names_table_model_class_init (ESelectNamesTableModelClass *klass) +{ + GtkObjectClass *object_class; + ETableModelClass *table_model_class; + + object_class = GTK_OBJECT_CLASS(klass); + table_model_class = E_TABLE_MODEL_CLASS(klass); + + gtk_object_add_arg_type ("ESelectNamesTableModel::source", + GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_SOURCE); + + object_class->destroy = e_select_names_table_model_destroy; + object_class->get_arg = e_select_names_table_model_get_arg; + object_class->set_arg = e_select_names_table_model_set_arg; +} + +/* + * ESelectNamesTableModel lifecycle management and vcard loading/saving. + */ + +static void +e_select_names_table_model_destroy (GtkObject *object) +{ + ESelectNamesTableModel *model; + + model = E_SELECT_NAMES_TABLE_MODEL (object); + + if (model->source) + gtk_object_unref(GTK_OBJECT(model->source)); +} + + +/* Set_arg handler for the model */ +static void +e_select_names_table_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +{ + ESelectNamesTableModel *model; + + model = E_SELECT_NAMES_TABLE_MODEL (object); + + switch (arg_id) { + case ARG_SOURCE: + if (model->source) + gtk_object_unref(GTK_OBJECT(model->source)); + model->source = E_SELECT_NAMES_MODEL(GTK_VALUE_OBJECT(*arg)); + if (model->source) + gtk_object_ref(GTK_OBJECT(model->source)); + break; + default: + return; + } +} + +/* Get_arg handler for the model */ +static void +e_select_names_table_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +{ + ESelectNamesTableModel *model; + + model = E_SELECT_NAMES_TABLE_MODEL (object); + + switch (arg_id) { + case ARG_SOURCE: + GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(model->source); + break; + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + +/** + * e_select_names_table_model_init: + */ +static void +e_select_names_table_model_init (ESelectNamesTableModel *model) +{ + model->source = NULL; +} diff --git a/addressbook/gui/component/select-names/e-select-names-table-model.h b/addressbook/gui/component/select-names/e-select-names-table-model.h new file mode 100644 index 0000000000..94cbaff13a --- /dev/null +++ b/addressbook/gui/component/select-names/e-select-names-table-model.h @@ -0,0 +1,42 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Authors: + * Chris Lahey + * + * Copyright (C) 2000 Helix Code, Inc. + */ + +#ifndef __E_SELECT_NAMES_TABLE_MODEL_H__ +#define __E_SELECT_NAMES_TABLE_MODEL_H__ + +#include +#include +#include +#include "e-select-names-model.h" +#include + +#define E_TYPE_SELECT_NAMES_TABLE_MODEL (e_select_names_table_model_get_type ()) +#define E_SELECT_NAMES_TABLE_MODEL(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SELECT_NAMES_TABLE_MODEL, ESelectNamesTableModel)) +#define E_SELECT_NAMES_TABLE_MODEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_TABLE_MODEL, ESelectNamesTableModelClass)) +#define E_IS_SELECT_NAMES_TABLE_MODEL(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SELECT_NAMES_TABLE_MODEL)) +#define E_IS_SELECT_NAMES_TABLE_MODEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_TABLE_MODEL)) + +typedef struct _ESelectNamesTableModel ESelectNamesTableModel; +typedef struct _ESelectNamesTableModelClass ESelectNamesTableModelClass; + +struct _ESelectNamesTableModel { + ETableModel parent; + + ESelectNamesModel *source; +}; + +struct _ESelectNamesTableModelClass { + ETableModel parent_class; +}; + +ETableModel *e_select_names_table_model_new (ESelectNamesModel *source); + +/* Standard Gtk function */ +GtkType e_select_names_table_model_get_type (void); + +#endif /* ! __E_SELECT_NAMES_TABLE_MODEL_H__ */ diff --git a/addressbook/gui/component/select-names/e-select-names-text-model.c b/addressbook/gui/component/select-names/e-select-names-text-model.c new file mode 100644 index 0000000000..98d0f153c2 --- /dev/null +++ b/addressbook/gui/component/select-names/e-select-names-text-model.c @@ -0,0 +1,263 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Authors: + * Chris Lahey + * + * Copyright (C) 2000 Helix Code, Inc. + */ + +#include +#include +#include +#include +#include + +#include "e-select-names-text-model.h" + +/* Object argument IDs */ +enum { + ARG_0, + ARG_SOURCE, +}; + +static void e_select_names_text_model_init (ESelectNamesTextModel *model); +static void e_select_names_text_model_class_init (ESelectNamesTextModelClass *klass); + +static void e_select_names_text_model_destroy (GtkObject *object); +static void e_select_names_text_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); +static void e_select_names_text_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); + +static void e_select_names_text_model_set_text (ETextModel *model, gchar *text); +static void e_select_names_text_model_insert (ETextModel *model, gint position, gchar *text); +static void e_select_names_text_model_insert_length (ETextModel *model, gint position, gchar *text, gint length); +static void e_select_names_text_model_delete (ETextModel *model, gint position, gint length); + +static void e_select_names_text_model_model_changed (ESelectNamesModel *source, + ESelectNamesTextModel *model); + + +ETextModelClass *parent_class; +#define PARENT_TYPE e_text_model_get_type() + +/** + * e_select_names_text_model_get_type: + * @void: + * + * Registers the &ESelectNamesTextModel class if necessary, and returns the type ID + * associated to it. + * + * Return value: The type ID of the &ESelectNamesTextModel class. + **/ +GtkType +e_select_names_text_model_get_type (void) +{ + static GtkType model_type = 0; + + if (!model_type) { + GtkTypeInfo model_info = { + "ESelectNamesTextModel", + sizeof (ESelectNamesTextModel), + sizeof (ESelectNamesTextModelClass), + (GtkClassInitFunc) e_select_names_text_model_class_init, + (GtkObjectInitFunc) e_select_names_text_model_init, + NULL, /* reserved_1 */ + NULL, /* reserved_2 */ + (GtkClassInitFunc) NULL + }; + + model_type = gtk_type_unique (PARENT_TYPE, &model_info); + } + + return model_type; +} + +/** + * e_select_names_text_model_new: + * @VCard: a string in vCard format + * + * Returns: a new #ESelectNamesTextModel that wraps the @VCard. + */ +ETextModel * +e_select_names_text_model_new (ESelectNamesModel *source) +{ + ETextModel *model = E_TEXT_MODEL(gtk_type_new(e_select_names_text_model_get_type())); + gtk_object_set(GTK_OBJECT(model), + "source", source, + NULL); + return model; +} + +static void +e_select_names_text_model_class_init (ESelectNamesTextModelClass *klass) +{ + GtkObjectClass *object_class; + ETextModelClass *text_model_class; + + object_class = GTK_OBJECT_CLASS(klass); + text_model_class = E_TEXT_MODEL_CLASS(klass); + + parent_class = gtk_type_class(PARENT_TYPE); + + gtk_object_add_arg_type ("ESelectNamesTextModel::source", + GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_SOURCE); + + object_class->destroy = e_select_names_text_model_destroy; + object_class->get_arg = e_select_names_text_model_get_arg; + object_class->set_arg = e_select_names_text_model_set_arg; + + text_model_class->set_text = e_select_names_text_model_set_text; + text_model_class->insert = e_select_names_text_model_insert; + text_model_class->insert_length = e_select_names_text_model_insert_length; + text_model_class->delete = e_select_names_text_model_delete; +} + +static void +e_select_names_text_model_set_text (ETextModel *model, gchar *text) +{ + e_select_names_model_clear(model); +} + +static void +e_select_names_text_model_insert (ETextModel *model, gint position, gchar *text) +{ +} + +static void +e_select_names_text_model_insert_length (ETextModel *model, gint position, gchar *text, gint length) +{ +} + +static void +e_select_names_text_model_delete (ETextModel *model, gint position, gint length) +{ +} + +static void +e_select_names_text_model_model_changed (ESelectNamesModel *source, + ESelectNamesTextModel *model) +{ + EList *list = e_select_names_model_get_data(source); + EIterator *iterator = e_list_get_iterator(list); + int length = 0; + int length_count = 0; + int *lengthsp; + char *string; + char *stringp; + for (e_iterator_reset(iterator); e_iterator_is_valid(iterator); e_iterator_next(iterator)) { + const ESelectNamesModelData *data = e_iterator_get(iterator); + length += strlen(data->string); + length_count++; + } + + g_free(model->lengths); + model->lengths = g_new(int, length_count + 1); + lengthsp = model->lengths; + + string = g_new(char, length + 1); + stringp = string; + *stringp = 0; + for (e_iterator_reset(iterator); e_iterator_is_valid(iterator); e_iterator_next(iterator)) { + const ESelectNamesModelData *data = e_iterator_get(iterator); + int this_length; + + strcpy(stringp, data->string); + this_length = strlen(stringp); + stringp += this_length; + *(lengthsp++) = this_length; + } + *stringp = 0; + *lengthsp = -1; + g_free(E_TEXT_MODEL(model)->text); + E_TEXT_MODEL(model)->text = string; +} + + +static void +e_select_names_text_model_add_source (ESelectNamesTextModel *model, + ESelectNamesModel *source) +{ + model->source = source; + if (model->source) + gtk_object_ref(GTK_OBJECT(model->source)); + model->source_changed_id = gtk_signal_connect(GTK_OBJECT(model->source), "changed", + GTK_SIGNAL_FUNC(e_select_names_text_model_model_changed), + model); +} + +static void +e_select_names_text_model_drop_source (ESelectNamesTextModel *model) +{ + if (model->source_changed_id) + gtk_signal_disconnect(GTK_OBJECT(model->source), model->source_changed_id); + if (model->source) + gtk_object_unref(GTK_OBJECT(model->source)); + model->source = NULL; + model->source_changed_id = 0; +} + +/* + * ESelectNamesTextModel lifecycle management and vcard loading/saving. + */ + +static void +e_select_names_text_model_destroy (GtkObject *object) +{ + ESelectNamesTextModel *model; + + model = E_SELECT_NAMES_TEXT_MODEL (object); + + e_select_names_text_model_drop_source(model); + g_free(model->lengths); + + if (GTK_OBJECT_CLASS(parent_class)->destroy) + GTK_OBJECT_CLASS(parent_class)->destroy(object); +} + + +/* Set_arg handler for the model */ +static void +e_select_names_text_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +{ + ESelectNamesTextModel *model; + + model = E_SELECT_NAMES_TEXT_MODEL (object); + + switch (arg_id) { + case ARG_SOURCE: + e_select_names_text_model_drop_source(model); + e_select_names_text_model_add_source(model, E_SELECT_NAMES_MODEL(GTK_VALUE_OBJECT(*arg))); + break; + default: + return; + } +} + +/* Get_arg handler for the model */ +static void +e_select_names_text_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +{ + ESelectNamesTextModel *model; + + model = E_SELECT_NAMES_TEXT_MODEL (object); + + switch (arg_id) { + case ARG_SOURCE: + GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(model->source); + break; + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + +/** + * e_select_names_text_model_init: + */ +static void +e_select_names_text_model_init (ESelectNamesTextModel *model) +{ + model->source = NULL; + model->source_changed_id = 0; + model->lengths = NULL; +} + diff --git a/addressbook/gui/component/select-names/e-select-names-text-model.h b/addressbook/gui/component/select-names/e-select-names-text-model.h new file mode 100644 index 0000000000..564886ffc9 --- /dev/null +++ b/addressbook/gui/component/select-names/e-select-names-text-model.h @@ -0,0 +1,44 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Authors: + * Chris Lahey + * + * Copyright (C) 2000 Helix Code, Inc. + */ + +#ifndef __E_SELECT_NAMES_TEXT_MODEL_H__ +#define __E_SELECT_NAMES_TEXT_MODEL_H__ + +#include +#include +#include +#include "e-select-names-model.h" +#include + +#define E_TYPE_SELECT_NAMES_TEXT_MODEL (e_select_names_text_model_get_type ()) +#define E_SELECT_NAMES_TEXT_MODEL(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SELECT_NAMES_TEXT_MODEL, ESelectNamesTextModel)) +#define E_SELECT_NAMES_TEXT_MODEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_TEXT_MODEL, ESelectNamesTextModelClass)) +#define E_IS_SELECT_NAMES_TEXT_MODEL(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SELECT_NAMES_TEXT_MODEL)) +#define E_IS_SELECT_NAMES_TEXT_MODEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_TEXT_MODEL)) + +typedef struct _ESelectNamesTextModel ESelectNamesTextModel; +typedef struct _ESelectNamesTextModelClass ESelectNamesTextModelClass; + +struct _ESelectNamesTextModel { + ETextModel parent; + + ESelectNamesModel *source; + int source_changed_id; + int *lengths; +}; + +struct _ESelectNamesTextModelClass { + ETextModel parent_class; +}; + +ETextModel *e_select_names_text_model_new (ESelectNamesModel *source); + +/* Standard Gtk function */ +GtkType e_select_names_text_model_get_type (void); + +#endif /* ! __E_SELECT_NAMES_TEXT_MODEL_H__ */ diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c new file mode 100644 index 0000000000..a17dd410d3 --- /dev/null +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -0,0 +1,344 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* e-select-names.c + * Copyright (C) 2000 Helix Code, Inc. + * Author: Chris Lahey + * + * 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 +#include +#include "e-select-names.h" +#include +#include +#include +#include +#include +#include + +static void e_select_names_init (ESelectNames *card); +static void e_select_names_class_init (ESelectNamesClass *klass); +static void e_select_names_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); +static void e_select_names_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); +static void e_select_names_destroy (GtkObject *object); + +static GnomeDialogClass *parent_class = NULL; +#define PARENT_TYPE gnome_dialog_get_type() + +/* The arguments we take */ +enum { + ARG_0, + ARG_BOOK, + ARG_QUERY, +}; + +typedef struct { + char *title; + ETableModel *model; + ESelectNames *names; +} ESelectNamesChild; + +GtkType +e_select_names_get_type (void) +{ + static GtkType type = 0; + + if (!type) { + static const GtkTypeInfo info = + { + "ESelectNames", + sizeof (ESelectNames), + sizeof (ESelectNamesClass), + (GtkClassInitFunc) e_select_names_class_init, + (GtkObjectInitFunc) e_select_names_init, + /* reserved_1 */ NULL, + /* reserved_2 */ NULL, + (GtkClassInitFunc) NULL, + }; + + type = gtk_type_unique (PARENT_TYPE, &info); + } + + return type; +} + +static void +e_select_names_class_init (ESelectNamesClass *klass) +{ + GtkObjectClass *object_class; + + object_class = (GtkObjectClass*) klass; + + parent_class = gtk_type_class (PARENT_TYPE); + + gtk_object_add_arg_type ("ESelectNames::book", GTK_TYPE_OBJECT, + GTK_ARG_READWRITE, ARG_BOOK); + gtk_object_add_arg_type ("ESelectNames::query", GTK_TYPE_STRING, + GTK_ARG_READWRITE, ARG_QUERY); + + object_class->set_arg = e_select_names_set_arg; + object_class->get_arg = e_select_names_get_arg; + object_class->destroy = e_select_names_destroy; +} + +#define SPEC " \ + \ + 0 \ + 2 \ + \ + \ +" + +GtkWidget *e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2); + +static void +set_book(EBook *book, EBookStatus status, ETableModel *model) +{ + gtk_object_set(GTK_OBJECT(model), + "book", book, + NULL); + gtk_object_unref(GTK_OBJECT(book)); +} + +GtkWidget * +e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2) +{ + ETableModel *model; + ETableHeader *header; + ECell *cell_left_just; + EBook *book; + GtkWidget *table; + char *filename; + char *uri; + + model = e_addressbook_model_new(); + cell_left_just = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + + header = e_table_header_new (); + e_table_header_add_column (header, e_table_col_new (0, "Full Name", 1.0, 20, cell_left_just, + g_str_compare, TRUE), 0); + + book = e_book_new(); + gtk_object_ref(GTK_OBJECT(model)); + gtk_object_ref(GTK_OBJECT(book)); + filename = gnome_util_prepend_user_home("evolution/local/Contacts/addressbook.db"); + uri = g_strdup_printf("file://%s", filename); + e_book_load_uri(book, uri, (EBookCallback) set_book, model); + g_free(uri); + g_free(filename); + table = e_table_new (header, model, SPEC); + gtk_object_set_data(GTK_OBJECT(table), "model", model); + return table; +} + +static void +set_current_selection(ETable *table, int row, ESelectNames *names) +{ + names->currently_selected = row; +} + +static void +e_select_names_init (ESelectNames *e_select_names) +{ + GladeXML *gui; + GtkWidget *widget; + + gui = glade_xml_new (EVOLUTION_GLADEDIR "/select-names.glade", NULL); + e_select_names->gui = gui; + + e_select_names->children = g_hash_table_new(g_str_hash, g_str_equal); + e_select_names->child_count = 0; + + widget = glade_xml_get_widget(gui, "table-top"); + if (!widget) { + return; + } + gtk_widget_ref(widget); + gtk_widget_unparent(widget); + gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(e_select_names)->vbox), widget, TRUE, TRUE, 0); + gtk_widget_unref(widget); + + gnome_dialog_append_buttons(GNOME_DIALOG(e_select_names), + GNOME_STOCK_BUTTON_OK, + GNOME_STOCK_BUTTON_CANCEL, + NULL); + + e_select_names->table = E_TABLE(glade_xml_get_widget(gui, "table-source")); + e_select_names->model = gtk_object_get_data(GTK_OBJECT(e_select_names->table), "model"); + + e_select_names->currently_selected = -1; + + gtk_signal_connect(GTK_OBJECT(e_select_names->table), "cursor_change", + GTK_SIGNAL_FUNC(set_current_selection), e_select_names); +} + +static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESelectNames *e_select_names) +{ + g_free(child->title); + gtk_object_unref(GTK_OBJECT(child->model)); + g_free(key); +} + +static void +e_select_names_destroy (GtkObject *object) { + ESelectNames *e_select_names = E_SELECT_NAMES(object); + + gtk_object_unref(GTK_OBJECT(e_select_names->gui)); + g_hash_table_foreach(e_select_names->children, (GHFunc) e_select_names_child_free, e_select_names); + g_hash_table_destroy(e_select_names->children); +} + +GtkWidget* +e_select_names_new (void) +{ + GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_select_names_get_type ())); + return widget; +} + +static void +e_select_names_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +{ + ESelectNames *editor; + + editor = E_SELECT_NAMES (o); + + switch (arg_id){ + default: + return; + } +} + +static void +e_select_names_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +{ + ESelectNames *e_select_names; + + e_select_names = E_SELECT_NAMES (object); + + switch (arg_id) { + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + +static void +button_clicked(GtkWidget *button, ESelectNamesChild *child) +{ + ESelectNames *names = child->names; + int row = names->currently_selected; + if (row != -1) { + ECard *card = e_addressbook_model_get_card(E_ADDRESSBOOK_MODEL(names->model), row); + e_cardlist_model_add(E_CARDLIST_MODEL(child->model), &card, 1); + gtk_object_unref(GTK_OBJECT(card)); + } +} + +void +e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id) +{ + ESelectNamesChild *child; + GtkWidget *button; + GtkWidget *alignment; + GtkTable *table; + char *label; + + ETableModel *model; + GtkWidget *etable; + ETableHeader *header; + ECell *cell_left_just; + + if (g_hash_table_lookup(e_select_names->children, id)) { + return; + } + + table = GTK_TABLE(glade_xml_get_widget (e_select_names->gui, "table-recipients")); + + child = g_new(ESelectNamesChild, 1); + + child->names = e_select_names; + + e_select_names->child_count++; + + alignment = gtk_alignment_new(0, 0, 1, 0); + label = g_strdup_printf("%s ->", _(name)); + button = gtk_button_new_with_label(label); + g_free(label); + gtk_container_add(GTK_CONTAINER(alignment), button); + gtk_widget_show_all(alignment); + gtk_signal_connect(GTK_OBJECT(button), "clicked", + GTK_SIGNAL_FUNC(button_clicked), child); + gtk_table_attach(table, alignment, + 0, 1, + e_select_names->child_count, + e_select_names->child_count + 1, + GTK_FILL, GTK_FILL, + 0, 0); + + model = e_cardlist_model_new(); + header = e_table_header_new (); + cell_left_just = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + e_table_header_add_column (header, e_table_col_new (0, "Full Name", 1.0, 20, cell_left_just, + g_str_compare, TRUE), 0); + etable = e_table_new (header, model, SPEC); + + child->model = model; + gtk_object_ref(GTK_OBJECT(child->model)); + + gtk_widget_show(etable); + + gtk_table_attach(table, etable, + 1, 2, + e_select_names->child_count, + e_select_names->child_count + 1, + GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, + 0, 0); +} + +static void * +card_copy(const void *value, void *closure) +{ + gtk_object_ref(GTK_OBJECT(value)); + return (void *)value; +} + +static void +card_free(void *value, void *closure) +{ + gtk_object_unref(GTK_OBJECT(value)); +} + +EList * +e_select_names_get_section(ESelectNames *e_select_names, char *id) +{ + ESelectNamesChild *child; + int i; + int rows; + EList *list; + + child = g_hash_table_lookup(e_select_names->children, id); + if (!child) + return NULL; + rows = e_table_model_row_count(child->model); + + list = e_list_new(card_copy, card_free, NULL); + for (i = 0; i < rows; i++) { + ECard *card = e_cardlist_model_get(E_CARDLIST_MODEL(child->model), i); + e_list_append(list, card); + gtk_object_unref(GTK_OBJECT(card)); + } + return list; +} diff --git a/addressbook/gui/component/select-names/e-select-names.h b/addressbook/gui/component/select-names/e-select-names.h new file mode 100644 index 0000000000..c9d4619db2 --- /dev/null +++ b/addressbook/gui/component/select-names/e-select-names.h @@ -0,0 +1,86 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* e-select-names.h + * Copyright (C) 2000 Helix Code, Inc. + * Author: Chris Lahey + * + * 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_SELECT_NAMES_H__ +#define __E_SELECT_NAMES_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#pragma } +#endif /* __cplusplus */ + +/* ESelectNames - A dialog displaying information about a contact. + * + * The following arguments are available: + * + * name type read/write description + * -------------------------------------------------------------------------------- + */ + +#define E_SELECT_NAMES_TYPE (e_select_names_get_type ()) +#define E_SELECT_NAMES(obj) (GTK_CHECK_CAST ((obj), E_SELECT_NAMES_TYPE, ESelectNames)) +#define E_SELECT_NAMES_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_SELECT_NAMES_TYPE, ESelectNamesClass)) +#define E_IS_SELECT_NAMES(obj) (GTK_CHECK_TYPE ((obj), E_SELECT_NAMES_TYPE)) +#define E_IS_SELECT_NAMES_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_SELECT_NAMES_TYPE)) + + +typedef struct _ESelectNames ESelectNames; +typedef struct _ESelectNamesClass ESelectNamesClass; + +struct _ESelectNames +{ + GnomeDialog parent; + + /* item specific fields */ + GladeXML *gui; + + GHashTable *children; /* Of type char * to ESelectNamesChild */ + int child_count; + ETable *table; + ETableModel *model; + int currently_selected; +}; + +struct _ESelectNamesClass +{ + GnomeDialogClass parent_class; +}; + + +GtkWidget *e_select_names_new (void); +GtkType e_select_names_get_type (void); +void e_select_names_add_section (ESelectNames *e_select_names, + char *name, + char *id); +/* Returns a ref counted list of addresses. */ +EList *e_select_names_get_section (ESelectNames *e_select_names, + char *id); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __E_SELECT_NAMES_H__ */ diff --git a/addressbook/gui/component/select-names/recipient.glade b/addressbook/gui/component/select-names/recipient.glade new file mode 100644 index 0000000000..b60972d094 --- /dev/null +++ b/addressbook/gui/component/select-names/recipient.glade @@ -0,0 +1,61 @@ + + + + + Recipient + recipient + + src + pixmaps + C + True + True + True + False + False + False + True + + + + GtkWindow + window1 + False + window1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkHBox + hbox-top + False + 4 + + + GtkAlignment + alignment1 + 1.08033e-07 + 0 + 1 + 0 + + 0 + False + True + + + + GtkButton + text-button + True + + + + + + + diff --git a/addressbook/gui/component/select-names/select-names.glade b/addressbook/gui/component/select-names/select-names.glade new file mode 100644 index 0000000000..46da911228 --- /dev/null +++ b/addressbook/gui/component/select-names/select-names.glade @@ -0,0 +1,245 @@ + + + + + Select-names + select-names + + src + pixmaps + C + True + True + False + False + False + True + select-names.glade.h + + + + GnomeDialog + dialog-top + False + Select Names + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox1 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area1 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button1 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button3 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + + GtkTable + table-top + 3 + 2 + False + 6 + 6 + + 0 + True + True + + + + GtkHBox + hbox1 + False + 4 + + 0 + 1 + 1 + 2 + 0 + 0 + True + False + False + False + True + True + + + + GtkEntry + entry-find + True + True + True + True + 0 + + + 0 + True + True + + + + + GtkButton + button-find + True + + + 0 + False + False + + + + + + GtkAccelLabel + accellabel1 + + GTK_JUSTIFY_LEFT + False + 0 + 0 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + True + False + False + False + True + True + + + + + Custom + table-source + e_addressbook_create_ebook_table + 0 + 0 + Sat, 10 Jun 2000 22:02:57 GMT + + 0 + 1 + 2 + 3 + 0 + 0 + True + True + False + False + True + True + + + + + GtkTable + table-recipients + 1 + 2 + False + 4 + 4 + + 1 + 2 + 2 + 3 + 0 + 0 + True + False + False + False + True + True + + + + GtkAccelLabel + accellabel2 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + True + + + + + + + + diff --git a/addressbook/gui/component/select-names/select-names.glade.h b/addressbook/gui/component/select-names/select-names.glade.h new file mode 100644 index 0000000000..a21ddce689 --- /dev/null +++ b/addressbook/gui/component/select-names/select-names.glade.h @@ -0,0 +1,10 @@ +/* + * 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_("Select Names"); +gchar *s = N_("Find..."); +gchar *s = N_("T_ype name or select from List:"); +gchar *s = N_("Message Recipients"); diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 17a6c52119..cedd798edf 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -28,6 +28,7 @@ #include #include #include +#include /* Signal IDs */ enum { -- cgit