aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r--addressbook/gui/component/.cvsignore10
-rw-r--r--addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in56
-rw-r--r--addressbook/gui/component/GNOME_Evolution_Addressbook.oafinfo56
-rw-r--r--addressbook/gui/component/Makefile.am89
-rw-r--r--addressbook/gui/component/addressbook-component.c132
-rw-r--r--addressbook/gui/component/addressbook-component.h29
-rw-r--r--addressbook/gui/component/addressbook-factory.c82
-rw-r--r--addressbook/gui/component/addressbook.c1143
-rw-r--r--addressbook/gui/component/addressbook.gnorba23
-rw-r--r--addressbook/gui/component/addressbook.h9
-rw-r--r--addressbook/gui/component/addressbook.oafinfo56
-rw-r--r--addressbook/gui/component/alphabet.glade357
-rw-r--r--addressbook/gui/component/alphabet.glade.h34
-rw-r--r--addressbook/gui/component/e-addressbook-model.c396
-rw-r--r--addressbook/gui/component/e-addressbook-model.h52
-rw-r--r--addressbook/gui/component/e-cardlist-model.c226
-rw-r--r--addressbook/gui/component/e-cardlist-model.h42
-rw-r--r--addressbook/gui/component/e-ldap-server-dialog.c143
-rw-r--r--addressbook/gui/component/e-ldap-server-dialog.h9
-rw-r--r--addressbook/gui/component/e-ldap-storage.c230
-rw-r--r--addressbook/gui/component/e-ldap-storage.h42
-rw-r--r--addressbook/gui/component/ldap-server-dialog.glade400
-rw-r--r--addressbook/gui/component/ldap-server-dialog.glade.h11
-rw-r--r--addressbook/gui/component/select-names/.cvsignore7
-rw-r--r--addressbook/gui/component/select-names/Makefile.am46
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.c222
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.h52
-rw-r--r--addressbook/gui/component/select-names/e-select-names-model.c200
-rw-r--r--addressbook/gui/component/select-names/e-select-names-model.h67
-rw-r--r--addressbook/gui/component/select-names/e-select-names-table-model.c157
-rw-r--r--addressbook/gui/component/select-names/e-select-names-table-model.h42
-rw-r--r--addressbook/gui/component/select-names/e-select-names-text-model.c265
-rw-r--r--addressbook/gui/component/select-names/e-select-names-text-model.h44
-rw-r--r--addressbook/gui/component/select-names/e-select-names.c344
-rw-r--r--addressbook/gui/component/select-names/e-select-names.h86
-rw-r--r--addressbook/gui/component/select-names/recipient.glade61
-rw-r--r--addressbook/gui/component/select-names/select-names.glade245
-rw-r--r--addressbook/gui/component/select-names/select-names.glade.h10
38 files changed, 0 insertions, 5475 deletions
diff --git a/addressbook/gui/component/.cvsignore b/addressbook/gui/component/.cvsignore
deleted file mode 100644
index a8ecb5d170..0000000000
--- a/addressbook/gui/component/.cvsignore
+++ /dev/null
@@ -1,10 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-evolution-addressbook
-evolution-addressbook.pure
-test-addressbook
diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in b/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in
deleted file mode 100644
index 15820b2e03..0000000000
--- a/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in
+++ /dev/null
@@ -1,56 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
- type="exe"
- location="evolution-addressbook">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/GenericFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="Factory for the sample Addressbook control"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:control:addressbook:851f883b-2fe7-4c94-a1e3-a1f2a7a03c49"
- type="factory"
- location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/addressbook-control:1.0"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="A sample Bonobo control which displays an addressbook."/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:evolution-shell-component-factory:addressbook:dbf3bba0-4b0a-4f07-899b-1ec56fdf38a0"
- type="exe"
- location="evolution-addressbook">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/GenericFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="Factory for the Evolution addressbook component."/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:evolution-shell-component:addressbook:b7a26547-7014-4bb5-98ab-2bcac2bb55ca"
- type="factory"
- location="OAFIID:evolution-shell-component-factory:addressbook:dbf3bba0-4b0a-4f07-899b-1ec56fdf38a0">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Evolution/ShellComponent:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="Evolution component for handling contacts."/>
-
-</oaf_server>
-
-</oaf_info>
diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.oafinfo b/addressbook/gui/component/GNOME_Evolution_Addressbook.oafinfo
deleted file mode 100644
index 15820b2e03..0000000000
--- a/addressbook/gui/component/GNOME_Evolution_Addressbook.oafinfo
+++ /dev/null
@@ -1,56 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
- type="exe"
- location="evolution-addressbook">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/GenericFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="Factory for the sample Addressbook control"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:control:addressbook:851f883b-2fe7-4c94-a1e3-a1f2a7a03c49"
- type="factory"
- location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/addressbook-control:1.0"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="A sample Bonobo control which displays an addressbook."/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:evolution-shell-component-factory:addressbook:dbf3bba0-4b0a-4f07-899b-1ec56fdf38a0"
- type="exe"
- location="evolution-addressbook">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/GenericFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="Factory for the Evolution addressbook component."/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:evolution-shell-component:addressbook:b7a26547-7014-4bb5-98ab-2bcac2bb55ca"
- type="factory"
- location="OAFIID:evolution-shell-component-factory:addressbook:dbf3bba0-4b0a-4f07-899b-1ec56fdf38a0">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Evolution/ShellComponent:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="Evolution component for handling contacts."/>
-
-</oaf_server>
-
-</oaf_info>
diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am
deleted file mode 100644
index 389f51f9ba..0000000000
--- a/addressbook/gui/component/Makefile.am
+++ /dev/null
@@ -1,89 +0,0 @@
-SUBDIRS = select-names
-
-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)"\"
-
-bin_PROGRAMS = \
- evolution-addressbook
-
-evolution_addressbook_SOURCES = \
- addressbook-component.c \
- addressbook-component.h \
- addressbook-factory.c \
- addressbook.c \
- 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 \
- e-ldap-storage.c \
- e-ldap-storage.h
-
-evolution_addressbook_LDADD = \
- select-names/libeselectnames.la \
- $(top_builddir)/shell/libeshell.a \
- $(EXTRA_GNOME_LIBS) \
- $(BONOBO_HTML_GNOME_LIBS) \
- $(top_builddir)/addressbook/gui/minicard/libeminicard.a \
- $(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 \
- $(top_builddir)/widgets/e-text/libetext.a \
- $(top_builddir)/widgets/e-table/libetable.a \
- $(top_builddir)/widgets/misc/libemiscwidgets.a \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/addressbook/printing/libecontactprint.a
-
-evolution_addressbook_LDFLAGS = `gnome-config --libs gdk_pixbuf`
-
-if USING_OAF
-oafdir = $(datadir)/oaf
-oaf_DATA = addressbook.oafinfo
-else
-gnorbadir = $(sysconfdir)/CORBA/servers
-gnorba_DATA = addressbook.gnorba
-endif
-
-gladedir = $(datadir)/evolution/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
-
-if ENABLE_PURIFY
-PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-
-all-local: evolution-addressbook.pure
-
-evolution-addressbook.pure: evolution-addressbook
- @rm -f evolution-addressbook.pure
- $(PLINK) $(evolution_addressbook_LDFLAGS) $(evolution_addressbook_OBJECTS) $(evolution_addressbook_LDADD) $(LIBS)
-
-endif
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
deleted file mode 100644
index b6b682d18d..0000000000
--- a/addressbook/gui/component/addressbook-component.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* addressbook-component.c
- *
- * Copyright (C) 2000 Helix Code, Inc.
- *
- * This program 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 program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo.h>
-
-#include "evolution-shell-component.h"
-#include "evolution-storage.h"
-
-#include "addressbook-component.h"
-#include "addressbook.h"
-#include "e-ldap-storage.h"
-
-
-#ifdef USING_OAF
-#define COMPONENT_FACTORY_ID "OAFIID:evolution-shell-component-factory:addressbook:dbf3bba0-4b0a-4f07-899b-1ec56fdf38a0"
-#else
-#define COMPONENT_FACTORY_ID "evolution-shell-component-factory:addressbook"
-#endif
-
-static BonoboGenericFactory *factory = NULL;
-
-static const EvolutionShellComponentFolderType folder_types[] = {
- { "contacts", "evolution-contacts.png" },
- { NULL, NULL }
-};
-
-#ifdef HAVE_LDAP
-extern void setup_ldap_storage (EvolutionShellComponent *shell_component);
-#endif
-
-
-/* EvolutionShellComponent methods and signals. */
-
-static EvolutionShellComponentResult
-create_view (EvolutionShellComponent *shell_component,
- const char *physical_uri,
- const char *type,
- BonoboControl **control_return,
- void *closure)
-{
- BonoboControl *control;
-
- if (g_strcasecmp (type, "contacts") != 0)
- return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE;
-
- control = addressbook_factory_new_control ();
- bonobo_control_set_property (control, "folder_uri", physical_uri, NULL);
-
- *control_return = control;
-
- return EVOLUTION_SHELL_COMPONENT_OK;
-}
-
-static int owner_count = 0;
-
-static void
-owner_set_cb (EvolutionShellComponent *shell_component,
- EvolutionShellClient *shell_client,
- gpointer user_data)
-{
- owner_count ++;
-
- setup_ldap_storage (shell_component);
-}
-
-static void
-owner_unset_cb (EvolutionShellComponent *shell_component,
- Evolution_Shell shell_interface,
- gpointer user_data)
-{
- owner_count --;
- if (owner_count == 0)
- gtk_main_quit();
-}
-
-
-/* The factory function. */
-
-static BonoboObject *
-factory_fn (BonoboGenericFactory *factory,
- void *closure)
-{
- EvolutionShellComponent *shell_component;
-
- shell_component = evolution_shell_component_new (folder_types, create_view, NULL, NULL, NULL);
-
- gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set",
- GTK_SIGNAL_FUNC (owner_set_cb), NULL);
-
- gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset",
- GTK_SIGNAL_FUNC (owner_unset_cb), NULL);
-
- return BONOBO_OBJECT (shell_component);
-}
-
-
-void
-addressbook_component_factory_init (void)
-{
- if (factory != NULL)
- return;
-
- factory = bonobo_generic_factory_new (COMPONENT_FACTORY_ID, factory_fn, NULL);
-
- if (factory == NULL)
- g_error ("Cannot initialize the Evolution addressbook factory.");
-}
-
diff --git a/addressbook/gui/component/addressbook-component.h b/addressbook/gui/component/addressbook-component.h
deleted file mode 100644
index ec37da694a..0000000000
--- a/addressbook/gui/component/addressbook-component.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* addressbook-component.h
- *
- * Copyright (C) 2000 Helix Code, Inc.
- *
- * This program 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 program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifndef _ADDRESSBOOK_COMPONENT_H
-#define _ADDRESSBOOK_COMPONENT_H
-
-void addressbook_component_factory_init (void);
-
-#endif /* _ADDRESSBOOK_COMPONENT_H */
diff --git a/addressbook/gui/component/addressbook-factory.c b/addressbook/gui/component/addressbook-factory.c
deleted file mode 100644
index f16c321b68..0000000000
--- a/addressbook/gui/component/addressbook-factory.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * sample-control-factory.c
- *
- * Copyright 1999, Helix Code, Inc.
- *
- * Author:
- * Nat Friedman (nat@nat.org)
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <bonobo.h>
-#include <glade/glade.h>
-#include <e-util/e-cursors.h>
-
-#include "addressbook.h"
-#include "addressbook-component.h"
-
-#ifdef USING_OAF
-
-#include <liboaf/liboaf.h>
-
-static void
-init_corba (int *argc, char **argv)
-{
- gnome_init_with_popt_table ("evolution-addressbook", "0.0",
- *argc, argv, oaf_popt_options, 0, NULL);
-
- oaf_init (*argc, argv);
-}
-
-#else
-
-#include <libgnorba/gnorba.h>
-
-static void
-init_corba (int *argc, char **argv)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- gnome_CORBA_init_with_popt_table (
- "evolution-addressbook", "0.0",
- argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
-
- CORBA_exception_free (&ev);
-}
-
-#endif
-
-static void
-init_bonobo (int argc, char **argv)
-{
- if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
- g_error (_("Could not initialize Bonobo"));
-
- glade_gnome_init ();
-}
-
-int
-main (int argc, char **argv)
-{
- init_corba (&argc, argv);
-
- init_bonobo (argc, argv);
-
- /* FIXME: Messy names here. This file should be `main.c'. `addressbook.c' should
- be `addressbook-control-factory.c' and the functions should be called
- `addressbook_control_factory_something()'. And `addressbook-component.c'
- should be `addressbook-component-factory.c'. */
-
- addressbook_factory_init ();
- addressbook_component_factory_init ();
-
- e_cursors_init();
-
- bonobo_main ();
-
- return 0;
-}
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
deleted file mode 100644
index f248e1e4bd..0000000000
--- a/addressbook/gui/component/addressbook.c
+++ /dev/null
@@ -1,1143 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * addressbook.c:
- *
- * Author:
- * Chris Lahey (clahey@helixcode.com)
- *
- * (C) 2000 Helix Code, Inc.
- */
-
-#include <config.h>
-
-#include <gnome.h>
-#include <libgnorba/gnorba.h>
-#include <bonobo.h>
-
-#include "addressbook.h"
-
-#include <ebook/e-book.h>
-#include <e-util/e-canvas.h>
-#include <e-util/e-util.h>
-#include <e-util/e-popup-menu.h>
-#include "e-minicard-view.h"
-
-#include <e-table.h>
-#include <e-cell-text.h>
-
-#include <e-addressbook-model.h>
-#include <select-names/e-select-names.h>
-#include "e-contact-editor.h"
-#include "e-contact-save-as.h"
-#include "e-ldap-server-dialog.h"
-#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-print-dialog.h>
-#include <libgnomeprint/gnome-print-master.h>
-#include <libgnomeprint/gnome-print-master-preview.h>
-
-#include <addressbook/printing/e-contact-print.h>
-
-#ifdef USING_OAF
-#define CONTROL_FACTORY_ID "OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
-#else
-#define CONTROL_FACTORY_ID "control-factory:addressbook"
-#endif
-
-#define PROPERTY_FOLDER_URI "folder_uri"
-
-#define PROPERTY_FOLDER_URI_IDX 1
-
-typedef enum {
- ADDRESSBOOK_VIEW_NONE, /* initialized to this */
- ADDRESSBOOK_VIEW_TABLE,
- ADDRESSBOOK_VIEW_MINICARD
-} AddressbookViewType;
-
-typedef struct {
- AddressbookViewType view_type;
- EBook *book;
- GtkWidget *vbox;
- GtkWidget *minicard_hbox;
- GtkWidget *canvas;
- GnomeCanvasItem *view;
- GnomeCanvasItem *rect;
- GtkWidget *table;
- ETableModel *model;
- ECardSimple *simple;
- GtkAllocation last_alloc;
- BonoboControl *control;
- BonoboPropertyBag *properties;
- char *uri;
-} AddressbookView;
-
-static void change_view_type (AddressbookView *view, AddressbookViewType view_type);
-
-static void
-control_deactivate (BonoboControl *control, BonoboUIHandler *uih)
-{
- /* how to remove a menu item */
- bonobo_ui_handler_menu_remove (uih, "/File/Print");
- bonobo_ui_handler_menu_remove (uih, "/File/TestSelectNames");
- bonobo_ui_handler_menu_remove (uih, "/View/<sep>");
- bonobo_ui_handler_menu_remove (uih, "/View/Toggle View");
- bonobo_ui_handler_menu_remove (uih, "/Actions/New Contact");
-#ifdef HAVE_LDAP
- bonobo_ui_handler_menu_remove (uih, "/Actions/New Directory Server");
-#endif
- /* remove our toolbar */
- bonobo_ui_handler_dock_remove (uih, "/Toolbar");
-}
-
-static void
-do_nothing_cb (BonoboUIHandler *uih, void *user_data, const char *path)
-{
- g_print ("Yow! I am called back!\n");
-}
-
-static void
-card_added_cb (EBook* book, EBookStatus status, const char *id,
- gpointer user_data)
-{
- g_print ("%s: %s(): a card was added\n", __FILE__, __FUNCTION__);
-}
-
-static void
-card_modified_cb (EBook* book, EBookStatus status,
- gpointer user_data)
-{
- g_print ("%s: %s(): a card was modified\n", __FILE__, __FUNCTION__);
-}
-
-/* Callback for the add_card signal from the contact editor */
-static void
-add_card_cb (EContactEditor *ce, ECard *card, gpointer data)
-{
- EBook *book;
-
- book = E_BOOK (data);
- e_book_add_card (book, card, card_added_cb, NULL);
-}
-
-/* Callback for the commit_card signal from the contact editor */
-static void
-commit_card_cb (EContactEditor *ce, ECard *card, gpointer data)
-{
- EBook *book;
-
- book = E_BOOK (data);
- e_book_commit_card (book, card, card_modified_cb, NULL);
-}
-
-/* Callback used when the contact editor is closed */
-static void
-editor_closed_cb (EContactEditor *ce, gpointer data)
-{
- gtk_object_unref (GTK_OBJECT (ce));
-}
-
-static void
-new_contact_cb (BonoboUIHandler *uih, void *user_data, const char *path)
-{
- ECard *card;
- EBook *book;
- EContactEditor *ce;
- AddressbookView *view = (AddressbookView *) user_data;
- GtkObject *object;
-
- card = e_card_new("");
-
- if (view->view)
- object = GTK_OBJECT(view->view);
- else
- object = GTK_OBJECT(view->model);
-
- gtk_object_get(object, "book", &book, NULL);
- g_assert (E_IS_BOOK (book));
-
- ce = e_contact_editor_new (card, TRUE);
-
- gtk_signal_connect (GTK_OBJECT (ce), "add_card",
- GTK_SIGNAL_FUNC (add_card_cb), book);
- gtk_signal_connect (GTK_OBJECT (ce), "commit_card",
- GTK_SIGNAL_FUNC (commit_card_cb), book);
- gtk_signal_connect (GTK_OBJECT (ce), "editor_closed",
- GTK_SIGNAL_FUNC (editor_closed_cb), NULL);
-
- gtk_object_sink(GTK_OBJECT(card));
-}
-
-static void
-toggle_view_as_cb (BonoboUIHandler *uih, void *user_data, const char *path)
-{
- AddressbookView *view = user_data;
-
- if (view->view_type == ADDRESSBOOK_VIEW_TABLE)
- change_view_type (view, ADDRESSBOOK_VIEW_MINICARD);
- else
- change_view_type (view, ADDRESSBOOK_VIEW_TABLE);
-}
-
-#ifdef HAVE_LDAP
-static void
-null_cb (EBook *book, EBookStatus status, gpointer closure)
-{
-}
-
-static void
-new_server_cb (BonoboUIHandler *uih, void *user_data, const char *path)
-{
- ELDAPServer *server = g_new (ELDAPServer, 1);
- EBook *book;
- AddressbookView *view = (AddressbookView *) user_data;
- GtkObject *object;
-
- /* fill in the defaults */
- server->name = g_strdup("");
- server->host = g_strdup("");
- server->port = 389;
- server->description = g_strdup("");
- server->rootdn = g_strdup("");
- server->uri = g_strdup_printf ("ldap://%s:%d/%s", server->host, server->port, server->rootdn);
- e_ldap_server_editor_show (server);
-
- if (view->view)
- object = GTK_OBJECT(view->view);
- else
- object = GTK_OBJECT(view->model);
- gtk_object_get(object, "book", &book, NULL);
- g_assert (E_IS_BOOK (book));
-
- /* write out the new server info */
- e_ldap_storage_add_server (server);
-
- /* now update the view */
- e_book_unload_uri (book);
- if (! e_book_load_uri (book, server->uri, null_cb, NULL)) {
- g_warning ("error calling load_uri!\n");
- }
-}
-#endif
-
-static char *
-get_query (AddressbookView *view)
-{
- GtkObject *object;
- char *query = NULL;
-
- if (view->view)
- object = GTK_OBJECT(view->view);
- else
- object = GTK_OBJECT(view->model);
-
- if (object)
- gtk_object_get (object, "query", &query, NULL);
-
- return query;
-}
-
-static void
-set_query (AddressbookView *view, char *query)
-{
- GtkObject *object;
-
- if (view->view)
- object = GTK_OBJECT(view->view);
- else
- object = GTK_OBJECT(view->model);
-
- gtk_object_set (object,
- "query", query,
- NULL);
-}
-
-static void
-set_book(AddressbookView *view)
-{
- if (view->book)
- gtk_object_set(view->view ? GTK_OBJECT(view->view) : GTK_OBJECT(view->model),
- "book", view->book,
- NULL);
-}
-
-static void
-find_contact_cb (BonoboUIHandler *uih, void *user_data, const char *path)
-{
- gint result;
- GtkWidget* search_entry = gtk_entry_new();
- gchar* search_text;
- AddressbookView *view = (AddressbookView *) user_data;
-
- GtkWidget* dlg = gnome_dialog_new ("Search Contacts", "Find",
- GNOME_STOCK_BUTTON_CANCEL, NULL);
-
- search_text = get_query (view);
- gtk_entry_set_text(GTK_ENTRY(search_entry), search_text);
- g_free (search_text);
-
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dlg)->vbox),
- search_entry, TRUE, TRUE, 0);
-
- gtk_widget_show_all (dlg);
-
- gnome_dialog_close_hides (GNOME_DIALOG (dlg), TRUE);
- result = gnome_dialog_run_and_close (GNOME_DIALOG (dlg));
-
- /* If the user clicks "okay"...*/
- if (result == 0) {
- search_text = gtk_entry_get_text(GTK_ENTRY(search_entry));
- set_query (view, search_text);
- }
-
-}
-
-static void
-card_deleted_cb (EBook* book, EBookStatus status, gpointer user_data)
-{
- g_print ("%s: %s(): a card was deleted\n", __FILE__, __FUNCTION__);
-}
-
-static void
-delete_contact_cb (BonoboUIHandler *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_minicard_view_remove_selection (E_MINICARD_VIEW(view->view), card_deleted_cb, NULL);
-}
-
-static void
-e_contact_print_destroy(GnomeDialog *dialog, gpointer data)
-{
- ETable *table = gtk_object_get_data(GTK_OBJECT(dialog), "table");
- EPrintable *printable = gtk_object_get_data(GTK_OBJECT(dialog), "printable");
- gtk_object_unref(GTK_OBJECT(printable));
- gtk_object_unref(GTK_OBJECT(table));
-}
-
-static void
-e_contact_print_button(GnomeDialog *dialog, gint button, gpointer data)
-{
- GnomePrintMaster *master;
- GnomePrintContext *pc;
- EPrintable *printable = gtk_object_get_data(GTK_OBJECT(dialog), "printable");
- GtkWidget *preview;
- switch( button ) {
- case GNOME_PRINT_PRINT:
- master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) );
- pc = gnome_print_master_get_context( master );
- e_printable_reset(printable);
- while (e_printable_data_left(printable)) {
- if (gnome_print_gsave(pc) == -1)
- /* FIXME */;
- if (gnome_print_translate(pc, .5 * 72, .5 * 72) == -1)
- /* FIXME */;
- e_printable_print_page(printable,
- pc,
- 7.5 * 72,
- 10.5 * 72,
- TRUE);
- if (gnome_print_grestore(pc) == -1)
- /* FIXME */;
- if (gnome_print_showpage(pc) == -1)
- /* FIXME */;
- }
- gnome_print_master_close(master);
- gnome_print_master_print(master);
- gtk_object_unref(GTK_OBJECT(master));
- gnome_dialog_close(dialog);
- break;
- case GNOME_PRINT_PREVIEW:
- master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) );
- pc = gnome_print_master_get_context( master );
- e_printable_reset(printable);
- while (e_printable_data_left(printable)) {
- if (gnome_print_gsave(pc) == -1)
- /* FIXME */;
- if (gnome_print_translate(pc, .5 * 72, .5 * 72) == -1)
- /* FIXME */;
- e_printable_print_page(printable,
- pc,
- 7.5 * 72,
- 10.5 * 72,
- TRUE);
- if (gnome_print_grestore(pc) == -1)
- /* FIXME */;
- if (gnome_print_showpage(pc) == -1)
- /* FIXME */;
- }
- gnome_print_master_close(master);
- preview = GTK_WIDGET(gnome_print_master_preview_new(master, "Print Preview"));
- gtk_widget_show_all(preview);
- gtk_object_unref(GTK_OBJECT(master));
- break;
- case GNOME_PRINT_CANCEL:
- gnome_dialog_close(dialog);
- break;
- }
-}
-
-static void
-print_cb (BonoboUIHandler *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view) {
- char *query = get_query(view);
- GtkWidget *print = e_contact_print_dialog_new(view->book, query);
- g_free(query);
- gtk_widget_show_all(print);
- } else {
- GtkWidget *dialog;
- EPrintable *printable;
-
- dialog = gnome_print_dialog_new("Print cards", GNOME_PRINT_DIALOG_RANGE | GNOME_PRINT_DIALOG_COPIES);
- gnome_print_dialog_construct_range_any(GNOME_PRINT_DIALOG(dialog), GNOME_PRINT_RANGE_ALL | GNOME_PRINT_RANGE_SELECTION,
- NULL, NULL, NULL);
-
- printable = e_table_get_printable(E_TABLE(view->table));
-
- gtk_object_ref(GTK_OBJECT(view->table));
-
- gtk_object_set_data(GTK_OBJECT(dialog), "table", view->table);
- gtk_object_set_data(GTK_OBJECT(dialog), "printable", printable);
-
- gtk_signal_connect(GTK_OBJECT(dialog),
- "clicked", GTK_SIGNAL_FUNC(e_contact_print_button), NULL);
- gtk_signal_connect(GTK_OBJECT(dialog),
- "destroy", GTK_SIGNAL_FUNC(e_contact_print_destroy), NULL);
- gtk_widget_show(dialog);
- }
-}
-
-static void
-test_select_names_cb (BonoboUIHandler *uih, void *user_data, const char *path)
-{
- ESelectNames *names = E_SELECT_NAMES(e_select_names_new());
-
- e_select_names_add_section(names, _("To"), "to");
- e_select_names_add_section(names, _("From"), "from");
- e_select_names_add_section(names, _("Cc"), "cc");
- gtk_widget_show(GTK_WIDGET(names));
-}
-
-static GnomeUIInfo gnome_toolbar [] = {
- GNOMEUIINFO_ITEM_STOCK (N_("New"), N_("Create a new contact"), new_contact_cb, GNOME_STOCK_PIXMAP_NEW),
-
- GNOMEUIINFO_SEPARATOR,
-
- GNOMEUIINFO_ITEM_STOCK (N_("Find"), N_("Find a contact"), find_contact_cb, GNOME_STOCK_PIXMAP_SEARCH),
- GNOMEUIINFO_ITEM_STOCK (N_("Print"), N_("Print contacts"), do_nothing_cb, GNOME_STOCK_PIXMAP_PRINT),
- GNOMEUIINFO_ITEM_STOCK (N_("Delete"), N_("Delete a contact"), delete_contact_cb, GNOME_STOCK_PIXMAP_TRASH),
- GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_END
-};
-
-
-static void
-search_entry_activated (GtkWidget* widget, gpointer user_data)
-{
- char* search_word = gtk_entry_get_text(GTK_ENTRY(widget));
- char* search_query;
- AddressbookView *view = (AddressbookView *) user_data;
-
- if (search_word && strlen (search_word))
- search_query = g_strdup_printf (
- "(contains \"full_name\" \"%s\")",
- search_word);
- else
- search_query = g_strdup (
- "(contains \"full_name\" \"\")");
-
- set_query(view, search_query);
-
- g_free (search_query);
-}
-
-static GtkWidget*
-make_quick_search_widget (GtkSignalFunc start_search_func,
- gpointer user_data_for_search)
-{
- GtkWidget *search_vbox = gtk_vbox_new (FALSE, 0);
- GtkWidget *search_entry = gtk_entry_new ();
-
- if (start_search_func)
- {
- gtk_signal_connect (GTK_OBJECT (search_entry), "activate",
- (GtkSignalFunc) search_entry_activated,
- user_data_for_search);
- }
-
- /* add the search entry to the our search_vbox */
- gtk_box_pack_start (GTK_BOX (search_vbox), search_entry,
- FALSE, TRUE, 3);
- gtk_box_pack_start (GTK_BOX (search_vbox),
- gtk_label_new("Quick Search"),
- FALSE, TRUE, 0);
-
- return search_vbox;
-}
-
-static void
-control_activate (BonoboControl *control, BonoboUIHandler *uih,
- AddressbookView *view)
-{
- Bonobo_UIHandler remote_uih;
- GtkWidget *toolbar, *toolbar_frame;
- BonoboControl *toolbar_control;
- GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
- GtkWidget *quick_search_widget;
-
- remote_uih = bonobo_control_get_remote_ui_handler (control);
- bonobo_ui_handler_set_container (uih, remote_uih);
-
- bonobo_ui_handler_menu_new_separator (uih, "/View/<sep>", -1);
-
- bonobo_ui_handler_menu_new_item (uih, "/File/Print",
- N_("Print"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0, print_cb,
- (gpointer) view);
-
- bonobo_ui_handler_menu_new_item (uih, "/File/TestSelectNames",
- N_("Test Select Names"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0, test_select_names_cb,
- (gpointer) view);
-
- bonobo_ui_handler_menu_new_item (uih, "/View/Toggle View",
- N_("As _Table"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0, toggle_view_as_cb,
- (gpointer)view);
-
- bonobo_ui_handler_menu_new_item (uih, "/Actions/New Contact",
- N_("_New Contact"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0, new_contact_cb,
- (gpointer)view);
-
-#ifdef HAVE_LDAP
- bonobo_ui_handler_menu_new_item (uih, "/Actions/New Directory Server",
- N_("N_ew Directory Server"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0, new_server_cb,
- (gpointer)view);
-#endif
-
- toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL,
- GTK_TOOLBAR_BOTH);
-
- gnome_app_fill_toolbar_with_data (GTK_TOOLBAR (toolbar),
- gnome_toolbar,
- NULL, view);
-
- gtk_box_pack_start (GTK_BOX (hbox), toolbar, FALSE, TRUE, 0);
-
-
- /* add the search_vbox to the hbox which will be our toolbar */
- quick_search_widget = make_quick_search_widget (
- search_entry_activated, view);
-
- gtk_box_pack_start (GTK_BOX (hbox),
- quick_search_widget,
- FALSE, TRUE, 0);
-
- gtk_widget_show_all (hbox);
-
- toolbar_frame = gtk_frame_new (NULL);
- gtk_frame_set_shadow_type (GTK_FRAME (toolbar_frame), GTK_SHADOW_OUT);
- gtk_container_add (GTK_CONTAINER (toolbar_frame), hbox);
- gtk_widget_show (toolbar_frame);
-
- gtk_widget_show_all (toolbar_frame);
-
- toolbar_control = bonobo_control_new (toolbar_frame);
- bonobo_ui_handler_dock_add (
- uih, "/Toolbar",
- bonobo_object_corba_objref (BONOBO_OBJECT (toolbar_control)),
- GNOME_DOCK_ITEM_BEH_EXCLUSIVE,
- GNOME_DOCK_TOP,
- 1, 1, 0);
-}
-
-static void
-control_activate_cb (BonoboControl *control,
- gboolean activate,
- AddressbookView *view)
-{
- BonoboUIHandler *uih;
-
- uih = bonobo_control_get_ui_handler (control);
- g_assert (uih);
-
- if (activate)
- control_activate (control, uih, view);
- else
- control_deactivate (control, uih);
-}
-
-static void
-addressbook_view_free(AddressbookView *view)
-{
- if (view->properties)
- bonobo_object_unref(BONOBO_OBJECT(view->properties));
- if (view->book)
- gtk_object_unref(GTK_OBJECT(view->book));
- g_free(view->uri);
- g_free(view);
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- AddressbookView *view = closure;
- if (status == E_BOOK_STATUS_SUCCESS) {
- set_book (view);
- } else {
- GtkWidget *warning_dialog, *label, *href;
- warning_dialog = gnome_dialog_new (
- _("Unable to open addressbook"),
- GNOME_STOCK_BUTTON_CLOSE,
- NULL);
-
- label = gtk_label_new (
- _("We were unable to open this addressbook. This either\n"
- "means you have entered an incorrect URI, or have tried\n"
- "to access an LDAP server and don't have LDAP support\n"
- "compiled in. If you've entered a URI, check the URI for\n"
- "correctness and reenter. If not, you probably have\n"
- "attempted to access an LDAP server. If you wish to be\n"
- "able to use LDAP, you'll need to download and install\n"
- "OpenLDAP and recompile and install evolution.\n"));
- gtk_misc_set_alignment(GTK_MISC(label),
- 0, .5);
- gtk_label_set_justify(GTK_LABEL(label),
- GTK_JUSTIFY_LEFT);
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (warning_dialog)->vbox),
- label, TRUE, TRUE, 0);
- gtk_widget_show (label);
-
- href = gnome_href_new ("http://www.openldap.org/", "OpenLDAP at http://www.openldap.org/");
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (warning_dialog)->vbox),
- href, FALSE, FALSE, 0);
- gtk_widget_show (href);
-
- gnome_dialog_run (GNOME_DIALOG (warning_dialog));
-
- gtk_object_destroy (GTK_OBJECT (warning_dialog));
- }
-}
-
-static void destroy_callback(GtkWidget *widget, gpointer data)
-{
- AddressbookView *view = data;
- addressbook_view_free(view);
-}
-
-static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, gpointer data)
-{
- double width;
- AddressbookView *view = data;
- view->last_alloc = *allocation;
- gnome_canvas_item_set( view->view,
- "height", (double) allocation->height,
- NULL );
- gnome_canvas_item_set( view->view,
- "minimum_width", (double) allocation->width,
- NULL );
- gtk_object_get(GTK_OBJECT(view->view),
- "width", &width,
- NULL);
- width = MAX(width, allocation->width);
- gnome_canvas_set_scroll_region(GNOME_CANVAS( view->canvas ), 0, 0, width, allocation->height );
- gnome_canvas_item_set( view->rect,
- "x2", (double) width,
- "y2", (double) allocation->height,
- NULL );
-}
-
-static void resize(GnomeCanvas *canvas, gpointer data)
-{
- double width;
- AddressbookView *view = data;
- gtk_object_get(GTK_OBJECT(view->view),
- "width", &width,
- NULL);
- width = MAX(width, view->last_alloc.width);
- gnome_canvas_set_scroll_region(GNOME_CANVAS(view->canvas), 0, 0, width, view->last_alloc.height );
- gnome_canvas_item_set( view->rect,
- "x2", (double) width,
- "y2", (double) view->last_alloc.height,
- NULL );
-}
-
-static void
-get_prop (BonoboPropertyBag *bag,
- BonoboArg *arg,
- guint arg_id,
- gpointer user_data)
-{
- AddressbookView *view = user_data;
-
- switch (arg_id) {
-
- case PROPERTY_FOLDER_URI_IDX:
- if (view && view->uri)
- BONOBO_ARG_SET_STRING (arg, view->uri);
- else
- BONOBO_ARG_SET_STRING (arg, "");
- break;
-
- default:
- g_warning ("Unhandled arg %d\n", arg_id);
- }
-}
-
-static void
-set_prop (BonoboPropertyBag *bag,
- const BonoboArg *arg,
- guint arg_id,
- gpointer user_data)
-{
- AddressbookView *view = user_data;
-
- char *uri_data;
-
- switch (arg_id) {
-
- case PROPERTY_FOLDER_URI_IDX:
- if (view->uri) {
- /* we've already had a uri set on this view, so unload it */
- e_book_unload_uri (view->book);
- g_free (view->uri);
- }
-
- view->uri = g_strdup(BONOBO_ARG_GET_STRING (arg));
-
- if (!strncmp (view->uri, "file:", 5)) {
- char *file_name = g_concat_dir_and_file(view->uri + 7, "addressbook.db");
- uri_data = g_strdup_printf("file://%s", file_name);
- g_free(file_name);
- }
- else {
- uri_data = g_strdup (view->uri);
- }
-
- if (! e_book_load_uri (view->book, uri_data, book_open_cb, view))
- printf ("error calling load_uri!\n");
-
- g_free(uri_data);
-
- break;
-
- default:
- g_warning ("Unhandled arg %d\n", arg_id);
- break;
- }
-}
-
-#define SPEC "<?xml version=\"1.0\"?> \
-<ETableSpecification click-to-add=\"1\"> \
- <columns-shown> \
- <column>0</column> \
- <column>1</column> \
- <column>2</column> \
- <column>3</column> \
- <column>4</column> \
- <column>5</column> \
- <column>6</column> \
- <column>7</column> \
- <column>8</column> \
- <column>10</column> \
- </columns-shown> \
- <grouping> \
- <leaf column=\"0\" ascending=\"1\"/> \
- </grouping> \
-</ETableSpecification>"
-
-static void
-teardown_minicard_view (AddressbookView *view)
-{
- if (view->view) {
- gtk_object_destroy(GTK_OBJECT(view->view));
- view->view = NULL;
- }
- if (view->minicard_hbox) {
- gtk_widget_destroy(view->minicard_hbox);
- view->minicard_hbox = NULL;
- }
-
- view->canvas = NULL;
-}
-
-typedef struct {
- AddressbookView *view;
- char letter;
-} LetterClosure;
-
-static void
-jump_to_letter(GtkWidget *button, LetterClosure *closure)
-{
- if (closure->view->view)
- e_minicard_view_jump_to_letter(E_MINICARD_VIEW(closure->view->view), closure->letter);
-}
-
-static void
-free_closure(GtkWidget *button, LetterClosure *closure)
-{
- g_free(closure);
-}
-
-static void
-connect_button (AddressbookView *view, GladeXML *gui, char letter)
-{
- char *name;
- GtkWidget *button;
- LetterClosure *closure;
- name = g_strdup_printf("button-%c", letter);
- button = glade_xml_get_widget(gui, name);
- g_free(name);
- if (!button)
- return;
- closure = g_new(LetterClosure, 1);
- closure->view = view;
- closure->letter = letter;
- gtk_signal_connect(GTK_OBJECT(button), "clicked",
- GTK_SIGNAL_FUNC(jump_to_letter), closure);
- gtk_signal_connect(GTK_OBJECT(button), "destroy",
- GTK_SIGNAL_FUNC(free_closure), closure);
-}
-
-static GtkWidget *
-create_alphabet (AddressbookView *view)
-{
- GtkWidget *widget;
- char letter;
- GladeXML *gui = glade_xml_new (EVOLUTION_GLADEDIR "/alphabet.glade", NULL);
-
- widget = glade_xml_get_widget(gui, "scrolledwindow-top");
- if (!widget) {
- return NULL;
- }
-
- connect_button(view, gui, '1');
- for (letter = 'a'; letter <= 'z'; letter ++) {
- connect_button(view, gui, letter);
- }
-
- gtk_object_unref(GTK_OBJECT(gui));
- return widget;
-}
-
-static void
-create_minicard_view (AddressbookView *view, char *initial_query)
-{
- GtkWidget *scrollbar;
- GtkWidget *vbox;
- GtkWidget *alphabet;
-
- gtk_widget_push_visual (gdk_rgb_get_visual ());
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- view->minicard_hbox = gtk_hbox_new(FALSE, 0);
-
- vbox = gtk_vbox_new(FALSE, 0);
-
- view->canvas = e_canvas_new();
- view->rect = gnome_canvas_item_new(
- gnome_canvas_root( GNOME_CANVAS( view->canvas ) ),
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) 100,
- "y2", (double) 100,
- "fill_color", "white",
- NULL );
-
- view->view = gnome_canvas_item_new(
- gnome_canvas_root( GNOME_CANVAS( view->canvas ) ),
- e_minicard_view_get_type(),
- "height", (double) 100,
- "minimum_width", (double) 100,
- NULL );
-
- gtk_signal_connect( GTK_OBJECT( view->canvas ), "reflow",
- GTK_SIGNAL_FUNC( resize ),
- view);
-
- gnome_canvas_set_scroll_region ( GNOME_CANVAS( view->canvas ),
- 0, 0,
- 100, 100 );
-
- gtk_box_pack_start(GTK_BOX(vbox), view->canvas, TRUE, TRUE, 0);
-
- scrollbar = gtk_hscrollbar_new(
- gtk_layout_get_hadjustment(GTK_LAYOUT(view->canvas)));
-
- gtk_box_pack_start(GTK_BOX(vbox), scrollbar, FALSE, FALSE, 0);
-
- gtk_box_pack_start(GTK_BOX(view->minicard_hbox), vbox, TRUE, TRUE, 0);
-
- alphabet = create_alphabet(view);
- if (alphabet) {
- gtk_object_ref(GTK_OBJECT(alphabet));
- gtk_widget_unparent(alphabet);
- gtk_box_pack_start(GTK_BOX(view->minicard_hbox), alphabet, FALSE, FALSE, 0);
- gtk_object_unref(GTK_OBJECT(alphabet));
- }
-
- gtk_box_pack_start(GTK_BOX(view->vbox), view->minicard_hbox, TRUE, TRUE, 0);
-
- gtk_widget_show_all( GTK_WIDGET(view->minicard_hbox) );
-
- /* Connect the signals */
- gtk_signal_connect( GTK_OBJECT( view->canvas ), "size_allocate",
- GTK_SIGNAL_FUNC( allocate_callback ),
- ( gpointer ) view );
-
-#if 0
- gdk_window_set_back_pixmap(
- GTK_LAYOUT(view->canvas)->bin_window, NULL, FALSE);
-#endif
-
- gtk_widget_pop_visual ();
- gtk_widget_pop_colormap ();
-}
-
-static void
-teardown_table_view (AddressbookView *view)
-{
- if (view->table) {
- gtk_widget_destroy (GTK_WIDGET (view->table));
- view->table = NULL;
- }
- if (view->model) {
- gtk_object_unref (GTK_OBJECT (view->model));
- view->model = NULL;
- }
- if (view->simple) {
- gtk_object_destroy (GTK_OBJECT (view->simple));
- view->simple = NULL;
- }
-}
-
-static void
-table_double_click(ETable *table, gint row, AddressbookView *view)
-{
- ECard *card = e_addressbook_model_get_card(E_ADDRESSBOOK_MODEL(view->model), row);
- EBook *book;
- EContactEditor *ce;
-
- gtk_object_get(GTK_OBJECT(view->model),
- "book", &book,
- NULL);
-
- g_assert (E_IS_BOOK (book));
-
- ce = e_contact_editor_new (card, FALSE);
-
- gtk_signal_connect (GTK_OBJECT (ce), "add_card",
- GTK_SIGNAL_FUNC (add_card_cb), book);
- gtk_signal_connect (GTK_OBJECT (ce), "commit_card",
- GTK_SIGNAL_FUNC (commit_card_cb), book);
- gtk_signal_connect (GTK_OBJECT (ce), "editor_closed",
- GTK_SIGNAL_FUNC (editor_closed_cb), NULL);
-
- gtk_object_unref(GTK_OBJECT(card));
-}
-
-static void
-save_as (GtkWidget *widget, ECard *card)
-{
- e_contact_save_as(_("Save as VCard"), card);
-}
-
-static gint
-table_right_click(ETable *table, gint row, gint col, GdkEvent *event, AddressbookView *view)
-{
- ECard *card = e_addressbook_model_get_card(E_ADDRESSBOOK_MODEL(view->model), row);
- EPopupMenu menu[] = { {"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), 0}, {NULL, NULL, NULL, 0} };
-
- e_popup_menu_run (menu, (GdkEventButton *)event, 0, card);
-
- return TRUE;
-}
-
-static void
-create_table_view (AddressbookView *view, char *initial_query)
-{
- ECell *cell_left_just;
- ETableHeader *e_table_header;
- int i;
-
- view->simple = e_card_simple_new(NULL);
-
- view->model = e_addressbook_model_new();
-
- /*
- Next we create a header. The ETableHeader is used in two
- different way. The first is the full_header. This is the
- list of possible columns in the view. The second use is
- completely internal. Many of the ETableHeader functions are
- for that purpose. The only functions we really need are
- e_table_header_new and e_table_header_add_col.
-
- First we create the header. */
- e_table_header = e_table_header_new ();
-
- /* Next we have to build renderers for all of the columns.
- Since all our columns are text columns, we can simply use
- the same renderer over and over again. If we had different
- types of columns, we could use a different renderer for
- each column. */
- cell_left_just = e_cell_text_new (view->model, NULL, GTK_JUSTIFY_LEFT);
-
- /* Next we create a column object for each view column and add
- them to the header. We don't create a column object for
- the importance column since it will not be shown. */
- for (i = 0; i < E_CARD_SIMPLE_FIELD_LAST - 1; i++){
- /* Create the column. */
- ETableCol *ecol = e_table_col_new (
- i, e_card_simple_get_name(view->simple, i+1),
- 1.0, 20, cell_left_just,
- g_str_compare, TRUE);
- /* Add it to the header. */
- e_table_header_add_column (e_table_header, ecol, i);
- }
-
- /* Here we create the table. We give it the three pieces of
- the table we've created, the header, the model, and the
- initial layout. It does the rest. */
- view->table = e_table_new (e_table_header, E_TABLE_MODEL(view->model), SPEC);
-
- gtk_signal_connect(GTK_OBJECT(view->table), "double_click",
- GTK_SIGNAL_FUNC(table_double_click), view);
- gtk_signal_connect(GTK_OBJECT(view->table), "right_click",
- GTK_SIGNAL_FUNC(table_right_click), view);
-
- gtk_object_set (GTK_OBJECT(view->table),
- "click_to_add_message", _("* Click here to add a contact *"),
- NULL);
-
- gtk_box_pack_start(GTK_BOX(view->vbox), view->table, TRUE, TRUE, 0);
-
- gtk_widget_show_all( GTK_WIDGET(view->table) );
-}
-
-static void
-change_view_type (AddressbookView *view, AddressbookViewType view_type)
-{
- char *query = NULL;
- BonoboUIHandler *uih = bonobo_control_get_ui_handler (view->control);
-
- if (view_type == view->view_type)
- return;
-
- if (view->view_type != ADDRESSBOOK_VIEW_NONE)
- query = get_query(view);
- else
- query = g_strdup("(contains \"full_name\" \"\")");
-
-
- switch (view_type) {
- case ADDRESSBOOK_VIEW_MINICARD:
- teardown_table_view (view);
- create_minicard_view (view, query);
- if (uih)
- bonobo_ui_handler_menu_set_label (uih, "/View/Toggle View",
- N_("As _Table"));
- break;
- case ADDRESSBOOK_VIEW_TABLE:
- teardown_minicard_view (view);
- create_table_view (view, query);
- if (uih)
- bonobo_ui_handler_menu_set_label (uih, "/View/Toggle View",
- N_("As _Minicards"));
- break;
- default:
- g_warning ("view_type must be either TABLE or MINICARD\n");
- g_free (query);
- return;
- }
-
- view->view_type = view_type;
-
- /* set the book */
- set_book (view);
-
- /* and reset the query */
- if (query)
- set_query (view, query);
- g_free (query);
-}
-
-
-BonoboControl *
-addressbook_factory_new_control (void)
-{
- AddressbookView *view;
-
- view = g_new0 (AddressbookView, 1);
-
- view->vbox = gtk_vbox_new(FALSE, 0);
-
- gtk_signal_connect( GTK_OBJECT( view->vbox ), "destroy",
- GTK_SIGNAL_FUNC( destroy_callback ),
- ( gpointer ) view );
-
- /* Create the control. */
- view->control = bonobo_control_new(view->vbox);
-
- view->model = NULL;
- view->view = NULL;
-
- /* create the initial view */
- change_view_type (view, ADDRESSBOOK_VIEW_MINICARD);
-
- gtk_widget_show_all( view->vbox );
-
- /* create the view's ebook */
- view->book = e_book_new ();
-
- view->properties = bonobo_property_bag_new (get_prop, set_prop, view);
-
- bonobo_property_bag_add (
- view->properties, PROPERTY_FOLDER_URI, PROPERTY_FOLDER_URI_IDX,
- BONOBO_ARG_STRING, NULL, _("The URI that the Folder Browser will display"), 0);
-
- bonobo_control_set_property_bag (view->control,
- view->properties);
-
- view->uri = NULL;
-
- gtk_signal_connect (GTK_OBJECT (view->control), "activate",
- control_activate_cb, view);
-
- return view->control;
-}
-
-static BonoboObject *
-addressbook_factory (BonoboGenericFactory *Factory, void *closure)
-{
- return BONOBO_OBJECT (addressbook_factory_new_control ());
-}
-
-void
-addressbook_factory_init (void)
-{
- static BonoboGenericFactory *addressbook_control_factory = NULL;
-
- if (addressbook_control_factory != NULL)
- return;
-
- addressbook_control_factory = bonobo_generic_factory_new (CONTROL_FACTORY_ID,
- addressbook_factory,
- NULL);
-
- if (addressbook_control_factory == NULL) {
- g_error ("I could not register a Addressbook factory.");
- }
-}
diff --git a/addressbook/gui/component/addressbook.gnorba b/addressbook/gui/component/addressbook.gnorba
deleted file mode 100644
index bc3830686d..0000000000
--- a/addressbook/gui/component/addressbook.gnorba
+++ /dev/null
@@ -1,23 +0,0 @@
-[control-factory:addressbook]
-type=exe
-repo_id=IDL:GNOME/GenericFactory:1.0
-description=Factory for the sample Addressbook control
-location_info=evolution-addressbook
-
-[control:addressbook]
-type=factory
-repo_id=IDL:BonoboControl/addressbook-control:1.0 IDL:GNOME/Control:1.0
-description=A sample Bonobo control which displays an addressbook.
-location_info=control-factory:addressbook
-
-[evolution-shell-component-factory:addressbook]
-type=exe
-repo_id=IDL:GNOME/GenericFactory:1.0
-description=Factory for the Evolution addressbook component.
-location_info=evolution-addressbook
-
-[evolution-shell-component:addressbook]
-type=factory
-repo_id=IDL:Evolution/ShellComponent:1.0
-description=Evolution component for handling contacts.
-location_info=evolution-shell-component-factory:addressbook
diff --git a/addressbook/gui/component/addressbook.h b/addressbook/gui/component/addressbook.h
deleted file mode 100644
index 66c5a7e4e6..0000000000
--- a/addressbook/gui/component/addressbook.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __ADDRESSBOOK_H__
-#define __ADDRESSBOOK_H__
-
-#include <bonobo/bonobo-control.h>
-
-BonoboControl *addressbook_factory_new_control (void);
-void addressbook_factory_init (void);
-
-#endif /* __ADDRESSBOOK_H__ */
diff --git a/addressbook/gui/component/addressbook.oafinfo b/addressbook/gui/component/addressbook.oafinfo
deleted file mode 100644
index 15820b2e03..0000000000
--- a/addressbook/gui/component/addressbook.oafinfo
+++ /dev/null
@@ -1,56 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
- type="exe"
- location="evolution-addressbook">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/GenericFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="Factory for the sample Addressbook control"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:control:addressbook:851f883b-2fe7-4c94-a1e3-a1f2a7a03c49"
- type="factory"
- location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/addressbook-control:1.0"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="A sample Bonobo control which displays an addressbook."/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:evolution-shell-component-factory:addressbook:dbf3bba0-4b0a-4f07-899b-1ec56fdf38a0"
- type="exe"
- location="evolution-addressbook">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/GenericFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="Factory for the Evolution addressbook component."/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:evolution-shell-component:addressbook:b7a26547-7014-4bb5-98ab-2bcac2bb55ca"
- type="factory"
- location="OAFIID:evolution-shell-component-factory:addressbook:dbf3bba0-4b0a-4f07-899b-1ec56fdf38a0">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Evolution/ShellComponent:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- value="Evolution component for handling contacts."/>
-
-</oaf_server>
-
-</oaf_info>
diff --git a/addressbook/gui/component/alphabet.glade b/addressbook/gui/component/alphabet.glade
deleted file mode 100644
index bc6e5f3798..0000000000
--- a/addressbook/gui/component/alphabet.glade
+++ /dev/null
@@ -1,357 +0,0 @@
-<?xml version="1.0"?>
-<GTK-Interface>
-
-<project>
- <name>alphabet</name>
- <program_name>alphabet</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>
- <gnome_help_support>True</gnome_help_support>
- <output_translatable_strings>True</output_translatable_strings>
- <translatable_strings_file>alphabet.glade.h</translatable_strings_file>
-</project>
-
-<widget>
- <class>GtkWindow</class>
- <name>window2</name>
- <visible>False</visible>
- <title>window2</title>
- <type>GTK_WINDOW_TOPLEVEL</type>
- <position>GTK_WIN_POS_NONE</position>
- <modal>False</modal>
- <allow_shrink>False</allow_shrink>
- <allow_grow>True</allow_grow>
- <auto_shrink>False</auto_shrink>
-
- <widget>
- <class>GtkScrolledWindow</class>
- <name>scrolledwindow-top</name>
- <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
- <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
- <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
- <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
-
- <widget>
- <class>GtkViewport</class>
- <name>viewport1</name>
- <border_width>4</border_width>
- <shadow_type>GTK_SHADOW_NONE</shadow_type>
-
- <widget>
- <class>GtkVBox</class>
- <name>vbox2</name>
- <width>27</width>
- <homogeneous>False</homogeneous>
- <spacing>4</spacing>
-
- <widget>
- <class>GtkButton</class>
- <name>button-1</name>
- <label>123</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-a</name>
- <label>a</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-b</name>
- <label>b</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-c</name>
- <label>c</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-d</name>
- <label>d</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-e</name>
- <label>e</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-f</name>
- <label>f</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-g</name>
- <label>g</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-h</name>
- <label>h</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-i</name>
- <label>i</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-j</name>
- <label>j</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-k</name>
- <label>k</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-l</name>
- <label>l</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-m</name>
- <label>m</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-n</name>
- <label>n</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-o</name>
- <label>o</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-p</name>
- <label>p</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-q</name>
- <label>q</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-r</name>
- <label>r</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-s</name>
- <label>s</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-t</name>
- <label>t</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-u</name>
- <label>u</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-v</name>
- <label>v</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-w</name>
- <can_focus>True</can_focus>
- <label>w</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-x</name>
- <label>x</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-y</name>
- <label>y</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-z</name>
- <label>z</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
- </widget>
- </widget>
- </widget>
-</widget>
-
-</GTK-Interface>
diff --git a/addressbook/gui/component/alphabet.glade.h b/addressbook/gui/component/alphabet.glade.h
deleted file mode 100644
index 2448eeb4fc..0000000000
--- a/addressbook/gui/component/alphabet.glade.h
+++ /dev/null
@@ -1,34 +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_("window2");
-gchar *s = N_("123");
-gchar *s = N_("a");
-gchar *s = N_("b");
-gchar *s = N_("c");
-gchar *s = N_("d");
-gchar *s = N_("e");
-gchar *s = N_("f");
-gchar *s = N_("g");
-gchar *s = N_("h");
-gchar *s = N_("i");
-gchar *s = N_("j");
-gchar *s = N_("k");
-gchar *s = N_("l");
-gchar *s = N_("m");
-gchar *s = N_("n");
-gchar *s = N_("o");
-gchar *s = N_("p");
-gchar *s = N_("q");
-gchar *s = N_("r");
-gchar *s = N_("s");
-gchar *s = N_("t");
-gchar *s = N_("u");
-gchar *s = N_("v");
-gchar *s = N_("w");
-gchar *s = N_("x");
-gchar *s = N_("y");
-gchar *s = N_("z");
diff --git a/addressbook/gui/component/e-addressbook-model.c b/addressbook/gui/component/e-addressbook-model.c
deleted file mode 100644
index 7deda52c98..0000000000
--- a/addressbook/gui/component/e-addressbook-model.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *
- * Author:
- * Christopher James Lahey <clahey@helixcode.com>
- *
- * (C) 1999 Helix Code, Inc.
- */
-
-#include <config.h>
-#include "e-addressbook-model.h"
-#include <gnome-xml/tree.h>
-#include <gnome-xml/parser.h>
-#include <gnome-xml/xmlmemory.h>
-#include <gnome.h>
-
-#define PARENT_TYPE e_table_model_get_type()
-ETableModelClass *parent_class;
-
-/*
- * EAddressbookModel callbacks
- * These are the callbacks that define the behavior of our custom model.
- */
-static void e_addressbook_model_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
-static void e_addressbook_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
-
-
-enum {
- ARG_0,
- ARG_BOOK,
- ARG_QUERY,
-};
-
-static void
-addressbook_destroy(GtkObject *object)
-{
- EAddressbookModel *model = E_ADDRESSBOOK_MODEL(object);
- int i;
-
- if (model->get_view_idle)
- g_source_remove(model->get_view_idle);
- if (model->book_view && model->create_card_id)
- gtk_signal_disconnect(GTK_OBJECT (model->book_view),
- model->create_card_id);
- if (model->book_view && model->remove_card_id)
- gtk_signal_disconnect(GTK_OBJECT (model->book_view),
- model->remove_card_id);
- if (model->book_view && model->modify_card_id)
- gtk_signal_disconnect(GTK_OBJECT (model->book_view),
- model->modify_card_id);
- if (model->book)
- gtk_object_unref(GTK_OBJECT(model->book));
- if (model->book_view)
- gtk_object_unref(GTK_OBJECT(model->book_view));
-
- for ( i = 0; i < model->data_count; i++ ) {
- gtk_object_unref(GTK_OBJECT(model->data[i]));
- }
- g_free(model->data);
-}
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-addressbook_col_count (ETableModel *etc)
-{
- return E_CARD_SIMPLE_FIELD_LAST;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-addressbook_row_count (ETableModel *etc)
-{
- EAddressbookModel *addressbook = E_ADDRESSBOOK_MODEL(etc);
- return addressbook->data_count;
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-addressbook_value_at (ETableModel *etc, int col, int row)
-{
- EAddressbookModel *addressbook = E_ADDRESSBOOK_MODEL(etc);
- const char *value;
- if ( col >= E_CARD_SIMPLE_FIELD_LAST - 1|| row >= addressbook->data_count )
- return NULL;
- value = e_card_simple_get_const(addressbook->data[row],
- col + 1);
- return (void *)(value ? value : "");
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
- EAddressbookModel *addressbook = E_ADDRESSBOOK_MODEL(etc);
- ECard *card;
- if ( col >= E_CARD_SIMPLE_FIELD_LAST - 1|| row >= addressbook->data_count )
- return;
- e_card_simple_set(addressbook->data[row],
- col + 1,
- val);
- gtk_object_get(GTK_OBJECT(addressbook->data[row]),
- "card", &card,
- NULL);
- e_book_commit_card(addressbook->book, card, NULL, NULL);
-
- e_table_model_cell_changed(etc, col, row);
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-addressbook_is_cell_editable (ETableModel *etc, int col, int row)
-{
- return TRUE;
-}
-
-static gint
-addressbook_append_row (ETableModel *etm)
-{
- ECard *card;
- EAddressbookModel *model = E_ADDRESSBOOK_MODEL(etm);
- model->data = g_realloc(model->data, (model->data_count + 1) * sizeof(ECard *));
- card = e_card_new("");
- model->data[model->data_count++] = e_card_simple_new (card);
- gtk_object_unref(GTK_OBJECT(card));
- e_table_model_row_inserted(E_TABLE_MODEL(model), model->data_count - 1);
- return model->data_count - 1;
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-addressbook_duplicate_value (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/* This function frees the value passed to it. */
-static void
-addressbook_free_value (ETableModel *etc, int col, void *value)
-{
- g_free(value);
-}
-
-static void *
-addressbook_initialize_value (ETableModel *etc, int col)
-{
- return g_strdup("");
-}
-
-static gboolean
-addressbook_value_is_empty (ETableModel *etc, int col, const void *value)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-addressbook_value_to_string (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-static void
-create_card(EBookView *book_view,
- const GList *cards,
- EAddressbookModel *model)
-{
- model->data = g_realloc(model->data, (model->data_count + g_list_length((GList *)cards)) * sizeof(ECard *));
- for ( ; cards; cards = cards->next) {
- model->data[model->data_count++] = e_card_simple_new (E_CARD(cards->data));
- e_table_model_row_inserted(E_TABLE_MODEL(model), model->data_count - 1);
- }
-}
-
-static void
-remove_card(EBookView *book_view,
- const char *id,
- EAddressbookModel *model)
-{
- int i;
- for ( i = 0; i < model->data_count; i++) {
- if ( !strcmp(e_card_simple_get_id(model->data[i]), id) ) {
- gtk_object_unref(GTK_OBJECT(model->data[i]));
- memmove(model->data + i, model->data + i + 1, (model->data_count - i - 1) * sizeof (ECard *));
- e_table_model_row_deleted(E_TABLE_MODEL(model), i);
- }
- }
-}
-
-static void
-modify_card(EBookView *book_view,
- const GList *cards,
- EAddressbookModel *model)
-{
- for ( ; cards; cards = cards->next) {
- int i;
- for ( i = 0; i < model->data_count; i++) {
- if ( !strcmp(e_card_simple_get_id(model->data[i]), e_card_get_id(E_CARD(cards->data))) ) {
- gtk_object_unref(GTK_OBJECT(model->data[i]));
- model->data[i] = e_card_simple_new(E_CARD(cards->data));
- gtk_object_ref(GTK_OBJECT(model->data[i]));
- e_table_model_row_changed(E_TABLE_MODEL(model), i);
- break;
- }
- }
- }
-}
-
-static void
-e_addressbook_model_class_init (GtkObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- parent_class = gtk_type_class (PARENT_TYPE);
-
- object_class->destroy = addressbook_destroy;
- object_class->set_arg = e_addressbook_model_set_arg;
- object_class->get_arg = e_addressbook_model_get_arg;
-
- gtk_object_add_arg_type ("EAddressbookModel::book", GTK_TYPE_OBJECT,
- GTK_ARG_READWRITE, ARG_BOOK);
- gtk_object_add_arg_type ("EAddressbookModel::query", GTK_TYPE_STRING,
- GTK_ARG_READWRITE, ARG_QUERY);
-
- model_class->column_count = addressbook_col_count;
- model_class->row_count = addressbook_row_count;
- model_class->value_at = addressbook_value_at;
- model_class->set_value_at = addressbook_set_value_at;
- model_class->is_cell_editable = addressbook_is_cell_editable;
- model_class->append_row = addressbook_append_row;
- model_class->duplicate_value = addressbook_duplicate_value;
- model_class->free_value = addressbook_free_value;
- model_class->initialize_value = addressbook_initialize_value;
- model_class->value_is_empty = addressbook_value_is_empty;
- model_class->value_to_string = addressbook_value_to_string;
-}
-
-static void
-e_addressbook_model_init (GtkObject *object)
-{
- EAddressbookModel *model = E_ADDRESSBOOK_MODEL(object);
- model->book = NULL;
- model->query = g_strdup("(contains \"full_name\" \"\")");
- model->book_view = NULL;
- model->get_view_idle = 0;
- model->create_card_id = 0;
- model->remove_card_id = 0;
- model->modify_card_id = 0;
- model->data = NULL;
- model->data_count = 0;
-}
-
-static void
-book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, gpointer closure)
-{
- EAddressbookModel *model = closure;
- int i;
- if (model->book_view && model->create_card_id)
- gtk_signal_disconnect(GTK_OBJECT (model->book_view),
- model->create_card_id);
- if (model->book_view && model->remove_card_id)
- gtk_signal_disconnect(GTK_OBJECT (model->book_view),
- model->remove_card_id);
- if (model->book_view && model->modify_card_id)
- gtk_signal_disconnect(GTK_OBJECT (model->book_view),
- model->modify_card_id);
- if (model->book_view)
- gtk_object_unref(GTK_OBJECT(model->book_view));
- model->book_view = book_view;
- if (model->book_view)
- gtk_object_ref(GTK_OBJECT(model->book_view));
- model->create_card_id = gtk_signal_connect(GTK_OBJECT(model->book_view),
- "card_added",
- GTK_SIGNAL_FUNC(create_card),
- model);
- model->remove_card_id = gtk_signal_connect(GTK_OBJECT(model->book_view),
- "card_removed",
- GTK_SIGNAL_FUNC(remove_card),
- model);
- model->modify_card_id = gtk_signal_connect(GTK_OBJECT(model->book_view),
- "card_changed",
- GTK_SIGNAL_FUNC(modify_card),
- model);
-
- for ( i = 0; i < model->data_count; i++ ) {
- gtk_object_unref(GTK_OBJECT(model->data[i]));
- }
- g_free(model->data);
- model->data = NULL;
- model->data_count = 0;
- e_table_model_changed(E_TABLE_MODEL(model));
-}
-
-static gboolean
-get_view(EAddressbookModel *model)
-{
- if (model->book && model->query)
- e_book_get_book_view(model->book, model->query, book_view_loaded, model);
-
- model->get_view_idle = 0;
- return FALSE;
-}
-
-ECard *
-e_addressbook_model_get_card(EAddressbookModel *model,
- int row)
-{
- if (model->data && row < model->data_count) {
- ECard *card;
- gtk_object_get(GTK_OBJECT(model->data[row]),
- "card", &card,
- NULL);
- gtk_object_ref(GTK_OBJECT(card));
- return card;
- }
- return NULL;
-}
-
-static void
-e_addressbook_model_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- EAddressbookModel *model;
-
- model = E_ADDRESSBOOK_MODEL (o);
-
- switch (arg_id){
- case ARG_BOOK:
- if (model->book)
- gtk_object_unref(GTK_OBJECT(model->book));
- model->book = E_BOOK(GTK_VALUE_OBJECT (*arg));
- if (model->book) {
- gtk_object_ref(GTK_OBJECT(model->book));
- if (model->get_view_idle == 0)
- model->get_view_idle = g_idle_add((GSourceFunc)get_view, model);
- }
- break;
- case ARG_QUERY:
- if (model->query)
- g_free(model->query);
- model->query = g_strdup(GTK_VALUE_STRING (*arg));
- if (model->get_view_idle == 0)
- model->get_view_idle = g_idle_add((GSourceFunc)get_view, model);
- break;
- }
-}
-
-static void
-e_addressbook_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
-{
- EAddressbookModel *e_addressbook_model;
-
- e_addressbook_model = E_ADDRESSBOOK_MODEL (object);
-
- switch (arg_id) {
- case ARG_BOOK:
- GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(e_addressbook_model->book);
- break;
- case ARG_QUERY:
- GTK_VALUE_STRING (*arg) = g_strdup(e_addressbook_model->query);
- break;
- default:
- arg->type = GTK_TYPE_INVALID;
- break;
- }
-}
-
-GtkType
-e_addressbook_model_get_type (void)
-{
- static GtkType type = 0;
-
- if (!type){
- GtkTypeInfo info = {
- "EAddressbookModel",
- sizeof (EAddressbookModel),
- sizeof (EAddressbookModelClass),
- (GtkClassInitFunc) e_addressbook_model_class_init,
- (GtkObjectInitFunc) e_addressbook_model_init,
- NULL, /* reserved 1 */
- NULL, /* reserved 2 */
- (GtkClassInitFunc) NULL
- };
-
- type = gtk_type_unique (PARENT_TYPE, &info);
- }
-
- return type;
-}
-
-ETableModel *
-e_addressbook_model_new (void)
-{
- EAddressbookModel *et;
-
- et = gtk_type_new (e_addressbook_model_get_type ());
-
- return E_TABLE_MODEL(et);
-}
diff --git a/addressbook/gui/component/e-addressbook-model.h b/addressbook/gui/component/e-addressbook-model.h
deleted file mode 100644
index bff9a21d00..0000000000
--- a/addressbook/gui/component/e-addressbook-model.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_ADDRESSBOOK_MODEL_H_
-#define _E_ADDRESSBOOK_MODEL_H_
-
-#include "e-table-model.h"
-#include <ebook/e-book.h>
-#include <ebook/e-book-view.h>
-#include <ebook/e-card-simple.h>
-
-#define E_ADDRESSBOOK_MODEL_TYPE (e_addressbook_model_get_type ())
-#define E_ADDRESSBOOK_MODEL(o) (GTK_CHECK_CAST ((o), E_ADDRESSBOOK_MODEL_TYPE, EAddressbookModel))
-#define E_ADDRESSBOOK_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_ADDRESSBOOK_MODEL_TYPE, EAddressbookModelClass))
-#define E_IS_ADDRESSBOOK_MODEL(o) (GTK_CHECK_TYPE ((o), E_ADDRESSBOOK_MODEL_TYPE))
-#define E_IS_ADDRESSBOOK_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_ADDRESSBOOK_MODEL_TYPE))
-
-/* Virtual Column list:
- 0 Email
- 1 Full Name
- 2 Street
- 3 Phone
-*/
-
-typedef struct {
- ETableModel parent;
-
- /* item specific fields */
- EBook *book;
- char *query;
- EBookView *book_view;
-
- int get_view_idle;
-
- ECardSimple **data;
- int data_count;
-
- int create_card_id, remove_card_id, modify_card_id;
-} EAddressbookModel;
-
-
-typedef struct {
- ETableModelClass parent_class;
-} EAddressbookModelClass;
-
-
-GtkType e_addressbook_model_get_type (void);
-ETableModel *e_addressbook_model_new (void);
-
-/* Returns object with ref count of 1. */
-ECard *e_addressbook_model_get_card(EAddressbookModel *model,
- int row);
-
-#endif /* _E_ADDRESSBOOK_MODEL_H_ */
diff --git a/addressbook/gui/component/e-cardlist-model.c b/addressbook/gui/component/e-cardlist-model.c
deleted file mode 100644
index 23b61d58be..0000000000
--- a/addressbook/gui/component/e-cardlist-model.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *
- * Author:
- * Christopher James Lahey <clahey@helixcode.com>
- *
- * (C) 1999 Helix Code, Inc.
- */
-
-#include <config.h>
-#include "e-cardlist-model.h"
-#include <gnome-xml/tree.h>
-#include <gnome-xml/parser.h>
-#include <gnome-xml/xmlmemory.h>
-#include <gnome.h>
-
-#define PARENT_TYPE e_table_model_get_type()
-
-static void
-e_cardlist_model_destroy(GtkObject *object)
-{
- ECardlistModel *model = E_CARDLIST_MODEL(object);
- int i;
-
- for ( i = 0; i < model->data_count; i++ ) {
- gtk_object_unref(GTK_OBJECT(model->data[i]));
- }
- g_free(model->data);
-}
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-e_cardlist_model_col_count (ETableModel *etc)
-{
- return E_CARD_SIMPLE_FIELD_LAST;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-e_cardlist_model_row_count (ETableModel *etc)
-{
- ECardlistModel *e_cardlist_model = E_CARDLIST_MODEL(etc);
- return e_cardlist_model->data_count;
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-e_cardlist_model_value_at (ETableModel *etc, int col, int row)
-{
- ECardlistModel *e_cardlist_model = E_CARDLIST_MODEL(etc);
- const char *value;
- if ( col >= E_CARD_SIMPLE_FIELD_LAST - 1|| row >= e_cardlist_model->data_count )
- return NULL;
- value = e_card_simple_get_const(e_cardlist_model->data[row],
- col + 1);
- return (void *)(value ? value : "");
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-e_cardlist_model_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
- ECardlistModel *e_cardlist_model = E_CARDLIST_MODEL(etc);
- ECard *card;
- if ( col >= E_CARD_SIMPLE_FIELD_LAST - 1|| row >= e_cardlist_model->data_count )
- return;
- e_card_simple_set(e_cardlist_model->data[row],
- col + 1,
- val);
- gtk_object_get(GTK_OBJECT(e_cardlist_model->data[row]),
- "card", &card,
- NULL);
-
- e_table_model_cell_changed(etc, col, row);
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-e_cardlist_model_is_cell_editable (ETableModel *etc, int col, int row)
-{
- return TRUE;
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-e_cardlist_model_duplicate_value (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/* This function frees the value passed to it. */
-static void
-e_cardlist_model_free_value (ETableModel *etc, int col, void *value)
-{
- g_free(value);
-}
-
-static void *
-e_cardlist_model_initialize_value (ETableModel *etc, int col)
-{
- return g_strdup("");
-}
-
-static gboolean
-e_cardlist_model_value_is_empty (ETableModel *etc, int col, const void *value)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-e_cardlist_model_value_to_string (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-void
-e_cardlist_model_add(ECardlistModel *model,
- ECard **cards,
- int count)
-{
- int i;
- model->data = g_realloc(model->data, model->data_count + count * sizeof(ECard *));
- for (i = 0; i < count; i++) {
- gboolean found = FALSE;
- gchar *id = e_card_get_id(cards[i]);
- for ( i = 0; i < model->data_count; i++) {
- if ( !strcmp(e_card_simple_get_id(model->data[i]), id) ) {
- found = TRUE;
- }
- }
- if (!found) {
- gtk_object_ref(GTK_OBJECT(cards[i]));
- model->data[model->data_count++] = e_card_simple_new (cards[i]);
- e_table_model_row_inserted(E_TABLE_MODEL(model), model->data_count - 1);
- }
- }
-}
-
-void
-e_cardlist_model_remove(ECardlistModel *model,
- const char *id)
-{
- int i;
- for ( i = 0; i < model->data_count; i++) {
- if ( !strcmp(e_card_simple_get_id(model->data[i]), id) ) {
- gtk_object_unref(GTK_OBJECT(model->data[i]));
- memmove(model->data + i, model->data + i + 1, (model->data_count - i - 1) * sizeof (ECard *));
- e_table_model_row_deleted(E_TABLE_MODEL(model), i);
- }
- }
-}
-
-static void
-e_cardlist_model_class_init (GtkObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- object_class->destroy = e_cardlist_model_destroy;
-
- model_class->column_count = e_cardlist_model_col_count;
- model_class->row_count = e_cardlist_model_row_count;
- model_class->value_at = e_cardlist_model_value_at;
- model_class->set_value_at = e_cardlist_model_set_value_at;
- model_class->is_cell_editable = e_cardlist_model_is_cell_editable;
- model_class->duplicate_value = e_cardlist_model_duplicate_value;
- model_class->free_value = e_cardlist_model_free_value;
- model_class->initialize_value = e_cardlist_model_initialize_value;
- model_class->value_is_empty = e_cardlist_model_value_is_empty;
- model_class->value_to_string = e_cardlist_model_value_to_string;
-}
-
-static void
-e_cardlist_model_init (GtkObject *object)
-{
- ECardlistModel *model = E_CARDLIST_MODEL(object);
- model->data = NULL;
- model->data_count = 0;
-}
-
-ECard *
-e_cardlist_model_get(ECardlistModel *model,
- int row)
-{
- if (model->data && row < model->data_count) {
- ECard *card;
- gtk_object_get(GTK_OBJECT(model->data[row]),
- "card", &card,
- NULL);
- gtk_object_ref(GTK_OBJECT(card));
- return card;
- }
- return NULL;
-}
-
-GtkType
-e_cardlist_model_get_type (void)
-{
- static GtkType type = 0;
-
- if (!type){
- GtkTypeInfo info = {
- "ECardlistModel",
- sizeof (ECardlistModel),
- sizeof (ECardlistModelClass),
- (GtkClassInitFunc) e_cardlist_model_class_init,
- (GtkObjectInitFunc) e_cardlist_model_init,
- NULL, /* reserved 1 */
- NULL, /* reserved 2 */
- (GtkClassInitFunc) NULL
- };
-
- type = gtk_type_unique (PARENT_TYPE, &info);
- }
-
- return type;
-}
-
-ETableModel *
-e_cardlist_model_new (void)
-{
- ECardlistModel *et;
-
- et = gtk_type_new (e_cardlist_model_get_type ());
-
- return E_TABLE_MODEL(et);
-}
diff --git a/addressbook/gui/component/e-cardlist-model.h b/addressbook/gui/component/e-cardlist-model.h
deleted file mode 100644
index b7df356342..0000000000
--- a/addressbook/gui/component/e-cardlist-model.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_CARDLIST_MODEL_H_
-#define _E_CARDLIST_MODEL_H_
-
-#include "e-table-model.h"
-#include <ebook/e-book.h>
-#include <ebook/e-book-view.h>
-#include <ebook/e-card-simple.h>
-
-#define E_CARDLIST_MODEL_TYPE (e_cardlist_model_get_type ())
-#define E_CARDLIST_MODEL(o) (GTK_CHECK_CAST ((o), E_CARDLIST_MODEL_TYPE, ECardlistModel))
-#define E_CARDLIST_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CARDLIST_MODEL_TYPE, ECardlistModelClass))
-#define E_IS_CARDLIST_MODEL(o) (GTK_CHECK_TYPE ((o), E_CARDLIST_MODEL_TYPE))
-#define E_IS_CARDLIST_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CARDLIST_MODEL_TYPE))
-
-typedef struct {
- ETableModel parent;
-
- /* item specific fields */
- ECardSimple **data;
- int data_count;
-} ECardlistModel;
-
-
-typedef struct {
- ETableModelClass parent_class;
-} ECardlistModelClass;
-
-
-GtkType e_cardlist_model_get_type (void);
-ETableModel *e_cardlist_model_new (void);
-
-/* Returns object with an extra ref count. */
-ECard *e_cardlist_model_get (ECardlistModel *model,
- int row);
-void e_cardlist_model_add (ECardlistModel *model,
- ECard **card,
- int count);
-void e_cardlist_model_remove (ECardlistModel *model,
- const char *id);
-
-#endif /* _E_CARDLIST_MODEL_H_ */
diff --git a/addressbook/gui/component/e-ldap-server-dialog.c b/addressbook/gui/component/e-ldap-server-dialog.c
deleted file mode 100644
index 2242282f3f..0000000000
--- a/addressbook/gui/component/e-ldap-server-dialog.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-ldap-server-dialog.c
- * Copyright (C) 2000 Helix Code, Inc.
- * Author: Chris Toshok <toshok@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 <gnome.h>
-#include <glade/glade.h>
-#include "e-ldap-server-dialog.h"
-
-typedef struct {
- GladeXML *gui;
- GtkWidget *dialog;
- ELDAPServer *server;
-} ELDAPServerDialog;
-
-static void
-fill_in_server_info (ELDAPServerDialog *dialog)
-{
- ELDAPServer *ldap_server = dialog->server;
- GtkEditable *editable;
- int position;
- char buf[128];
-
- /* the name */
- position = 0;
- editable = GTK_EDITABLE(glade_xml_get_widget(dialog->gui, "name-entry"));
- gtk_editable_delete_text (editable, 0, -1);
- gtk_editable_insert_text (editable, ldap_server->name, strlen (ldap_server->name), &position);
-
- /* the server description */
- position = 0;
- editable = GTK_EDITABLE(glade_xml_get_widget(dialog->gui, "description-entry"));
- gtk_editable_delete_text (editable, 0, -1);
- gtk_editable_insert_text (editable, ldap_server->description, strlen (ldap_server->description), &position);
-
- /* the server hostname */
- position = 0;
- editable = GTK_EDITABLE(glade_xml_get_widget(dialog->gui, "server-entry"));
- gtk_editable_delete_text (editable, 0, -1);
- gtk_editable_insert_text (editable, ldap_server->host, strlen (ldap_server->host), &position);
-
- /* the server port */
- position = 0;
- g_snprintf (buf, sizeof(buf), "%d", ldap_server->port);
- editable = GTK_EDITABLE(glade_xml_get_widget(dialog->gui, "port-entry"));
- gtk_editable_delete_text (editable, 0, -1);
- gtk_editable_insert_text (editable, buf, strlen (buf), &position);
-
- /* the root dn */
- position = 0;
- editable = GTK_EDITABLE(glade_xml_get_widget(dialog->gui, "root-dn-entry"));
- gtk_editable_delete_text (editable, 0, -1);
- gtk_editable_insert_text (editable, ldap_server->rootdn, strlen (ldap_server->rootdn), &position);
-}
-
-static void
-extract_server_info (ELDAPServerDialog *dialog)
-{
- ELDAPServer *ldap_server = dialog->server;
- GtkEditable *editable;
- char *description, *server, *port, *rootdn, *name;
-
- /* the server name */
- editable = GTK_EDITABLE(glade_xml_get_widget(dialog->gui, "name-entry"));
- name = gtk_editable_get_chars(editable, 0, -1);
- if (name && *name) {
- if (ldap_server->name)
- g_free(ldap_server->name);
- ldap_server->name = name;
- }
-
- /* the server description */
- editable = GTK_EDITABLE(glade_xml_get_widget(dialog->gui, "description-entry"));
- description = gtk_editable_get_chars(editable, 0, -1);
- if (description && *description) {
- if (ldap_server->description)
- g_free(ldap_server->description);
- ldap_server->description = description;
- }
-
- /* the server hostname */
- editable = GTK_EDITABLE(glade_xml_get_widget(dialog->gui, "server-entry"));
- server = gtk_editable_get_chars(editable, 0, -1);
- if (server && *server) {
- if (ldap_server->host)
- g_free(ldap_server->host);
- ldap_server->host = server;
- }
-
- /* the server port */
- editable = GTK_EDITABLE(glade_xml_get_widget(dialog->gui, "port-entry"));
- port = gtk_editable_get_chars(editable, 0, -1);
- if (port && *port) {
- ldap_server->port = atoi(port);
- }
- g_free(port);
-
- /* the root dn */
- editable = GTK_EDITABLE(glade_xml_get_widget(dialog->gui, "root-dn-entry"));
- rootdn = gtk_editable_get_chars(editable, 0, -1);
- if (rootdn && *rootdn) {
- if (ldap_server->rootdn)
- g_free (ldap_server->rootdn);
- ldap_server->rootdn = rootdn;
- }
-}
-
-void
-e_ldap_server_editor_show(ELDAPServer *server)
-{
- ELDAPServerDialog *dialog = g_new0 (ELDAPServerDialog, 1);
-
- dialog->server = server;
- dialog->gui = glade_xml_new (EVOLUTION_GLADEDIR "/ldap-server-dialog.glade", NULL);
-
- dialog->dialog = glade_xml_get_widget(dialog->gui, "ldap-server-dialog");
-
- fill_in_server_info (dialog);
-
- gnome_dialog_run (GNOME_DIALOG(dialog->dialog));
-
- extract_server_info (dialog);
-
- gnome_dialog_close (GNOME_DIALOG(dialog->dialog));
-}
diff --git a/addressbook/gui/component/e-ldap-server-dialog.h b/addressbook/gui/component/e-ldap-server-dialog.h
deleted file mode 100644
index e5ae169f5c..0000000000
--- a/addressbook/gui/component/e-ldap-server-dialog.h
+++ /dev/null
@@ -1,9 +0,0 @@
-
-#ifndef __E_LDAP_SERVER_DIALOG_H__
-#define __E_LDAP_SERVER_DIALOG_H__
-
-#include "e-ldap-storage.h"
-
-void e_ldap_server_editor_show(ELDAPServer *server);
-
-#endif /* __E_LDAP_SERVER_DIALOG_H__ */
diff --git a/addressbook/gui/component/e-ldap-storage.c b/addressbook/gui/component/e-ldap-storage.c
deleted file mode 100644
index ab3fc21fdb..0000000000
--- a/addressbook/gui/component/e-ldap-storage.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-ldap-storage.c
- *
- * Copyright (C) 2000 Helix Code, Inc.
- *
- * This program 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 program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Chris Toshok
- */
-
-/* The ldap server file goes like this:
-
- <?xml version="1.0"?>
- <contactservers>
- <contactserver>
- <name>LDAP Server</name>
- <description>This is my company address book.</description>
- <uri>ldap://ldap.somewhere.net/</uri>
- </contactserver>
- </contactservers>
-
- FIXME: Do we want to use a namespace for this?
- FIXME: Do we want to have an internationalized description?
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo.h>
-
-#include "evolution-shell-component.h"
-#include "evolution-storage.h"
-
-#include <gnome-xml/parser.h>
-#include <gnome-xml/xmlmemory.h>
-
-#include "e-ldap-storage.h"
-#include "e-ldap-server-dialog.h"
-
-#include "e-util/e-util.h"
-#include "e-util/e-xml-utils.h"
-
-#define LDAPSERVER_XML "ldapservers.xml"
-
-static gboolean load_ldap_data (EvolutionStorage *storage, const char *file_path);
-static gboolean save_ldap_data (const char *file_path);
-
-GHashTable *servers;
-EvolutionStorage *storage;
-
-void
-setup_ldap_storage (EvolutionShellComponent *shell_component)
-{
- EvolutionShellClient *shell_client;
- Evolution_Shell corba_shell;
- char *path;
-
- shell_client = evolution_shell_component_get_owner (shell_component);
- if (shell_client == CORBA_OBJECT_NIL) {
- g_warning ("We have no shell!?");
- return;
- }
-
- corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client));
-
- storage = evolution_storage_new (_("External Directories"));
- if (evolution_storage_register_on_shell (storage, corba_shell) != EVOLUTION_STORAGE_OK) {
- g_warning ("Cannot register storage");
- return;
- }
-
- /* save the storage for later */
- servers = g_hash_table_new (g_str_hash, g_str_equal);
-
- gtk_object_set_data (GTK_OBJECT (shell_component), "e-storage", storage);
-
- path = g_strdup_printf ("%s/evolution/" LDAPSERVER_XML, g_get_home_dir());
- load_ldap_data (storage, path);
- g_free (path);
-}
-
-static char *
-get_string_value (xmlNode *node,
- const char *name)
-{
- xmlNode *p;
- xmlChar *xml_string;
- char *retval;
-
- p = e_xml_get_child_by_name (node, (xmlChar *) name);
- if (p == NULL)
- return NULL;
-
- p = e_xml_get_child_by_name (p, (xmlChar *) "text");
- if (p == NULL)
- return NULL;
-
- xml_string = xmlNodeListGetString (node->doc, p, 1);
- retval = g_strdup ((char *) xml_string);
- xmlFree (xml_string);
-
- return retval;
-}
-
-static gboolean
-load_ldap_data (EvolutionStorage *storage,
- const char *file_path)
-{
- xmlDoc *doc;
- xmlNode *root;
- xmlNode *child;
-
- doc = xmlParseFile (file_path);
- if (doc == NULL) {
- return FALSE;
- }
-
- root = xmlDocGetRootElement (doc);
- if (root == NULL || strcmp (root->name, "contactservers") != 0) {
- xmlFreeDoc (doc);
- return FALSE;
- }
-
- for (child = root->childs; child; child = child->next) {
- char *path;
- ELDAPServer *server;
-
- if (strcmp (child->name, "contactserver")) {
- g_warning ("unknown node '%s' in %s", child->name, file_path);
- continue;
- }
-
- server = g_new (ELDAPServer, 1);
-
- server->name = get_string_value (child, "name");
- server->uri = get_string_value (child, "uri");
- server->description = get_string_value (child, "description");
-
- path = g_strdup_printf ("/%s", server->name);
- evolution_storage_new_folder (storage, path, "contacts", server->uri, server->description);
-
- g_hash_table_insert (servers, server->name, server);
-
- g_free (path);
- }
-
- xmlFreeDoc (doc);
-
- return TRUE;
-}
-
-static void
-ldap_server_foreach(gpointer key, gpointer value, gpointer user_data)
-{
- ELDAPServer *server = (ELDAPServer*)value;
- xmlNode *root = (xmlNode*)user_data;
- xmlNode *server_root = xmlNewDocNode (root, NULL,
- (xmlChar *) "contactserver", NULL);
-
- xmlAddChild (root, server_root);
-
- xmlNewChild (server_root, NULL, (xmlChar *) "name",
- (xmlChar *) server->name);
-
- xmlNewChild (server_root, NULL, (xmlChar *) "uri",
- (xmlChar *) server->uri);
-
- if (server->description)
- xmlNewChild (server_root, NULL, (xmlChar *) "description",
- (xmlChar *) server->description);
-}
-
-static gboolean
-save_ldap_data (const char *file_path)
-{
- xmlDoc *doc;
- xmlNode *root;
-
- doc = xmlNewDoc ((xmlChar *) "1.0");
- root = xmlNewDocNode (doc, NULL, (xmlChar *) "contactservers", NULL);
- xmlDocSetRootElement (doc, root);
-
- g_hash_table_foreach (servers, ldap_server_foreach, root);
-
- if (xmlSaveFile (file_path, doc) < 0) {
- unlink (file_path);
- xmlFreeDoc (doc);
- return FALSE;
- }
-
- xmlFreeDoc (doc);
- return TRUE;
-}
-
-void
-e_ldap_storage_add_server (ELDAPServer *server)
-{
- char *path;
- /* add it to our hashtable */
- g_hash_table_insert (servers, server->name, server);
-
- /* and then to the ui */
- path = g_strdup_printf ("/%s", server->name);
- evolution_storage_new_folder (storage, path, "contacts", server->uri, server->description);
-
- g_free (path);
-
- path = g_strdup_printf ("%s/evolution/" LDAPSERVER_XML, g_get_home_dir());
- save_ldap_data (path);
- g_free (path);
-}
-
-void
-e_ldap_storage_remove_server (char *name)
-{
-}
diff --git a/addressbook/gui/component/e-ldap-storage.h b/addressbook/gui/component/e-ldap-storage.h
deleted file mode 100644
index cf11e9a6fb..0000000000
--- a/addressbook/gui/component/e-ldap-storage.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-ldap-storage.h
- *
- * Copyright (C) 2000 Helix Code, Inc.
- *
- * This program 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 program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Chris Toshok
- */
-
-#ifndef __E_LDAP_STORAGE_H__
-#define __E_LDAP_STORAGE_H__
-
-#include "evolution-shell-component.h"
-
-typedef struct {
- char *name;
- char *description;
- char *host;
- int port;
- char *rootdn;
- char *uri;
-} ELDAPServer;
-
-void setup_ldap_storage (EvolutionShellComponent *shell_component);
-void e_ldap_storage_add_server (ELDAPServer *server);
-void e_ldap_storage_remove_server (char *name);
-
-#endif /* __E_LDAP_STORAGE_H__ */
diff --git a/addressbook/gui/component/ldap-server-dialog.glade b/addressbook/gui/component/ldap-server-dialog.glade
deleted file mode 100644
index a4dad9c2c2..0000000000
--- a/addressbook/gui/component/ldap-server-dialog.glade
+++ /dev/null
@@ -1,400 +0,0 @@
-<?xml version="1.0"?>
-<GTK-Interface>
-
-<project>
- <name>newserver</name>
- <program_name>newserver</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>
- <output_main_file>False</output_main_file>
- <output_translatable_strings>True</output_translatable_strings>
- <translatable_strings_file>ldap-server-dialog.glade.h</translatable_strings_file>
-</project>
-
-<widget>
- <class>GnomeDialog</class>
- <name>ldap-server-dialog</name>
- <type>GTK_WINDOW_TOPLEVEL</type>
- <position>GTK_WIN_POS_NONE</position>
- <modal>False</modal>
- <allow_shrink>False</allow_shrink>
- <allow_grow>False</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>dialog-vbox1</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>dialog-action_area1</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>button3</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>vbox1</name>
- <homogeneous>False</homogeneous>
- <spacing>0</spacing>
- <child>
- <padding>0</padding>
- <expand>True</expand>
- <fill>True</fill>
- </child>
-
- <widget>
- <class>GtkTable</class>
- <name>table2</name>
- <rows>5</rows>
- <columns>2</columns>
- <homogeneous>False</homogeneous>
- <row_spacing>0</row_spacing>
- <column_spacing>0</column_spacing>
- <child>
- <padding>0</padding>
- <expand>True</expand>
- <fill>True</fill>
- </child>
-
- <widget>
- <class>GtkEntry</class>
- <name>description-entry</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>2</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>server-entry</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>2</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>port-entry</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>2</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>
- <class>GtkEntry</class>
- <name>root-dn-entry</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>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>
-
- <widget>
- <class>GtkAlignment</class>
- <name>alignment1</name>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xscale>1</xscale>
- <yscale>1</yscale>
- <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>True</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>True</yfill>
- </child>
-
- <widget>
- <class>GtkLabel</class>
- <name>label1</name>
- <label>Description:</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- </widget>
- </widget>
-
- <widget>
- <class>GtkAlignment</class>
- <name>alignment2</name>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xscale>1</xscale>
- <yscale>1</yscale>
- <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>
- <class>GtkLabel</class>
- <name>label2</name>
- <label>LDAP Server:</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- </widget>
- </widget>
-
- <widget>
- <class>GtkAlignment</class>
- <name>alignment3</name>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xscale>1</xscale>
- <yscale>1</yscale>
- <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>
- <class>GtkLabel</class>
- <name>label3</name>
- <label>Port Number:</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- </widget>
- </widget>
-
- <widget>
- <class>GtkAlignment</class>
- <name>alignment4</name>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xscale>1</xscale>
- <yscale>1</yscale>
- <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>
- <class>GtkLabel</class>
- <name>label4</name>
- <label>Root DN:</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- </widget>
- </widget>
-
- <widget>
- <class>GtkEntry</class>
- <name>name-entry</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>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>
-
- <widget>
- <class>GtkAlignment</class>
- <name>alignment5</name>
- <xalign>0</xalign>
- <yalign>0.5</yalign>
- <xscale>1</xscale>
- <yscale>1</yscale>
- <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>
- <class>GtkLabel</class>
- <name>label5</name>
- <label>Name:</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- </widget>
- </widget>
- </widget>
- </widget>
- </widget>
-</widget>
-
-</GTK-Interface>
diff --git a/addressbook/gui/component/ldap-server-dialog.glade.h b/addressbook/gui/component/ldap-server-dialog.glade.h
deleted file mode 100644
index c99dfa3cb5..0000000000
--- a/addressbook/gui/component/ldap-server-dialog.glade.h
+++ /dev/null
@@ -1,11 +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_("Description:");
-gchar *s = N_("LDAP Server:");
-gchar *s = N_("Port Number:");
-gchar *s = N_("Root DN:");
-gchar *s = N_("Name:");
diff --git a/addressbook/gui/component/select-names/.cvsignore b/addressbook/gui/component/select-names/.cvsignore
deleted file mode 100644
index d6c55c7345..0000000000
--- a/addressbook/gui/component/select-names/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-.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
deleted file mode 100644
index f028eeeb89..0000000000
--- a/addressbook/gui/component/select-names/Makefile.am
+++ /dev/null
@@ -1,46 +0,0 @@
-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-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
deleted file mode 100644
index ac59787932..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-manager.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@helixcode.com>
- *
- * Copyright (C) 2000 Helix Code, Inc.
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <gtk/gtk.h>
-
-#include "e-select-names-manager.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 {
- ARG_0,
- ARG_CARD,
-};
-
-
-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);
-
-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);
-
-/**
- * e_select_names_manager_get_type:
- * @void:
- *
- * Registers the &ESelectNamesManager class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &ESelectNamesManager class.
- **/
-GtkType
-e_select_names_manager_get_type (void)
-{
- static GtkType manager_type = 0;
-
- if (!manager_type) {
- GtkTypeInfo manager_info = {
- "ESelectNamesManager",
- sizeof (ESelectNamesManager),
- sizeof (ESelectNamesManagerClass),
- (GtkClassInitFunc) e_select_names_manager_class_init,
- (GtkObjectInitFunc) e_select_names_manager_init,
- NULL, /* reserved_1 */
- NULL, /* reserved_2 */
- (GtkClassInitFunc) NULL
- };
-
- manager_type = gtk_type_unique (gtk_object_get_type (), &manager_info);
- }
-
- return manager_type;
-}
-
-/**
- * e_select_names_manager_new:
- * @VCard: a string in vCard format
- *
- * Returns: a new #ESelectNamesManager that wraps the @VCard.
- */
-ESelectNamesManager *
-e_select_names_manager_new (void)
-{
- ESelectNamesManager *manager = E_SELECT_NAMES_MANAGER(gtk_type_new(e_select_names_manager_get_type()));
- return manager;
-}
-
-static void
-e_select_names_manager_class_init (ESelectNamesManagerClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = GTK_OBJECT_CLASS(klass);
-
- gtk_object_add_arg_type ("ESelectNamesManager::card",
- GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_CARD);
-
- object_class->destroy = e_select_names_manager_destroy;
- object_class->get_arg = e_select_names_manager_get_arg;
- object_class->set_arg = e_select_names_manager_set_arg;
-}
-
-/*
- * ESelectNamesManager lifecycle management and vcard loading/saving.
- */
-
-static void
-e_select_names_manager_destroy (GtkObject *object)
-{
- ESelectNamesManager *manager;
-
- manager = E_SELECT_NAMES_MANAGER (object);
-
- gtk_object_unref(GTK_OBJECT(manager->sections));
-}
-
-
-/* Set_arg handler for the manager */
-static void
-e_select_names_manager_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
-{
- ESelectNamesManager *manager;
-
- manager = E_SELECT_NAMES_MANAGER (object);
-
- switch (arg_id) {
- case ARG_CARD:
- break;
- default:
- return;
- }
-}
-
-/* Get_arg handler for the manager */
-static void
-e_select_names_manager_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
-{
- ESelectNamesManager *manager;
-
- manager = E_SELECT_NAMES_MANAGER (object);
-
- switch (arg_id) {
- case ARG_CARD:
- break;
- default:
- arg->type = GTK_TYPE_INVALID;
- break;
- }
-}
-
-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:
- */
-static void
-e_select_names_manager_init (ESelectNamesManager *manager)
-{
- manager->sections = e_list_new(section_copy, section_free, manager);
-}
-
-void e_select_names_manager_add_section (ESelectNamesManager *manager,
- char *id,
- char *title)
-{
- 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_activate_dialog (ESelectNamesManager *manager,
- char *id)
-{
-}
-
-/* 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
deleted file mode 100644
index 600644f01a..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-manager.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@helixcode.com>
- *
- * Copyright (C) 2000 Helix Code, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_MANAGER_H__
-#define __E_SELECT_NAMES_MANAGER_H__
-
-#include <time.h>
-#include <gtk/gtk.h>
-#include <stdio.h>
-#include <e-util/e-list.h>
-
-#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))
-#define E_SELECT_NAMES_MANAGER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManagerClass))
-#define E_IS_SELECT_NAMES_MANAGER(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SELECT_NAMES_MANAGER))
-#define E_IS_SELECT_NAMES_MANAGER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MANAGER))
-
-typedef struct _ESelectNamesManager ESelectNamesManager;
-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_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 */
-EList *e_select_names_manager_get_cards (ESelectNamesManager *manager,
- char *id);
-
-/* Standard Gtk function */
-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
deleted file mode 100644
index 8399136dd8..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-model.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@helixcode.com>
- *
- * Copyright (C) 2000 Helix Code, Inc.
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <gtk/gtk.h>
-
-#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
deleted file mode 100644
index 20c90818f7..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-model.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@helixcode.com>
- *
- * Copyright (C) 2000 Helix Code, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_MODEL_H__
-#define __E_SELECT_NAMES_MODEL_H__
-
-#include <time.h>
-#include <gtk/gtk.h>
-#include <stdio.h>
-#include <e-util/e-list.h>
-#include <addressbook/backend/ebook/e-card.h>
-
-#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
deleted file mode 100644
index dc3edda5f9..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-table-model.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@helixcode.com>
- *
- * Copyright (C) 2000 Helix Code, Inc.
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <gtk/gtk.h>
-
-#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
deleted file mode 100644
index 94cbaff13a..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-table-model.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@helixcode.com>
- *
- * Copyright (C) 2000 Helix Code, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_TABLE_MODEL_H__
-#define __E_SELECT_NAMES_TABLE_MODEL_H__
-
-#include <time.h>
-#include <gtk/gtk.h>
-#include <stdio.h>
-#include "e-select-names-model.h"
-#include <widgets/e-table/e-table-model.h>
-
-#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
deleted file mode 100644
index db273796f3..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-text-model.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@helixcode.com>
- *
- * Copyright (C) 2000 Helix Code, Inc.
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <gtk/gtk.h>
-
-#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)
-{
-#if 0
- e_select_names_model_clear(model);
-#endif
-}
-
-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
deleted file mode 100644
index 564886ffc9..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-text-model.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@helixcode.com>
- *
- * Copyright (C) 2000 Helix Code, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_TEXT_MODEL_H__
-#define __E_SELECT_NAMES_TEXT_MODEL_H__
-
-#include <time.h>
-#include <gtk/gtk.h>
-#include <stdio.h>
-#include "e-select-names-model.h"
-#include <widgets/e-text/e-text-model.h>
-
-#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
deleted file mode 100644
index c5791bb9bd..0000000000
--- a/addressbook/gui/component/select-names/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 <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-select-names.h"
-#include <e-table-simple.h>
-#include <e-table.h>
-#include <e-cell-text.h>
-#include <addressbook/gui/component/e-addressbook-model.h>
-#include <addressbook/gui/component/e-cardlist-model.h>
-#include <addressbook/backend/ebook/e-book.h>
-
-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 "<ETableSpecification no-header=\"1\"> \
- <columns-shown> \
- <column> 0 </column> \
- <column> 2 </column> \
- </columns-shown> \
- <grouping> <leaf column=\"0\" ascending=\"1\"/> </grouping> \
-</ETableSpecification>"
-
-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
deleted file mode 100644
index c9d4619db2..0000000000
--- a/addressbook/gui/component/select-names/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 <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_SELECT_NAMES_H__
-#define __E_SELECT_NAMES_H__
-
-#include <gnome.h>
-#include <glade/glade.h>
-#include <e-util/e-list.h>
-#include <widgets/e-table/e-table.h>
-
-#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
deleted file mode 100644
index b60972d094..0000000000
--- a/addressbook/gui/component/select-names/recipient.glade
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0"?>
-<GTK-Interface>
-
-<project>
- <name>Recipient</name>
- <program_name>recipient</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>
- <gnome_help_support>True</gnome_help_support>
-</project>
-
-<widget>
- <class>GtkWindow</class>
- <name>window1</name>
- <visible>False</visible>
- <title>window1</title>
- <type>GTK_WINDOW_TOPLEVEL</type>
- <position>GTK_WIN_POS_NONE</position>
- <modal>False</modal>
- <allow_shrink>False</allow_shrink>
- <allow_grow>True</allow_grow>
- <auto_shrink>False</auto_shrink>
-
- <widget>
- <class>GtkHBox</class>
- <name>hbox-top</name>
- <homogeneous>False</homogeneous>
- <spacing>4</spacing>
-
- <widget>
- <class>GtkAlignment</class>
- <name>alignment1</name>
- <xalign>1.08033e-07</xalign>
- <yalign>0</yalign>
- <xscale>1</xscale>
- <yscale>0</yscale>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>True</fill>
- </child>
-
- <widget>
- <class>GtkButton</class>
- <name>text-button</name>
- <can_focus>True</can_focus>
- <label>-&gt;</label>
- </widget>
- </widget>
- </widget>
-</widget>
-
-</GTK-Interface>
diff --git a/addressbook/gui/component/select-names/select-names.glade b/addressbook/gui/component/select-names/select-names.glade
deleted file mode 100644
index 46da911228..0000000000
--- a/addressbook/gui/component/select-names/select-names.glade
+++ /dev/null
@@ -1,245 +0,0 @@
-<?xml version="1.0"?>
-<GTK-Interface>
-
-<project>
- <name>Select-names</name>
- <program_name>select-names</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>
- <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>select-names.glade.h</translatable_strings_file>
-</project>
-
-<widget>
- <class>GnomeDialog</class>
- <name>dialog-top</name>
- <visible>False</visible>
- <title>Select Names</title>
- <type>GTK_WINDOW_TOPLEVEL</type>
- <position>GTK_WIN_POS_NONE</position>
- <modal>False</modal>
- <allow_shrink>False</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>dialog-vbox1</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>dialog-action_area1</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>button3</name>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
- </widget>
- </widget>
-
- <widget>
- <class>GtkTable</class>
- <name>table-top</name>
- <rows>3</rows>
- <columns>2</columns>
- <homogeneous>False</homogeneous>
- <row_spacing>6</row_spacing>
- <column_spacing>6</column_spacing>
- <child>
- <padding>0</padding>
- <expand>True</expand>
- <fill>True</fill>
- </child>
-
- <widget>
- <class>GtkHBox</class>
- <name>hbox1</name>
- <homogeneous>False</homogeneous>
- <spacing>4</spacing>
- <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>True</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>True</yfill>
- </child>
-
- <widget>
- <class>GtkEntry</class>
- <name>entry-find</name>
- <can_focus>True</can_focus>
- <has_focus>True</has_focus>
- <editable>True</editable>
- <text_visible>True</text_visible>
- <text_max_length>0</text_max_length>
- <text></text>
- <child>
- <padding>0</padding>
- <expand>True</expand>
- <fill>True</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button-find</name>
- <can_focus>True</can_focus>
- <label>Find...</label>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
- </widget>
-
- <widget>
- <class>GtkAccelLabel</class>
- <name>accellabel1</name>
- <label>T_ype name or select from List:</label>
- <justify>GTK_JUSTIFY_LEFT</justify>
- <wrap>False</wrap>
- <xalign>0</xalign>
- <yalign>0</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>True</xexpand>
- <yexpand>False</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>True</yfill>
- </child>
- </widget>
-
- <widget>
- <class>Custom</class>
- <name>table-source</name>
- <creation_function>e_addressbook_create_ebook_table</creation_function>
- <int1>0</int1>
- <int2>0</int2>
- <last_modification_time>Sat, 10 Jun 2000 22:02:57 GMT</last_modification_time>
- <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>True</xexpand>
- <yexpand>True</yexpand>
- <xshrink>False</xshrink>
- <yshrink>False</yshrink>
- <xfill>True</xfill>
- <yfill>True</yfill>
- </child>
- </widget>
-
- <widget>
- <class>GtkTable</class>
- <name>table-recipients</name>
- <rows>1</rows>
- <columns>2</columns>
- <homogeneous>False</homogeneous>
- <row_spacing>4</row_spacing>
- <column_spacing>4</column_spacing>
- <child>
- <left_attach>1</left_attach>
- <right_attach>2</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>True</yfill>
- </child>
-
- <widget>
- <class>GtkAccelLabel</class>
- <name>accellabel2</name>
- <label>Message Recipients</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>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>True</yfill>
- </child>
- </widget>
- </widget>
- </widget>
- </widget>
-</widget>
-
-</GTK-Interface>
diff --git a/addressbook/gui/component/select-names/select-names.glade.h b/addressbook/gui/component/select-names/select-names.glade.h
deleted file mode 100644
index a21ddce689..0000000000
--- a/addressbook/gui/component/select-names/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");