aboutsummaryrefslogtreecommitdiffstats
path: root/shell/importer
diff options
context:
space:
mode:
Diffstat (limited to 'shell/importer')
-rw-r--r--shell/importer/.cvsignore10
-rw-r--r--shell/importer/GNOME_Evolution_Importer.idl95
-rw-r--r--shell/importer/Makefile.am63
-rw-r--r--shell/importer/evolution-importer-client.c253
-rw-r--r--shell/importer/evolution-importer-client.h72
-rw-r--r--shell/importer/evolution-importer-listener.c225
-rw-r--r--shell/importer/evolution-importer-listener.h71
-rw-r--r--shell/importer/evolution-importer.c230
-rw-r--r--shell/importer/evolution-importer.h95
-rw-r--r--shell/importer/evolution-intelligent-importer.c198
-rw-r--r--shell/importer/evolution-intelligent-importer.h74
-rw-r--r--shell/importer/import.glade91
-rw-r--r--shell/importer/importer.c665
-rw-r--r--shell/importer/importer.h33
-rw-r--r--shell/importer/intelligent.c232
-rw-r--r--shell/importer/intelligent.h29
16 files changed, 0 insertions, 2436 deletions
diff --git a/shell/importer/.cvsignore b/shell/importer/.cvsignore
deleted file mode 100644
index a1e30a4161..0000000000
--- a/shell/importer/.cvsignore
+++ /dev/null
@@ -1,10 +0,0 @@
-.deps
-.libs
-Makefile.in
-Makefile
-GNOME_Evolution_Importer-stubs.c
-GNOME_Evolution_Importer-skels.c
-GNOME_Evolution_Importer-common.c
-GNOME_Evolution_Importer.h
-*.lo
-*.la
diff --git a/shell/importer/GNOME_Evolution_Importer.idl b/shell/importer/GNOME_Evolution_Importer.idl
deleted file mode 100644
index adeb900dde..0000000000
--- a/shell/importer/GNOME_Evolution_Importer.idl
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Interfaces for the importer framework.
- *
- * Authors:
- * Iain Holmes <iain@helixcode.com>
- *
- * Copyright (C) 2000 Helix Code, Inc.
- */
-
-#include <Bonobo.idl>
-
-module GNOME {
-module Evolution {
- interface ImporterListener : Bonobo::Unknown {
- enum ImporterResult {
- OK,
- UNSUPPORTED_OPERATION,
- NOT_READY,
- BUSY,
- UNKNOWN_DATA,
- BAD_DATA,
- BAD_FILE
- };
-
- /**
- * notifyResult:
- * @result: The result of the import.
- * @more_items: Are there any more items to be processed?
- *
- * Notifies the listener of the result and whether there are
- * any more items to be imported.
- */
- oneway void notifyResult (in ImporterResult result,
- in boolean more_items);
- };
-
- interface Importer : Bonobo::Unknown {
-
- /**
- * processItem:
- * @listener: The ImporterListener that will be notified of the
- * progress.
- *
- * Processes the next item.
- *
- */
- oneway void processItem (in ImporterListener listener);
-
- /**
- * getError:
- *
- * Retrieve a detailed explaination of the error.
- *
- * Returns: A string.
- */
- string getError ();
-
- /**
- * supportFormat:
- * @filename: The filename of the file.
- *
- * Checks if the importer created by this factory can
- * import the file specified.
- *
- * Returns: A boolean, TRUE if it can import the file,
- * FALSE otherwise.
- */
- boolean supportFormat (in string filename);
-
- /**
- * loadFile:
- * @filename: The filename of the file.
- * @folderpath: The full pathname to the folder.
- *
- * Loads the file and prepares an Importer object that can
- * process files of this type.
- *
- * Returns: An Importer object.
- */
- boolean loadFile (in string filename,
- in string folderpath);
- };
-
- interface IntelligentImporter : Bonobo::Unknown {
-
- readonly attribute string importername;
- readonly attribute string message;
-
- boolean canImport ();
-
- void importData ();
- };
-};
-};
diff --git a/shell/importer/Makefile.am b/shell/importer/Makefile.am
deleted file mode 100644
index 2a15012bbb..0000000000
--- a/shell/importer/Makefile.am
+++ /dev/null
@@ -1,63 +0,0 @@
-INCLUDES = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/shell \
- -I$(top_builddir)/shell \
- -I$(includedir) \
- $(EXTRA_GNOME_CFLAGS) \
- -DG_LOG_DOMAIN=\"Evolution-Importer\" \
- -DEVOLUTION_GLADEDIR=\"$(datadir)/evolution/glade\"
-
-lib_LTLIBRARIES = libevolution-importer.la
-
-IDLS = \
- GNOME_Evolution_Importer.idl
-
-IDL_GENERATED = \
- GNOME_Evolution_Importer.h \
- GNOME_Evolution_Importer-common.c \
- GNOME_Evolution_Importer-skels.c \
- GNOME_Evolution_Importer-stubs.c
-
-GNOME_Evolution_Importer-impl.o: GNOME_Evolution_Importer.h
-
-$(IDL_GENERATED): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
- $(srcdir)/GNOME_Evolution_Importer.idl
-
-idldir = $(datadir)/idl
-idl_DATA = $(IDLS)
-
-libevolution_importerincludedir = $(includedir)/evolution/importer
-libevolution_importer_la_SOURCES = \
- $(IDL_GENERATED) \
- evolution-intelligent-importer.c \
- evolution-importer-client.c \
- evolution-importer-listener.c \
- evolution-importer.c \
- intelligent.c \
- intelligent.h \
- importer.c \
- importer.h
-
-libevolution_importerinclude_HEADERS = \
- GNOME_Evolution_Importer.h \
- evolution-intelligent-importer.h \
- evolution-importer-client.h \
- evolution-importer-listener.h \
- evolution-importer.h
-
-libevolution_importer_la_LIBADD = \
- $(top_builddir)/e-util/libeutil.la \
- $(EXTRA_GNOME_LIBS) \
- $(GTKHTML_LIBS)
-
-gladedir = $(datadir)/evolution/glade
-glade_DATA = import.glade
-
-EXTRA_DIST = $(glade_DATA) $(IDLS)
-
-BUILT_SOURCES=$(IDL_GENERATED)
-CLEANFILES += $(BUILT_SOURCES)
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
-
diff --git a/shell/importer/evolution-importer-client.c b/shell/importer/evolution-importer-client.c
deleted file mode 100644
index 0921dd8773..0000000000
--- a/shell/importer/evolution-importer-client.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-importer-client.c
- *
- * Copyright (C) 2000 Ximian, 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: Iain Holmes <iain@ximian.com>
- * Based on evolution-shell-component-client.c by Ettore Perazzoli
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo/bonobo-object.h>
-#include <bonobo/bonobo-main.h>
-#include <gal/util/e-util.h>
-
-#include <liboaf/liboaf.h>
-
-#include "GNOME_Evolution_Importer.h"
-#include "evolution-importer-client.h"
-
-
-#define PARENT_TYPE BONOBO_OBJECT_CLIENT_TYPE
-static BonoboObjectClass *parent_class = NULL;
-
-
-static void
-destroy (GtkObject *object)
-{
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
-}
-
-static void
-class_init (EvolutionImporterClientClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = GTK_OBJECT_CLASS (klass);
- parent_class = gtk_type_class (PARENT_TYPE);
-
- object_class->destroy = destroy;
-}
-
-static void
-init (EvolutionImporterClient *client)
-{
-}
-
-static void
-evolution_importer_client_construct (EvolutionImporterClient *client,
- CORBA_Object corba_object)
-{
- g_return_if_fail (client != NULL);
- g_return_if_fail (EVOLUTION_IS_IMPORTER_CLIENT (client));
- g_return_if_fail (corba_object != CORBA_OBJECT_NIL);
-
- bonobo_object_client_construct (BONOBO_OBJECT_CLIENT (client), corba_object);
-}
-
-/**
- * evolution_importer_client_new:
- * @objref: The CORBA_Object to make a client for.
- *
- * Makes a client for @objref. @objref should be an Evolution_Importer.
- *
- * Returns: A newly created EvolutionImporterClient.
- */
-EvolutionImporterClient *
-evolution_importer_client_new (const CORBA_Object objref)
-{
- EvolutionImporterClient *client;
-
- g_return_val_if_fail (objref != CORBA_OBJECT_NIL, NULL);
-
- client = gtk_type_new (evolution_importer_client_get_type ());
- evolution_importer_client_construct (client, objref);
-
- return client;
-}
-
-/**
- * evolution_importer_client_new_from_id:
- * @id: The oafiid of the component to make a client for.
- *
- * Makes a client for the object returned by activating @id.
- *
- * Returns: A newly created EvolutionImporterClient.
- */
-EvolutionImporterClient *
-evolution_importer_client_new_from_id (const char *id)
-{
- CORBA_Environment ev;
- CORBA_Object objref;
-
- g_return_val_if_fail (id != NULL, NULL);
-
- CORBA_exception_init (&ev);
- objref = oaf_activate_from_id ((char *) id, 0, NULL, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- CORBA_exception_free (&ev);
- g_warning ("Could not start %s.", id);
- return NULL;
- }
-
- CORBA_exception_free (&ev);
- if (objref == CORBA_OBJECT_NIL) {
- g_warning ("Could not activate component %s", id);
- return NULL;
- }
-
- return evolution_importer_client_new (objref);
-}
-
-/* API */
-/**
- * evolution_importer_client_support_format:
- * @client: The EvolutionImporterClient.
- * @filename: Name of the file to check.
- *
- * Checks whether @client is able to import @filename.
- *
- * Returns: TRUE if @client can import @filename, FALSE otherwise.
- */
-gboolean
-evolution_importer_client_support_format (EvolutionImporterClient *client,
- const char *filename)
-{
- GNOME_Evolution_Importer corba_importer;
- gboolean result;
- CORBA_Environment ev;
-
- g_return_val_if_fail (client != NULL, FALSE);
- g_return_val_if_fail (EVOLUTION_IS_IMPORTER_CLIENT (client), FALSE);
- g_return_val_if_fail (filename != NULL, FALSE);
-
- CORBA_exception_init (&ev);
- corba_importer = bonobo_object_corba_objref (BONOBO_OBJECT (client));
- result = GNOME_Evolution_Importer_supportFormat (corba_importer,
- filename, &ev);
- CORBA_exception_free (&ev);
-
- return result;
-}
-
-/**
- * evolution_importer_client_load_file:
- * @client: The EvolutionImporterClient.
- * @filename: The file to load.
- * @folderpath: The full path to the folder, or NULL for Inbox.
- *
- * Loads and initialises the importer.
- *
- * Returns: TRUE on sucess, FALSE on failure.
- */
-gboolean
-evolution_importer_client_load_file (EvolutionImporterClient *client,
- const char *filename,
- const char *folderpath)
-{
- GNOME_Evolution_Importer corba_importer;
- gboolean result;
- CORBA_Environment ev;
-
- g_return_val_if_fail (client != NULL, FALSE);
- g_return_val_if_fail (EVOLUTION_IS_IMPORTER_CLIENT (client), FALSE);
- g_return_val_if_fail (filename != NULL, FALSE);
-
- CORBA_exception_init (&ev);
- corba_importer = bonobo_object_corba_objref (BONOBO_OBJECT (client));
- result = GNOME_Evolution_Importer_loadFile (corba_importer,
- filename,
- folderpath ? folderpath : "",
- &ev);
- CORBA_exception_free (&ev);
-
- return result;
-}
-
-/**
- * evolution_importer_client_process_item:
- * @client: The EvolutionImporterClient.
- * @listener: The EvolutionImporterListener.
- *
- * Starts importing the next item in the file. @listener will be notified
- * when the item has finished.
- */
-void
-evolution_importer_client_process_item (EvolutionImporterClient *client,
- EvolutionImporterListener *listener)
-{
- GNOME_Evolution_Importer corba_importer;
- GNOME_Evolution_ImporterListener corba_listener;
- CORBA_Environment ev;
-
- g_return_if_fail (client != NULL);
- g_return_if_fail (EVOLUTION_IS_IMPORTER_CLIENT (client));
- g_return_if_fail (listener != NULL);
- g_return_if_fail (EVOLUTION_IS_IMPORTER_LISTENER (listener));
-
- CORBA_exception_init (&ev);
-
- corba_importer = bonobo_object_corba_objref (BONOBO_OBJECT (client));
- corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (listener));
- GNOME_Evolution_Importer_processItem (corba_importer,
- corba_listener, &ev);
- CORBA_exception_free (&ev);
-}
-
-/**
- * evolution_importer_client_get_error:
- * @client: The EvolutionImporterClient.
- *
- * Gets the error as a string.
- *
- * Returns: The error as a string. If there is no error NULL is returned.
- * Importers need not support this method and if so, NULL is also returned.
- */
-const char *
-evolution_importer_client_get_error (EvolutionImporterClient *client)
-{
- GNOME_Evolution_Importer corba_importer;
- CORBA_char *str;
- CORBA_Environment ev;
-
- g_return_val_if_fail (client != NULL, NULL);
- g_return_val_if_fail (EVOLUTION_IS_IMPORTER_CLIENT (client), NULL);
-
- corba_importer = bonobo_object_corba_objref (BONOBO_OBJECT (client));
-
- CORBA_exception_init (&ev);
- str = GNOME_Evolution_Importer_getError (corba_importer, &ev);
-
- return str;
-}
-
-E_MAKE_TYPE (evolution_importer_client, "EvolutionImporterClient",
- EvolutionImporterClient, class_init, init, PARENT_TYPE)
diff --git a/shell/importer/evolution-importer-client.h b/shell/importer/evolution-importer-client.h
deleted file mode 100644
index e9a343dc80..0000000000
--- a/shell/importer/evolution-importer-client.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-importer-client.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: Iain Holmes <iain@helixcode.com>
- */
-
-#ifndef EVOLUTION_IMPORTER_CLIENT_H
-#define EVOLUTION_IMPORTER_CLIENT_H
-
-#include <bonobo/bonobo-object-client.h>
-#include <importer/evolution-importer.h>
-#include <importer/evolution-importer-listener.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif
-
-#define EVOLUTION_TYPE_IMPORTER_CLIENT (evolution_importer_client_get_type ())
-#define EVOLUTION_IMPORTER_CLIENT(obj) (GTK_CHECK_CAST ((obj), EVOLUTION_TYPE_IMPORTER_CLIENT, EvolutionImporterClient))
-#define EVOLUTION_IMPORTER_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_IMPORTER_CLIENT, EvolutionImporterClientClass))
-#define EVOLUTION_IS_IMPORTER_CLIENT(obj) (GTK_CHECK_TYPE ((obj), EVOLUTION_TYPE_IMPORTER_CLIENT))
-#define EVOLUTION_IS_IMPORTER_CLIENT_CLASS(klass) (GTK_CHECK_TYPE ((klass), EVOLUTION_TYPE_IMPORTER_CLIENT))
-
-
-typedef struct _EvolutionImporterClient EvolutionImporterClient;
-typedef struct _EvolutionImporterClientClass EvolutionImporterClientClass;
-
-struct _EvolutionImporterClient {
- BonoboObjectClient parent;
-};
-
-struct _EvolutionImporterClientClass {
- BonoboObjectClientClass parent_class;
-};
-
-GtkType evolution_importer_client_get_type (void);
-
-EvolutionImporterClient *evolution_importer_client_new (const CORBA_Object objref);
-EvolutionImporterClient *evolution_importer_client_new_from_id (const char *id);
-
-gboolean evolution_importer_client_support_format (EvolutionImporterClient *client,
- const char *filename);
-gboolean evolution_importer_client_load_file (EvolutionImporterClient *client,
- const char *filename,
- const char *folderpath);
-void evolution_importer_client_process_item (EvolutionImporterClient *client,
- EvolutionImporterListener *listener);
-const char *evolution_importer_client_get_error (EvolutionImporterClient *client);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/shell/importer/evolution-importer-listener.c b/shell/importer/evolution-importer-listener.c
deleted file mode 100644
index 84d6ad22b3..0000000000
--- a/shell/importer/evolution-importer-listener.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-importer-client.c
- *
- * Copyright (C) 2000 Ximian, 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: Iain Holmes <iain@ximian.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo/bonobo-object.h>
-#include <gal/util/e-util.h>
-
-#include "GNOME_Evolution_Importer.h"
-#include "evolution-importer-listener.h"
-
-#define PARENT_TYPE BONOBO_X_OBJECT_TYPE
-
-static BonoboObjectClass *parent_class = NULL;
-
-struct _EvolutionImporterListenerPrivate {
- EvolutionImporterListenerCallback callback;
-
- void *closure;
-};
-
-#if 0
-static POA_GNOME_Evolution_ImporterListener__vepv Listener_vepv;
-
-static POA_GNOME_Evolution_ImporterListener *
-create_servant (void)
-{
- POA_GNOME_Evolution_ImporterListener *servant;
- CORBA_Environment ev;
-
- servant = (POA_GNOME_Evolution_ImporterListener *) g_new0 (BonoboObjectServant, 1);
- servant->vepv = &Listener_vepv;
-
- CORBA_exception_init (&ev);
- POA_GNOME_Evolution_ImporterListener__init ((PortableServer_Servant) servant, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_free (servant);
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- CORBA_exception_free (&ev);
-
- return servant;
-}
-#endif
-
-static EvolutionImporterResult
-corba_result_to_evolution (GNOME_Evolution_ImporterListener_ImporterResult corba_result)
-{
- switch (corba_result) {
- case GNOME_Evolution_ImporterListener_OK:
- return EVOLUTION_IMPORTER_OK;
- case GNOME_Evolution_ImporterListener_UNSUPPORTED_OPERATION:
- return EVOLUTION_IMPORTER_UNSUPPORTED_OPERATION;
- case GNOME_Evolution_ImporterListener_UNKNOWN_DATA:
- return EVOLUTION_IMPORTER_UNKNOWN_DATA;
- case GNOME_Evolution_ImporterListener_BAD_DATA:
- return EVOLUTION_IMPORTER_BAD_DATA;
- case GNOME_Evolution_ImporterListener_BAD_FILE:
- return EVOLUTION_IMPORTER_BAD_FILE;
- case GNOME_Evolution_ImporterListener_NOT_READY:
- return EVOLUTION_IMPORTER_NOT_READY;
- case GNOME_Evolution_ImporterListener_BUSY:
- return EVOLUTION_IMPORTER_BUSY;
- default:
- return EVOLUTION_IMPORTER_UNKNOWN_ERROR;
- }
-}
-
-static inline EvolutionImporterListener *
-evolution_importer_listener_from_servant (PortableServer_Servant servant)
-{
- return EVOLUTION_IMPORTER_LISTENER (bonobo_object_from_servant (servant));
-}
-
-static void
-impl_GNOME_Evolution_ImporterListener_notifyResult (PortableServer_Servant servant,
- GNOME_Evolution_ImporterListener_ImporterResult result,
- CORBA_boolean more_items,
- CORBA_Environment *ev)
-{
- EvolutionImporterListener *listener;
- EvolutionImporterListenerPrivate *priv;
- EvolutionImporterResult out_result;
-
- listener = evolution_importer_listener_from_servant (servant);
- priv = listener->priv;
-
- out_result = corba_result_to_evolution (result);
- if (priv->callback) {
- (priv->callback) (listener, out_result, more_items,
- priv->closure);
- }
-
- return;
-}
-
-
-/* GtkObject methods */
-static void
-destroy (GtkObject *object)
-{
- EvolutionImporterListener *listener;
- EvolutionImporterListenerPrivate *priv;
-
- listener = EVOLUTION_IMPORTER_LISTENER (object);
- priv = listener->priv;
-
- if (priv == NULL)
- return;
-
- g_free (priv);
- listener->priv = NULL;
-
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-#if 0
-static void
-corba_class_init (void)
-{
- POA_GNOME_Evolution_ImporterListener__vepv *vepv;
- POA_GNOME_Evolution_ImporterListener__epv *epv;
- PortableServer_ServantBase__epv *base_epv;
-
- base_epv = g_new0 (PortableServer_ServantBase__epv, 1);
- base_epv->_private = NULL;
- base_epv->finalize = NULL;
- base_epv->default_POA = NULL;
-
- epv = g_new0 (POA_GNOME_Evolution_ImporterListener__epv, 1);
- epv->notifyResult = impl_GNOME_Evolution_ImporterListener_notifyResult;
-
- vepv = &Listener_vepv;
- vepv->_base_epv = base_epv;
- vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
- vepv->GNOME_Evolution_ImporterListener_epv = epv;
-}
-#endif
-
-static void
-evolution_importer_listener_class_init (EvolutionImporterListenerClass *klass)
-{
- GtkObjectClass *object_class;
- POA_GNOME_Evolution_ImporterListener__epv *epv = &klass->epv;
-
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = destroy;
-
- parent_class = gtk_type_class (PARENT_TYPE);
- epv->notifyResult = impl_GNOME_Evolution_ImporterListener_notifyResult;
-}
-
-static void
-evolution_importer_listener_init (EvolutionImporterListener *listener)
-{
- EvolutionImporterListenerPrivate *priv;
-
- priv = g_new0 (EvolutionImporterListenerPrivate, 1);
- listener->priv = priv;
-}
-
-static void
-evolution_importer_listener_construct (EvolutionImporterListener *listener,
- EvolutionImporterListenerCallback callback,
- void *closure)
-{
- EvolutionImporterListenerPrivate *priv;
-
- g_return_if_fail (listener != NULL);
- g_return_if_fail (EVOLUTION_IS_IMPORTER_LISTENER (listener));
- g_return_if_fail (callback != NULL);
-
- priv = listener->priv;
- priv->callback = callback;
- priv->closure = closure;
-}
-
-/**
- * evolution_importer_listener_new
- * @callback: The #EvolutionImporterListenerCallback callback.
- * @closure: The data that will be passed to that callback.
- *
- * Creates a new #EvolutionImporterListener object which calls @callback when
- * something happens.
- * Returns: A newly allocated #EvolutionImporterListener.
- */
-EvolutionImporterListener *
-evolution_importer_listener_new (EvolutionImporterListenerCallback callback,
- void *closure)
-{
- EvolutionImporterListener *listener;
-
- listener = gtk_type_new (evolution_importer_listener_get_type ());
-
- evolution_importer_listener_construct (listener, callback, closure);
- return listener;
-}
-
-BONOBO_X_TYPE_FUNC_FULL (EvolutionImporterListener,
- GNOME_Evolution_ImporterListener,
- PARENT_TYPE, evolution_importer_listener);
diff --git a/shell/importer/evolution-importer-listener.h b/shell/importer/evolution-importer-listener.h
deleted file mode 100644
index e61fdb3465..0000000000
--- a/shell/importer/evolution-importer-listener.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-importer-listener.h
- *
- * Copyright (C) 2000 Ximian, 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: Iain Holmes <iain@ximian.com>
- */
-
-#ifndef EVOLUTION_IMPORTER_LISTENER_H
-#define EVOLUTION_IMPORTER_LISTENER_H
-
-#include <bonobo/bonobo-xobject.h>
-#include <importer/GNOME_Evolution_Importer.h>
-#include "evolution-importer.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* cplusplus */
-
-#define EVOLUTION_TYPE_IMPORTER_LISTENER (evolution_importer_listener_get_type ())
-#define EVOLUTION_IMPORTER_LISTENER(obj) (GTK_CHECK_CAST ((obj), EVOLUTION_TYPE_IMPORTER_LISTENER, EvolutionImporterListener))
-#define EVOLUTION_IMPORTER_LISTENER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_IMPORTER_LISTENER, EvolutionImporterListenerClass))
-#define EVOLUTION_IS_IMPORTER_LISTENER(obj) (GTK_CHECK_TYPE ((obj), EVOLUTION_TYPE_IMPORTER_LISTENER))
-#define EVOLUTION_IS_IMPORTER_LISTENER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EVOLUTION_TYPE_IMPORTER_LISTENER))
-
-typedef struct _EvolutionImporterListener EvolutionImporterListener;
-typedef struct _EvolutionImporterListenerPrivate EvolutionImporterListenerPrivate;
-typedef struct _EvolutionImporterListenerClass EvolutionImporterListenerClass;
-
-typedef void (* EvolutionImporterListenerCallback) (EvolutionImporterListener *listener,
- EvolutionImporterResult result,
- gboolean more_items,
- void *closure);
-struct _EvolutionImporterListener {
- BonoboXObject parent;
-
- EvolutionImporterListenerPrivate *priv;
-};
-
-struct _EvolutionImporterListenerClass {
- BonoboXObjectClass parent_class;
-
- POA_GNOME_Evolution_ImporterListener__epv epv;
-};
-
-GtkType evolution_importer_listener_get_type (void);
-
-EvolutionImporterListener *evolution_importer_listener_new (EvolutionImporterListenerCallback callback,
- void *closure);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/shell/importer/evolution-importer.c b/shell/importer/evolution-importer.c
deleted file mode 100644
index af3acf487b..0000000000
--- a/shell/importer/evolution-importer.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-importer.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: Iain Holmes <iain@helixcode.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo/bonobo-object.h>
-#include <gal/util/e-util.h>
-
-#include "GNOME_Evolution_Importer.h"
-#include "evolution-importer.h"
-
-
-#define PARENT_TYPE BONOBO_X_OBJECT_TYPE
-static BonoboObjectClass *parent_class = NULL;
-
-struct _EvolutionImporterPrivate {
- EvolutionImporterLoadFileFn load_file_fn;
- EvolutionImporterSupportFormatFn support_format_fn;
- EvolutionImporterProcessItemFn process_item_fn;
- EvolutionImporterGetErrorFn get_error_fn;
-
- void *closure;
-};
-
-
-static inline EvolutionImporter *
-evolution_importer_from_servant (PortableServer_Servant servant)
-{
- return EVOLUTION_IMPORTER (bonobo_object_from_servant (servant));
-}
-
-static CORBA_boolean
-impl_GNOME_Evolution_Importer_supportFormat (PortableServer_Servant servant,
- const CORBA_char *filename,
- CORBA_Environment *ev)
-{
- EvolutionImporter *importer;
- EvolutionImporterPrivate *priv;
-
- importer = evolution_importer_from_servant (servant);
- priv = importer->priv;
-
- if (priv->support_format_fn != NULL)
- return (priv->support_format_fn) (importer, filename,
- priv->closure);
- else
- return FALSE;
-}
-
-static CORBA_boolean
-impl_GNOME_Evolution_Importer_loadFile (PortableServer_Servant servant,
- const CORBA_char *filename,
- const CORBA_char *folderpath,
- CORBA_Environment *ev)
-{
- EvolutionImporter *importer;
- EvolutionImporterPrivate *priv;
-
- importer = evolution_importer_from_servant (servant);
- priv = importer->priv;
-
- if (priv->load_file_fn != NULL)
- return (priv->load_file_fn) (importer, filename,
- folderpath, priv->closure);
- else
- return FALSE;
-}
-
-static void
-impl_GNOME_Evolution_Importer_processItem (PortableServer_Servant servant,
- GNOME_Evolution_ImporterListener listener,
- CORBA_Environment *ev)
-{
- EvolutionImporter *importer;
- EvolutionImporterPrivate *priv;
-
- importer = evolution_importer_from_servant (servant);
- priv = importer->priv;
-
- if (priv->process_item_fn != NULL)
- (priv->process_item_fn) (importer, listener, priv->closure, ev);
- else
- GNOME_Evolution_ImporterListener_notifyResult (listener,
- GNOME_Evolution_ImporterListener_UNSUPPORTED_OPERATION, FALSE, ev);
-}
-
-static CORBA_char *
-impl_GNOME_Evolution_Importer_getError (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- EvolutionImporter *importer;
- EvolutionImporterPrivate *priv;
- CORBA_char *out_str;
-
- importer = evolution_importer_from_servant (servant);
- priv = importer->priv;
-
- if (priv->get_error_fn != NULL) {
- out_str = (priv->get_error_fn) (importer, priv->closure);
- return CORBA_string_dup (out_str ? out_str : "");
- } else
- return CORBA_string_dup ("");
-}
-
-
-static void
-destroy (GtkObject *object)
-{
- EvolutionImporter *importer;
- EvolutionImporterPrivate *priv;
-
- importer = EVOLUTION_IMPORTER (object);
- priv = importer->priv;
-
- if (priv == NULL)
- return;
-
- g_free (priv);
- importer->priv = NULL;
-
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-static void
-evolution_importer_class_init (EvolutionImporterClass *klass)
-{
- GtkObjectClass *object_class;
- POA_GNOME_Evolution_Importer__epv *epv = &klass->epv;
-
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = destroy;
-
- parent_class = gtk_type_class (PARENT_TYPE);
- epv->supportFormat = impl_GNOME_Evolution_Importer_supportFormat;
- epv->loadFile = impl_GNOME_Evolution_Importer_loadFile;
- epv->processItem = impl_GNOME_Evolution_Importer_processItem;
- epv->getError = impl_GNOME_Evolution_Importer_getError;
-}
-
-static void
-evolution_importer_init (EvolutionImporter *importer)
-{
- EvolutionImporterPrivate *priv;
-
- priv = g_new0 (EvolutionImporterPrivate, 1);
-
- importer->priv = priv;
-}
-
-
-
-static void
-evolution_importer_construct (EvolutionImporter *importer,
- EvolutionImporterSupportFormatFn support_format_fn,
- EvolutionImporterLoadFileFn load_file_fn,
- EvolutionImporterProcessItemFn process_item_fn,
- EvolutionImporterGetErrorFn get_error_fn,
- void *closure)
-{
- EvolutionImporterPrivate *priv;
-
- g_return_if_fail (importer != NULL);
- g_return_if_fail (EVOLUTION_IS_IMPORTER (importer));
- g_return_if_fail (support_format_fn != NULL);
- g_return_if_fail (load_file_fn != NULL);
- g_return_if_fail (process_item_fn != NULL);
-
- priv = importer->priv;
- priv->support_format_fn = support_format_fn;
- priv->load_file_fn = load_file_fn;
- priv->process_item_fn = process_item_fn;
- priv->get_error_fn = get_error_fn;
-
- priv->closure = closure;
-}
-
-/**
- * evolution_importer_new:
- * @support_format_fn: The function to be called by the supportFormat method.
- * @load_file_fn: The function to be called by the loadFile method.
- * @process_item_fn: The function to be called by the processItem method.
- * @get_error_fn: The function to be called by the getError method.
- * @closure: The data to be passed to all of the above functions.
- *
- * Creates a new EvolutionImporter object. Of the parameters only
- * @get_error_function and @closure may be #NULL.
- *
- * Returns: A newly created EvolutionImporter object.
- */
-EvolutionImporter *
-evolution_importer_new (EvolutionImporterSupportFormatFn support_format_fn,
- EvolutionImporterLoadFileFn load_file_fn,
- EvolutionImporterProcessItemFn process_item_fn,
- EvolutionImporterGetErrorFn get_error_fn,
- void *closure)
-{
- EvolutionImporter *importer;
-
- importer = gtk_type_new (evolution_importer_get_type ());
- evolution_importer_construct (importer, support_format_fn, load_file_fn,
- process_item_fn, get_error_fn, closure);
- return importer;
-}
-
-BONOBO_X_TYPE_FUNC_FULL (EvolutionImporter,
- GNOME_Evolution_Importer,
- PARENT_TYPE,
- evolution_importer);
diff --git a/shell/importer/evolution-importer.h b/shell/importer/evolution-importer.h
deleted file mode 100644
index 3df870bbf3..0000000000
--- a/shell/importer/evolution-importer.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-importer.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: Iain Holmes <iain@helixcode.com>
- */
-
-#ifndef EVOLUTION_IMPORTER_H
-#define EVOLUTION_IMPORTER_H
-
-#include <bonobo/bonobo-xobject.h>
-#include <importer/GNOME_Evolution_Importer.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* cplusplus */
-
-#define EVOLUTION_TYPE_IMPORTER (evolution_importer_get_type ())
-#define EVOLUTION_IMPORTER(obj) (GTK_CHECK_CAST ((obj), EVOLUTION_TYPE_IMPORTER, EvolutionImporter))
-#define EVOLUTION_IMPORTER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_IMPORTER, EvolutionImporterClass))
-#define EVOLUTION_IS_IMPORTER(obj) (GTK_CHECK_TYPE ((obj), EVOLUTION_TYPE_IMPORTER))
-#define EVOLUTION_IS_IMPORTER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EVOLUTION_TYPE_IMPORTER))
-
-typedef struct _EvolutionImporter EvolutionImporter;
-typedef struct _EvolutionImporterPrivate EvolutionImporterPrivate;
-typedef struct _EvolutionImporterClass EvolutionImporterClass;
-
-typedef gboolean (* EvolutionImporterSupportFormatFn) (EvolutionImporter *importer,
- const char *filename,
- void *closure);
-typedef gboolean (* EvolutionImporterLoadFileFn) (EvolutionImporter *importer,
- const char *filename,
- const char *folderpath,
- void *closure);
-typedef void (* EvolutionImporterProcessItemFn) (EvolutionImporter *importer,
- CORBA_Object listener,
- void *closure,
- CORBA_Environment *ev);
-typedef char *(* EvolutionImporterGetErrorFn) (EvolutionImporter *importer,
- void *closure);
-
-typedef enum {
- EVOLUTION_IMPORTER_OK,
- EVOLUTION_IMPORTER_UNSUPPORTED_OPERATION,
- EVOLUTION_IMPORTER_INTERRUPTED,
- EVOLUTION_IMPORTER_BUSY,
- EVOLUTION_IMPORTER_NOT_READY,
- EVOLUTION_IMPORTER_UNKNOWN_DATA,
- EVOLUTION_IMPORTER_BAD_DATA,
- EVOLUTION_IMPORTER_BAD_FILE,
- EVOLUTION_IMPORTER_UNKNOWN_ERROR
-} EvolutionImporterResult;
-
-struct _EvolutionImporter {
- BonoboXObject parent;
-
- EvolutionImporterPrivate *priv;
-};
-
-struct _EvolutionImporterClass {
- BonoboXObjectClass parent_class;
-
- POA_GNOME_Evolution_Importer__epv epv;
-};
-
-GtkType evolution_importer_get_type (void);
-
-EvolutionImporter *evolution_importer_new (EvolutionImporterSupportFormatFn support_format_fn,
- EvolutionImporterLoadFileFn load_file_fn,
- EvolutionImporterProcessItemFn process_item_fn,
- EvolutionImporterGetErrorFn get_error_fn,
- void *closure);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/shell/importer/evolution-intelligent-importer.c b/shell/importer/evolution-intelligent-importer.c
deleted file mode 100644
index 0149d48f97..0000000000
--- a/shell/importer/evolution-intelligent-importer.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-intelligent-importer.c
- *
- * Copyright (C) 2000, 2001 Ximian, 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: Iain Holmes <iain@ximian.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo/bonobo-object.h>
-
-#include "GNOME_Evolution_Importer.h"
-#include "evolution-intelligent-importer.h"
-
-
-#define PARENT_TYPE BONOBO_X_OBJECT_TYPE
-static BonoboObjectClass *parent_class = NULL;
-
-struct _EvolutionIntelligentImporterPrivate {
- EvolutionIntelligentImporterCanImportFn can_import_fn;
- EvolutionIntelligentImporterImportDataFn import_data_fn;
-
- char *importername;
- char *message;
- void *closure;
-};
-
-
-static inline EvolutionIntelligentImporter *
-evolution_intelligent_importer_from_servant (PortableServer_Servant servant)
-{
- return EVOLUTION_INTELLIGENT_IMPORTER (bonobo_object_from_servant (servant));
-}
-
-static CORBA_char *
-impl_GNOME_Evolution_IntelligentImporter__get_importername (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- EvolutionIntelligentImporter *ii;
-
- ii = evolution_intelligent_importer_from_servant (servant);
-
- return CORBA_string_dup (ii->priv->importername ?
- ii->priv->importername : "");
-}
-
-static CORBA_char *
-impl_GNOME_Evolution_IntelligentImporter__get_message (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- EvolutionIntelligentImporter *ii;
-
- ii = evolution_intelligent_importer_from_servant (servant);
-
- return CORBA_string_dup (ii->priv->message ?
- ii->priv->message : "");
-}
-
-static CORBA_boolean
-impl_GNOME_Evolution_IntelligentImporter_canImport (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- EvolutionIntelligentImporter *ii;
- EvolutionIntelligentImporterPrivate *priv;
-
- ii = evolution_intelligent_importer_from_servant (servant);
- priv = ii->priv;
-
- if (priv->can_import_fn != NULL)
- return (priv->can_import_fn) (ii, priv->closure);
- else
- return FALSE;
-}
-
-static void
-impl_GNOME_Evolution_IntelligentImporter_importData (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- EvolutionIntelligentImporter *ii;
- EvolutionIntelligentImporterPrivate *priv;
-
- ii = evolution_intelligent_importer_from_servant (servant);
- priv = ii->priv;
-
- if (priv->import_data_fn)
- (priv->import_data_fn) (ii, priv->closure);
-}
-
-
-static void
-destroy (GtkObject *object)
-{
- EvolutionIntelligentImporter *ii;
-
- ii = EVOLUTION_INTELLIGENT_IMPORTER (object);
-
- if (ii->priv == NULL)
- return;
-
- g_free (ii->priv->importername);
- g_free (ii->priv);
- ii->priv = NULL;
-
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-static void
-evolution_intelligent_importer_class_init (EvolutionIntelligentImporterClass *klass)
-{
- GtkObjectClass *object_class;
- POA_GNOME_Evolution_IntelligentImporter__epv *epv = &klass->epv;
-
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = destroy;
-
- parent_class = gtk_type_class (PARENT_TYPE);
- epv->_get_importername = impl_GNOME_Evolution_IntelligentImporter__get_importername;
- epv->_get_message = impl_GNOME_Evolution_IntelligentImporter__get_message;
- epv->canImport = impl_GNOME_Evolution_IntelligentImporter_canImport;
- epv->importData = impl_GNOME_Evolution_IntelligentImporter_importData;
-}
-
-static void
-evolution_intelligent_importer_init (EvolutionIntelligentImporter *ii)
-{
- ii->priv = g_new0 (EvolutionIntelligentImporterPrivate, 1);
-}
-
-
-static void
-evolution_intelligent_importer_construct (EvolutionIntelligentImporter *ii,
- EvolutionIntelligentImporterCanImportFn can_import_fn,
- EvolutionIntelligentImporterImportDataFn import_data_fn,
- const char *importername,
- const char *message,
- void *closure)
-{
- g_return_if_fail (ii != NULL);
- ii->priv->importername = g_strdup (importername);
- ii->priv->message = g_strdup (message);
-
- ii->priv->can_import_fn = can_import_fn;
- ii->priv->import_data_fn = import_data_fn;
- ii->priv->closure = closure;
-}
-
-/**
- * evolution_intelligent_importer_new:
- * can_import_fn: The function that will be called to see if this importer can do
- * anything.
- * import_data_fn: The function that will be called when the importer should
- * import the data.
- * importername: The name of this importer.
- * message: The message that will be displayed when the importer can import.
- * closure: The data to be passed to @can_import_fn and @import_data_fn.
- *
- * Creates a new IntelligentImporter.
- *
- * Returns: A newly allocated EvolutionIntelligentImporter.
- */
-EvolutionIntelligentImporter *
-evolution_intelligent_importer_new (EvolutionIntelligentImporterCanImportFn can_import_fn,
- EvolutionIntelligentImporterImportDataFn import_data_fn,
- const char *importername,
- const char *message,
- void *closure)
-{
- EvolutionIntelligentImporter *ii;
-
- ii = gtk_type_new (evolution_intelligent_importer_get_type ());
- evolution_intelligent_importer_construct (ii, can_import_fn,
- import_data_fn, importername,
- message, closure);
- return ii;
-}
-
-BONOBO_X_TYPE_FUNC_FULL (EvolutionIntelligentImporter,
- GNOME_Evolution_IntelligentImporter,
- PARENT_TYPE,
- evolution_intelligent_importer);
diff --git a/shell/importer/evolution-intelligent-importer.h b/shell/importer/evolution-intelligent-importer.h
deleted file mode 100644
index 1714a2a046..0000000000
--- a/shell/importer/evolution-intelligent-importer.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-intelligent-importer.h
- *
- * Copyright (C) 2000 Ximian, 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: Iain Holmes <iain@ximian.com>
- */
-
-#ifndef EVOLUTION_INTELLIGENT_IMPORTER_H
-#define EVOLUTION_INTELLIGENT_IMPORTER_H
-
-#include <bonobo/bonobo-xobject.h>
-#include <importer/GNOME_Evolution_Importer.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define EVOLUTION_TYPE_INTELLIGENT_IMPORTER (evolution_intelligent_importer_get_type ())
-#define EVOLUTION_INTELLIGENT_IMPORTER(obj) (GTK_CHECK_CAST ((obj), EVOLUTION_TYPE_INTELLIGENT_IMPORTER, EvolutionIntelligentImporter))
-#define EVOLUTION_INTELLIGENT_IMPORTER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_INTELLIGENT_IMPORTER, EvolutionIntelligentImporterClass))
-#define EVOLUTION_IS_INTELLIGENT_IMPORTER(obj) (GTK_CHECK_TYPE ((obj), EVOLUTION_TYPE_INTELLIGENT_IMPORTER))
-#define EVOLUTION_IS_INTELLIGENT_IMPORTER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EVOLUTION_TYPE_INTELLIGENT_IMPORTER))
-
-typedef struct _EvolutionIntelligentImporter EvolutionIntelligentImporter;
-typedef struct _EvolutionIntelligentImporterPrivate EvolutionIntelligentImporterPrivate;
-typedef struct _EvolutionIntelligentImporterClass EvolutionIntelligentImporterClass;
-
-typedef gboolean (* EvolutionIntelligentImporterCanImportFn) (EvolutionIntelligentImporter *ii,
- void *closure);
-typedef void (* EvolutionIntelligentImporterImportDataFn) (EvolutionIntelligentImporter *ii,
- void *closure);
-
-struct _EvolutionIntelligentImporter {
- BonoboXObject parent;
-
- EvolutionIntelligentImporterPrivate *priv;
-};
-
-struct _EvolutionIntelligentImporterClass {
- BonoboXObjectClass parent_class;
-
- POA_GNOME_Evolution_IntelligentImporter__epv epv;
-};
-
-GtkType evolution_intelligent_importer_get_type (void);
-
-EvolutionIntelligentImporter *evolution_intelligent_importer_new (EvolutionIntelligentImporterCanImportFn can_import_fn,
- EvolutionIntelligentImporterImportDataFn import_data_fn,
- const char *importername,
- const char *message,
- void *closure);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/shell/importer/import.glade b/shell/importer/import.glade
deleted file mode 100644
index b540129d27..0000000000
--- a/shell/importer/import.glade
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0"?>
-<GTK-Interface>
-
-<project>
- <name>import</name>
- <program_name>import</program_name>
- <directory></directory>
- <source_directory>.</source_directory>
- <pixmaps_directory>../../art</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>
-</project>
-
-<widget>
- <class>GtkWindow</class>
- <name>importwizard</name>
- <visible>False</visible>
- <title>Evolution Importer Utility</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>GnomeDruid</class>
- <name>druid1</name>
-
- <widget>
- <class>GnomeDruidPageStart</class>
- <name>page1</name>
- <title>Evolution Import Utility</title>
- <text>Welcome to the Evolution Import Utility.
-With this wizard you will be guided through the process of
-importing external files into Evolution.</text>
- <title_color>1,1,1</title_color>
- <text_color>0,0,0</text_color>
- <background_color>153,174,191</background_color>
- <logo_background_color>255,255,255</logo_background_color>
- <textbox_color>255,255,255</textbox_color>
- <logo_image>../../images/evolution/import.png</logo_image>
- </widget>
-
- <widget>
- <class>GnomeDruidPageStandard</class>
- <name>page2</name>
- <title>Select a file</title>
- <title_color>1,1,1</title_color>
- <background_color>153,174,191</background_color>
- <logo_background_color>255,255,255</logo_background_color>
- <logo_image>../../images/evolution/import.png</logo_image>
-
- <widget>
- <class>GtkVBox</class>
- <child_name>GnomeDruidPageStandard:vbox</child_name>
- <name>druid-vbox1</name>
- <homogeneous>False</homogeneous>
- <spacing>0</spacing>
- <child>
- <padding>0</padding>
- <expand>True</expand>
- <fill>True</fill>
- </child>
-
- <widget>
- <class>Placeholder</class>
- </widget>
- </widget>
- </widget>
-
- <widget>
- <class>GnomeDruidPageFinish</class>
- <name>page3</name>
- <title>Import</title>
- <text>Click &quot;Import&quot; to begin importing the file into Evolution. </text>
- <background_color>153,174,191</background_color>
- <logo_background_color>255,255,255</logo_background_color>
- <textbox_color>255,255,255</textbox_color>
- <text_color>0,0,0</text_color>
- <title_color>1,1,1</title_color>
- <logo_image>../../images/evolution/import.png</logo_image>
- </widget>
- </widget>
-</widget>
-
-</GTK-Interface>
diff --git a/shell/importer/importer.c b/shell/importer/importer.c
deleted file mode 100644
index e7163cf329..0000000000
--- a/shell/importer/importer.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* importer.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: Iain Holmes <iain@helixcode.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <libgnome/gnome-defs.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-druid.h>
-#include <libgnomeui/gnome-druid-page-finish.h>
-#include <libgnomeui/gnome-druid-page-standard.h>
-#include <libgnomeui/gnome-druid-page-start.h>
-#include <libgnomeui/gnome-file-entry.h>
-#include <libgnomeui/gnome-stock.h>
-
-#include <liboaf/liboaf.h>
-
-#include <evolution-importer-client.h>
-
-#include <glade/glade.h>
-#include <gtkhtml/gtkhtml.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <e-util/e-html-utils.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <gal/widgets/e-unicode.h>
-
-#include "importer.h"
-#include "GNOME_Evolution_Importer.h"
-
-typedef struct _ImportDialogFilePage {
- GtkWidget *vbox;
- GtkWidget *filename;
- GtkWidget *filetype;
- GtkWidget *menu;
-
- gboolean need_filename;
-} ImportDialogFilePage;
-
-typedef struct _ImportData {
- GladeXML *wizard;
- GtkWidget *dialog;
- GtkWidget *druid;
- ImportDialogFilePage *filepage;
- GtkWidget *filedialog;
- GtkWidget *vbox;
-
- char *choosen_iid;
-} ImportData;
-
-#define IMPORTER_DEBUG
-#ifdef IMPORTER_DEBUG
-#define IN g_print ("=====> %s (%d)\n", __FUNCTION__, __LINE__)
-#define OUT g_print ("<==== %s (%d)\n", __FUNCTION__, __LINE__)
-#else
-#define IN
-#define OUT
-#endif
-
-/* Some HTML helper functions copied from mail/mail-config-druid.c */
-static struct {
- char *name;
- char *text;
-} info[] = {
- { "file_html",
- N_("Choose the file that you want to import into Evolution, "
- "and select what type of file it is from the list.\n\n"
- "You can select \"Automatic\" if you do not know, and "
- "Evolution will attempt to work it out.")
- }
-};
-static int num_info = (sizeof (info) / sizeof (info[0]));
-
-static void
-html_size_req (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- requisition->height = GTK_LAYOUT (widget)->height;
-}
-
-static GtkWidget *
-create_html (const char *name)
-{
- GtkWidget *scrolled, *html;
- GtkHTMLStream *stream;
- GtkStyle *style;
- char *utf8;
- int i;
-
- html = gtk_html_new ();
- GTK_LAYOUT (html)->height = 0;
- gtk_signal_connect (GTK_OBJECT (html), "size_request",
- GTK_SIGNAL_FUNC (html_size_req), NULL);
- gtk_html_set_editable (GTK_HTML (html), FALSE);
- style = gtk_rc_get_style (html);
- if (!style)
- style = gtk_widget_get_style (html);
- if (style) {
- gtk_html_set_default_background_color (GTK_HTML (html),
- &style->bg[0]);
- }
- gtk_widget_show (html);
-
- scrolled = gtk_scrolled_window_new (NULL, NULL);
- gtk_widget_show (scrolled);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
- GTK_POLICY_NEVER, GTK_POLICY_NEVER);
- gtk_container_add (GTK_CONTAINER (scrolled), html);
-
- for (i = 0; i < num_info; i++) {
- if (!strcmp (name, info[i].name))
- break;
- }
- g_return_val_if_fail (i != num_info, scrolled);
-
- stream = gtk_html_begin_content (GTK_HTML (html),
- "text/html; charset=utf-8");
- gtk_html_write (GTK_HTML (html), stream, "<html><p>", 9);
- utf8 = e_utf8_from_locale_string (_(info[i].text));
- gtk_html_write (GTK_HTML (html), stream, utf8, strlen (utf8));
- g_free (utf8);
- gtk_html_write (GTK_HTML (html), stream, "</p></html>", 11);
- gtk_html_end (GTK_HTML (html), stream, GTK_HTML_STREAM_OK);
-
- return scrolled;
-}
-
-/* Importing functions */
-
-/* Data to be passed around */
-typedef struct _ImporterComponentData {
- EvolutionImporterClient *client;
- EvolutionImporterListener *listener;
- char *filename;
-
- GnomeDialog *dialog;
- GtkWidget *contents;
-
- int item;
-
- gboolean stop;
- gboolean destroyed;
-} ImporterComponentData;
-
-static gboolean importer_timeout_fn (gpointer data);
-static void
-import_cb (EvolutionImporterListener *listener,
- EvolutionImporterResult result,
- gboolean more_items,
- void *data)
-{
- ImporterComponentData *icd = (ImporterComponentData *) data;
- char *label;
-
- IN;
- if (icd->stop != TRUE) {
- if (result == EVOLUTION_IMPORTER_NOT_READY) {
- /* Importer isn't ready yet.
- Wait 5 seconds and try again. */
-
- label = g_strdup_printf (_("Importing %s\nImporter not ready."
- "\nWaiting 5 seconds to retry."),
- icd->filename);
- gtk_label_set_text (GTK_LABEL (icd->contents), label);
- g_free (label);
- while (gtk_events_pending ())
- gtk_main_iteration ();
-
- gtk_timeout_add (5000, importer_timeout_fn, data);
- OUT;
- return;
- }
-
- if (result == EVOLUTION_IMPORTER_BUSY) {
- gtk_timeout_add (5000, importer_timeout_fn, data);
- OUT;
- return;
- }
-
- if (more_items) {
- label = g_strdup_printf (_("Importing %s\nImporting item %d."),
- icd->filename, ++(icd->item));
- gtk_label_set_text (GTK_LABEL (icd->contents), label);
- g_free (label);
- while (gtk_events_pending ())
- gtk_main_iteration ();
-
- g_idle_add_full (G_PRIORITY_LOW, importer_timeout_fn,
- data, NULL);
- OUT;
- return;
- }
- }
-
- g_free (icd->filename);
- if (!icd->destroyed)
- gtk_object_destroy (GTK_OBJECT (icd->dialog));
- bonobo_object_unref (BONOBO_OBJECT (icd->listener));
- bonobo_object_unref (BONOBO_OBJECT (icd->client));
- g_free (icd);
-
- OUT;
-}
-
-static gboolean
-importer_timeout_fn (gpointer data)
-{
- ImporterComponentData *icd = (ImporterComponentData *) data;
- char *label;
-
- IN;
- label = g_strdup_printf (_("Importing %s\nImporting item %d."),
- icd->filename, icd->item);
- gtk_label_set_text (GTK_LABEL (icd->contents), label);
- g_free (label);
- while (gtk_events_pending ())
- gtk_main_iteration ();
-
- evolution_importer_client_process_item (icd->client, icd->listener);
- OUT;
- return FALSE;
-}
-
-static void
-dialog_clicked_cb (GnomeDialog *dialog,
- int button_number,
- ImporterComponentData *icd)
-{
- if (button_number != 0)
- return; /* Interesting... */
-
- icd->stop = TRUE;
-}
-
-static void
-dialog_destroy_cb (GtkObject *object,
- ImporterComponentData *icd)
-{
- icd->stop = TRUE;
- icd->destroyed = TRUE;
-}
-
-static char *
-get_iid_for_filetype (const char *filename)
-{
- OAF_ServerInfoList *info_list;
- CORBA_Environment ev;
- GList *can_handle = NULL, *l;
- char *ret_iid;
- int i, len = 0;
-
- CORBA_exception_init (&ev);
- info_list = oaf_query ("repo_ids.has ('IDL:GNOME/Evolution/Importer:1.0')", NULL, &ev);
-
- for (i = 0; i < info_list->_length; i++) {
- CORBA_Environment ev2;
- CORBA_Object importer;
- const OAF_ServerInfo *info;
-
- info = info_list->_buffer + i;
-
- CORBA_exception_init (&ev2);
- importer = oaf_activate_from_id ((char *) info->iid, 0, NULL, &ev2);
- if (ev2._major != CORBA_NO_EXCEPTION) {
- g_warning ("Error activating %s", info->iid);
- CORBA_exception_free (&ev2);
- continue;
- }
-
- if (GNOME_Evolution_Importer_supportFormat (importer,
- filename, &ev2)) {
- can_handle = g_list_prepend (can_handle,
- g_strdup (info->iid));
- len++;
- }
-
- bonobo_object_release_unref (importer, &ev2);
- CORBA_exception_free (&ev2);
- }
-
- if (len == 1) {
- ret_iid = can_handle->data;
- g_list_free (can_handle);
- return ret_iid;
- } else if (len > 1) {
- /* FIXME: Some way to choose between multiple iids */
- /* FIXME: Free stuff */
- g_warning ("Multiple iids can support %s", filename);
- ret_iid = g_strdup (can_handle->data);
-
- for (l = can_handle; l; l = l->next)
- g_free (l->data);
- g_list_free (can_handle);
- return ret_iid;
- } else {
- return NULL;
- }
-}
-
-static void
-start_import (const char *filename,
- const char *iid)
-{
- ImporterComponentData *icd;
- char *label;
- char *real_iid;
-
- if (iid == NULL || strcmp (iid, "Automatic") == 0) {
- /* Work out the component to use */
- real_iid = get_iid_for_filetype (filename);
- } else {
- real_iid = g_strdup (iid);
- }
-
- g_print ("Importing with: %s\n", real_iid);
-
- if (real_iid == NULL) {
- char *message;
-
- message = g_strdup_printf (_("There is no importer that is able to handle\n%s"), filename);
- e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, message);
- g_free (message);
-
- return;
- }
-
- icd = g_new (ImporterComponentData, 1);
- icd->stop = FALSE;
- icd->destroyed = FALSE;
- icd->dialog = GNOME_DIALOG (gnome_dialog_new (_("Importing"),
- GNOME_STOCK_BUTTON_CANCEL,
- NULL));
- gtk_signal_connect (GTK_OBJECT (icd->dialog), "clicked",
- GTK_SIGNAL_FUNC (dialog_clicked_cb), icd);
- gtk_signal_connect (GTK_OBJECT (icd->dialog), "destroy",
- GTK_SIGNAL_FUNC (dialog_destroy_cb), icd);
-
- label = g_strdup_printf (_("Importing %s.\nStarting %s"),
- filename, real_iid);
- icd->contents = gtk_label_new (label);
- g_free (label);
-
- gtk_box_pack_start (GTK_BOX (icd->dialog->vbox), icd->contents,
- TRUE, TRUE, 0);
- gtk_widget_show_all (GTK_WIDGET (icd->dialog));
- while (gtk_events_pending ())
- gtk_main_iteration ();
-
- icd->client = evolution_importer_client_new_from_id (real_iid);
- if (icd->client == NULL) {
- label = g_strdup_printf (_("Error starting %s"), real_iid);
- g_free (real_iid);
- gtk_label_set_text (GTK_LABEL (icd->contents), label);
- g_free (label);
- while (gtk_events_pending ())
- gtk_main_iteration ();
-
- gtk_object_unref (GTK_OBJECT (icd->dialog));
- g_free (icd);
- return;
- }
- g_free (real_iid);
-
- /* NULL for folderpath means use Inbox */
- if (evolution_importer_client_load_file (icd->client, filename, NULL) == FALSE) {
- label = g_strdup_printf (_("Error loading %s"), filename);
- gtk_label_set_text (GTK_LABEL (icd->contents), label);
- g_free (label);
- while (gtk_events_pending ())
- gtk_main_iteration ();
-
- bonobo_object_unref (BONOBO_OBJECT (icd->client));
- gtk_object_unref (GTK_OBJECT (icd->dialog));
- g_free (icd);
- return;
- }
-
- icd->filename = g_strdup (filename);
- icd->item = 1;
-
- label = g_strdup_printf (_("Importing %s\nImporting item 1."),
- filename);
- gtk_label_set_text (GTK_LABEL (icd->contents), label);
- g_free (label);
- while (gtk_events_pending ())
- gtk_main_iteration ();
-
- icd->listener = evolution_importer_listener_new (import_cb, icd);
- evolution_importer_client_process_item (icd->client, icd->listener);
-}
-
-static void
-filename_changed (GtkEntry *entry,
- ImportData *data)
-{
- ImportDialogFilePage *page;
- char *filename;
-
- page = data->filepage;
-
- filename = gtk_entry_get_text (entry);
- if (filename != NULL && *filename != '\0')
- page->need_filename = FALSE;
- else
- page->need_filename = TRUE;
-
- gnome_druid_set_buttons_sensitive (GNOME_DRUID (data->druid),
- TRUE, !page->need_filename, TRUE);
-}
-
-static const char *
-get_name_from_component_info (const OAF_ServerInfo *info)
-{
- OAF_Property *property;
- const char *name;
-
- property = oaf_server_info_prop_find ((OAF_ServerInfo *) info,
- "evolution:menu-name");
- if (property == NULL || property->v._d != OAF_P_STRING)
- return NULL;
-
- name = property->v._u.value_string;
-
- return name;
-}
-
-static void
-item_selected (GtkWidget *item,
- ImportData *data)
-{
- char *iid;
-
- g_free (data->choosen_iid);
- iid = gtk_object_get_data (GTK_OBJECT (item), "oafiid");
- g_print ("iid: %s\n", iid);
- if (iid == NULL)
- data->choosen_iid = g_strdup ("Automatic");
- else
- data->choosen_iid = g_strdup (iid);
-}
-
-static GtkWidget *
-create_plugin_menu (ImportData *data)
-{
- OAF_ServerInfoList *info_list;
- CORBA_Environment ev;
- int i;
- GtkWidget *menu;
- GtkWidget *item;
-
- menu = gtk_menu_new ();
- item = gtk_menu_item_new_with_label (_("Automatic"));
- gtk_object_set_data_full (GTK_OBJECT (item), "oafiid",
- g_strdup ("Automatic"), g_free);
- gtk_menu_append (GTK_MENU (menu), item);
-
- CORBA_exception_init (&ev);
- info_list = oaf_query ("repo_ids.has ('IDL:GNOME/Evolution/Importer:1.0')", NULL, &ev);
- for (i = 0; i < info_list->_length; i++) {
- const OAF_ServerInfo *info;
- char *name = NULL;
-
- info = info_list->_buffer + i;
-
- name = g_strdup (get_name_from_component_info (info));
- if (name == NULL) {
- name = g_strdup (info->iid);
- }
-
- item = gtk_menu_item_new_with_label (name);
- g_free (name);
-
- gtk_signal_connect (GTK_OBJECT (item), "activate",
- GTK_SIGNAL_FUNC (item_selected), data);
-
- gtk_object_set_data_full (GTK_OBJECT (item), "oafiid",
- g_strdup (info->iid), g_free);
- gtk_menu_append (GTK_MENU (menu), item);
- }
-
- return menu;
-}
-
-static ImportDialogFilePage *
-importer_file_page_new (ImportData *data)
-{
- ImportDialogFilePage *page;
- GtkWidget *table, *label;
- int row = 0;
-
- page = g_new0 (ImportDialogFilePage, 1);
-
- page->vbox = gtk_vbox_new (FALSE, 5);
- page->need_filename = TRUE;
-
- table = gtk_table_new (2, 2, FALSE);
- gtk_table_set_row_spacings (GTK_TABLE (table), 2);
- gtk_table_set_col_spacings (GTK_TABLE (table), 10);
- gtk_container_set_border_width (GTK_CONTAINER (table), 8);
- gtk_box_pack_start (GTK_BOX (page->vbox), table, TRUE, TRUE, 0);
-
- label = gtk_label_new (_("Filename:"));
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row + 1,
- GTK_FILL, 0, 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
-
- page->filename = gnome_file_entry_new (NULL, _("Select a file"));
- gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (page->filename))),
- "changed", GTK_SIGNAL_FUNC (filename_changed),
- data);
-
- gtk_table_attach (GTK_TABLE (table), page->filename, 1, 2,
- row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
-
- row++;
-
- label = gtk_label_new (_("File type:"));
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row + 1,
- GTK_FILL, 0, 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
-
- page->filetype = gtk_option_menu_new ();
- page->menu = create_plugin_menu (data);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (page->filetype), page->menu);
-
- gtk_table_attach (GTK_TABLE (table), page->filetype, 1, 2,
- row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
- gtk_widget_show_all (table);
-
- return page;
-}
-
-static void
-import_druid_cancel (GnomeDruid *druid,
- ImportData *data)
-{
- gtk_widget_destroy (GTK_WIDGET (data->dialog));
-}
-
-static void
-import_druid_destroy (GtkObject *object,
- ImportData *data)
-{
- gtk_object_unref (GTK_OBJECT (data->wizard));
- g_free (data->choosen_iid);
- g_free (data);
-}
-
-static void
-import_druid_finish (GnomeDruidPage *page,
- GnomeDruid *druid,
- ImportData *data)
-{
- char *filename;
- char *iid;
-
- filename = g_strdup (gtk_entry_get_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (data->filepage->filename)))));
- iid = g_strdup (data->choosen_iid);
-
- gtk_widget_destroy (data->dialog);
- start_import (filename, iid);
-
- g_free (filename);
- g_free (iid);
-}
-
-static gboolean
-prepare_file_page (GnomeDruidPage *page,
- GnomeDruid *druid,
- ImportData *data)
-{
- g_print ("Prepare thyself\n");
- gnome_druid_set_buttons_sensitive (druid, TRUE,
- !data->filepage->need_filename,
- TRUE);
- return FALSE;
-}
-
-/* Hack to change the Finish button */
-static void
-druid_finish_button_change (GnomeDruid *druid)
-{
- GtkWidget *button = druid->finish;
- GtkWidget *hbox = GTK_BIN (button)->child, *hbox2;
- GtkBoxChild *child;
- GtkWidget *label;
-
- /* Get the second item from the children list */
- hbox2 = ((GtkBoxChild *)GTK_BOX (hbox)->children->data)->widget;
-
- g_return_if_fail (GTK_IS_BOX (hbox2));
- child = (GtkBoxChild *)g_list_nth_data (GTK_BOX (hbox2)->children, 0);
- label = child->widget;
-
- /* Safety check :) */
- g_return_if_fail (GTK_IS_LABEL (label));
-
- gtk_label_set_text (GTK_LABEL (label), _("Import"));
-}
-
-void
-show_import_wizard (BonoboUIComponent *component,
- gpointer user_data,
- const char *cname)
-{
- ImportData *data = g_new0 (ImportData, 1);
- GnomeDruidPageStart *start;
- GnomeDruidPageFinish *finish;
- GtkWidget *html;
-
- data->wizard = glade_xml_new (EVOLUTION_GLADEDIR "/import.glade", NULL);
- data->dialog = glade_xml_get_widget (data->wizard, "importwizard");
- gtk_window_set_wmclass (GTK_WINDOW (data->dialog), "importdruid",
- "Evolution:shell");
-
- data->druid = glade_xml_get_widget (data->wizard, "druid1");
- gtk_signal_connect (GTK_OBJECT (data->druid), "cancel",
- GTK_SIGNAL_FUNC (import_druid_cancel), data);
-
- druid_finish_button_change (GNOME_DRUID (data->druid));
- start = GNOME_DRUID_PAGE_START (glade_xml_get_widget (data->wizard, "page1"));
- data->filedialog = glade_xml_get_widget (data->wizard, "page2");
- gtk_signal_connect (GTK_OBJECT (data->filedialog), "prepare",
- GTK_SIGNAL_FUNC (prepare_file_page), data);
-
- finish = GNOME_DRUID_PAGE_FINISH (glade_xml_get_widget (data->wizard, "page3"));
-
- data->filepage = importer_file_page_new (data);
- data->vbox = data->filepage->vbox;
-
- html = create_html ("file_html");
- gtk_box_pack_start (GTK_BOX (data->vbox), html, FALSE, TRUE, 0);
- gtk_box_reorder_child (GTK_BOX (data->vbox), html, 0);
-
- gtk_box_pack_start (GTK_BOX (GNOME_DRUID_PAGE_STANDARD (data->filedialog)->vbox), data->vbox, TRUE, TRUE, 0);
-
- /* Finish page */
- gtk_signal_connect (GTK_OBJECT (finish), "finish",
- GTK_SIGNAL_FUNC (import_druid_finish), data);
- gtk_signal_connect (GTK_OBJECT (data->dialog), "destroy",
- GTK_SIGNAL_FUNC (import_druid_destroy), data);
-
- gtk_widget_show_all (data->dialog);
-}
diff --git a/shell/importer/importer.h b/shell/importer/importer.h
deleted file mode 100644
index 644ff62866..0000000000
--- a/shell/importer/importer.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* importer.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: Iain Holmes <iain@helixcode.com>
- */
-
-#include <bonobo/bonobo-ui-component.h>
-
-#ifndef __IMPORTER_H__
-#define __IMPORTER_H__
-
-void show_import_wizard (BonoboUIComponent *component,
- gpointer user_data,
- const char *cname);
-
-#endif
diff --git a/shell/importer/intelligent.c b/shell/importer/intelligent.c
deleted file mode 100644
index 24d903d6f3..0000000000
--- a/shell/importer/intelligent.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* intelligent.c
- *
- * Authors:
- * Iain Holmes <iain@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (http://www.ximian.com)
- *
- * 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
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtkbox.h>
-#include <gtk/gtkcheckbutton.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtkobject.h>
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtkwindow.h>
-
-#include <libgnome/gnome-defs.h>
-#include <libgnome/gnome-config.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeui/gnome-stock.h>
-
-#include <liboaf/liboaf.h>
-
-#include "intelligent.h"
-#include "GNOME_Evolution_Importer.h"
-
-/* Prototypes */
-
-void intelligent_importer_init (void);
-
-/* End prototypes */
-
-static void
-start_importer (const char *iid)
-{
- CORBA_Object importer;
- CORBA_Environment ev;
- CORBA_char *name;
- CORBA_char *message;
- CORBA_boolean can_run;
-
- GtkWidget *dialog, *label, *ask;
- gboolean dontaskagain;
- char *str, *prefix;
-
- if (iid == NULL || *iid == '\0')
- return;
-
- /* Check if we want to show this one again */
- prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", gnome_util_user_home ());
- gnome_config_push_prefix (prefix);
- g_free (prefix);
-
- dontaskagain = gnome_config_get_bool (iid);
- gnome_config_pop_prefix ();
-
- if (dontaskagain)
- return;
-
- CORBA_exception_init (&ev);
- importer = oaf_activate_from_id ((char *) iid, 0, NULL, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- CORBA_exception_free (&ev);
- g_warning ("Could not start %s", iid);
- return;
- }
-
- CORBA_exception_free (&ev);
- if (importer == CORBA_OBJECT_NIL) {
- g_warning ("Could not activate_component %s", iid);
- return;
- }
-
- CORBA_exception_init (&ev);
- can_run = GNOME_Evolution_IntelligentImporter_canImport (importer, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Could not get canImport(%s): %s", iid, CORBA_exception_id (&ev));
- CORBA_Object_release (importer, &ev);
- CORBA_exception_free (&ev);
- return;
- }
- CORBA_exception_free (&ev);
-
- if (can_run == FALSE) {
- return;
- }
-
- name = GNOME_Evolution_IntelligentImporter__get_importername (importer,
- &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Could not get name(%s): %s", iid, CORBA_exception_id (&ev));
- CORBA_Object_release (importer, &ev);
- CORBA_exception_free (&ev);
- return;
- }
- message = GNOME_Evolution_IntelligentImporter__get_message (importer, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Could not get message(%s): %s", iid, CORBA_exception_id (&ev));
- CORBA_Object_release (importer, &ev);
- CORBA_exception_free (&ev);
- return;
- }
-
- CORBA_exception_free (&ev);
-
- dialog = gnome_dialog_new ("Import files",
- GNOME_STOCK_BUTTON_YES, GNOME_STOCK_BUTTON_NO,
- NULL);
- gtk_window_set_title (GTK_WINDOW (dialog), name);
- CORBA_free (name);
-
- label = gtk_label_new (message);
- CORBA_free (message);
-
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label,
- FALSE, FALSE, 0);
- gtk_widget_show (label);
-
- ask = gtk_check_button_new_with_label (_("Don't ask me again"));
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), ask,
- FALSE, FALSE, 0);
- gtk_widget_show (ask);
-
- switch (gnome_dialog_run (GNOME_DIALOG (dialog))) {
- case 0:
- /* Yes */
- dontaskagain = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ask));
- prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", gnome_util_user_home ());
- gnome_config_push_prefix (prefix);
- g_free (prefix);
-
- gnome_config_set_bool (iid, dontaskagain);
- gnome_config_sync ();
- gnome_config_drop_all ();
-
- gnome_config_pop_prefix ();
-
- gtk_object_destroy (GTK_OBJECT (dialog));
- while (gtk_events_pending ())
- gtk_main_iteration ();
-
- GNOME_Evolution_IntelligentImporter_importData (importer, &ev);
- break;
- case 1:
- case -1:
- default:
- /* No */
- dontaskagain = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ask));
- prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", gnome_util_user_home ());
- gnome_config_push_prefix (prefix);
- g_free (prefix);
-
- gnome_config_set_bool (iid, dontaskagain);
- gnome_config_sync ();
- gnome_config_drop_all ();
-
- gnome_config_pop_prefix ();
-
- gtk_object_destroy (GTK_OBJECT (dialog));
-
- break;
- }
-
- CORBA_exception_init (&ev);
- CORBA_Object_release (importer, &ev);
- CORBA_exception_free (&ev);
-}
-
-
-static GList *
-get_intelligent_importers (void)
-{
- OAF_ServerInfoList *info_list;
- GList *iids_ret = NULL;
- CORBA_Environment ev;
- int i;
-
- CORBA_exception_init (&ev);
- info_list = oaf_query ("repo_ids.has ('IDL:GNOME/Evolution/IntelligentImporter:1.0')", NULL, &ev);
- CORBA_exception_free (&ev);
-
- for (i = 0; i < info_list->_length; i++) {
- const OAF_ServerInfo *info;
-
- info = info_list->_buffer + i;
- iids_ret = g_list_prepend (iids_ret, g_strdup (info->iid));
- }
-
- return iids_ret;
-}
-
-void
-intelligent_importer_init (void)
-{
- GList *importers, *l;
-
- importers = get_intelligent_importers ();
- if (importers == NULL)
- return; /* No intelligent importers. Easy :) */
-
- /* Loop through each importer, running it. */
- for (l = importers; l; l = l->next) {
- start_importer (l->data);
- g_free (l->data);
- }
-
- g_list_free (importers);
-}
-
diff --git a/shell/importer/intelligent.h b/shell/importer/intelligent.h
deleted file mode 100644
index 8d528f5e77..0000000000
--- a/shell/importer/intelligent.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* importer.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: Kjartan Maraas <kmaraas@gnome.org>
- */
-
-#ifndef __INTELLIGENT_H__
-#define __INTELLIGENT_H__
-
-void intelligent_importer_init (void);
-
-#endif