diff options
author | Milan Crha <mcrha@redhat.com> | 2009-08-14 06:52:21 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-08-14 06:52:21 +0800 |
commit | 260c0c8e1eabeefd3d364f62114b4aa8d2b0028e (patch) | |
tree | 946e070d0b3784a032632bc2f24f5928cc33799c | |
parent | ff3e7d4f75898b5854618203d4ee675dca2c38af (diff) | |
download | gsoc2013-evolution-260c0c8e1eabeefd3d364f62114b4aa8d2b0028e.tar gsoc2013-evolution-260c0c8e1eabeefd3d364f62114b4aa8d2b0028e.tar.gz gsoc2013-evolution-260c0c8e1eabeefd3d364f62114b4aa8d2b0028e.tar.bz2 gsoc2013-evolution-260c0c8e1eabeefd3d364f62114b4aa8d2b0028e.tar.lz gsoc2013-evolution-260c0c8e1eabeefd3d364f62114b4aa8d2b0028e.tar.xz gsoc2013-evolution-260c0c8e1eabeefd3d364f62114b4aa8d2b0028e.tar.zst gsoc2013-evolution-260c0c8e1eabeefd3d364f62114b4aa8d2b0028e.zip |
Bug 567260 – Migrate from GnomeDruid to GtkAssistant
-rw-r--r-- | e-util/e-import.c | 4 | ||||
-rw-r--r-- | plugins/groupwise-features/install-shared.c | 45 | ||||
-rw-r--r-- | shell/Makefile.am | 4 | ||||
-rw-r--r-- | shell/e-shell-importer.c | 291 | ||||
-rw-r--r-- | shell/import.glade | 124 |
5 files changed, 162 insertions, 306 deletions
diff --git a/e-util/e-import.c b/e-util/e-import.c index 6f4c5947b4..0c10715ce3 100644 --- a/e-util/e-import.c +++ b/e-util/e-import.c @@ -29,10 +29,6 @@ #include <gtk/gtk.h> -#include <libgnomeui/gnome-druid.h> -#include <libgnomeui/gnome-druid-page-standard.h> -#include <libgnomeui/gnome-druid-page-edge.h> - #include "e-import.h" #include <glib/gi18n.h> diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index d78a73f5a2..1725835b5f 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -27,8 +27,6 @@ #include <string.h> #include <glib.h> #include <gtk/gtk.h> -#include <libgnomeui/gnome-druid.h> -#include <libgnomeui/gnome-druid-page-edge.h> #include <glib/gi18n.h> #include <gconf/gconf-client.h> #include <e-util/e-config.h> @@ -154,7 +152,7 @@ accept_free(gpointer data) } static void -accept_clicked(GnomeDruidPage *page, GtkWidget *druid, CamelMimeMessage *msg) +apply_clicked (GtkAssistant *assistant, CamelMimeMessage *msg) { EMFolderTreeModel *model; EMFolderTree *folder_tree; @@ -175,11 +173,10 @@ accept_clicked(GnomeDruidPage *page, GtkWidget *druid, CamelMimeMessage *msg) accept_data->model = model; g_object_set_data_full((GObject *)dialog, "accept-data", accept_data, accept_free); g_signal_connect (dialog, "response", G_CALLBACK (install_folder_response), accept_data); - g_object_set_data_full((GObject *)dialog, "druid", druid, (GDestroyNotify)gtk_widget_destroy); + g_object_set_data_full((GObject *)dialog, "assistant", assistant, (GDestroyNotify)gtk_widget_destroy); gtk_window_set_title (GTK_WINDOW (dialog), "Install Shared Folder"); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); gtk_widget_show (dialog); - } void @@ -189,8 +186,6 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) const gchar *name; const gchar *email; GtkWidget *window; - GnomeDruid *wizard; - GnomeDruidPageEdge *title_page; CamelMimeMessage *msg = (CamelMimeMessage *) target->message; CamelStreamMem *content; CamelDataWrapper *dw; @@ -217,20 +212,36 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) from_addr = camel_mime_message_get_from ((CamelMimeMessage *)target->message); if (from_addr && camel_internet_address_get(from_addr, 0, &name, &email)) { + GtkWidget *page; + GtkAssistant *assistant = GTK_ASSISTANT (gtk_assistant_new ()); + start_message = g_strdup_printf (_("The user '%s' has shared a folder with you\n\n" "Message from '%s'\n\n\n" "%s\n\n\n" - "Click 'Forward' to install the shared folder\n\n"), + "Click 'Apply' to install the shared folder\n\n"), name, name, content->buffer->data); - title_page = GNOME_DRUID_PAGE_EDGE (gnome_druid_page_edge_new_with_vals(GNOME_EDGE_START, TRUE, _("Install the shared folder"), start_message, NULL, NULL, NULL)); - g_free(start_message); - wizard = GNOME_DRUID (gnome_druid_new_with_window (_("Shared Folder Installation"), NULL, TRUE, (GtkWidget**)(&window))); - gtk_window_set_position (GTK_WINDOW (window) , GTK_WIN_POS_CENTER_ALWAYS); - gnome_druid_append_page(wizard, GNOME_DRUID_PAGE(title_page)); - gtk_widget_show_all (GTK_WIDGET (title_page)); - camel_object_ref(msg); - g_object_set_data_full((GObject *)title_page, "msg", msg, camel_object_unref); - g_signal_connect (title_page, "next", G_CALLBACK(accept_clicked), msg); + + page = gtk_label_new (start_message); + gtk_label_set_line_wrap (GTK_LABEL (page), TRUE); + gtk_misc_set_alignment (GTK_MISC (page), 0.0, 0.0); + gtk_misc_set_padding (GTK_MISC (page), 10, 10); + + gtk_assistant_append_page (assistant, page); + gtk_assistant_set_page_title (assistant, page, _("Install the shared folder")); + gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONFIRM); + gtk_assistant_set_page_complete (assistant, page, TRUE); + + gtk_window_set_title (GTK_WINDOW (assistant), _("Shared Folder Installation")); + gtk_window_set_position (GTK_WINDOW (assistant) , GTK_WIN_POS_CENTER_ALWAYS); + + camel_object_ref (msg); + g_object_set_data_full((GObject *)page, "msg", msg, camel_object_unref); + + g_signal_connect (assistant, "apply", G_CALLBACK (apply_clicked), msg); + + gtk_widget_show_all (GTK_WIDGET (assistant)); + + g_free (start_message); } else g_warning ("Could not get the sender name"); diff --git a/shell/Makefile.am b/shell/Makefile.am index 877d4c83bc..5923bbb8f9 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -145,9 +145,6 @@ error_DATA = shell.error errordir = $(privdatadir)/errors @EVO_PLUGIN_RULE@ -glade_DATA = \ - import.glade - # GConf schemas schemadir = $(GCONF_SCHEMA_FILE_DIR) @@ -180,7 +177,6 @@ endif EXTRA_DIST = \ shell.error.xml \ - $(glade_DATA) \ $(schema_in_files) \ ChangeLog.pre-1-4 \ evolution-nognome.in \ diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c index 0c9b6f8924..6f3471d8dd 100644 --- a/shell/e-shell-importer.c +++ b/shell/e-shell-importer.c @@ -34,10 +34,6 @@ #include <glib/gi18n.h> -#include <libgnomeui/gnome-druid.h> -#include <libgnomeui/gnome-druid-page-edge.h> -#include <libgnomeui/gnome-druid-page-standard.h> - #include "misc/e-gui-utils.h" #include "e-util/e-dialog-utils.h" @@ -83,9 +79,7 @@ typedef struct _ImportDialogImporterPage { typedef struct _ImportData { EShellWindow *window; - GladeXML *wizard; - GtkWidget *dialog; - GtkWidget *druid; + GtkWidget *assistant; ImportDialogFilePage *filepage; ImportDialogDestPage *destpage; ImportDialogTypePage *typepage; @@ -95,8 +89,6 @@ typedef struct _ImportData { GtkWidget *typedialog; GtkWidget *destdialog; GtkWidget *intelligent; - GnomeDruidPageEdge *start; - GnomeDruidPageEdge *finish; GtkWidget *vbox; EImport *import; @@ -235,7 +227,7 @@ filename_changed (GtkWidget *widget, } } - gnome_druid_set_buttons_sensitive(GNOME_DRUID (data->druid), TRUE, fileok, TRUE, FALSE); + gtk_assistant_set_page_complete (GTK_ASSISTANT (data->assistant), page->vbox, fileok); } static void @@ -304,6 +296,8 @@ importer_file_page_new (ImportData *data) row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_label_set_mnemonic_widget(GTK_LABEL(label), page->filetype); + gtk_container_set_border_width (GTK_CONTAINER (page->vbox), 10); + gtk_widget_show_all (table); return page; @@ -318,6 +312,8 @@ importer_dest_page_new (ImportData *data) page->vbox = gtk_vbox_new (FALSE, 5); + gtk_container_set_border_width (GTK_CONTAINER (page->vbox), 10); + return page; } @@ -335,7 +331,10 @@ importer_type_page_new (ImportData *data) page->file = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (page->intelligent), _("Import a _single file")); gtk_box_pack_start (GTK_BOX (page->vbox), page->file, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (page->vbox), 10); + gtk_widget_show_all (page->vbox); + return page; } @@ -353,23 +352,25 @@ importer_importer_page_new (ImportData *data) sep = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (page->vbox), sep, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (page->vbox), 10); + gtk_widget_show_all (page->vbox); return page; } -static gboolean -prepare_intelligent_page (GnomeDruidPage *dpage, - GnomeDruid *druid, - ImportData *data) +static void +prepare_intelligent_page (GtkAssistant *assistant, GtkWidget *apage, ImportData *data) { GSList *l; GtkWidget *table; gint row; ImportDialogImporterPage *page = data->importerpage; - if (page->target != NULL) - return FALSE; + if (page->target != NULL) { + gtk_assistant_set_page_complete (assistant, apage, FALSE); + return; + } page->target = e_import_target_new_home(data->import, g_get_home_dir()); @@ -379,8 +380,8 @@ prepare_intelligent_page (GnomeDruidPage *dpage, if (l == NULL) { gtk_box_pack_start(GTK_BOX (data->importerpage->vbox), create_help("nodata_html"), FALSE, TRUE, 0); - gnome_druid_set_buttons_sensitive(druid, TRUE, FALSE, TRUE, FALSE); - return TRUE; + gtk_assistant_set_page_complete (assistant, apage, FALSE); + return; } table = gtk_table_new(g_slist_length(l), 2, FALSE); @@ -408,33 +409,30 @@ prepare_intelligent_page (GnomeDruidPage *dpage, gtk_widget_show(table); gtk_box_pack_start((GtkBox *)data->importerpage->vbox, table, FALSE, FALSE, 0); - return FALSE; + gtk_assistant_set_page_complete (assistant, apage, TRUE); } static void -import_druid_cancel (GnomeDruid *druid, - ImportData *data) +import_assistant_cancel (GtkAssistant *assistant, ImportData *data) { if (data->import_dialog) gtk_dialog_response (GTK_DIALOG (data->import_dialog), GTK_RESPONSE_CANCEL); else - gtk_widget_destroy (GTK_WIDGET (data->dialog)); + gtk_widget_destroy (GTK_WIDGET (data->assistant)); } static gboolean -import_druid_esc (GnomeDruid *druid, - GdkEventKey *event, - ImportData *data) +import_assistant_esc (GtkAssistant *assistant, GdkEventKey *event, ImportData *data) { if (event->keyval == GDK_Escape) { - gtk_widget_destroy (GTK_WIDGET (data->dialog)); + gtk_widget_destroy (GTK_WIDGET (assistant)); return TRUE; } else return FALSE; } static void -import_druid_weak_notify (gpointer blah, +import_assistant_weak_notify (gpointer blah, GObject *where_the_object_was) { ImportData *data = (ImportData *) blah; @@ -442,8 +440,8 @@ import_druid_weak_notify (gpointer blah, if (data->import_dialog && (GObject *)data->import_dialog != where_the_object_was) { /* postpone freeing of 'data' after the 'import_dialog' will stop, but also indicate that the 'dialog' gone already */ - data->dialog = NULL; - g_object_weak_ref ((GObject *)data->import_dialog, import_druid_weak_notify, data); + data->assistant = NULL; + g_object_weak_ref ((GObject *)data->import_dialog, import_assistant_weak_notify, data); gtk_dialog_response (GTK_DIALOG (data->import_dialog), GTK_RESPONSE_CANCEL); return; } @@ -457,7 +455,6 @@ import_druid_weak_notify (gpointer blah, g_object_unref(data->import); - g_object_unref(data->wizard); g_free(data); } @@ -481,7 +478,7 @@ static void import_done(EImport *ei, gpointer d) { ImportData *data = d; - gboolean have_dialog = data->dialog != NULL; + gboolean have_dialog = data->assistant != NULL; gtk_widget_destroy (data->import_dialog); @@ -489,7 +486,7 @@ import_done(EImport *ei, gpointer d) on the above destroy call */ if (have_dialog) { data->import_dialog = NULL; - gtk_widget_destroy (data->dialog); + gtk_widget_destroy (data->assistant); } } @@ -508,9 +505,7 @@ import_intelligent_done(EImport *ei, gpointer d) } static void -import_druid_finish (GnomeDruidPage *page, - GnomeDruid *druid, - ImportData *data) +import_assistant_apply (GtkAssistant *assistant, ImportData *data) { EImportCompleteFunc done = NULL; gchar *msg = NULL; @@ -543,16 +538,14 @@ import_druid_finish (GnomeDruidPage *page, e_import_import(data->import, data->import_target, data->import_importer, import_status, import_done, data); } else { - gtk_widget_destroy(data->dialog); + gtk_widget_destroy(data->assistant); } g_free(msg); } -static gboolean -prepare_file_page (GnomeDruidPage *dpage, - GnomeDruid *druid, - ImportData *data) +static void +prepare_file_page (GtkAssistant *assistant, GtkWidget *apage, ImportData *data) { GSList *importers, *imp; GtkListStore *store; @@ -560,7 +553,7 @@ prepare_file_page (GnomeDruidPage *dpage, if (page->target != NULL) { filename_changed(data->filepage->filename, data); - return FALSE; + return; } page->target = e_import_target_new_uri(data->import, NULL, NULL); @@ -589,23 +582,10 @@ prepare_file_page (GnomeDruidPage *dpage, filename_changed (data->filepage->filename, data); g_signal_connect (page->filetype, "changed", G_CALLBACK (filetype_changed_cb), data); - - return FALSE; } static gboolean -next_file_page (GnomeDruidPage *page, - GnomeDruid *druid, - ImportData *data) -{ - /* We dont sensitise the next button if we're not already usable */ - return FALSE; -} - -static gboolean -prepare_dest_page (GnomeDruidPage *dpage, - GnomeDruid *druid, - ImportData *data) +prepare_dest_page (GtkAssistant *assistant, GtkWidget *apage, ImportData *data) { ImportDialogDestPage *page = data->destpage; @@ -619,174 +599,171 @@ prepare_dest_page (GnomeDruidPage *dpage, gtk_widget_show(page->control); } - gtk_box_pack_start((GtkBox *)data->destpage->vbox, page->control, TRUE, TRUE, 0); + gtk_box_pack_start ((GtkBox *)data->destpage->vbox, page->control, TRUE, TRUE, 0); + gtk_assistant_set_page_complete (assistant, apage, TRUE); return FALSE; } -static gboolean -next_dest_page (GnomeDruidPage *page, - GnomeDruid *druid, - ImportData *data) -{ - gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->finish)); - return TRUE; -} - -static gboolean -next_type_page (GnomeDruidPage *page, - GnomeDruid *druid, - ImportData *data) +static void +dialog_weak_notify (gpointer data, + GObject *where_the_dialog_was) { - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->typepage->intelligent))) { - gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->intelligent)); - } else { - gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->filedialog)); - } + gboolean *dialog_open = (gboolean *) data; - return TRUE; + *dialog_open = FALSE; } -static gboolean -back_finish_page (GnomeDruidPage *page, - GnomeDruid *druid, - ImportData *data) +enum { + PAGE_START, + PAGE_INTELI_OR_DIRECT, + PAGE_INTELI_SOURCE, + PAGE_FILE_CHOOSE, + PAGE_FILE_DEST, + PAGE_FINISH +}; + +static gint +forward_cb (gint current_page, gpointer user_data) { - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->typepage->intelligent))) { - gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->intelligent)); - } else { - gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->destdialog)); + ImportData *data = user_data; + + switch (current_page) { + case PAGE_INTELI_OR_DIRECT: + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->typepage->intelligent))) + return PAGE_INTELI_SOURCE; + else + return PAGE_FILE_CHOOSE; + case PAGE_INTELI_SOURCE: + return PAGE_FINISH; } - return TRUE; -} - -static gboolean -back_intelligent_page (GnomeDruidPage *page, - GnomeDruid *druid, - ImportData *data) -{ - gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->typedialog)); - return TRUE; + return current_page + 1; } static void -dialog_weak_notify (gpointer data, - GObject *where_the_dialog_was) +import_assistant_prepare (GtkAssistant *assistant, GtkWidget *page, gpointer user_data) { - gboolean *dialog_open = (gboolean *) data; - - *dialog_open = FALSE; + ImportData *data = user_data; + + if (page == data->importerpage->vbox) + prepare_intelligent_page (assistant, page, data); + else if (page == data->filepage->vbox) + prepare_file_page (assistant, page, data); + else if (page == data->destpage->vbox) + prepare_dest_page (assistant, page, data); } void e_shell_importer_start_import (EShellWindow *shell_window) { ImportData *data = g_new0 (ImportData, 1); - GtkWidget *html; + GtkWidget *html, *page; static gboolean dialog_open = FALSE; GdkPixbuf *icon; - gchar *gladefile; + GtkAssistant *assistant; if (dialog_open) { return; } - data->import = e_import_new("org.gnome.evolution.shell.importer"); + data->import = e_import_new ("org.gnome.evolution.shell.importer"); icon = e_icon_factory_get_icon ("stock_mail-import", GTK_ICON_SIZE_DIALOG); dialog_open = TRUE; data->window = shell_window; + data->assistant = gtk_assistant_new (); - gladefile = g_build_filename (EVOLUTION_GLADEDIR, "import.glade", NULL); - data->wizard = glade_xml_new (gladefile, NULL, NULL); - g_free (gladefile); - data->dialog = glade_xml_get_widget (data->wizard, "importwizard"); - gtk_window_set_default_size (GTK_WINDOW (data->dialog), 480, 320); - gtk_window_set_wmclass (GTK_WINDOW (data->dialog), "importdruid", - "Evolution:shell"); - e_dialog_set_transient_for (GTK_WINDOW (data->dialog), GTK_WIDGET (shell_window)); - g_object_weak_ref ((GObject *)data->dialog, dialog_weak_notify, &dialog_open); - - data->druid = glade_xml_get_widget (data->wizard, "druid1"); - g_signal_connect (data->druid, "cancel", - G_CALLBACK (import_druid_cancel), data); - g_signal_connect (data->druid, "key_press_event", - G_CALLBACK (import_druid_esc), data); - - gtk_button_set_use_underline ((GtkButton *)((GnomeDruid *)data->druid)->finish, TRUE); - gtk_button_set_label((GtkButton *)((GnomeDruid *)data->druid)->finish, _("_Import")); + assistant = GTK_ASSISTANT (data->assistant); /* Start page */ - data->start = GNOME_DRUID_PAGE_EDGE (glade_xml_get_widget (data->wizard, "page0")); - gnome_druid_page_edge_set_logo (data->start, icon); + page = gtk_label_new (""); + gtk_label_set_line_wrap (GTK_LABEL (page), TRUE); + gtk_misc_set_alignment (GTK_MISC (page), 0.0, 0.0); + gtk_misc_set_padding (GTK_MISC (page), 10, 10); + gtk_label_set_text (GTK_LABEL (page), _( + "Welcome to the Evolution Import Assistant.\n" + "With this assistant you will be guided through the process of importing external files into Evolution.")); + + gtk_assistant_append_page (assistant, page); + gtk_assistant_set_page_header_image (assistant, page, icon); + gtk_assistant_set_page_title (assistant, page, _("Evolution Import Assistant")); + gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_INTRO); + gtk_assistant_set_page_complete (assistant, page, TRUE); /* Intelligent or direct import page */ - data->typedialog = glade_xml_get_widget (data->wizard, "page1"); - gnome_druid_page_standard_set_logo (GNOME_DRUID_PAGE_STANDARD (data->typedialog), icon); - g_signal_connect (data->typedialog, "next", - G_CALLBACK (next_type_page), data); data->typepage = importer_type_page_new (data); html = create_help ("type_html"); gtk_box_pack_start (GTK_BOX (data->typepage->vbox), html, FALSE, TRUE, 0); gtk_box_reorder_child (GTK_BOX (data->typepage->vbox), html, 0); - gtk_box_pack_start (GTK_BOX (GNOME_DRUID_PAGE_STANDARD (data->typedialog)->vbox), data->typepage->vbox, TRUE, TRUE, 0); + page = data->typepage->vbox; + gtk_assistant_append_page (assistant, page); + gtk_assistant_set_page_header_image (assistant, page, icon); + gtk_assistant_set_page_title (assistant, page, _("Importer Type")); + gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); + gtk_assistant_set_page_complete (assistant, page, TRUE); /* Intelligent importer source page */ - data->intelligent = glade_xml_get_widget (data->wizard, "page2-intelligent"); - gnome_druid_page_standard_set_logo (GNOME_DRUID_PAGE_STANDARD (data->intelligent), icon); - g_signal_connect (data->intelligent, "back", - G_CALLBACK (back_intelligent_page), data); - g_signal_connect_after (data->intelligent, "prepare", - G_CALLBACK (prepare_intelligent_page), data); - data->importerpage = importer_importer_page_new (data); html = create_help ("intelligent_html"); gtk_box_pack_start (GTK_BOX (data->importerpage->vbox), html, FALSE, TRUE, 0); gtk_box_reorder_child (GTK_BOX (data->importerpage->vbox), html, 0); - gtk_box_pack_start (GTK_BOX (GNOME_DRUID_PAGE_STANDARD (data->intelligent)->vbox), data->importerpage->vbox, TRUE, TRUE, 0); + page = data->importerpage->vbox; + gtk_assistant_append_page (assistant, page); + gtk_assistant_set_page_header_image (assistant, page, icon); + gtk_assistant_set_page_title (assistant, page, _("Select Information to Import")); + gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); /* File selection and file type page */ - data->filedialog = glade_xml_get_widget (data->wizard, "page2-file"); - gnome_druid_page_standard_set_logo (GNOME_DRUID_PAGE_STANDARD (data->filedialog), icon); - g_signal_connect_after (data->filedialog, "prepare", - G_CALLBACK (prepare_file_page), data); - g_signal_connect (data->filedialog, "next", - G_CALLBACK (next_file_page), data); data->filepage = importer_file_page_new (data); - html = create_help ("file_html"); gtk_box_pack_start (GTK_BOX (data->filepage->vbox), html, FALSE, TRUE, 0); gtk_box_reorder_child (GTK_BOX (data->filepage->vbox), html, 0); - gtk_box_pack_start (GTK_BOX (GNOME_DRUID_PAGE_STANDARD (data->filedialog)->vbox), data->filepage->vbox, TRUE, TRUE, 0); + page = data->filepage->vbox; + gtk_assistant_append_page (assistant, page); + gtk_assistant_set_page_header_image (assistant, page, icon); + gtk_assistant_set_page_title (assistant, page, _("Select a File")); + gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); /* File destination page */ - data->destdialog = glade_xml_get_widget (data->wizard, "page3-file"); - g_signal_connect_after (data->destdialog, "prepare", - G_CALLBACK (prepare_dest_page), data); - g_signal_connect (data->destdialog, "next", - G_CALLBACK (next_dest_page), data); - data->destpage = importer_dest_page_new (data); - gtk_box_pack_start (GTK_BOX (GNOME_DRUID_PAGE_STANDARD (data->destdialog)->vbox), data->destpage->vbox, TRUE, TRUE, 0); + page = data->destpage->vbox; + gtk_assistant_append_page (assistant, page); + gtk_assistant_set_page_header_image (assistant, page, icon); + gtk_assistant_set_page_title (assistant, page, _("Import Location")); + gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); /* Finish page */ - data->finish = GNOME_DRUID_PAGE_EDGE (glade_xml_get_widget (data->wizard, "page4")); - gnome_druid_page_edge_set_logo (data->finish, icon); - g_signal_connect (data->finish, "back", - G_CALLBACK (back_finish_page), data); + page = gtk_label_new (""); + gtk_misc_set_alignment (GTK_MISC (page), 0.5, 0.5); + gtk_label_set_text (GTK_LABEL (page), _("Click \"Apply\" to begin importing the file into Evolution.")); + + gtk_assistant_append_page (assistant, page); + gtk_assistant_set_page_header_image (assistant, page, icon); + gtk_assistant_set_page_title (assistant, page, _("Import File")); + gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONFIRM); + gtk_assistant_set_page_complete (assistant, page, TRUE); - g_signal_connect (data->finish, "finish", - G_CALLBACK (import_druid_finish), data); + /* setup the rest */ + g_object_weak_ref ((GObject *)assistant, dialog_weak_notify, &dialog_open); - g_object_weak_ref ((GObject *)data->dialog, import_druid_weak_notify, data); + gtk_assistant_set_forward_page_func (assistant, forward_cb, data, NULL); + + g_signal_connect (assistant, "key_press_event", G_CALLBACK (import_assistant_esc), data); + g_signal_connect (assistant, "cancel", G_CALLBACK (import_assistant_cancel), data); + g_signal_connect (assistant, "prepare", G_CALLBACK (import_assistant_prepare), data); + g_signal_connect (assistant, "apply", G_CALLBACK (import_assistant_apply), data); + + g_object_weak_ref ((GObject *)assistant, import_assistant_weak_notify, data); g_object_unref (icon); - gtk_widget_show_all (data->dialog); + gtk_assistant_update_buttons_state (assistant); + + gtk_widget_show_all (data->assistant); } diff --git a/shell/import.glade b/shell/import.glade deleted file mode 100644 index 389d2feee3..0000000000 --- a/shell/import.glade +++ /dev/null @@ -1,124 +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"/> - -<widget class="GtkWindow" id="importwizard"> - <property name="title" translatable="yes">Evolution Import Assistant</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - - <child> - <widget class="GnomeDruid" id="druid1"> - <property name="border_width">4</property> - <property name="visible">True</property> - <property name="show_help">False</property> - - <child> - <widget class="GnomeDruidPageEdge" id="page0"> - <property name="visible">True</property> - <property name="position">GNOME_EDGE_START</property> - <property name="title" translatable="yes">Evolution Import Assistant</property> - <property name="text" translatable="yes">Welcome to the Evolution Import Assistant. -With this assistant you will be guided through the process of -importing external files into Evolution.</property> - </widget> - </child> - - <child> - <widget class="GnomeDruidPageStandard" id="page1"> - <property name="visible">True</property> - <property name="title" translatable="yes">Importer Type</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="druid-vbox2"> - <property name="border_width">16</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GnomeDruidPageStandard" id="page2-file"> - <property name="visible">True</property> - <property name="title" translatable="yes">Select a File</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="druid-vbox1"> - <property name="border_width">16</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GnomeDruidPageStandard" id="page3-file"> - <property name="visible">True</property> - <property name="title" translatable="yes">Import Location</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="druid-vbox3"> - <property name="border_width">16</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GnomeDruidPageStandard" id="page2-intelligent"> - <property name="visible">True</property> - <property name="title" translatable="yes">Select Information to Import</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="druid-vbox3"> - <property name="border_width">16</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GnomeDruidPageEdge" id="page4"> - <property name="visible">True</property> - <property name="position">GNOME_EDGE_FINISH</property> - <property name="title" translatable="yes">Import File</property> - <property name="text" translatable="yes">Click "Import" to begin importing the file into Evolution. </property> - </widget> - </child> - </widget> - </child> -</widget> - -</glade-interface> |