aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-list-editor
diff options
context:
space:
mode:
authornobody <nobody@localhost>2003-06-29 00:20:00 +0800
committernobody <nobody@localhost>2003-06-29 00:20:00 +0800
commit6205e8cad4ef2c93093b06e579ad26bd6b6505bd (patch)
treee521429188462e4446c632b5bd4b6f333e589995 /addressbook/gui/contact-list-editor
parent5a8e20476b93515b8e69f7e1c8f659ab3dc55a8f (diff)
downloadgsoc2013-evolution-GDM2_2_4_4_0.tar
gsoc2013-evolution-GDM2_2_4_4_0.tar.gz
gsoc2013-evolution-GDM2_2_4_4_0.tar.bz2
gsoc2013-evolution-GDM2_2_4_4_0.tar.lz
gsoc2013-evolution-GDM2_2_4_4_0.tar.xz
gsoc2013-evolution-GDM2_2_4_4_0.tar.zst
gsoc2013-evolution-GDM2_2_4_4_0.zip
This commit was manufactured by cvs2svn to create tag 'GDM2_2_4_4_0'.GDM2_2_4_4_0
svn path=/tags/GDM2_2_4_4_0/; revision=21592
Diffstat (limited to 'addressbook/gui/contact-list-editor')
-rw-r--r--addressbook/gui/contact-list-editor/.cvsignore6
-rw-r--r--addressbook/gui/contact-list-editor/Makefile.am55
-rw-r--r--addressbook/gui/contact-list-editor/contact-list-editor.glade313
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list4
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c1044
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.etspec7
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.h107
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-model.c260
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-model.h52
9 files changed, 0 insertions, 1848 deletions
diff --git a/addressbook/gui/contact-list-editor/.cvsignore b/addressbook/gui/contact-list-editor/.cvsignore
deleted file mode 100644
index f151930645..0000000000
--- a/addressbook/gui/contact-list-editor/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile.in
-Makefile
-.deps
-.pure
-e-contact-list-editor-marshal.c
-e-contact-list-editor-marshal.h
diff --git a/addressbook/gui/contact-list-editor/Makefile.am b/addressbook/gui/contact-list-editor/Makefile.am
deleted file mode 100644
index 82e296f8cf..0000000000
--- a/addressbook/gui/contact-list-editor/Makefile.am
+++ /dev/null
@@ -1,55 +0,0 @@
-INCLUDES = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook/ \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir)/addressbook/gui/merging \
- -I$(top_srcdir)/addressbook/gui/contact-editor \
- -I$(top_builddir)/shell \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)\"" \
- -DPREFIX=\""$(prefix)"\" \
- -DG_LOG_DOMAIN=\"contact-list-editor\" \
- -DG_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED \
- -DLIBGNOME_DISABLE_DEPRECATED \
- -DLIBGNOMEUI_DISABLE_DEPRECATED \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = \
- libecontactlisteditor.la
-
-libecontactlisteditor_la_SOURCES = \
- e-contact-list-editor.c \
- e-contact-list-editor.h \
- e-contact-list-editor-marshal.c \
- e-contact-list-model.c \
- e-contact-list-model.h
-
-# GLib marshalling cruft
-
-e-contact-list-editor-marshal.h: e-contact-list-editor-marshal.list
- ( @GLIB_GENMARSHAL@ --prefix=ecle_marshal e-contact-list-editor-marshal.list --header > e-contact-list-editor-marshal.tmp \
- && mv e-contact-list-editor-marshal.tmp e-contact-list-editor-marshal.h ) \
- || ( rm -f e-contact-list-editor-marshal.tmp && exit 1 )
-
-e-contact-list-editor-marshal.c: e-contact-list-editor-marshal.h
- ( @GLIB_GENMARSHAL@ --prefix=ecle_marshal e-contact-list-editor-marshal.list --body > e-contact-list-editor-marshal.tmp \
- && mv e-contact-list-editor-marshal.tmp e-contact-list-editor-marshal.c ) \
- || ( rm -f e-contact-list-editor-marshal.tmp && exit 1 )
-
-MARSHAL_GENERATED = e-contact-list-editor-marshal.c e-contact-list-editor-marshal.h
-
-
-glade_DATA = contact-list-editor.glade
-etspec_DATA = e-contact-list-editor.etspec
-
-BUILT_SOURCES = $(MARSHAL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST = $(glade_DATA) \
- $(etspec_DATA) \
- e-contact-list-editor-marshal.list
diff --git a/addressbook/gui/contact-list-editor/contact-list-editor.glade b/addressbook/gui/contact-list-editor/contact-list-editor.glade
deleted file mode 100644
index c64eebd520..0000000000
--- a/addressbook/gui/contact-list-editor/contact-list-editor.glade
+++ /dev/null
@@ -1,313 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-<requires lib="bonobo"/>
-
-<widget class="GnomeApp" id="contact list editor">
- <property name="title" translatable="yes">contact-list-editor</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">426</property>
- <property name="default_height">304</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="enable_layout_config">True</property>
-
- <child internal-child="dock">
- <widget class="BonoboDock" id="dock1">
- <property name="visible">True</property>
- <property name="allow_floating">True</property>
-
- <child>
- <widget class="GtkVBox" id="vbox8">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox6">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_List name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">list-name-entry</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="list-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom7">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">evolution-contacts-plain.png</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 23 Jun 2001 05:59:21 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame3">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox7">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox9">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Type an email address or drag a contact into the list below:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="email-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="contact-list-table">
- <property name="visible">True</property>
- <property name="creation_function">e_contact_list_editor_create_table</property>
- <property name="string1"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 23 Jun 2001 06:00:16 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="visible-addrs-checkbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Hide addresses when sending mail to this list</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox10">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">
-</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox4">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="add-email-button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="remove-button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Members</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list b/addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list
deleted file mode 100644
index 8d94a0bf3b..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list
+++ /dev/null
@@ -1,4 +0,0 @@
-INT:OBJECT
-NONE:INT,OBJECT
-NONE:INT,OBJECT
-NONE:NONE
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
deleted file mode 100644
index ab6ea97096..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ /dev/null
@@ -1,1044 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-list-editor.c
- * Copyright (C) 2001 Ximian, Inc.
- * Author: Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * 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 "e-contact-list-editor.h"
-
-#include <string.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-window-icon.h>
-#include <bonobo/bonobo-ui-container.h>
-#include <bonobo/bonobo-ui-util.h>
-#include <bonobo/bonobo-window.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include "shell/evolution-shell-component-utils.h"
-
-#include "addressbook/gui/widgets/e-addressbook-util.h"
-
-#include "e-contact-editor.h"
-#include "e-contact-save-as.h"
-#include "e-contact-list-model.h"
-#include "e-contact-list-editor-marshal.h"
-
-/* Signal IDs */
-enum {
- LIST_ADDED,
- LIST_MODIFIED,
- LIST_DELETED,
- EDITOR_CLOSED,
- LAST_SIGNAL
-};
-
-static void e_contact_list_editor_init (EContactListEditor *editor);
-static void e_contact_list_editor_class_init (EContactListEditorClass *klass);
-static void e_contact_list_editor_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_list_editor_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_list_editor_dispose (GObject *object);
-
-static void create_ui (EContactListEditor *ce);
-static void set_editable (EContactListEditor *editor);
-static void command_state_changed (EContactListEditor *editor);
-static void close_dialog (EContactListEditor *cle);
-static void extract_info(EContactListEditor *editor);
-static void fill_in_info(EContactListEditor *editor);
-
-static void add_email_cb (GtkWidget *w, EContactListEditor *editor);
-static void remove_entry_cb (GtkWidget *w, EContactListEditor *editor);
-static void list_name_changed_cb (GtkWidget *w, EContactListEditor *editor);
-static void visible_addrs_toggled_cb (GtkWidget *w, EContactListEditor *editor);
-
-static gint app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data);
-static gboolean table_drag_drop_cb (ETable *table, int row, int col, GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor);
-static gboolean table_drag_motion_cb (ETable *table, int row, int col, GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor);
-static void table_drag_data_received_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y,
- GtkSelectionData *selection_data, guint info, guint time,
- EContactListEditor *editor);
-
-static GtkObjectClass *parent_class = NULL;
-
-static guint contact_list_editor_signals[LAST_SIGNAL];
-
-enum DndTargetType {
- DND_TARGET_TYPE_VCARD,
-};
-#define VCARD_TYPE "text/x-vcard"
-static GtkTargetEntry drag_types[] = {
- { VCARD_TYPE, 0, DND_TARGET_TYPE_VCARD },
-};
-static const int num_drag_types = sizeof (drag_types) / sizeof (drag_types[0]);
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_CARD,
- PROP_IS_NEW_LIST,
- PROP_EDITABLE
-};
-
-static GSList *all_contact_list_editors = NULL;
-
-GType
-e_contact_list_editor_get_type (void)
-{
- static GType cle_type = 0;
-
- if (!cle_type) {
- static const GTypeInfo cle_info = {
- sizeof (EContactListEditorClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_list_editor_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactListEditor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_list_editor_init,
- };
-
- cle_type = g_type_register_static (GTK_TYPE_OBJECT, "EContactListEditor", &cle_info, 0);
- }
-
- return cle_type;
-}
-
-
-static void
-e_contact_list_editor_class_init (EContactListEditorClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (GTK_TYPE_OBJECT);
-
- object_class->set_property = e_contact_list_editor_set_property;
- object_class->get_property = e_contact_list_editor_get_property;
- /* object_class->dispose = e_contact_list_editor_dispose;*/
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CARD,
- g_param_spec_object ("card",
- _("Card"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CARD,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_IS_NEW_LIST,
- g_param_spec_boolean ("is_new_list",
- _("Is New List"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- contact_list_editor_signals[LIST_ADDED] =
- g_signal_new ("list_added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, list_added),
- NULL, NULL,
- ecle_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_list_editor_signals[LIST_MODIFIED] =
- g_signal_new ("list_modified",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, list_modified),
- NULL, NULL,
- ecle_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_list_editor_signals[LIST_DELETED] =
- g_signal_new ("list_deleted",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, list_deleted),
- NULL, NULL,
- ecle_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_list_editor_signals[EDITOR_CLOSED] =
- g_signal_new ("editor_closed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, editor_closed),
- NULL, NULL,
- ecle_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-static void
-e_contact_list_editor_init (EContactListEditor *editor)
-{
- GladeXML *gui;
- GtkWidget *bonobo_win;
- BonoboUIContainer *container;
- char *icon_path;
-
- editor->card = NULL;
- editor->changed = FALSE;
- editor->editable = TRUE;
- editor->in_async_call = FALSE;
- editor->is_new_list = FALSE;
-
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/contact-list-editor.glade", NULL, NULL);
- editor->gui = gui;
-
- editor->app = glade_xml_get_widget (gui, "contact list editor");
-
- editor->table = glade_xml_get_widget (gui, "contact-list-table");
- editor->model = g_object_get_data (G_OBJECT(editor->table), "model");
-
- /* XXX need this for libglade-2 it seems */
- gtk_widget_show (editor->table);
-
- editor->add_button = glade_xml_get_widget (editor->gui, "add-email-button");
- editor->remove_button = glade_xml_get_widget (editor->gui, "remove-button");
-
- editor->email_entry = glade_xml_get_widget (gui, "email-entry");
- editor->list_name_entry = glade_xml_get_widget (gui, "list-name-entry");
-
- editor->visible_addrs_checkbutton = glade_xml_get_widget (gui, "visible-addrs-checkbutton");
-
- /* Construct the app */
- bonobo_win = bonobo_window_new ("contact-list-editor", _("Contact List Editor"));
-
- /* FIXME: The sucking bit */
- {
- GtkWidget *contents;
-
- contents = bonobo_dock_get_client_area (gnome_app_get_dock (GNOME_APP (editor->app)));
-
- if (!contents) {
- g_message ("contact_list_editor_construct(): Could not get contents");
- return;
- }
- gtk_widget_ref (contents);
- gtk_container_remove (GTK_CONTAINER (contents->parent), contents);
- bonobo_window_set_contents (BONOBO_WINDOW (bonobo_win), contents);
- gtk_widget_destroy (editor->app);
- editor->app = bonobo_win;
- }
-
- /* Build the menu and toolbar */
-
- container = bonobo_window_get_ui_container (BONOBO_WINDOW (editor->app));
-
- editor->uic = bonobo_ui_component_new_default ();
- if (!editor->uic) {
- g_message ("e_contact_list_editor_init(): eeeeek, could not create the UI handler!");
- return;
- }
- bonobo_ui_component_set_container (editor->uic,
- bonobo_object_corba_objref (
- BONOBO_OBJECT (container)), NULL);
-
- create_ui (editor);
-
- /* connect signals */
- g_signal_connect (editor->add_button,
- "clicked", G_CALLBACK(add_email_cb), editor);
- g_signal_connect (editor->email_entry,
- "activate", G_CALLBACK(add_email_cb), editor);
- g_signal_connect (editor->remove_button,
- "clicked", G_CALLBACK(remove_entry_cb), editor);
- g_signal_connect (editor->list_name_entry,
- "changed", G_CALLBACK(list_name_changed_cb), editor);
- g_signal_connect (editor->visible_addrs_checkbutton,
- "toggled", G_CALLBACK(visible_addrs_toggled_cb), editor);
-
- e_table_drag_dest_set (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- 0, drag_types, num_drag_types, GDK_ACTION_LINK);
-
- g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- "table_drag_motion", G_CALLBACK(table_drag_motion_cb), editor);
- g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- "table_drag_drop", G_CALLBACK (table_drag_drop_cb), editor);
- g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- "table_drag_data_received", G_CALLBACK(table_drag_data_received_cb), editor);
-
- command_state_changed (editor);
-
- /* Connect to the deletion of the dialog */
-
- g_signal_connect (editor->app, "delete_event",
- G_CALLBACK (app_delete_event_cb), editor);
-
- /* set the icon */
- icon_path = g_build_filename (EVOLUTION_IMAGESDIR, "contact-list-16.png", NULL);
- gnome_window_icon_set_from_file (GTK_WINDOW (editor->app), icon_path);
- g_free (icon_path);
-}
-
-static void
-e_contact_list_editor_dispose (GObject *object)
-{
- /* XXX need to call parent dispose */
-}
-
-typedef struct {
- EContactListEditor *cle;
- gboolean should_close;
-} EditorCloseStruct;
-
-static void
-list_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruct *ecs)
-{
- EContactListEditor *cle = ecs->cle;
- gboolean should_close = ecs->should_close;
-
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, TRUE);
- cle->in_async_call = FALSE;
-
- e_card_set_id (cle->card, id);
-
- g_signal_emit (cle, contact_list_editor_signals[LIST_ADDED], 0,
- status, cle->card);
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- cle->is_new_list = FALSE;
-
- if (should_close)
- close_dialog (cle);
- else
- command_state_changed (cle);
- }
-
- g_object_unref (cle);
- g_free (ecs);
-}
-
-static void
-list_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
-{
- EContactListEditor *cle = ecs->cle;
- gboolean should_close = ecs->should_close;
-
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, TRUE);
- cle->in_async_call = FALSE;
-
- g_signal_emit (cle, contact_list_editor_signals[LIST_MODIFIED], 0,
- status, cle->card);
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- if (should_close)
- close_dialog (cle);
- }
-
- g_object_unref (cle); /* release ref held for ebook callback */
- g_free (ecs);
-}
-
-static void
-save_card (EContactListEditor *cle, gboolean should_close)
-{
- extract_info (cle);
-
- if (cle->book) {
- EditorCloseStruct *ecs = g_new(EditorCloseStruct, 1);
-
- ecs->cle = cle;
- g_object_ref (cle);
- ecs->should_close = should_close;
-
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, FALSE);
- cle->in_async_call = TRUE;
-
- if (cle->is_new_list)
- e_book_add_card (cle->book, cle->card, (EBookIdCallback)list_added_cb, ecs);
- else
- e_book_commit_card (cle->book, cle->card, (EBookCallback)list_modified_cb, ecs);
-
- cle->changed = FALSE;
- }
-}
-
-static gboolean
-is_named (EContactListEditor *editor)
-{
- char *string = gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1);
- gboolean named = FALSE;
-
- if (string && *string) {
- named = TRUE;
- }
-
- g_free (string);
-
- return named;
-}
-
-static gboolean
-prompt_to_save_changes (EContactListEditor *editor)
-{
- if (!editor->changed || !is_named (editor))
- return TRUE;
-
- switch (e_addressbook_prompt_save_dialog (GTK_WINDOW(editor->app))) {
- case GTK_RESPONSE_YES:
- save_card (editor, FALSE);
- return TRUE;
- case GTK_RESPONSE_NO:
- return TRUE;
- case GTK_RESPONSE_CANCEL:
- default:
- return FALSE;
- }
-}
-
-static void
-file_close_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- if (!prompt_to_save_changes (cle))
- return;
-
- close_dialog (cle);
-}
-
-static void
-file_save_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- save_card (cle, FALSE);
-}
-
-static void
-file_save_as_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- extract_info (cle);
-
- e_contact_save_as(_("Save List as VCard"), cle->card, GTK_WINDOW (cle->app));
-}
-
-static void
-file_send_as_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- extract_info (cle);
-
- e_addressbook_send_card(cle->card, E_ADDRESSBOOK_DISPOSITION_AS_ATTACHMENT);
-}
-
-static void
-file_send_to_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- extract_info (cle);
-
- e_addressbook_send_card(cle->card, E_ADDRESSBOOK_DISPOSITION_AS_TO);
-}
-
-static void
-tb_save_and_close_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
- save_card (cle, TRUE);
-}
-
-static void
-list_deleted_cb (EBook *book, EBookStatus status, EContactListEditor *cle)
-{
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, TRUE);
- cle->in_async_call = FALSE;
-
- g_signal_emit (cle, contact_list_editor_signals[LIST_DELETED], 0,
- status, cle->card);
-
- /* always close the dialog after we successfully delete a list */
- if (status == E_BOOK_STATUS_SUCCESS)
- close_dialog (cle);
-
- g_object_unref (cle); /* release reference held for callback */
-}
-
-static void
-delete_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
- ECard *card = cle->card;
-
- g_object_ref (card);
-
- if (e_contact_editor_confirm_delete(GTK_WINDOW(cle->app))) {
-
- extract_info (cle);
-
- if (!cle->is_new_list) {
- gtk_widget_set_sensitive (cle->app, FALSE);
- cle->in_async_call = TRUE;
-
- g_object_ref (cle); /* hold reference for callback */
- e_book_remove_card (cle->book, card, (EBookCallback)list_deleted_cb, cle);
- }
- }
-
- g_object_unref (card);
-}
-
-static
-BonoboUIVerb verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSave", file_save_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSaveClose", tb_save_and_close_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorDelete", delete_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSaveAs", file_save_as_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSendAs", file_send_as_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSendTo", file_send_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorClose", file_close_cb),
- BONOBO_UI_VERB_END
-};
-
-static EPixmap pixmaps[] = {
- E_PIXMAP ("/commands/ContactListEditorSave", "save-16.png"),
- E_PIXMAP ("/commands/ContactListEditorSaveClose", "save-16.png"),
- E_PIXMAP ("/commands/ContactListEditorSaveAs", "save-as-16.png"),
-
- E_PIXMAP ("/commands/ContactListEditorDelete", "evolution-trash-mini.png"),
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
- E_PIXMAP ("/commands/ContactListEditorPrint", "print.xpm"),
- E_PIXMAP ("/commands/ContactListEditorPrintEnvelope", "print.xpm"),
-#endif
- E_PIXMAP ("/Toolbar/ContactListEditorSaveClose", "buttons/save-24.png"),
- E_PIXMAP ("/Toolbar/ContactListEditorDelete", "buttons/delete-message.png"),
- E_PIXMAP ("/Toolbar/ContactListEditorPrint", "buttons/print.png"),
-
- E_PIXMAP_END
-};
-
-static void
-create_ui (EContactListEditor *ce)
-{
- bonobo_ui_component_add_verb_list_with_data (
- ce->uic, verbs, ce);
-
- bonobo_ui_util_set_ui (ce->uic, PREFIX,
- EVOLUTION_UIDIR "/evolution-contact-list-editor.xml",
- "evolution-contact-list-editor", NULL);
-
- e_pixmaps_update (ce->uic, pixmaps);
-}
-
-static void
-contact_list_editor_destroy_notify (gpointer data,
- GObject *where_the_object_was)
-{
- EContactListEditor *ce = E_CONTACT_LIST_EDITOR (data);
-
- all_contact_list_editors = g_slist_remove (all_contact_list_editors, ce);
-}
-
-EContactListEditor *
-e_contact_list_editor_new (EBook *book,
- ECard *list_card,
- gboolean is_new_list,
- gboolean editable)
-{
- EContactListEditor *ce = g_object_new (E_TYPE_CONTACT_LIST_EDITOR, NULL);
-
- all_contact_list_editors = g_slist_prepend (all_contact_list_editors, ce);
- g_object_weak_ref (G_OBJECT (ce), contact_list_editor_destroy_notify, ce);
-
- g_object_ref (ce);
- gtk_object_sink (GTK_OBJECT (ce));
-
- g_object_set (ce,
- "book", book,
- "card", list_card,
- "is_new_list", is_new_list,
- "editable", editable,
- NULL);
-
- return ce;
-}
-
-static void
-e_contact_list_editor_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- EContactListEditor *editor;
-
- editor = E_CONTACT_LIST_EDITOR (object);
-
- switch (prop_id){
- case PROP_BOOK:
- if (editor->book)
- g_object_unref (editor->book);
- editor->book = E_BOOK(g_value_get_object (value));
- g_object_ref (editor->book);
- /* XXX more here about editable/etc. */
- break;
- case PROP_CARD:
- if (editor->card)
- g_object_unref (editor->card);
- editor->card = e_card_duplicate(E_CARD(g_value_get_object (value)));
- fill_in_info(editor);
- editor->changed = FALSE;
- command_state_changed (editor);
- break;
- case PROP_IS_NEW_LIST: {
- gboolean new_value = g_value_get_boolean (value);
- gboolean changed = (editor->is_new_list != new_value);
-
- editor->is_new_list = new_value;
-
- if (changed)
- command_state_changed (editor);
- break;
- }
- case PROP_EDITABLE: {
- gboolean new_value = g_value_get_boolean (value);
- gboolean changed = (editor->editable != new_value);
-
- editor->editable = new_value;
-
- if (changed) {
- set_editable (editor);
- command_state_changed (editor);
- }
- break;
- }
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_contact_list_editor_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- EContactListEditor *editor;
-
- editor = E_CONTACT_LIST_EDITOR (object);
-
- switch (prop_id) {
- case PROP_BOOK:
- g_value_set_object (value, editor->book);
- break;
-
- case PROP_CARD:
- extract_info(editor);
- g_value_set_object (value, editor->card);
- break;
-
- case PROP_IS_NEW_LIST:
- g_value_set_boolean (value, editor->is_new_list);
- break;
-
- case PROP_EDITABLE:
- g_value_set_boolean (value, editor->editable);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-void
-e_contact_list_editor_show (EContactListEditor *editor)
-{
- gtk_widget_show (editor->app);
-}
-
-void
-e_contact_list_editor_raise (EContactListEditor *editor)
-{
- gdk_window_raise (GTK_WIDGET (editor->app)->window);
-}
-
-GtkWidget *
-e_contact_list_editor_create_table(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-e_contact_list_editor_create_table(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
-
- ETableModel *model;
- GtkWidget *table;
-
- model = e_contact_list_model_new ();
-
- table = e_table_scrolled_new_from_spec_file (model,
- NULL,
- EVOLUTION_ETSPECDIR "/e-contact-list-editor.etspec",
- NULL);
-
- g_object_set_data(G_OBJECT(table), "model", model);
-
- return table;
-}
-
-static void
-add_email_cb (GtkWidget *w, EContactListEditor *editor)
-{
- GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (editor->table));
- const char *text = gtk_entry_get_text (GTK_ENTRY(editor->email_entry));
-
- if (text && *text) {
- e_contact_list_model_add_email (E_CONTACT_LIST_MODEL(editor->model), text);
-
- /* Skip to the end of the list */
- if (adj->upper - adj->lower > adj->page_size)
- gtk_adjustment_set_value (adj, adj->upper);
- }
-
- gtk_entry_set_text (GTK_ENTRY(editor->email_entry), "");
-
- editor->changed = TRUE;
-
- command_state_changed (editor);
-}
-
-static void
-remove_row (int model_row, EContactListEditor *editor)
-{
- e_contact_list_model_remove_row (E_CONTACT_LIST_MODEL (editor->model), model_row);
-}
-
-static void
-remove_entry_cb (GtkWidget *w, EContactListEditor *editor)
-{
- e_table_selected_row_foreach (e_table_scrolled_get_table(E_TABLE_SCROLLED(editor->table)),
- (EForeachFunc)remove_row, editor);
- editor->changed = TRUE;
- command_state_changed (editor);
-}
-
-static void
-list_name_changed_cb (GtkWidget *w, EContactListEditor *editor)
-{
- editor->changed = TRUE;
- command_state_changed (editor);
-}
-
-static void
-visible_addrs_toggled_cb (GtkWidget *w, EContactListEditor *editor)
-{
- editor->changed = TRUE;
- command_state_changed (editor);
-}
-
-static void
-set_editable (EContactListEditor *editor)
-{
- gtk_widget_set_sensitive (editor->email_entry, editor->editable);
- gtk_widget_set_sensitive (editor->list_name_entry, editor->editable);
- gtk_widget_set_sensitive (editor->add_button, editor->editable);
- gtk_widget_set_sensitive (editor->remove_button, editor->editable);
- gtk_widget_set_sensitive (editor->table, editor->editable);
-}
-
-/* Closes the dialog box and emits the appropriate signals */
-static void
-close_dialog (EContactListEditor *cle)
-{
- g_assert (cle->app != NULL);
-
- gtk_widget_destroy (cle->app);
- cle->app = NULL;
-
- g_signal_emit (cle, contact_list_editor_signals[EDITOR_CLOSED], 0);
-}
-
-/* Callback used when the editor is destroyed */
-static gint
-app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
-{
- EContactListEditor *ce;
-
- ce = E_CONTACT_LIST_EDITOR (data);
-
- /* if we're in an async call, don't allow the dialog to close */
- if (ce->in_async_call)
- return TRUE;
-
- if (!prompt_to_save_changes (ce))
- return TRUE;
-
- close_dialog (ce);
- return TRUE;
-}
-
-static gboolean
-table_drag_motion_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor)
-{
- GList *p;
-
- for (p = context->targets; p != NULL; p = p->next) {
- char *possible_type;
-
- possible_type = gdk_atom_name ((GdkAtom) p->data);
- if (!strcmp (possible_type, VCARD_TYPE)) {
- g_free (possible_type);
- gdk_drag_status (context, GDK_ACTION_LINK, time);
- return TRUE;
- }
-
- g_free (possible_type);
- }
-
- return FALSE;
-}
-
-static gboolean
-table_drag_drop_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor)
-{
- if (context->targets == NULL)
- return FALSE;
-
-
- gtk_drag_get_data (GTK_WIDGET (table), context,
- GDK_POINTER_TO_ATOM (context->targets->data),
- time);
- return TRUE;
-}
-
-static void
-table_drag_data_received_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y,
- GtkSelectionData *selection_data,
- guint info, guint time, EContactListEditor *editor)
-{
- GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (editor->table));
- char *target_type;
- gboolean changed = FALSE;
- gboolean handled = FALSE;
-
- target_type = gdk_atom_name (selection_data->target);
-
- if (!strcmp (target_type, VCARD_TYPE)) {
-
- GList *card_list = e_card_load_cards_from_string_with_default_charset (selection_data->data, "ISO-8859-1");
- GList *c;
-
- if (card_list)
- handled = TRUE;
-
- for (c = card_list; c; c = c->next) {
- ECard *ecard = c->data;
-
- if (!e_card_evolution_list (ecard)) {
- ECardSimple *simple = e_card_simple_new (ecard);
-
- e_contact_list_model_add_card (E_CONTACT_LIST_MODEL (editor->model),
- simple);
-
- g_object_unref (simple);
-
- changed = TRUE;
- }
- }
- g_list_foreach (card_list, (GFunc)g_object_unref, NULL);
- g_list_free (card_list);
-
- /* Skip to the end of the list */
- if (adj->upper - adj->lower > adj->page_size)
- gtk_adjustment_set_value (adj, adj->upper);
-
- if (changed) {
- editor->changed = TRUE;
- command_state_changed (editor);
- }
- }
-
- gtk_drag_finish (context, handled, FALSE, time);
-}
-
-static void
-command_state_changed (EContactListEditor *editor)
-{
- gboolean named = is_named (editor);
-
- bonobo_ui_component_set_prop (editor->uic,
- "/commands/ContactListEditorSaveClose",
- "sensitive",
- editor->changed && named && editor->editable ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (editor->uic,
- "/commands/ContactListEditorSave",
- "sensitive",
- editor->changed && named && editor->editable ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (editor->uic,
- "/commands/ContactListEditorDelete",
- "sensitive",
- editor->editable && !editor->is_new_list ? "1" : "0", NULL);
-}
-
-static void
-extract_info(EContactListEditor *editor)
-{
- ECard *card = editor->card;
- if (card) {
- int i;
- EList *email_list;
- EIterator *email_iter;
- char *string = gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1);
-
- if (string && *string)
- g_object_set (card,
- "file_as", string,
- "full_name", string,
- NULL);
-
- g_free (string);
-
-
- g_object_set (card,
- "list", GINT_TO_POINTER (TRUE),
- "list_show_addresses",
- GINT_TO_POINTER (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton))),
- NULL);
-
- g_object_get (card,
- "email", &email_list,
- NULL);
-
- /* clear the email list */
- email_iter = e_list_get_iterator (email_list);
- e_iterator_last (email_iter);
- while (e_iterator_is_valid (E_ITERATOR (email_iter))) {
- e_iterator_delete (E_ITERATOR (email_iter));
- }
- g_object_unref (email_iter);
-
- /* then refill it from the contact list model */
- for (i = 0; i < e_table_model_row_count (editor->model); i ++) {
- const EDestination *dest = e_contact_list_model_get_destination (E_CONTACT_LIST_MODEL (editor->model), i);
- gchar *dest_xml = e_destination_export (dest);
- if (dest_xml) {
- e_list_append (email_list, dest_xml);
- }
- g_free (dest_xml);
- }
- g_object_unref (email_list);
- }
-}
-
-static void
-fill_in_info(EContactListEditor *editor)
-{
- if (editor->card) {
- char *file_as;
- gboolean show_addresses = FALSE;
- gboolean is_evolution_list = FALSE;
- EList *email_list;
- EIterator *email_iter;
-
- g_object_get (editor->card,
- "file_as", &file_as,
- "email", &email_list,
- "list", &is_evolution_list,
- "list_show_addresses", &show_addresses,
- NULL);
-
- gtk_editable_delete_text (GTK_EDITABLE (editor->list_name_entry), 0, -1);
- if (file_as) {
- int position = 0;
- gtk_editable_insert_text (GTK_EDITABLE (editor->list_name_entry), file_as, strlen (file_as), &position);
- g_free (file_as);
- }
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton), !show_addresses);
-
- e_contact_list_model_remove_all (E_CONTACT_LIST_MODEL (editor->model));
-
- email_iter = e_list_get_iterator (email_list);
-
- while (e_iterator_is_valid (email_iter)) {
- const char *dest_xml = e_iterator_get (email_iter);
- EDestination *dest;
-
- /* g_message ("incoming xml: [%s]", dest_xml); */
- dest = e_destination_import (dest_xml);
-
- if (dest != NULL) {
- e_contact_list_model_add_destination (E_CONTACT_LIST_MODEL (editor->model), dest);
- }
-
- e_iterator_next (email_iter);
- }
- g_object_unref (email_list);
- }
-}
-
-
-gboolean
-e_contact_list_editor_request_close_all (void)
-{
- GSList *p;
- GSList *pnext;
- gboolean retval;
-
- retval = TRUE;
- for (p = all_contact_list_editors; p != NULL; p = pnext) {
- pnext = p->next;
-
- e_contact_list_editor_raise (E_CONTACT_LIST_EDITOR (p->data));
- if (! prompt_to_save_changes (E_CONTACT_LIST_EDITOR (p->data))) {
- retval = FALSE;
- break;
- }
-
- close_dialog (E_CONTACT_LIST_EDITOR (p->data));
- }
-
- return retval;
-}
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.etspec b/addressbook/gui/contact-list-editor/e-contact-list-editor.etspec
deleted file mode 100644
index 6d5f4f2514..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.etspec
+++ /dev/null
@@ -1,7 +0,0 @@
-<ETableSpecification no-headers="true" cursor-mode="line" selection-mode="single">
-<ETableColumn model_col= "0" _title="Contact" expansion="1.0" minimum_width="20" resizable="true" cell="string" compare="string" />
- <ETableState>
- <column source="0"/>
- <grouping> </grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.h b/addressbook/gui/contact-list-editor/e-contact-list-editor.h
deleted file mode 100644
index 184145a0f7..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-list-editor.h
- * Copyright (C) 2001 Ximian, Inc.
- * Author: Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_CONTACT_LIST_EDITOR_H__
-#define __E_CONTACT_LIST_EDITOR_H__
-
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-app-helper.h>
-#include <bonobo/bonobo-ui-component.h>
-#include <glade/glade.h>
-#include <gal/e-table/e-table-model.h>
-
-#include "addressbook/backend/ebook/e-book.h"
-#include "addressbook/backend/ebook/e-card.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_CONTACT_LIST_EDITOR (e_contact_list_editor_get_type ())
-#define E_CONTACT_LIST_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CONTACT_LIST_EDITOR, EContactListEditor))
-#define E_CONTACT_LIST_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CONTACT_LIST_EDITOR, EContactListEditorClass))
-#define E_IS_CONTACT_LIST_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CONTACT_LIST_EDITOR))
-#define E_IS_CONTACT_LIST_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CONTACT_LIST_EDITOR))
-
-
-typedef struct _EContactListEditor EContactListEditor;
-typedef struct _EContactListEditorClass EContactListEditorClass;
-
-struct _EContactListEditor
-{
- GtkObject object;
-
- /* item specific fields */
- EBook *book;
- ECard *card;
-
- /* UI handler */
- BonoboUIComponent *uic;
-
- GladeXML *gui;
- GtkWidget *app;
-
- GtkWidget *table;
- ETableModel *model;
- GtkWidget *email_entry;
- GtkWidget *list_name_entry;
- GtkWidget *add_button;
- GtkWidget *remove_button;
- GtkWidget *visible_addrs_checkbutton;
-
- /* Whether we are editing a new card or an existing one */
- guint is_new_list : 1;
-
- /* Whether the card has been changed since bringing up the contact editor */
- guint changed : 1;
-
- /* Whether the contact editor will accept modifications */
- guint editable : 1;
-
- /* Whether an async wombat call is in progress */
- guint in_async_call : 1;
-};
-
-struct _EContactListEditorClass
-{
- GtkObjectClass parent_class;
-
- /* Notification signals */
-
- void (* list_added) (EContactListEditor *cle, EBookStatus status, ECard *card);
- void (* list_modified) (EContactListEditor *cle, EBookStatus status, ECard *card);
- void (* list_deleted) (EContactListEditor *cle, EBookStatus status, ECard *card);
- void (* editor_closed) (EContactListEditor *cle);
-};
-
-EContactListEditor *e_contact_list_editor_new (EBook *book,
- ECard *list_card,
- gboolean is_new_list,
- gboolean editable);
-GType e_contact_list_editor_get_type (void);
-void e_contact_list_editor_show (EContactListEditor *editor);
-void e_contact_list_editor_raise (EContactListEditor *editor);
-
-gboolean e_contact_list_editor_confirm_delete (GtkWindow *parent);
-
-gboolean e_contact_list_editor_request_close_all (void);
-
-G_END_DECLS
-
-
-#endif /* __E_CONTACT_LIST_EDITOR_H__ */
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c
deleted file mode 100644
index 6cad1bd9bf..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-model.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <config.h>
-#include <string.h>
-#include "e-contact-list-model.h"
-
-#define PARENT_TYPE e_table_model_get_type()
-static ETableModelClass *parent_class;
-
-#define COLS 1
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-contact_list_col_count (ETableModel *etc)
-{
- return COLS;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-contact_list_row_count (ETableModel *etc)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL (etc);
- return model->data_count;
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-contact_list_value_at (ETableModel *etc, int col, int row)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL (etc);
-
- return (void *) e_destination_get_textrep (model->data[row], TRUE);
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-contact_list_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
- /* nothing */
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-contact_list_is_cell_editable (ETableModel *etc, int col, int row)
-{
- return FALSE;
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-contact_list_duplicate_value (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/* This function frees the value passed to it. */
-static void
-contact_list_free_value (ETableModel *etc, int col, void *value)
-{
- g_free(value);
-}
-
-static void *
-contact_list_initialize_value (ETableModel *etc, int col)
-{
- return g_strdup("");
-}
-
-static gboolean
-contact_list_value_is_empty (ETableModel *etc, int col, const void *value)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-contact_list_value_to_string (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-static void
-contact_list_model_destroy (GtkObject *o)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL (o);
- int i;
-
- for (i = 0; i < model->data_count; i ++) {
- g_object_unref (model->data[i]);
- }
- g_free (model->data);
-
- model->data_count = 0;
- model->data_alloc = 0;
-}
-
-static void
-e_contact_list_model_class_init (GtkObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->destroy = contact_list_model_destroy;
-
- model_class->column_count = contact_list_col_count;
- model_class->row_count = contact_list_row_count;
- model_class->value_at = contact_list_value_at;
- model_class->set_value_at = contact_list_set_value_at;
- model_class->is_cell_editable = contact_list_is_cell_editable;
- model_class->duplicate_value = contact_list_duplicate_value;
- model_class->free_value = contact_list_free_value;
- model_class->initialize_value = contact_list_initialize_value;
- model_class->value_is_empty = contact_list_value_is_empty;
- model_class->value_to_string = contact_list_value_to_string;
-}
-
-static void
-e_contact_list_model_init (GtkObject *object)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL(object);
-
- model->data_alloc = 10;
- model->data_count = 0;
- model->data = g_new (EDestination*, model->data_alloc);
-}
-
-GType
-e_contact_list_model_get_type (void)
-{
- static GType cle_type = 0;
-
- if (!cle_type) {
- static const GTypeInfo cle_info = {
- sizeof (EContactListModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_list_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactListModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_list_model_init,
- };
-
- cle_type = g_type_register_static (E_TABLE_MODEL_TYPE, "EContactListModel", &cle_info, 0);
- }
-
- return cle_type;
-}
-
-void
-e_contact_list_model_construct (EContactListModel *model)
-{
-}
-
-ETableModel *
-e_contact_list_model_new ()
-{
- EContactListModel *model;
-
- model = g_object_new (E_TYPE_CONTACT_LIST_MODEL, NULL);
-
- e_contact_list_model_construct (model);
-
- return E_TABLE_MODEL(model);
-}
-
-void
-e_contact_list_model_add_destination (EContactListModel *model, EDestination *dest)
-{
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (E_IS_DESTINATION (dest));
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- if (model->data_count + 1 >= model->data_alloc) {
- model->data_alloc *= 2;
- model->data = g_renew (EDestination*, model->data, model->data_alloc);
- }
-
- model->data[model->data_count ++] = dest;
- g_object_ref (dest);
-
- e_table_model_row_inserted (E_TABLE_MODEL (model), model->data_count - 1);
-}
-
-void
-e_contact_list_model_add_email (EContactListModel *model,
- const char *email)
-{
- EDestination *new_dest;
-
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (email != NULL);
-
- new_dest = e_destination_new ();
- e_destination_set_email (new_dest, email);
-
- e_contact_list_model_add_destination (model, new_dest);
-}
-
-void
-e_contact_list_model_add_card (EContactListModel *model,
- ECardSimple *simple)
-{
- EDestination *new_dest;
-
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (E_IS_CARD_SIMPLE (simple));
-
- new_dest = e_destination_new ();
- e_destination_set_card (new_dest, simple->card, 0); /* Hard-wired for default e-mail */
-
- e_contact_list_model_add_destination (model, new_dest);
-}
-
-void
-e_contact_list_model_remove_row (EContactListModel *model, int row)
-{
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (0 <= row && row < model->data_count);
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- g_object_unref (model->data[row]);
- memmove (model->data + row, model->data + row + 1, sizeof (EDestination*) * (model->data_count - row - 1));
- model->data_count --;
-
- e_table_model_row_deleted (E_TABLE_MODEL (model), row);
-}
-
-void
-e_contact_list_model_remove_all (EContactListModel *model)
-{
- int i;
-
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- for (i = 0; i < model->data_count; i ++) {
- g_object_unref (model->data[i]);
- model->data[i] = NULL;
- }
-
- model->data_count = 0;
-
- e_table_model_changed (E_TABLE_MODEL (model));
-}
-
-
-const EDestination *
-e_contact_list_model_get_destination (EContactListModel *model, int row)
-{
- g_return_val_if_fail (E_IS_CONTACT_LIST_MODEL (model), NULL);
- g_return_val_if_fail (0 <= row && row < model->data_count, NULL);
-
- return model->data[row];
-}
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.h b/addressbook/gui/contact-list-editor/e-contact-list-model.h
deleted file mode 100644
index bb07d83544..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-model.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_CONTACT_LIST_MODEL_H_
-#define _E_CONTACT_LIST_MODEL_H_
-
-#include <gtk/gtk.h>
-#include <gal/e-table/e-table-model.h>
-#include "addressbook/backend/ebook/e-book.h"
-#include "addressbook/backend/ebook/e-book-view.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-#include "addressbook/backend/ebook/e-destination.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_CONTACT_LIST_MODEL (e_contact_list_model_get_type ())
-#define E_CONTACT_LIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_CONTACT_LIST_MODEL, EContactListModel))
-#define E_CONTACT_LIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_CONTACT_LIST_MODEL, EContactListModelClass))
-#define E_IS_CONTACT_LIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_CONTACT_LIST_MODEL))
-#define E_IS_CONTACT_LIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_CONTACT_LIST_MODEL))
-
-typedef struct _EContactListModel EContactListModel;
-typedef struct _EContactListModelClass EContactListModelClass;
-
-struct _EContactListModel {
- ETableModel parent;
-
- EDestination **data;
- int data_count;
- int data_alloc;
-};
-
-
-struct _EContactListModelClass {
- ETableModelClass parent_class;
-};
-
-
-GType e_contact_list_model_get_type (void);
-void e_contact_list_model_construct (EContactListModel *model);
-ETableModel *e_contact_list_model_new (void);
-
-void e_contact_list_model_add_destination (EContactListModel *model, EDestination *dest);
-void e_contact_list_model_add_email (EContactListModel *model, const char *email);
-void e_contact_list_model_add_card (EContactListModel *model, ECardSimple *simple);
-
-void e_contact_list_model_remove_row (EContactListModel *model, int row);
-void e_contact_list_model_remove_all (EContactListModel *model);
-
-const EDestination *e_contact_list_model_get_destination (EContactListModel *model, int row);
-
-G_END_DECLS
-
-#endif /* _E_CONTACT_LIST_MODEL_H_ */