Ask for a folder to import into.
svn path=/trunk/; revision=9775
This commit is contained in:
@ -1,3 +1,19 @@
|
|||||||
|
2001-05-11 Iain Holmes <iain@ximian.com>
|
||||||
|
|
||||||
|
* e-shell-folder-selection-dialog.c (dbl_click_cb): Use gnome_dialog_close
|
||||||
|
instead of gtk_widget_destroy.
|
||||||
|
(impl_clicked): Use gnome_dialog_close instead of gtk_widget_destroy.
|
||||||
|
|
||||||
|
* e-shell-view-menu.c: #include e-shell-importer.h instead of importer/importer.h
|
||||||
|
|
||||||
|
* importer/Makefile.am: Remove importer.c and importer.h.
|
||||||
|
|
||||||
|
* importer/importer.[ch]: Moved these to e-shell-importer.[ch]
|
||||||
|
|
||||||
|
* e-shell-importer.c (start_import): Take a folderpath to import into.
|
||||||
|
(importer_druid_finish): Show the EShellFolderSelectionDialog to get a folder to
|
||||||
|
import into.
|
||||||
|
|
||||||
2001-05-11 JP Rosevear <jpr@ximian.com>
|
2001-05-11 JP Rosevear <jpr@ximian.com>
|
||||||
|
|
||||||
* e-component-registry.c (register_component): component_new refs
|
* e-component-registry.c (register_component): component_new refs
|
||||||
|
@ -102,6 +102,8 @@ evolution_SOURCES = \
|
|||||||
e-shell-folder-selection-dialog.h \
|
e-shell-folder-selection-dialog.h \
|
||||||
e-shell-folder-title-bar.c \
|
e-shell-folder-title-bar.c \
|
||||||
e-shell-folder-title-bar.h \
|
e-shell-folder-title-bar.h \
|
||||||
|
e-shell-importer.c \
|
||||||
|
e-shell-importer.h \
|
||||||
e-shell-offline-handler.c \
|
e-shell-offline-handler.c \
|
||||||
e-shell-offline-handler.h \
|
e-shell-offline-handler.h \
|
||||||
e-shell-utils.c \
|
e-shell-utils.c \
|
||||||
|
@ -162,7 +162,7 @@ dbl_click_cb (EStorageSetView *essv,
|
|||||||
e_shell_folder_selection_dialog_get_selected_path (folder_selection_dialog));
|
e_shell_folder_selection_dialog_get_selected_path (folder_selection_dialog));
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_destroy (GTK_WIDGET (folder_selection_dialog));
|
gnome_dialog_close (GNOME_DIALOG (folder_selection_dialog));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -185,12 +185,12 @@ impl_clicked (GnomeDialog *dialog,
|
|||||||
if (check_folder_type (folder_selection_dialog)) {
|
if (check_folder_type (folder_selection_dialog)) {
|
||||||
gtk_signal_emit (GTK_OBJECT (folder_selection_dialog), signals[FOLDER_SELECTED],
|
gtk_signal_emit (GTK_OBJECT (folder_selection_dialog), signals[FOLDER_SELECTED],
|
||||||
e_shell_folder_selection_dialog_get_selected_path (folder_selection_dialog));
|
e_shell_folder_selection_dialog_get_selected_path (folder_selection_dialog));
|
||||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
gnome_dialog_close (GNOME_DIALOG (dialog));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1: /* Cancel */
|
case 1: /* Cancel */
|
||||||
gtk_signal_emit (GTK_OBJECT (folder_selection_dialog), signals[CANCELLED]);
|
gtk_signal_emit (GTK_OBJECT (folder_selection_dialog), signals[CANCELLED]);
|
||||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
gnome_dialog_close (GNOME_DIALOG (dialog));
|
||||||
break;
|
break;
|
||||||
case 2: /* Add */
|
case 2: /* Add */
|
||||||
storage_set_view = E_STORAGE_SET_VIEW (priv->storage_set_view);
|
storage_set_view = E_STORAGE_SET_VIEW (priv->storage_set_view);
|
||||||
|
@ -34,10 +34,15 @@
|
|||||||
#include <libgnomeui/gnome-druid-page-start.h>
|
#include <libgnomeui/gnome-druid-page-start.h>
|
||||||
#include <libgnomeui/gnome-file-entry.h>
|
#include <libgnomeui/gnome-file-entry.h>
|
||||||
#include <libgnomeui/gnome-stock.h>
|
#include <libgnomeui/gnome-stock.h>
|
||||||
|
#include <libgnomeui/gnome-dialog.h>
|
||||||
|
|
||||||
#include <liboaf/liboaf.h>
|
#include <liboaf/liboaf.h>
|
||||||
|
|
||||||
#include <evolution-importer-client.h>
|
#include "e-shell.h"
|
||||||
|
#include "e-shell-view.h"
|
||||||
|
#include "e-shell-folder-selection-dialog.h"
|
||||||
|
|
||||||
|
#include "importer/evolution-importer-client.h"
|
||||||
|
|
||||||
#include <glade/glade.h>
|
#include <glade/glade.h>
|
||||||
#include <gtkhtml/gtkhtml.h>
|
#include <gtkhtml/gtkhtml.h>
|
||||||
@ -46,8 +51,8 @@
|
|||||||
#include <gal/widgets/e-gui-utils.h>
|
#include <gal/widgets/e-gui-utils.h>
|
||||||
#include <gal/widgets/e-unicode.h>
|
#include <gal/widgets/e-unicode.h>
|
||||||
|
|
||||||
#include "importer.h"
|
#include "e-shell-importer.h"
|
||||||
#include "GNOME_Evolution_Importer.h"
|
#include "importer/GNOME_Evolution_Importer.h"
|
||||||
|
|
||||||
typedef struct _ImportDialogFilePage {
|
typedef struct _ImportDialogFilePage {
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
@ -59,6 +64,9 @@ typedef struct _ImportDialogFilePage {
|
|||||||
} ImportDialogFilePage;
|
} ImportDialogFilePage;
|
||||||
|
|
||||||
typedef struct _ImportData {
|
typedef struct _ImportData {
|
||||||
|
EShell *shell;
|
||||||
|
EShellView *view;
|
||||||
|
|
||||||
GladeXML *wizard;
|
GladeXML *wizard;
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
GtkWidget *druid;
|
GtkWidget *druid;
|
||||||
@ -69,7 +77,9 @@ typedef struct _ImportData {
|
|||||||
char *choosen_iid;
|
char *choosen_iid;
|
||||||
} ImportData;
|
} ImportData;
|
||||||
|
|
||||||
#define IMPORTER_DEBUG
|
/*
|
||||||
|
#define IMPORTER_DEBUG
|
||||||
|
*/
|
||||||
#ifdef IMPORTER_DEBUG
|
#ifdef IMPORTER_DEBUG
|
||||||
#define IN g_print ("=====> %s (%d)\n", __FUNCTION__, __LINE__)
|
#define IN g_print ("=====> %s (%d)\n", __FUNCTION__, __LINE__)
|
||||||
#define OUT g_print ("<==== %s (%d)\n", __FUNCTION__, __LINE__)
|
#define OUT g_print ("<==== %s (%d)\n", __FUNCTION__, __LINE__)
|
||||||
@ -319,12 +329,14 @@ get_iid_for_filetype (const char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
start_import (const char *filename,
|
start_import (const char *folderpath,
|
||||||
|
const char *filename,
|
||||||
const char *iid)
|
const char *iid)
|
||||||
{
|
{
|
||||||
ImporterComponentData *icd;
|
ImporterComponentData *icd;
|
||||||
char *label;
|
char *label;
|
||||||
char *real_iid;
|
char *real_iid;
|
||||||
|
char *real_folderpath;
|
||||||
|
|
||||||
if (iid == NULL || strcmp (iid, "Automatic") == 0) {
|
if (iid == NULL || strcmp (iid, "Automatic") == 0) {
|
||||||
/* Work out the component to use */
|
/* Work out the component to use */
|
||||||
@ -383,7 +395,12 @@ start_import (const char *filename,
|
|||||||
g_free (real_iid);
|
g_free (real_iid);
|
||||||
|
|
||||||
/* NULL for folderpath means use Inbox */
|
/* NULL for folderpath means use Inbox */
|
||||||
if (evolution_importer_client_load_file (icd->client, filename, "/Inbox") == FALSE) {
|
g_warning ("Folderpath: %s", folderpath);
|
||||||
|
if (*folderpath == '/') {
|
||||||
|
real_folderpath = strchr (folderpath + 1, '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (evolution_importer_client_load_file (icd->client, filename, real_folderpath) == FALSE) {
|
||||||
label = g_strdup_printf (_("Error loading %s"), filename);
|
label = g_strdup_printf (_("Error loading %s"), filename);
|
||||||
gtk_label_set_text (GTK_LABEL (icd->contents), label);
|
gtk_label_set_text (GTK_LABEL (icd->contents), label);
|
||||||
g_free (label);
|
g_free (label);
|
||||||
@ -572,14 +589,34 @@ import_druid_finish (GnomeDruidPage *page,
|
|||||||
GnomeDruid *druid,
|
GnomeDruid *druid,
|
||||||
ImportData *data)
|
ImportData *data)
|
||||||
{
|
{
|
||||||
|
GtkWidget *folder;
|
||||||
char *filename;
|
char *filename;
|
||||||
char *iid;
|
char *iid;
|
||||||
|
char *foldername;
|
||||||
|
|
||||||
filename = g_strdup (gtk_entry_get_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (data->filepage->filename)))));
|
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);
|
iid = g_strdup (data->choosen_iid);
|
||||||
|
|
||||||
|
folder = e_shell_folder_selection_dialog_new (data->shell,
|
||||||
|
_("Select folder"),
|
||||||
|
e_shell_view_get_current_uri (data->view),
|
||||||
|
NULL);
|
||||||
gtk_widget_destroy (data->dialog);
|
gtk_widget_destroy (data->dialog);
|
||||||
start_import (filename, iid);
|
|
||||||
|
gnome_dialog_close_hides (GNOME_DIALOG (folder), TRUE);
|
||||||
|
switch (gnome_dialog_run (GNOME_DIALOG (folder))) {
|
||||||
|
case 0:
|
||||||
|
foldername = e_shell_folder_selection_dialog_get_selected_path (E_SHELL_FOLDER_SELECTION_DIALOG (folder));
|
||||||
|
foldername = g_strdup (foldername);
|
||||||
|
|
||||||
|
start_import (foldername, filename, iid);
|
||||||
|
g_free (foldername);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
gtk_widget_destroy (folder);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
g_free (iid);
|
g_free (iid);
|
||||||
@ -590,7 +627,6 @@ prepare_file_page (GnomeDruidPage *page,
|
|||||||
GnomeDruid *druid,
|
GnomeDruid *druid,
|
||||||
ImportData *data)
|
ImportData *data)
|
||||||
{
|
{
|
||||||
g_print ("Prepare thyself\n");
|
|
||||||
gnome_druid_set_buttons_sensitive (druid, TRUE,
|
gnome_druid_set_buttons_sensitive (druid, TRUE,
|
||||||
!data->filepage->need_filename,
|
!data->filepage->need_filename,
|
||||||
TRUE);
|
TRUE);
|
||||||
@ -629,6 +665,9 @@ show_import_wizard (BonoboUIComponent *component,
|
|||||||
GnomeDruidPageFinish *finish;
|
GnomeDruidPageFinish *finish;
|
||||||
GtkWidget *html;
|
GtkWidget *html;
|
||||||
|
|
||||||
|
data->view = E_SHELL_VIEW (user_data);
|
||||||
|
data->shell = e_shell_view_get_shell (data->view);
|
||||||
|
|
||||||
data->wizard = glade_xml_new (EVOLUTION_GLADEDIR "/import.glade", NULL);
|
data->wizard = glade_xml_new (EVOLUTION_GLADEDIR "/import.glade", NULL);
|
||||||
data->dialog = glade_xml_get_widget (data->wizard, "importwizard");
|
data->dialog = glade_xml_get_widget (data->wizard, "importwizard");
|
||||||
gtk_window_set_wmclass (GTK_WINDOW (data->dialog), "importdruid",
|
gtk_window_set_wmclass (GTK_WINDOW (data->dialog), "importdruid",
|
||||||
@ -644,7 +683,7 @@ show_import_wizard (BonoboUIComponent *component,
|
|||||||
gtk_signal_connect (GTK_OBJECT (data->filedialog), "prepare",
|
gtk_signal_connect (GTK_OBJECT (data->filedialog), "prepare",
|
||||||
GTK_SIGNAL_FUNC (prepare_file_page), data);
|
GTK_SIGNAL_FUNC (prepare_file_page), data);
|
||||||
|
|
||||||
finish = GNOME_DRUID_PAGE_FINISH (glade_xml_get_widget (data->wizard, "page3"));
|
finish = GNOME_DRUID_PAGE_FINISH (glade_xml_get_widget (data->wizard, "page4"));
|
||||||
|
|
||||||
data->filepage = importer_file_page_new (data);
|
data->filepage = importer_file_page_new (data);
|
||||||
data->vbox = data->filepage->vbox;
|
data->vbox = data->filepage->vbox;
|
@ -45,7 +45,7 @@
|
|||||||
#include "e-shell-constants.h"
|
#include "e-shell-constants.h"
|
||||||
|
|
||||||
#include "e-shell-view-menu.h"
|
#include "e-shell-view-menu.h"
|
||||||
#include "importer/importer.h"
|
#include "e-shell-importer.h"
|
||||||
|
|
||||||
#include "e-util/e-gui-utils.h"
|
#include "e-util/e-gui-utils.h"
|
||||||
|
|
||||||
|
@ -35,9 +35,7 @@ libevolution_importer_la_SOURCES = \
|
|||||||
evolution-importer-listener.c \
|
evolution-importer-listener.c \
|
||||||
evolution-importer.c \
|
evolution-importer.c \
|
||||||
intelligent.c \
|
intelligent.c \
|
||||||
intelligent.h \
|
intelligent.h
|
||||||
importer.c \
|
|
||||||
importer.h
|
|
||||||
|
|
||||||
libevolution_importerinclude_HEADERS = \
|
libevolution_importerinclude_HEADERS = \
|
||||||
GNOME_Evolution_Importer.h \
|
GNOME_Evolution_Importer.h \
|
||||||
|
Reference in New Issue
Block a user