r21653 - gnucash/trunk - Bug #664877 - Migrate Qif Import Druid to an Assistant

Geert Janssens gjanssens at code.gnucash.org
Fri Dec 2 15:55:44 EST 2011


Author: gjanssens
Date: 2011-12-02 15:55:43 -0500 (Fri, 02 Dec 2011)
New Revision: 21653
Trac: http://svn.gnucash.org/trac/changeset/21653

Added:
   gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c
   gnucash/trunk/src/import-export/qif-import/assistant-qif-import.glade
   gnucash/trunk/src/import-export/qif-import/assistant-qif-import.h
Removed:
   gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
   gnucash/trunk/src/import-export/qif-import/druid-qif-import.h
   gnucash/trunk/src/import-export/qif-import/qif.glade
Modified:
   gnucash/trunk/po/POTFILES.in
   gnucash/trunk/src/gnome/dialog-new-user.c
   gnucash/trunk/src/gnome/dialog-new-user.h
   gnucash/trunk/src/import-export/qif-import/Makefile.am
   gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c
   gnucash/trunk/src/import-export/qif-import/dialog-account-picker.h
   gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c
   gnucash/trunk/src/import-export/qif-import/gncmod-qif-import.c
Log:
Bug #664877 - Migrate Qif Import Druid to an Assistant
Patch by Robert Fewell

Modified: gnucash/trunk/po/POTFILES.in
===================================================================
--- gnucash/trunk/po/POTFILES.in	2011-12-02 11:09:16 UTC (rev 21652)
+++ gnucash/trunk/po/POTFILES.in	2011-12-02 20:55:43 UTC (rev 21653)
@@ -415,10 +415,10 @@
 src/import-export/ofx/gnc-plugin-ofx.c
 src/import-export/qif-import/dialog-account-picker.c
 src/import-export/qif-import/dialog-account-picker.glade
-src/import-export/qif-import/druid-qif-import.c
+src/import-export/qif-import/assistant-qif-import.c
 src/import-export/qif-import/gncmod-qif-import.c
 src/import-export/qif-import/gnc-plugin-qif-import.c
-src/import-export/qif-import/qif.glade
+src/import-export/qif-import/assistant-qif-import.glade
 src/import-export/qif-import/schemas/apps_gnucash_import_qif.schemas.in
 src/import-export/qif-io-core/gncmod-qifiocore.c
 src/import-export/qif/qif-context.c

Modified: gnucash/trunk/src/gnome/dialog-new-user.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-new-user.c	2011-12-02 11:09:16 UTC (rev 21652)
+++ gnucash/trunk/src/gnome/dialog-new-user.c	2011-12-02 20:55:43 UTC (rev 21653)
@@ -44,16 +44,16 @@
 /* This static indicates the debugging module that this .o belongs to.  */
 static QofLogModule log_module = GNC_MOD_GUI;
 
-/* function to open a qif import druid */
-static void (*qifImportDruidFcn)(void) = NULL;
+/* function to open a qif import assistant */
+static void (*qifImportAssistantFcn)(void) = NULL;
 
 static void gnc_ui_new_user_cancel_dialog (void);
 
 void
-gnc_new_user_dialog_register_qif_druid (void (*cb_fcn)(void))
+gnc_new_user_dialog_register_qif_assistant (void (*cb_fcn)(void))
 {
-    g_return_if_fail (qifImportDruidFcn == NULL);
-    qifImportDruidFcn = cb_fcn;
+    g_return_if_fail (qifImportAssistantFcn == NULL);
+    qifImportAssistantFcn = cb_fcn;
 }
 
 void
@@ -95,9 +95,9 @@
     tutorial_button = GTK_WIDGET(gtk_builder_get_object (builder, "tutorial_button"));
 
     /* Set the sensitivity of the qif-import button based on the availability
-     * of the qif-import druid.
+     * of the qif-import assistant.
      */
-    gtk_widget_set_sensitive (import_qif_button, (qifImportDruidFcn != NULL));
+    gtk_widget_set_sensitive (import_qif_button, (qifImportAssistantFcn != NULL));
 
     result = gtk_dialog_run (GTK_DIALOG (dialog));
     switch (result)
@@ -112,10 +112,10 @@
             gnc_ui_hierarchy_assistant_with_callback(TRUE, after_hierarchy_assistant);
             break;
         }
-        else if ((qifImportDruidFcn != NULL)
+        else if ((qifImportAssistantFcn != NULL)
                  && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (import_qif_button)))
         {
-            qifImportDruidFcn();
+            qifImportAssistantFcn();
             gncp_new_user_finish ();
             break;
         }

Modified: gnucash/trunk/src/gnome/dialog-new-user.h
===================================================================
--- gnucash/trunk/src/gnome/dialog-new-user.h	2011-12-02 11:09:16 UTC (rev 21652)
+++ gnucash/trunk/src/gnome/dialog-new-user.h	2011-12-02 20:55:43 UTC (rev 21653)
@@ -26,8 +26,8 @@
 void gnc_ui_new_user_dialog (void);
 void gnc_set_first_startup (gboolean first_startup);
 
-/* Register the qif-import druid */
-void gnc_new_user_dialog_register_qif_druid (void (*cb_fcn)(void));
+/* Register the qif-import assistant */
+void gnc_new_user_dialog_register_qif_assistant (void (*cb_fcn)(void));
 
 /* private */
 void gncp_new_user_finish (void);

Modified: gnucash/trunk/src/import-export/qif-import/Makefile.am
===================================================================
--- gnucash/trunk/src/import-export/qif-import/Makefile.am	2011-12-02 11:09:16 UTC (rev 21652)
+++ gnucash/trunk/src/import-export/qif-import/Makefile.am	2011-12-02 20:55:43 UTC (rev 21653)
@@ -4,14 +4,14 @@
 
 libgncmod_qif_import_la_SOURCES = \
   dialog-account-picker.c \
-  druid-qif-import.c \
+  assistant-qif-import.c \
   gnc-plugin-qif-import.c \
   gnc-druid-test.c \
   gncmod-qif-import.c
 
 noinst_HEADERS = \
   dialog-account-picker.h \
-  druid-qif-import.h \
+  assistant-qif-import.h \
   gnc-druid-test.h \
   gnc-plugin-qif-import.h
 
@@ -48,11 +48,10 @@
   qif-to-gnc.scm \
   qif-utils.scm
 
-gladedir = ${GNC_GLADE_DIR}
-glade_DATA = qif.glade
-
 gtkbuilderdir = ${GNC_GTKBUILDER_DIR}
-gtkbuilder_DATA = dialog-account-picker.glade
+gtkbuilder_DATA = \
+   dialog-account-picker.glade \
+   assistant-qif-import.glade
 
 AM_CPPFLAGS = \
   -I${top_srcdir}/src \
@@ -76,7 +75,6 @@
 
 EXTRA_DIST = \
   ${gncscm_DATA} \
-  ${glade_DATA} \
   ${gtkbuilder_DATA} \
   file-format.txt \
   $(ui_DATA)

Copied: gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c (from rev 21651, gnucash/trunk/src/import-export/qif-import/druid-qif-import.c)
===================================================================
--- gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c	                        (rev 0)
+++ gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c	2011-12-02 20:55:43 UTC (rev 21653)
@@ -0,0 +1,3645 @@
+/********************************************************************\
+ * assistant-qif-import.c -- window for importing QIF files         *
+ *                        (GnuCash)                                 *
+ * Copyright (C) 2000 Bill Gribble <grib at billgribble.com>           *
+ * Copyright (c) 2006 David Hampton <hampton at employees.org>         *
+ * Copyright (c) 2011 Robert Fewell                                 *
+ *                                                                  *
+ * 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, contact:                        *
+ *                                                                  *
+ * Free Software Foundation           Voice:  +1-617-542-5942       *
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
+ * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
+\********************************************************************/
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <glib/gstdio.h>
+#include <libguile.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+#include "Account.h"
+#include "Transaction.h"
+#include "dialog-account-picker.h"
+#include "dialog-commodity.h"
+#include "dialog-progress.h"
+#include "dialog-utils.h"
+#include "assistant-qif-import.h"
+#include "assistant-utils.h"
+#include "gnc-component-manager.h"
+#include "qof.h"
+#include "gnc-file.h"
+#include "gnc-gui-query.h"
+#include "gnc-currency-edit.h"
+#include "gnc-ui-util.h"
+#include "gnc-gconf-utils.h"
+#include "gnc-gtk-utils.h"
+#include "gnc-main-window.h"
+#include "gnc-plugin-page-account-tree.h"
+#include "gnc-ui.h"
+#include "guile-mappings.h"
+
+#include "swig-runtime.h"
+
+#define ASSISTANT_QIF_IMPORT_CM_CLASS "assistant-qif-import"
+#define GCONF_SECTION "dialogs/import/qif"
+#define GCONF_NAME_SHOW_DOC "show_doc"
+#define GCONF_NAME_DEFAULT_TRANSACTION_STATUS "default_status"
+
+#define PREV_ROW "prev_row"
+
+static QofLogModule log_module = GNC_MOD_ASSISTANT;
+
+enum filename_cols
+{
+    FILENAME_COL_INDEX = 0,
+    FILENAME_COL_NAME,
+    NUM_FILENAME_COLS
+};
+
+enum account_cols
+{
+    ACCOUNT_COL_INDEX = 0,
+    ACCOUNT_COL_QIF_NAME,
+    ACCOUNT_COL_GNC_NAME,
+    ACCOUNT_COL_NEW,
+    ACCOUNT_COL_ELLIPSIZE,
+    NUM_ACCOUNT_COLS
+};
+
+enum qif_trans_cols
+{
+    QIF_TRANS_COL_INDEX = 0,
+    QIF_TRANS_COL_DATE,
+    QIF_TRANS_COL_DESCRIPTION,
+    QIF_TRANS_COL_AMOUNT,
+    QIF_TRANS_COL_CHECKED,
+    NUM_QIF_TRANS_COLS
+};
+
+struct _qifimportwindow
+{
+    GtkWidget * window;
+    GtkWidget * assistant;
+    
+    /* Widgets on the file selection page. */
+    GtkWidget * filename_entry;
+
+    /* File loading progress page. */
+    GtkWidget * load_pause;
+    GtkWidget * load_start;
+    GtkWidget * load_log;
+    GNCProgressDialog *load_progress;
+
+    /* Widgets on the default account page. */
+    GtkWidget * acct_entry;
+
+    /* Widgets on the date format page. */
+    GtkWidget * date_format_combo;
+
+    /* Widgets on the files loaded page. */
+    GtkWidget * selected_file_view;
+    GtkWidget * unload_file_btn;
+
+    /* Widgets on the account matching page. */
+    GtkWidget * acct_view;
+    GtkWidget * acct_view_count;
+    GtkWidget * acct_view_btn;
+
+    /* Widgets on the category matching page. */
+    GtkWidget * cat_view;
+    GtkWidget * cat_view_count;
+    GtkWidget * cat_view_btn;
+
+    /* Widgets on the memo matching page. */
+    GtkWidget * memo_view;
+    GtkWidget * memo_view_count;
+    GtkWidget * memo_view_btn;
+
+    /* Widgets on the currency page. */
+    GtkWidget * currency_picker;
+
+    /* Widgets on the commodity page. */
+    gint        num_new_pages;
+
+    /* Conversion progress page. */
+    GtkWidget * convert_pause;
+    GtkWidget * convert_start;
+    GtkWidget * convert_log;
+    GNCProgressDialog *convert_progress;
+
+    /* Widgets on the duplicates page. */
+    GtkWidget * new_transaction_view;
+    GtkWidget * old_transaction_view;
+
+    /* Widgets on the summary page. */
+    GtkWidget * summary_text;
+
+    GList     * commodity_pages;
+
+    gboolean  show_doc_pages;
+    gboolean  ask_date_format;
+    gboolean  busy;
+    gboolean  load_stop;
+
+    SCM       imported_files;
+    SCM       selected_file;
+
+    SCM       acct_map_info;
+    SCM       acct_display_info;
+
+    SCM       cat_map_info;
+    SCM       cat_display_info;
+
+    SCM       memo_map_info;
+    SCM       memo_display_info;
+
+    SCM       gnc_acct_info;
+    SCM       security_hash;
+    SCM       security_prefs;
+    SCM       new_securities;
+    GList   * new_namespaces;
+    SCM       ticker_map;
+
+    SCM       imported_account_tree;
+    SCM       match_transactions;
+    SCM       transaction_status;
+    int       selected_transaction;
+};
+
+struct _qifassistantpage
+{
+    GtkWidget     *page;
+    GtkWidget     *namespace_combo;
+    GtkWidget     *name_entry;
+    GtkWidget     *mnemonic_entry;
+    gnc_commodity *commodity;
+    SCM            hash_key;
+};
+
+typedef struct _qifassistantpage QIFAssistantPage;
+
+static void gnc_ui_qif_import_assistant_destroy (GtkObject *object, gpointer user_data);
+static void gnc_ui_qif_import_assistant_close_handler (gpointer user_data );
+
+void gnc_ui_qif_import_cancel_cb (GtkAssistant *gtkassistant, gpointer user_data);
+void gnc_ui_qif_import_prepare_cb (GtkAssistant *assistant, GtkWidget *page, gpointer user_data);
+void gnc_ui_qif_import_finish_cb (GtkAssistant *gtkassistant, gpointer user_data);
+void gnc_ui_qif_import_close_cb (GtkAssistant *gtkassistant, gpointer user_data);
+
+void gnc_ui_qif_import_intro_prepare (GtkAssistant  *assistant, gpointer user_data);
+
+void gnc_ui_qif_import_load_file_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_select_file_cb (GtkButton *button, gpointer user_data);
+
+void gnc_ui_qif_import_load_progress_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_load_progress_pause_cb (GtkButton *button, gpointer user_data);
+void gnc_ui_qif_import_load_progress_start_cb (GtkButton * button, gpointer user_data);
+
+void gnc_ui_qif_import_date_format_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_date_valid_cb (GtkWidget *widget, gpointer user_data);
+
+void gnc_ui_qif_import_account_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_acct_valid_cb (GtkWidget *widget, gpointer user_data);
+
+void gnc_ui_qif_import_loaded_files_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_load_another_cb (GtkButton *button, gpointer user_data);
+void gnc_ui_qif_import_unload_file_cb (GtkButton *button, gpointer user_data);
+
+static void update_file_page (QIFImportWindow * wind);
+
+void gnc_ui_qif_import_account_match_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_account_doc_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_account_rematch_cb (GtkButton *button, gpointer user_data);
+
+void gnc_ui_qif_import_catagory_match_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_catagory_doc_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_category_rematch_cb (GtkButton *button, gpointer user_data);
+
+void gnc_ui_qif_import_memo_match_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_memo_doc_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_memo_rematch_cb (GtkButton *button, gpointer user_data);
+
+void gnc_ui_qif_import_currency_prepare (GtkAssistant *assistant, gpointer user_data);
+
+void gnc_ui_qif_import_commodity_new_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_commodity_doc_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_comm_changed_cb (GtkWidget *widget, gpointer user_data);
+
+void gnc_ui_qif_import_convert_progress_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_convert_progress_pause_cb (GtkButton * button, gpointer user_data);
+void gnc_ui_qif_import_convert_progress_start_cb(GtkButton * button, gpointer user_data);
+
+void gnc_ui_qif_import_duplicates_match_prepare (GtkAssistant *assistant, gpointer user_data);
+void gnc_ui_qif_import_duplicates_doc_prepare (GtkAssistant *assistant, gpointer user_data);
+
+void gnc_ui_qif_import_end_page_prepare (GtkAssistant *assistant, gpointer user_data);
+
+void gnc_ui_qif_import_summary_page_prepare (GtkAssistant *assistant, gpointer user_data);
+
+
+/****************************************************************
+ * update_account_picker_page
+ *
+ * Generic function to update an account_picker page.  This
+ * generalizes the code shared whenever any QIF -> GNC mapper is
+ * updating it's LIST STORE.  It asks the Scheme side to guess some account
+ * translations and then shows the account name and suggested
+ * translation in the Accounts page view (acount picker list).
+ ****************************************************************/
+static void
+update_account_picker_page(QIFImportWindow * wind, SCM make_display,
+                           GtkWidget *view, SCM map_info, SCM * display_info)
+{
+
+    SCM  get_qif_name = scm_c_eval_string("qif-map-entry:qif-name");
+    SCM  get_gnc_name = scm_c_eval_string("qif-map-entry:gnc-name");
+    SCM  get_new      = scm_c_eval_string("qif-map-entry:new-acct?");
+    SCM  accts_left;
+    const gchar *qif_name = NULL;
+    const gchar *gnc_name = NULL;
+    gboolean checked;
+    gint row = 0;
+    gint prev_row;
+    GtkListStore *store;
+    GtkTreeIter iter;
+    GtkTreePath *path;
+    GtkTreeSelection *selection;
+
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(view)));
+
+    /* now get the list of strings to display in the gtk_list_store widget */
+    accts_left = scm_call_3(make_display,
+                            wind->imported_files,
+                            map_info,
+                            wind->gnc_acct_info);
+
+    scm_gc_unprotect_object(*display_info);
+    *display_info = accts_left;
+    scm_gc_protect_object(*display_info);
+
+    /* clear the list */
+    gtk_list_store_clear(store);
+
+    while (!scm_is_null(accts_left))
+    {
+        if (scm_is_string(scm_call_1(get_qif_name, SCM_CAR(accts_left))))
+        {
+            char * str;
+
+            scm_dynwind_begin (0);
+            str = scm_to_locale_string (scm_call_1(get_qif_name, SCM_CAR(accts_left)));
+            qif_name = g_strdup (str);
+            scm_dynwind_free (str);
+            scm_dynwind_end ();
+        }
+        if (scm_is_string(scm_call_1(get_gnc_name, SCM_CAR(accts_left))))
+        {
+            char * str;
+
+            scm_dynwind_begin (0);
+            str = scm_to_locale_string (scm_call_1(get_gnc_name, SCM_CAR(accts_left)));
+            gnc_name = g_strdup (str);
+            scm_dynwind_free (str);
+            scm_dynwind_end ();
+        }
+        checked  = (scm_call_1(get_new, SCM_CAR(accts_left)) == SCM_BOOL_T);
+
+        gtk_list_store_append(store, &iter);
+        gtk_list_store_set(store, &iter,
+                           ACCOUNT_COL_INDEX,     row++,
+                           ACCOUNT_COL_QIF_NAME,  qif_name,
+                           ACCOUNT_COL_GNC_NAME,  gnc_name,
+                           ACCOUNT_COL_NEW,       checked,
+                           ACCOUNT_COL_ELLIPSIZE, PANGO_ELLIPSIZE_START,
+                           -1);
+        accts_left = SCM_CDR(accts_left);
+    }
+
+    /* move to the old selected row */
+    prev_row = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(store), PREV_ROW));
+    if (prev_row != -1)
+    {
+        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
+        path = gtk_tree_path_new_from_indices(prev_row, -1);
+        gtk_tree_selection_select_path(selection, path);
+        gtk_tree_path_free(path);
+    }
+    else
+    {
+        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
+        path = gtk_tree_path_new_from_indices( 0, -1);
+        gtk_tree_selection_select_path(selection, path);
+        gtk_tree_path_free(path);
+    }
+}
+
+
+/****************************************************************
+ * update_account_page
+ *
+ * update the QIF account -> GNC Account picker
+ ****************************************************************/
+static void
+update_account_page(QIFImportWindow * wind)
+{
+
+    SCM  make_account_display = scm_c_eval_string("qif-dialog:make-account-display");
+
+    update_account_picker_page(wind, make_account_display, wind->acct_view,
+                               wind->acct_map_info, &(wind->acct_display_info));
+}
+
+
+/****************************************************************
+ * update_category_page
+ *
+ * update the QIF category -> GNC Account picker
+ ****************************************************************/
+static void
+update_category_page(QIFImportWindow * wind)
+{
+    SCM  make_category_display = scm_c_eval_string("qif-dialog:make-category-display");
+
+    update_account_picker_page(wind, make_category_display, wind->cat_view,
+                               wind->cat_map_info, &(wind->cat_display_info));
+}
+
+
+/****************************************************************
+ * update_memo_page
+ *
+ * update the QIF memo -> GNC Account picker
+ ****************************************************************/
+static void
+update_memo_page(QIFImportWindow * wind)
+{
+    SCM  make_memo_display = scm_c_eval_string("qif-dialog:make-memo-display");
+
+    update_account_picker_page(wind, make_memo_display, wind->memo_view,
+                               wind->memo_map_info, &(wind->memo_display_info));
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_commodity_destroy
+ *
+ * This function destroys any commodity pages.
+ ****************************************************************/
+static void
+gnc_ui_qif_import_commodity_destroy(QIFImportWindow * wind)
+{
+    GList              *pageptr;
+    GtkWidget          *gtkpage;
+    QIFAssistantPage   *page;
+
+    for (pageptr = wind->commodity_pages; pageptr; pageptr = pageptr->next)
+    {
+        gtkpage   = pageptr->data;
+        page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
+
+        /* Unprotect the Scheme hash key. */
+        scm_gc_unprotect_object(page->hash_key);
+
+        /* Free the memory allocated for the page's struct. */
+        g_free(page);
+    }
+
+    /* Free the list of pages. */
+    g_list_free(wind->commodity_pages);
+    wind->commodity_pages = NULL;
+}
+
+
+/**********************************************
+ * gnc_ui_qif_import_assistant_destroy
+ * close the QIF Import assistant window
+ **********************************************/
+static void
+gnc_ui_qif_import_assistant_destroy(GtkObject *object, gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+
+    /* Destroy the progress dialog helpers. */
+    gnc_progress_dialog_destroy(wind->load_progress);
+
+    /* Destroy any commodity pages. */
+    gnc_ui_qif_import_commodity_destroy(wind);
+
+    gnc_unregister_gui_component_by_data(ASSISTANT_QIF_IMPORT_CM_CLASS, wind);
+
+    gtk_widget_destroy(wind->window);
+
+    scm_gc_unprotect_object(wind->imported_files);
+    scm_gc_unprotect_object(wind->selected_file);
+    scm_gc_unprotect_object(wind->gnc_acct_info);
+    scm_gc_unprotect_object(wind->cat_display_info);
+    scm_gc_unprotect_object(wind->cat_map_info);
+    scm_gc_unprotect_object(wind->memo_display_info);
+    scm_gc_unprotect_object(wind->memo_map_info);
+    scm_gc_unprotect_object(wind->acct_display_info);
+    scm_gc_unprotect_object(wind->acct_map_info);
+    scm_gc_unprotect_object(wind->security_hash);
+    scm_gc_unprotect_object(wind->security_prefs);
+    scm_gc_unprotect_object(wind->new_securities);
+    scm_gc_unprotect_object(wind->ticker_map);
+    scm_gc_unprotect_object(wind->imported_account_tree);
+    scm_gc_unprotect_object(wind->match_transactions);
+
+    g_free(wind);
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_select_loaded_file_cb
+ * callback when a file is clicked in the "loaded files" page
+ ****************************************************************/
+static void
+gnc_ui_qif_import_select_loaded_file_cb(GtkTreeSelection *selection,
+                                        gpointer          user_data)
+{
+    QIFImportWindow * wind = user_data;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    gint row;
+    GtkWidget *button;
+
+    button = (wind->unload_file_btn);
+    if (gtk_tree_selection_get_selected(selection, &model, &iter))
+    {
+        gtk_tree_model_get(model, &iter, FILENAME_COL_INDEX, &row, -1);
+        if (scm_is_list(wind->imported_files) &&
+                (scm_ilength(wind->imported_files) > row))
+        {
+            scm_gc_unprotect_object(wind->selected_file);
+            wind->selected_file = scm_list_ref(wind->imported_files,
+                                               scm_int2num(row));
+            scm_gc_protect_object(wind->selected_file);
+            g_object_set(button, "sensitive", TRUE, (gchar*)NULL);
+        }
+    }
+    else
+    {
+        scm_gc_unprotect_object(wind->selected_file);
+        wind->selected_file = SCM_BOOL_F;
+        scm_gc_protect_object(wind->selected_file);
+        g_object_set(button, "sensitive", FALSE, (gchar*)NULL);
+    }
+}
+
+
+/****************************************************
+ * create_account_picker_view
+ ****************************************************/
+static void
+create_account_picker_view(GtkWidget *widget,
+                           const gchar *col_name,
+                           GCallback activate_cb,
+                           GCallback select_cb,
+                           gpointer user_data)
+{
+    GtkTreeView *view = GTK_TREE_VIEW(widget);
+    GtkTreeSelection *selection = gtk_tree_view_get_selection(view);
+    GtkListStore *store;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+
+    store = gtk_list_store_new(NUM_ACCOUNT_COLS, G_TYPE_INT, G_TYPE_STRING,
+                               G_TYPE_STRING, G_TYPE_BOOLEAN,
+                               PANGO_TYPE_ELLIPSIZE_MODE);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(col_name,
+             renderer,
+             "text",
+             ACCOUNT_COL_QIF_NAME,
+             "ellipsize",
+             ACCOUNT_COL_ELLIPSIZE,
+             NULL);
+    g_object_set(column, "expand", TRUE, NULL);
+    gtk_tree_view_column_set_resizable(column, TRUE);
+    gtk_tree_view_append_column(view, column);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("GnuCash account name"),
+             renderer,
+             "text",
+             ACCOUNT_COL_GNC_NAME,
+             "ellipsize",
+             ACCOUNT_COL_ELLIPSIZE,
+             NULL);
+
+    g_object_set(column, "expand", TRUE, NULL);
+    gtk_tree_view_column_set_resizable(column, TRUE);
+    gtk_tree_view_append_column(view, column);
+
+    renderer = gtk_cell_renderer_toggle_new();
+    g_object_set(renderer, "activatable", FALSE, NULL);
+    column = gtk_tree_view_column_new_with_attributes(_("New?"),
+             renderer,
+             "active",
+             ACCOUNT_COL_NEW,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+
+    g_object_set_data(G_OBJECT(store), PREV_ROW, GINT_TO_POINTER(-1));
+
+    /* Connect the signal handlers. */
+    g_signal_connect(view, "row-activated", G_CALLBACK(activate_cb), user_data);
+    g_signal_connect(selection, "changed", G_CALLBACK(select_cb), user_data);
+
+    /* Allow multiple rows to be selected. */
+    gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
+}
+
+
+/********************************************************************
+ * rematch_line
+ *
+ * This is a helper function for tree controls used by some assistant
+ * pages for mapping QIF values to GnuCash accounts. It processes
+ * the selected rows when a user tries to edit the account mappings.
+ * The account picker is displayed, and the chosen GnuCash account
+ * becomes the new mapping for each row.  Finally, the update_page
+ * function is called.
+ ********************************************************************/
+static void
+rematch_line(QIFImportWindow *wind, GtkTreeSelection *selection,
+             SCM display_info, SCM map_info,
+             void (*update_page)(QIFImportWindow *))
+{
+    SCM           get_qif_name = scm_c_eval_string("qif-map-entry:qif-name");
+    SCM           get_gnc_name = scm_c_eval_string("qif-map-entry:gnc-name");
+    SCM           set_gnc_name = scm_c_eval_string("qif-map-entry:set-gnc-name!");
+    SCM           map_entry;
+    SCM           gnc_name;
+    GList        *pathlist;
+    GList        *current;
+    GtkTreeModel *model;
+    GtkTreeIter   iter;
+    gint          row;
+
+    /* Get a list of selected rows. */
+    pathlist = gtk_tree_selection_get_selected_rows(selection, &model);
+    if (!pathlist)
+        return;
+
+    /*
+     * Update the first selected row.
+     */
+
+    /* Get the row number of the first selected row. */
+    if (!gtk_tree_model_get_iter(model, &iter, (GtkTreePath *) pathlist->data))
+        return;
+    gtk_tree_model_get(model, &iter, ACCOUNT_COL_INDEX, &row, -1);
+
+    /* Save the row number. */
+    g_object_set_data(G_OBJECT(model), PREV_ROW, GINT_TO_POINTER(row));
+    if (row == -1)
+        return;
+
+    /* Find the <qif-map-entry> corresponding to the selected row. */
+    map_entry = scm_list_ref(display_info, scm_int2num(row));
+
+    /* Call the account picker to update it. */
+    if (!qif_account_picker_dialog(wind, map_entry))
+        return;
+    gnc_name = scm_call_1(get_gnc_name, map_entry);
+
+    /* Update the mapping hash table. */
+    scm_hash_set_x(map_info, scm_call_1(get_qif_name, map_entry), map_entry);
+
+    /*
+     * Map all other selected rows to the same GnuCash account.
+     */
+    for (current = pathlist->next; current; current = current->next)
+    {
+        /* Get the row number. */
+        gtk_tree_model_get_iter(model, &iter, (GtkTreePath *) current->data);
+        gtk_tree_model_get(model, &iter, ACCOUNT_COL_INDEX, &row, -1);
+
+        /* Update the <qif-map-entry> for the selected row. */
+        map_entry = scm_list_ref(display_info, scm_int2num(row));
+        scm_call_2(set_gnc_name, map_entry, gnc_name);
+
+        /* Update the mapping hash table. */
+        scm_hash_set_x(map_info, scm_call_1(get_qif_name, map_entry), map_entry);
+    }
+
+    /* Free the path list. */
+    g_list_foreach(pathlist, (GFunc) gtk_tree_path_free, NULL);
+    g_list_free(pathlist);
+
+    /* Update the display. */
+    update_page(wind);
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_account_activate_cb
+ *
+ * This handler is invoked when a row is double-clicked in the "Match
+ * QIF accounts to GnuCash accounts" page.
+ ********************************************************************/
+static void
+gnc_ui_qif_import_account_activate_cb(GtkTreeView *view, GtkTreePath *path,
+                                      GtkTreeViewColumn *column,
+                                      gpointer user_data)
+{
+    QIFImportWindow  *wind = user_data;
+
+    g_return_if_fail(wind);
+
+    rematch_line(wind, gtk_tree_view_get_selection(view),
+                 wind->acct_display_info, wind->acct_map_info,
+                 update_account_page);
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_account_select_cb
+ *
+ * This handler is invoked when the selection of account matchings
+ * has changed.  It updates the selection count and enables/disables
+ * the "Change" button.
+ ********************************************************************/
+static void
+gnc_ui_qif_import_account_select_cb(GtkTreeSelection *selection,
+                                    gpointer user_data)
+{
+    QIFImportWindow  *wind = user_data;
+    gint              count = gtk_tree_selection_count_selected_rows(selection);
+    gchar            *count_str;
+
+    g_return_if_fail(wind);
+
+    /* Update the "items selected" count. */
+    if (wind->acct_view_count)
+    {
+        count_str = g_strdup_printf("%d", count);
+        gtk_label_set_text(GTK_LABEL(wind->acct_view_count), count_str);
+        g_free(count_str);
+    }
+
+    /* Enable/disable the Change button. */
+    if (wind->acct_view_btn)
+    {
+        if (count)
+            gtk_widget_set_sensitive(wind->acct_view_btn, TRUE);
+        else
+            gtk_widget_set_sensitive(wind->acct_view_btn, FALSE);
+    }
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_category_activate_cb
+ *
+ * This handler is invoked when a row is double-clicked in the "Match
+ * QIF categories to GnuCash accounts" page.
+ ********************************************************************/
+static void
+gnc_ui_qif_import_category_activate_cb(GtkTreeView *view, GtkTreePath *path,
+                                       GtkTreeViewColumn *column,
+                                       gpointer user_data)
+{
+    QIFImportWindow *wind = user_data;
+    GtkTreeSelection *selection;
+
+    g_return_if_fail(view && wind);
+    selection = gtk_tree_view_get_selection(view);
+
+    rematch_line(wind, selection, wind->cat_display_info, wind->cat_map_info,
+                 update_category_page);
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_category_select_cb
+ *
+ * This handler is invoked when the selection of category matchings
+ * has changed.  It updates the selection count and enables/disables
+ * the "Change" button.
+ ********************************************************************/
+static void
+gnc_ui_qif_import_category_select_cb(GtkTreeSelection *selection,
+                                     gpointer user_data)
+{
+    QIFImportWindow  *wind = user_data;
+    gint              count = gtk_tree_selection_count_selected_rows(selection);
+    gchar            *count_str;
+
+    g_return_if_fail(wind);
+
+    /* Update the "items selected" count. */
+    if (wind->cat_view_count)
+    {
+        count_str = g_strdup_printf("%d", count);
+        gtk_label_set_text(GTK_LABEL(wind->cat_view_count), count_str);
+        g_free(count_str);
+    }
+
+    /* Enable/disable the Change button. */
+    if (wind->cat_view_btn)
+    {
+        if (count)
+            gtk_widget_set_sensitive(wind->cat_view_btn, TRUE);
+        else
+            gtk_widget_set_sensitive(wind->cat_view_btn, FALSE);
+    }
+}
+
+
+/********************************************************************
+ *  gnc_ui_qif_import_memo_activate_cb
+ *
+ * This handler is invoked when a row is double-clicked in the "Match
+ * QIF payee/memo to GnuCash accounts" page.
+ ********************************************************************/
+static void
+gnc_ui_qif_import_memo_activate_cb(GtkTreeView *view, GtkTreePath *path,
+                                   GtkTreeViewColumn *column,
+                                   gpointer user_data)
+{
+    QIFImportWindow *wind = user_data;
+    GtkTreeSelection *selection;
+
+    g_return_if_fail(view && wind);
+    selection = gtk_tree_view_get_selection(view);
+
+    rematch_line(wind, selection, wind->memo_display_info, wind->memo_map_info,
+                 update_memo_page);
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_memo_select_cb
+ *
+ * This handler is invoked when the selection of memo matchings
+ * has changed.  It updates the selection count and enables/disables
+ * the "Change" button.
+ ********************************************************************/
+static void
+gnc_ui_qif_import_memo_select_cb(GtkTreeSelection *selection,
+                                 gpointer user_data)
+{
+    QIFImportWindow  *wind = user_data;
+    gint              count = gtk_tree_selection_count_selected_rows(selection);
+    gchar            *count_str;
+
+    g_return_if_fail(wind);
+
+    /* Update the "items selected" count. */
+    if (wind->memo_view_count)
+    {
+        count_str = g_strdup_printf("%d", count);
+        gtk_label_set_text(GTK_LABEL(wind->memo_view_count), count_str);
+        g_free(count_str);
+    }
+
+    /* Enable/disable the Change button. */
+    if (wind->memo_view_btn)
+    {
+        if (count)
+            gtk_widget_set_sensitive(wind->memo_view_btn, TRUE);
+        else
+            gtk_widget_set_sensitive(wind->memo_view_btn, FALSE);
+    }
+}
+
+
+/*********************************************
+ * new_security_page
+ *********************************************/
+static QIFAssistantPage *
+new_security_page(SCM security_hash_key, gnc_commodity *comm, QIFImportWindow *wind )
+{
+
+    QIFAssistantPage *retval = g_new0(QIFAssistantPage, 1);
+    GtkWidget    *table;
+    GtkWidget    *label;
+    gchar        *title = NULL;
+    const char   *str;
+    GtkWidget    *page;
+    gint         newindex;
+    char         *name_tooltip =
+        _("Enter a name or short description, such as \"Red Hat Stock\".");
+    char         *mnemonic_tooltip =
+        _("Enter the ticker symbol or other well known abbreviation, such as"
+          " \"RHT\". If there isn't one, or you don't know it, create your own.");
+    char         *namespace_tooltip =
+        _("Select the exchange on which the symbol is traded, or select the"
+          " type of investment (such as FUND for mutual funds.) If you don't"
+          " see your exchange or an appropriate investment type, you can"
+          " enter a new one.");
+
+    /* Make the page widget. */
+    page = gtk_vbox_new( FALSE, 0 );
+    retval->page = page;
+    g_object_set_data(G_OBJECT(retval->page), "page_struct", retval);
+    page = retval->page;
+
+    /* Insert the new page */
+    newindex = gtk_assistant_insert_page (GTK_ASSISTANT(wind->window), page, 14);
+    gtk_assistant_set_page_type(GTK_ASSISTANT(wind->window), page, GTK_ASSISTANT_PAGE_PROGRESS );
+    gtk_assistant_set_page_complete (GTK_ASSISTANT (wind->window), page, TRUE);
+    gtk_assistant_update_buttons_state (GTK_ASSISTANT (wind->window));
+
+    /* Save the commodity and the hash table key. */
+    retval->commodity = comm;
+    retval->hash_key = security_hash_key;
+    scm_gc_protect_object(retval->hash_key);
+
+    /* Set the page title. */
+    str = gnc_commodity_get_mnemonic(comm);
+    str = str ? str : "";
+    title = _("Enter information about");
+    title =  g_strdup_printf("%s \"%s\"", title, str);
+    gtk_assistant_set_page_title(GTK_ASSISTANT(wind->window), page, title);
+    g_free(title);
+
+    /*
+     * Add all the widgets to the page.
+     */
+    table = gtk_table_new(3, 2, FALSE);
+    gtk_table_set_row_spacings(GTK_TABLE(table), 6);
+    gtk_table_set_col_spacings(GTK_TABLE(table), 12);
+
+    /* Name entry */
+    retval->name_entry = gtk_entry_new();
+    gtk_entry_set_text(GTK_ENTRY(retval->name_entry),
+                       gnc_commodity_get_fullname(comm));
+    label = gtk_label_new_with_mnemonic(_("_Name or description:"));
+    gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->name_entry);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+
+    gtk_widget_set_tooltip_text(label, name_tooltip);
+    gtk_widget_set_tooltip_text(retval->name_entry, name_tooltip);
+
+    gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
+                     GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+    gtk_table_attach_defaults(GTK_TABLE(table), retval->name_entry,
+                              1, 2, 0, 1);
+
+    g_signal_connect (retval->name_entry, "changed",
+                      G_CALLBACK (gnc_ui_qif_import_comm_changed_cb), wind);
+
+    /* Mnemonic entry */
+    retval->mnemonic_entry = gtk_entry_new();
+    gtk_entry_set_text(GTK_ENTRY(retval->mnemonic_entry),
+                       gnc_commodity_get_mnemonic(comm));
+    label = gtk_label_new_with_mnemonic(
+                _("_Ticker symbol or other abbreviation:"));
+    gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->mnemonic_entry);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+
+    gtk_widget_set_tooltip_text(label, mnemonic_tooltip);
+    gtk_widget_set_tooltip_text(retval->mnemonic_entry, mnemonic_tooltip);
+
+    gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2,
+                     GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+    gtk_table_attach_defaults(GTK_TABLE(table), retval->mnemonic_entry,
+                              1, 2, 1, 2);
+
+    g_signal_connect (retval->mnemonic_entry, "changed",
+                      G_CALLBACK (gnc_ui_qif_import_comm_changed_cb), wind);
+
+    /* Namespace entry */
+    retval->namespace_combo = gtk_combo_box_entry_new_text();
+    gnc_cbe_add_completion(GTK_COMBO_BOX_ENTRY(retval->namespace_combo));
+    label = gtk_label_new_with_mnemonic(
+                _("_Exchange or abbreviation type:"));
+    gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->namespace_combo);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+
+    gtk_widget_set_tooltip_text(label, namespace_tooltip);
+    gtk_widget_set_tooltip_text(retval->namespace_combo, namespace_tooltip);
+
+    gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
+                     GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+    gtk_table_attach_defaults(GTK_TABLE(table), retval->namespace_combo,
+                              1, 2, 2, 3);
+
+    gtk_container_set_border_width(GTK_CONTAINER(page),12);
+
+    gtk_box_pack_start(GTK_BOX(page), table, FALSE, FALSE, 12);
+
+    return retval;
+}
+
+
+/********************************************************************
+ * prepare_security_pages
+ *
+ * Prepare the assistant page for each security.
+ ********************************************************************/
+static void
+prepare_security_pages(QIFImportWindow * wind)
+{
+    SCM   hash_ref  = scm_c_eval_string("hash-ref");
+    SCM   securities;
+    SCM   comm_ptr_token;
+
+    GList          * current;
+    gnc_commodity  * commodity;
+    QIFAssistantPage   * new_page;
+
+    /*
+     * Make assistant pages for each new QIF security.
+     */
+    gnc_set_busy_cursor(NULL, TRUE);
+    securities = wind->new_securities;
+    current = wind->commodity_pages;
+    while (!scm_is_null(securities) && (securities != SCM_BOOL_F))
+    {
+        if (current)
+        {
+            /* The page has already been made. */
+            current = current->next;
+        }
+        else
+        {
+            /* Get the GnuCash commodity corresponding to the new QIF security. */
+            comm_ptr_token = scm_call_2(hash_ref,
+                                        wind->security_hash,
+                                        SCM_CAR(securities));
+#define FUNC_NAME "new_security_page"
+            commodity = SWIG_MustGetPtr(comm_ptr_token,
+                                        SWIG_TypeQuery("_p_gnc_commodity"), 1, 0);
+#undef FUNC_NAME
+
+            /* Build a new security page. */
+            new_page = new_security_page(SCM_CAR(securities), commodity, wind);
+
+            /* Add it to the list of security pages. */
+            wind->commodity_pages = g_list_append(wind->commodity_pages,
+                                                  new_page->page);
+
+            gtk_widget_show_all(new_page->page);
+        }
+        wind->num_new_pages = wind->num_new_pages + 1;
+        securities = SCM_CDR(securities);
+    }
+    gnc_unset_busy_cursor(NULL);
+    PINFO("Number of New Security pages is %d", wind->num_new_pages);
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_commodity_update
+ *
+ * This function updates the commodities based on the values for
+ * mnemonic, namespace, and name approved by the user.
+ ****************************************************************/
+static void
+gnc_ui_qif_import_commodity_update(QIFImportWindow * wind)
+{
+    GList              *pageptr;
+    GtkWidget          *gtkpage;
+    QIFAssistantPage   *page;
+    const gchar        *mnemonic = NULL;
+    gchar              *namespace = NULL;
+    const gchar        *fullname = NULL;
+    gnc_commodity      *tab_commodity;
+
+    for (pageptr = wind->commodity_pages; pageptr; pageptr = pageptr->next)
+    {
+        gtkpage   = pageptr->data;
+        page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
+
+        /* Get any changes from the commodity page. */
+        mnemonic  = gtk_entry_get_text(GTK_ENTRY(page->mnemonic_entry));
+        namespace = gnc_ui_namespace_picker_ns(page->namespace_combo);
+        fullname  = gtk_entry_get_text(GTK_ENTRY(page->name_entry));
+
+        /* Update the commodity with the new values. */
+        gnc_commodity_set_namespace(page->commodity, namespace);
+        gnc_commodity_set_fullname(page->commodity, fullname);
+        gnc_commodity_set_mnemonic(page->commodity, mnemonic);
+
+        /* Add the commodity to the commodity table (if it isn't a duplicate). */
+        tab_commodity = gnc_commodity_table_lookup(gnc_get_current_commodities(),
+                        namespace, mnemonic);
+        if (!tab_commodity || tab_commodity == page->commodity)
+            tab_commodity = gnc_commodity_table_insert(gnc_get_current_commodities(),
+                            page->commodity);
+
+        /* Update the security hash table. */
+        scm_hash_set_x(wind->security_hash,
+                       page->hash_key,
+                       SWIG_NewPointerObj(tab_commodity,
+                                          SWIG_TypeQuery("_p_gnc_commodity"), 0));
+
+        g_free(namespace);
+    }
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_convert_undo
+ *
+ * This function launches the Scheme procedure that un-imports
+ * any imported accounts and transactions.
+ ****************************************************************/
+static void
+gnc_ui_qif_import_convert_undo(QIFImportWindow * wind)
+{
+    SCM undo = scm_c_eval_string("qif-import:qif-to-gnc-undo");
+
+    gnc_set_busy_cursor(NULL, TRUE);
+
+    /* Undo the conversion. */
+    scm_call_1(undo, wind->imported_account_tree);
+
+    /* There's no imported account tree any more. */
+    scm_gc_unprotect_object(wind->imported_account_tree);
+    wind->imported_account_tree = SCM_BOOL_F;
+    scm_gc_protect_object(wind->imported_account_tree);
+
+    /* Get rid of the list of matched transactions. */
+    scm_gc_unprotect_object(wind->match_transactions);
+    wind->match_transactions = SCM_BOOL_F;
+    scm_gc_protect_object(wind->match_transactions);
+
+    gnc_unset_busy_cursor(NULL);
+}
+
+
+/****************************************************************
+ * refresh_old_transactions
+ *
+ * This function launches the Scheme procedure that refreshes
+ * the old transactions.
+ ****************************************************************/
+static void
+refresh_old_transactions(QIFImportWindow * wind, int selection)
+{
+    SCM          possible_matches;
+    SCM          current_xtn;
+    SCM          selected;
+    Transaction  * gnc_xtn;
+    Split        * gnc_split;
+    const gchar  * amount_str;
+    int          rownum = 0;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkTreeIter iter;
+
+    view = GTK_TREE_VIEW(wind->old_transaction_view);
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+    gtk_list_store_clear(store);
+
+    if (wind->match_transactions != SCM_BOOL_F)
+    {
+        possible_matches = SCM_CDR(scm_list_ref(wind->match_transactions,
+                                                scm_int2num(wind->selected_transaction)));
+        scm_call_2(scm_c_eval_string("qif-import:refresh-match-selection"),
+                   possible_matches, scm_int2num(selection));
+
+        while (!scm_is_null(possible_matches))
+        {
+            current_xtn = SCM_CAR(possible_matches);
+#define FUNC_NAME "xaccTransCountSplits"
+            gnc_xtn     = SWIG_MustGetPtr(SCM_CAR(current_xtn),
+                                          SWIG_TypeQuery("_p_Transaction"), 1, 0);
+#undef FUNC_NAME
+            selected    = SCM_CDR(current_xtn);
+
+            if (xaccTransCountSplits(gnc_xtn) > 2)
+            {
+                amount_str = _("(split)");
+            }
+            else
+            {
+                gnc_split = xaccTransGetSplit(gnc_xtn, 0);
+                amount_str =
+                    xaccPrintAmount(gnc_numeric_abs(xaccSplitGetValue(gnc_split)),
+                                    gnc_account_print_info
+                                    (xaccSplitGetAccount(gnc_split), TRUE));
+            }
+
+            gtk_list_store_append(store, &iter);
+            gtk_list_store_set
+            (store, &iter,
+             QIF_TRANS_COL_INDEX, rownum++,
+             QIF_TRANS_COL_DATE, gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
+             QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
+             QIF_TRANS_COL_AMOUNT, amount_str,
+             QIF_TRANS_COL_CHECKED, selected != SCM_BOOL_F,
+             -1);
+
+            possible_matches = SCM_CDR(possible_matches);
+        }
+    }
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_duplicate_new_select_cb
+ *
+ * This function is the call back for duplicate transactions.
+ ****************************************************************/
+static void
+gnc_ui_qif_import_duplicate_new_select_cb(GtkTreeSelection *selection,
+        QIFImportWindow  *wind)
+{
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+
+    if (gtk_tree_selection_get_selected(selection, &model, &iter))
+        gtk_tree_model_get(model, &iter,
+                           QIF_TRANS_COL_INDEX, &wind->selected_transaction,
+                           -1);
+    refresh_old_transactions(wind, -1);
+}
+
+
+/****************************************************************
+ * reset_ignore_old_select
+ ****************************************************************/
+static gboolean
+reset_ignore_old_select(gboolean *ignore)
+{
+    *ignore = FALSE;
+    return FALSE;
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_duplicate_old_select_cb
+ *
+ * This function is the call back for duplicate transactions.
+ ****************************************************************/
+static void
+gnc_ui_qif_import_duplicate_old_select_cb(GtkTreeSelection *selection,
+        QIFImportWindow  *wind)
+{
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    gint row;
+    static gboolean ignore_old_select = FALSE;
+
+    /* Get the current selection then clear it.  We're about to clear
+     * the entire list store and rebuild it so this prevents errors. */
+    if (!gtk_tree_selection_get_selected(selection, &model, &iter))
+        return;
+    gtk_tree_selection_unselect_all(selection);
+
+    /* Getting a weird double call the first time a line is clicked.
+     * Once via gtk_tree_view_button_press and then again via
+     * gtk_tree_view_grab_focus. */
+    if (ignore_old_select)
+        return;
+    ignore_old_select = TRUE;
+    g_idle_add((GSourceFunc)reset_ignore_old_select, &ignore_old_select);
+
+    /* Get the row the user clicked on and update the scheme
+     * code/rebuild the list store.  */
+    gtk_tree_model_get(model, &iter,
+                       QIF_TRANS_COL_INDEX, &row,
+                       -1);
+    refresh_old_transactions(wind, row);
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_check_acct_tree
+ *
+ * Designed for use with gnc_main_window_foreach_page(), this
+ * function determines whether an account tab is open in the main
+ * window. The parameter user_data must point to a gboolean.
+ ********************************************************************/
+static void
+gnc_ui_qif_import_check_acct_tree(GncPluginPage *page, gpointer user_data)
+{
+    gboolean *found = user_data;
+
+    if (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page) && found)
+        *found = TRUE;
+}
+
+
+/****************************************************************
+ * do_cancel
+ *
+ * Clears out any imported data and shuts down the importer.
+ ****************************************************************/
+static void
+do_cancel(QIFImportWindow * wind)
+{
+    GList                *pageptr;
+    GtkWidget            *gtkpage;
+    QIFAssistantPage     *page;
+    gnc_commodity_table  *table;
+
+    gnc_set_busy_cursor(NULL, TRUE);
+
+    /* Remove any converted data. */
+    gnc_ui_qif_import_convert_undo(wind);
+
+    /* Remove any commodities created for assistant pages. */
+    for (pageptr = wind->commodity_pages; pageptr; pageptr = pageptr->next)
+    {
+        gtkpage   = pageptr->data;
+        page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
+        gnc_commodity_destroy(page->commodity);
+    }
+
+    /* Remove any namespaces created by the user. */
+    table = gnc_get_current_commodities();
+    while (wind->new_namespaces)
+    {
+        gnc_commodity_table_delete_namespace(table, (gchar *) wind->new_namespaces->data);
+
+        /* Free the data and the list element. */
+        g_free(wind->new_namespaces->data);
+        wind->new_namespaces = g_list_delete_link(wind->new_namespaces,
+                               wind->new_namespaces);
+    }
+    gnc_unset_busy_cursor(NULL);
+
+    /* Destroy the assistant. */
+    gnc_close_gui_component_by_data(ASSISTANT_QIF_IMPORT_CM_CLASS, wind);
+}
+
+
+/****************************************************************
+ * cancel_timeout_cb
+ *
+ * This timer callback function waits until the busy flag
+ * has been cleared before acting to cancel the import.
+ ****************************************************************/
+static gboolean
+cancel_timeout_cb(gpointer data)
+{
+    QIFImportWindow *wind = data;
+
+    if (wind->busy)
+        /* Wait for timer to go off again. */
+        return TRUE;
+
+    /* The busy flag was lowered. Perform the cancel. */
+    do_cancel(wind);
+
+    /* Cancel the timer. */
+    return FALSE;
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_cancel_cb
+ *
+ * Invoked when the "Cancel" button is clicked.
+ ****************************************************************/
+void
+gnc_ui_qif_import_cancel_cb(GtkAssistant *gtkassistant, gpointer user_data)
+{
+    QIFImportWindow  *wind = user_data;
+
+    if (wind->busy)
+    {
+        /* Cancel any long-running Scheme operation. */
+        scm_c_eval_string("(qif-import:cancel)");
+
+        /* Wait for the busy flag to be lowered. */
+        g_timeout_add(200, cancel_timeout_cb, user_data);
+    }
+    else
+        do_cancel(wind);
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_close_cb
+ *
+ * Invoked when the "Close" button is clicked.
+ ****************************************************************/
+void
+gnc_ui_qif_import_close_cb(GtkAssistant *gtkassistant, gpointer user_data)
+{
+    QIFImportWindow  *wind = user_data;
+
+    gnc_close_gui_component_by_data( ASSISTANT_QIF_IMPORT_CM_CLASS, wind );
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_assistant_get_mappings
+ *
+ * SCM get mappings.
+ ****************************************************************/
+SCM
+gnc_ui_qif_import_assistant_get_mappings(QIFImportWindow * w)
+{
+    return SCM_LIST3(w->acct_map_info,
+                     w->cat_map_info,
+                     w->memo_map_info);
+}
+
+
+/* ================================================================== */
+/*                                                                    */
+/*                         IMPORTER CREATION                          */
+/*                                                                    */
+/* ================================================================== */
+
+/********************************************************************
+ * get_preferences
+ *
+ * Get all user preferences related to QIF import.
+ ********************************************************************/
+static void
+get_preferences(QIFImportWindow *wind)
+{
+    GError * err = NULL;
+    gchar *status_pref = NULL;
+    gchar tmp_transaction_status = 'n';
+
+    g_return_if_fail(wind);
+
+    /* Get the user's preference for showing documentation pages. */
+    wind->show_doc_pages =
+        gnc_gconf_get_bool(GCONF_SECTION, GCONF_NAME_SHOW_DOC, &err);
+    if (err != NULL)
+    {
+        g_warning("QIF import: gnc_gconf_get_bool error: %s", err->message);
+        g_error_free(err);
+
+        /* Show documentation pages by default. */
+        g_warning("QIF import: Couldn't get %s setting from gconf.",
+                  GCONF_NAME_SHOW_DOC);
+        g_warning("QIF import: Documentation pages will be shown by default.");
+        wind->show_doc_pages = TRUE;
+    }
+
+    /* Clear / Reconcile transaction if not specified in QIF file. */
+    status_pref = gnc_gconf_get_string(
+                      GCONF_SECTION, GCONF_NAME_DEFAULT_TRANSACTION_STATUS, &err);
+    if (err != NULL)
+    {
+        g_warning("QIF import: gnc_gconf_get_string error: %s", err->message);
+        g_error_free(err);
+        g_warning("QIF import: Couldn't get %s setting from gconf.",
+                  GCONF_NAME_DEFAULT_TRANSACTION_STATUS);
+    }
+    else
+    {
+        if (g_strcmp0(status_pref, "cleared") == 0)
+        {
+            tmp_transaction_status = 'c';
+        }
+        else if (g_strcmp0(status_pref, "reconciled") == 0)
+        {
+            tmp_transaction_status = 'y';
+        }
+    }
+    g_free(status_pref);
+    wind->transaction_status = SCM_MAKE_CHAR(tmp_transaction_status);
+}
+
+
+/********************************************************************
+ * initialize_scheme
+ *
+ * Initialize all Scheme-controlled objects.
+ ********************************************************************/
+static void
+initialize_scheme(QIFImportWindow *wind)
+{
+    SCM  load_map_prefs;
+    SCM  mapping_info;
+    SCM  create_ticker_map;
+
+    g_return_if_fail(wind);
+
+    /* Initialize Scheme variables. */
+    wind->imported_files        = SCM_EOL;
+    wind->selected_file         = SCM_BOOL_F;
+    wind->gnc_acct_info         = SCM_BOOL_F;
+    wind->cat_display_info      = SCM_BOOL_F;
+    wind->cat_map_info          = SCM_BOOL_F;
+    wind->acct_display_info     = SCM_BOOL_F;
+    wind->acct_map_info         = SCM_BOOL_F;
+    wind->memo_display_info     = SCM_BOOL_F;
+    wind->memo_map_info         = SCM_BOOL_F;
+    wind->security_hash         = SCM_BOOL_F;
+    wind->security_prefs        = SCM_BOOL_F;
+    wind->new_securities        = SCM_BOOL_F;
+    wind->ticker_map            = SCM_BOOL_F;
+    wind->imported_account_tree = SCM_BOOL_F;
+    wind->match_transactions    = SCM_BOOL_F;
+
+    /* Get the saved state of mappings from Quicken accounts and
+     * categories to GnuCash accounts. */
+    load_map_prefs = scm_c_eval_string("qif-import:load-map-prefs");
+    mapping_info = scm_call_0(load_map_prefs);
+    wind->gnc_acct_info         = scm_list_ref(mapping_info, scm_int2num(0));
+    wind->acct_map_info         = scm_list_ref(mapping_info, scm_int2num(1));
+    wind->cat_map_info          = scm_list_ref(mapping_info, scm_int2num(2));
+    wind->memo_map_info         = scm_list_ref(mapping_info, scm_int2num(3));
+    wind->security_hash         = scm_list_ref(mapping_info, scm_int2num(4));
+    wind->security_prefs        = scm_list_ref(mapping_info, scm_int2num(5));
+
+    /* Get the initial ticker map. */
+    create_ticker_map = scm_c_eval_string("make-ticker-map");
+    wind->ticker_map            = scm_call_0(create_ticker_map);
+
+    /* Protect our data from garbage collection. */
+    scm_gc_protect_object(wind->imported_files);
+    scm_gc_protect_object(wind->selected_file);
+    scm_gc_protect_object(wind->gnc_acct_info);
+    scm_gc_protect_object(wind->cat_display_info);
+    scm_gc_protect_object(wind->cat_map_info);
+    scm_gc_protect_object(wind->memo_display_info);
+    scm_gc_protect_object(wind->memo_map_info);
+    scm_gc_protect_object(wind->acct_display_info);
+    scm_gc_protect_object(wind->acct_map_info);
+    scm_gc_protect_object(wind->security_hash);
+    scm_gc_protect_object(wind->security_prefs);
+    scm_gc_protect_object(wind->new_securities);
+    scm_gc_protect_object(wind->ticker_map);
+    scm_gc_protect_object(wind->imported_account_tree);
+    scm_gc_protect_object(wind->match_transactions);
+}
+
+
+/*****************************************
+ * Page 0 - Intro Page Page 
+ ****************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_intro_prepare
+ *
+ * Prepare the intro page for display.
+ ********************************************************************/
+void
+gnc_ui_qif_import_intro_prepare (GtkAssistant  *assistant, gpointer user_data)
+{
+    QIFImportWindow   *wind = user_data;
+
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    SCM unload = scm_c_eval_string("qif-dialog:unload-qif-file");
+    SCM files_list;
+
+    /* Set load stop to FALSE */
+    wind->load_stop = FALSE;
+
+    files_list = scm_call_2(unload, wind->selected_file, wind->imported_files);
+
+    scm_gc_unprotect_object(wind->imported_files);
+    wind->imported_files = files_list;
+    scm_gc_protect_object(wind->imported_files);
+
+    scm_gc_unprotect_object(wind->selected_file);
+    wind->selected_file = SCM_BOOL_F;
+    scm_gc_protect_object(wind->selected_file);
+}
+
+
+/*****************************************
+ * Page 1 - Load File Page Procedures
+ ****************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_load_file_complete
+ *
+ * Do we have a file to load.
+ ********************************************************************/
+static gboolean
+gnc_ui_qif_import_load_file_complete (GtkAssistant  *assistant,
+                                    gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    const gchar * path_to_load;
+
+    /* Get the file name. */
+    path_to_load = gtk_entry_get_text(GTK_ENTRY(wind->filename_entry));
+
+    /* Validate the chosen filename. */
+    if (strlen(path_to_load) == 0)
+        gnc_error_dialog(wind->window, "%s", _("Please select a file to load."));
+    else if (g_access(path_to_load, R_OK) < 0)
+        gnc_error_dialog(wind->window, "%s",
+                         _("File not found or read permission denied. "
+                           "Please select another file."));
+    else
+    {
+        SCM qif_file_loaded = scm_c_eval_string("qif-dialog:qif-file-loaded?");
+
+        /* See if the file is already loaded. */
+        if (scm_call_2(qif_file_loaded,
+                       scm_makfrom0str(path_to_load),
+                       wind->imported_files) == SCM_BOOL_T)
+            gnc_error_dialog(wind->window, "%s",
+                             _("That QIF file is already loaded. "
+                               "Please select another file."));
+        else
+        {
+            /* Passed all checks; proceed to the next page. */
+            return TRUE;
+        }
+    }
+
+    /* Stay on this page. */
+    return FALSE;
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_load_file_prepare
+ *
+ * Prepare the load file page for display.
+ ********************************************************************/
+void
+gnc_ui_qif_import_load_file_prepare (GtkAssistant  *assistant, gpointer user_data)
+{
+    QIFImportWindow   *wind = user_data;
+
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_select_file_cb
+ *
+ * invoked when the "select file" button is clicked
+ * this is just to pick a file name and reset-to-defaults all the
+ * fields describing how to parse the file.
+ ********************************************************************/
+void
+gnc_ui_qif_import_select_file_cb(GtkButton * button,
+                                 gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+
+    GtkAssistant *assistant = GTK_ASSISTANT(wind->window);
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    GtkFileFilter *filter;
+    char * new_file_name;
+    char *file_name, *default_dir;
+
+    /* Default to whatever's already present */
+    default_dir = gnc_get_default_directory(GCONF_SECTION);
+
+    filter = gtk_file_filter_new();
+    gtk_file_filter_set_name(filter, "*.qif");
+    gtk_file_filter_add_pattern(filter, "*.[Qq][Ii][Ff]");
+    new_file_name = gnc_file_dialog(_("Select QIF File"),
+                                    g_list_prepend (NULL, filter),
+                                    default_dir,
+                                    GNC_FILE_DIALOG_IMPORT);
+
+    /* Insure valid data, and something that can be freed. */
+    if (new_file_name == NULL)
+    {
+        file_name = g_strdup(default_dir);
+    }
+    else if (!g_path_is_absolute(new_file_name))
+    {
+        file_name = g_build_filename(default_dir, new_file_name, NULL);
+        g_free(new_file_name);
+    }
+    else
+    {
+        file_name = new_file_name;
+        /* Update the working directory */
+        g_free(default_dir);
+        default_dir = g_path_get_dirname(file_name);
+        gnc_set_default_directory(GCONF_SECTION, default_dir);
+    }
+    g_free(default_dir);
+
+    /* set the filename entry for what was selected */
+    gtk_entry_set_text(GTK_ENTRY(wind->filename_entry), file_name);
+    g_free(file_name);
+
+    gtk_assistant_set_page_complete (assistant, page,
+                                     gnc_ui_qif_import_load_file_complete (assistant, user_data));
+}
+
+
+/*****************************************
+ * Page 2 - Load Progress Page Procedures
+ ****************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_load_progress_pause_cb
+ *
+ * Invoked when the "Pause" button is clicked.
+ ********************************************************************/
+void
+gnc_ui_qif_import_load_progress_pause_cb(GtkButton * button,
+                            gpointer user_data)
+{
+    QIFImportWindow *wind = user_data;
+    SCM toggle_pause      = scm_c_eval_string("qif-import:toggle-pause");
+    SCM progress;
+
+    if (!wind->busy)
+        return;
+
+    /* Create SCM for the progress helper. */
+    progress = SWIG_NewPointerObj(wind->load_progress,
+                                  SWIG_TypeQuery("_p__GNCProgressDialog"),
+                                  0);
+
+    /* Pause (or resume) the currently running operation. */
+    scm_call_1(toggle_pause, progress);
+
+    /* Swap the button label between pause and resume. */
+    if (strcmp(gtk_button_get_label(button), _("_Resume")))
+    {
+        gtk_button_set_use_stock(button, FALSE);
+        gtk_button_set_use_underline(button, TRUE);
+        gtk_button_set_label(button, _("_Resume"));
+    }
+    else
+    {
+        gtk_button_set_use_stock(button, TRUE);
+        gtk_button_set_use_underline(button, FALSE);
+        gtk_button_set_label(button, "gtk-media-pause");
+    }
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_load_progress_start_cb
+ *
+ * Invoked when the "Start" button is clicked.
+ ********************************************************************/
+void
+gnc_ui_qif_import_load_progress_start_cb(GtkButton * button,
+                            gpointer user_data)
+{
+    QIFImportWindow   *wind = user_data;
+    gint num = gtk_assistant_get_current_page (GTK_ASSISTANT(wind->window));
+    GtkWidget *page = gtk_assistant_get_nth_page (GTK_ASSISTANT(wind->window), num);
+
+    const gchar * path_to_load;
+
+    SCM make_qif_file   = scm_c_eval_string("make-qif-file");
+    SCM qif_file_load   = scm_c_eval_string("qif-file:read-file");
+    SCM qif_file_parse  = scm_c_eval_string("qif-file:parse-fields");
+    SCM unload_qif_file = scm_c_eval_string("qif-dialog:unload-qif-file");
+    SCM parse_results   = scm_c_eval_string("qif-file:parse-fields-results");
+    SCM scm_qiffile;
+    SCM imported_files = SCM_EOL;
+    SCM load_return, parse_return;
+    SCM progress;
+
+    /* Raise the busy flag so the assistant can't be canceled unexpectedly. */
+    wind->busy = TRUE;
+    gtk_widget_set_sensitive(wind->load_pause, TRUE);
+
+    /* Get the file name. */
+    path_to_load = gtk_entry_get_text(GTK_ENTRY(wind->filename_entry));
+
+    /* Create the <qif-file> object. */
+    scm_qiffile          = scm_call_0(make_qif_file);
+    scm_gc_unprotect_object(wind->selected_file);
+    wind->selected_file  = scm_qiffile;
+    scm_gc_protect_object(wind->selected_file);
+    imported_files       = scm_cons(scm_qiffile, wind->imported_files);
+
+    /* Create SCM for the progress helper. */
+    progress = SWIG_NewPointerObj(wind->load_progress,
+                                  SWIG_TypeQuery("_p__GNCProgressDialog"),
+                                  0);
+
+    /* Clear any previous pause or cancel state. */
+    scm_c_eval_string("(qif-import:reset-cancel-pause)");
+
+    /*
+     * Load the file.
+     *
+     * The loader returns:
+     *  success:   ()
+     *  failure:   (#f error-message)
+     *  warning:   (#t error-message)
+     *  cancel:    #t
+     *  exception: #f
+     */
+
+    /* This step will fill 70% of the bar. */
+    gnc_progress_dialog_push(wind->load_progress, 0.7);
+    load_return = scm_call_4(qif_file_load,
+                             SCM_CAR(imported_files),
+                             scm_makfrom0str(path_to_load),
+                             wind->ticker_map,
+                             progress);
+    gnc_progress_dialog_pop(wind->load_progress);
+    if (load_return == SCM_BOOL_T)
+    {
+        /* Canceled by the user. */
+
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->load_pause, FALSE);
+
+        /* Inform the user. */
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Canceled"));
+
+        wind->busy = FALSE;
+        wind->load_stop = TRUE;
+    }
+    else if (load_return == SCM_BOOL_F || !scm_is_list(load_return))
+    {
+        /* A bug was detected. */
+
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->load_pause, FALSE);
+
+        /* Inform the user. */
+        gnc_progress_dialog_append_log(wind->load_progress,
+                                       _( "An error occurred while loading the QIF file."));
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
+        gnc_progress_dialog_reset_value(wind->load_progress);
+        gnc_error_dialog(wind->window, "%s",
+                         _( "An error occurred while loading the QIF file."));
+        /* FIXME: How should we request that the user report this problem? */
+
+        wind->busy = FALSE;
+        wind->load_stop = TRUE;
+    }
+    else if (!scm_is_null(load_return))
+    {
+        /* since the result of scm_to_locale_string doesn't appear to be used */
+        /* can we just delete the whole if statement? */
+        if (scm_is_string(SCM_CADR(load_return)))
+        {
+            char * str;
+
+            scm_dynwind_begin (0);
+            str = scm_to_locale_string (SCM_CADR(load_return));
+            /* str doesn't seem to be used anywhere, so go ahead and free it */
+            scm_dynwind_free (str);
+            scm_dynwind_end ();
+        }
+
+        if (SCM_CAR(load_return) == SCM_BOOL_F)
+        {
+            imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
+            scm_gc_unprotect_object(wind->imported_files);
+            wind->imported_files = imported_files;
+            scm_gc_protect_object(wind->imported_files);
+
+            gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
+            gnc_progress_dialog_reset_value(wind->load_progress);
+
+            gtk_widget_set_sensitive(wind->load_pause, FALSE);
+            wind->busy = FALSE;
+            wind->load_stop = TRUE;
+        }
+    }
+
+    /*
+     * Parse the fields.
+     *
+     * The parser returns:
+     *   success:   ()
+     *   failure:   (#f . ((type . error) ...))
+     *   warning:   (#t . ((type . error) ...))
+     *   cancel:    #t
+     *   exception: #f
+     */
+
+    /* This step will fill the remainder of the bar. */
+    gnc_progress_dialog_push(wind->load_progress, 1);
+    parse_return = scm_call_2(qif_file_parse, SCM_CAR(imported_files), progress);
+    gnc_progress_dialog_pop(wind->load_progress);
+    wind->ask_date_format = FALSE;
+    if (parse_return == SCM_BOOL_T)
+    {
+        /* Canceled by the user. */
+
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->load_pause, FALSE);
+
+        /* Unload the file. */
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Cleaning up"));
+        imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
+
+        /* Inform the user. */
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Canceled"));
+
+        wind->busy = FALSE;
+        wind->load_stop = TRUE;
+    }
+    else if (parse_return == SCM_BOOL_F || !scm_is_list(parse_return))
+    {
+        /* A bug was detected. */
+
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->load_pause, FALSE);
+
+        /* Unload the file. */
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Cleaning up"));
+        imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
+
+        /* Inform the user. */
+        gnc_progress_dialog_append_log(wind->load_progress,
+                                       _( "A bug was detected while parsing the QIF file."));
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
+        gnc_progress_dialog_reset_value(wind->load_progress);
+        gnc_error_dialog(wind->window, "%s",
+                         _( "A bug was detected while parsing the QIF file."));
+        /* FIXME: How should we request that the user report this problem? */
+
+        wind->busy = FALSE;
+        wind->load_stop = TRUE;
+    }
+    else if (!scm_is_null(parse_return))
+    {
+        /* Are there only warnings? */
+        if (SCM_CAR(parse_return) == SCM_BOOL_T)
+        {
+            SCM date_formats;
+
+            /* A warning means that (potentially) the date format is
+             * ambiguous.  So search the results for the "date" type and if
+             * it's found, set up the format selector page. */
+            if ((date_formats = scm_call_2(parse_results,
+                                           SCM_CDR(parse_return),
+                                           scm_str2symbol("date"))) != SCM_BOOL_F)
+            {
+                gint n_items;
+
+                /* Block the date call back */
+                g_signal_handlers_block_by_func( wind->date_format_combo, gnc_ui_qif_import_date_valid_cb, wind );
+                /* Clear the date format combo box. */
+                gtk_combo_box_set_active(GTK_COMBO_BOX(wind->date_format_combo), -1);
+                n_items = gtk_tree_model_iter_n_children(
+                              gtk_combo_box_get_model(GTK_COMBO_BOX(wind->date_format_combo)),
+                              NULL);
+                while (n_items-- > 0)
+                    gtk_combo_box_remove_text(GTK_COMBO_BOX(wind->date_format_combo), 0);
+
+                /* Add the formats for the user to select from. */
+                while (scm_is_list(date_formats) && !scm_is_null(date_formats))
+                {
+                    gtk_combo_box_append_text(GTK_COMBO_BOX(wind->date_format_combo),
+                                              SCM_SYMBOL_CHARS(SCM_CAR(date_formats)));
+                    date_formats = SCM_CDR(date_formats);
+                }
+                gtk_combo_box_set_active(GTK_COMBO_BOX(wind->date_format_combo), -1 );
+
+                /* Unblock the date call back */
+                g_signal_handlers_unblock_by_func( wind->date_format_combo, gnc_ui_qif_import_date_valid_cb, wind );
+
+                wind->ask_date_format = TRUE;
+            }
+        }
+        else
+        {
+            /* Parsing failed. */
+            imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
+            gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
+            gnc_progress_dialog_reset_value(wind->load_progress);
+
+            gtk_widget_set_sensitive(wind->load_pause, FALSE);
+            wind->busy = FALSE;
+            wind->load_stop = TRUE;
+        }
+    }
+
+    /* Enable the assistant buttons */
+    gtk_assistant_set_page_complete (GTK_ASSISTANT(wind->window), page, TRUE);
+
+    /* Set Pause and Start buttons */
+    gtk_widget_set_sensitive(wind->load_pause, FALSE);
+    gtk_widget_set_sensitive(wind->load_start, FALSE);
+
+    if(wind->load_stop == FALSE)
+    {
+        /* The file was loaded successfully. */
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Loading completed"));
+        gnc_progress_dialog_set_value(wind->load_progress, 1);
+
+        scm_gc_unprotect_object(wind->imported_files);
+        wind->imported_files = imported_files;
+        scm_gc_protect_object(wind->imported_files);
+
+        gtk_widget_set_sensitive(wind->load_pause, FALSE);
+        wind->busy = FALSE;
+
+        /* Auto step to next page */
+        gtk_assistant_set_current_page (GTK_ASSISTANT(wind->window), num + 1); 
+    }
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_load_progress_prepare
+ *
+ * Prepare the file loading progress page for display.
+ ********************************************************************/
+void
+gnc_ui_qif_import_load_progress_prepare (GtkAssistant  *assistant, gpointer user_data)
+{
+    QIFImportWindow   *wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    /* Reset the progress display. */
+    gnc_progress_dialog_set_primary(wind->load_progress, "");
+    gnc_progress_dialog_set_secondary(wind->load_progress,
+                                      _("When you press the Start Button, GnuCash will load your QIF file. If there are no errors or warnings, you will automatically proceed to the next step. Otherwise, the details will be shown below for your review."));
+    gnc_progress_dialog_set_sub(wind->load_progress, " ");
+    gnc_progress_dialog_reset_value(wind->load_progress);
+    gnc_progress_dialog_reset_log(wind->load_progress);
+
+    /* Set Pause and Start buttons */
+    gtk_widget_set_sensitive(wind->load_pause, FALSE);
+    gtk_widget_set_sensitive(wind->load_start, TRUE);
+
+    /* Enable the assistant buttons */
+    gtk_assistant_set_page_complete (assistant, page, FALSE);
+}
+
+
+/*****************************************
+ * Page 3 - Date format Page Procedures
+ ****************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_date_format_prepare
+ *
+ * Determine if we need the date page and what is next page.
+ ********************************************************************/
+void
+gnc_ui_qif_import_date_format_prepare (GtkAssistant  *assistant, gpointer user_data)
+
+{
+    QIFImportWindow *wind = user_data;
+    GtkWidget *page;
+    gint num = gtk_assistant_get_current_page (assistant);
+
+    if (wind->ask_date_format)
+    {
+        /* We need to get a date format, so stay here. */
+    }
+    else
+    {
+        /* Skip ahead to the Account page. */
+        gtk_assistant_set_current_page (assistant, num + 1);
+    }
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_date_valid_cb
+ *
+ * Reparse file with new date format.
+ ********************************************************************/
+void
+gnc_ui_qif_import_date_valid_cb (GtkWidget *widget, gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+
+    GtkAssistant *assistant = GTK_ASSISTANT(wind->window);
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    SCM  reparse_dates   = scm_c_eval_string("qif-file:reparse-dates");
+    SCM  check_from_acct = scm_c_eval_string("qif-file:check-from-acct");
+    SCM  format_sym;
+    gchar *text;
+
+    /* Get the selected date format. */
+    text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(wind->date_format_combo));
+    if (!text)
+    {
+        g_critical("QIF import: BUG DETECTED in gnc_ui_qif_import_date_valid_cb. Format is NULL.");
+    }
+    format_sym = scm_str2symbol(text);
+    g_free(text);
+
+    /* Reparse the dates using the selected format. */
+    scm_call_2(reparse_dates, wind->selected_file, format_sym);
+
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+}
+
+
+/******************************************
+ * Page 4 - Account Setup Page Procedures
+ ******************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_account_prepare
+ *
+ * Do we need to specify an account.
+ ********************************************************************/
+void
+gnc_ui_qif_import_account_prepare (GtkAssistant  *assistant, gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    GtkWidget *page;
+    gint num = gtk_assistant_get_current_page (assistant);
+
+    SCM  check_from_acct = scm_c_eval_string("qif-file:check-from-acct");
+
+    /* Determine the next page to display. */
+    if (scm_call_1(check_from_acct, wind->selected_file) != SCM_BOOL_T)
+    {
+        /* There is an account name missing. Ask the user to provide one. */
+        SCM default_acct = scm_c_eval_string("qif-file:path-to-accountname");
+        const gchar * default_acctname = NULL;
+
+        if (scm_is_string(scm_call_1(default_acct, wind->selected_file)))
+        {
+            char * str;
+
+            scm_dynwind_begin (0);
+            str = scm_to_locale_string (scm_call_1(default_acct,
+                                                   wind->selected_file));
+            default_acctname = g_strdup (str);
+            scm_dynwind_free (str);
+            scm_dynwind_end ();
+        }
+        gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
+    }
+    else
+    {
+        /* Skip ahead to the "loaded files" page. */
+        gtk_assistant_set_current_page (assistant, num + 1);
+    }
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_acct_valid_cb
+ *
+ * Invoked when the "next" button is clicked on the default acct page.
+ ********************************************************************/
+void
+gnc_ui_qif_import_acct_valid_cb(GtkWidget * widget,
+                                 gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+
+    GtkAssistant *assistant = GTK_ASSISTANT(wind->window);
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    const gchar * acct_name = gtk_entry_get_text(GTK_ENTRY(wind->acct_entry));
+
+    if (!acct_name || acct_name[0] == 0)
+    {
+       /* Disable the assistant Buttons */
+       gtk_assistant_set_page_complete (assistant, page, FALSE);
+    }
+    else
+    {
+       /* Enable the assistant Buttons */
+       gtk_assistant_set_page_complete (assistant, page, TRUE);
+    }
+}
+
+
+/*****************************************
+ * Page 5 - Loaded Files Page Procedures
+ ****************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_loaded_files_prepare
+ *
+ * Get the loaded files page ready for viewing
+ ********************************************************************/
+void
+gnc_ui_qif_import_loaded_files_prepare (GtkAssistant *assistant,
+                                gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    const gchar * acct_name = gtk_entry_get_text(GTK_ENTRY(wind->acct_entry));
+    SCM    fix_default = scm_c_eval_string("qif-import:fix-from-acct");
+    SCM    scm_name;
+
+    scm_name = scm_makfrom0str(acct_name);
+    scm_call_2(fix_default, wind->selected_file, scm_name);
+
+    /* Enable the assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+
+    update_file_page(wind);
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_load_another_cb
+ * Invoked when the "load another" button is clicked on the loaded
+ * files page.
+ ********************************************************************/
+void
+gnc_ui_qif_import_load_another_cb(GtkButton * button,
+                                  gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    GtkAssistant *assistant = GTK_ASSISTANT(wind->window);
+    GtkWidget *page;
+    gint num = gtk_assistant_get_current_page (assistant);
+
+    gtk_assistant_set_current_page (assistant, 1);
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_unload_cb
+ * Invoked when the "unload" button is clicked on the loaded files
+ * page.
+ ********************************************************************/
+void
+gnc_ui_qif_import_unload_file_cb(GtkButton * button,
+                                 gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+
+    SCM unload_qif_file = scm_c_eval_string("qif-dialog:unload-qif-file");
+    SCM imported_files;
+
+    if (wind->selected_file != SCM_BOOL_F)
+    {
+        imported_files =
+            scm_call_2(unload_qif_file, wind->selected_file, wind->imported_files);
+
+        scm_gc_unprotect_object(wind->imported_files);
+        wind->imported_files = imported_files;
+        scm_gc_protect_object(wind->imported_files);
+
+        scm_gc_unprotect_object(wind->selected_file);
+        wind->selected_file = SCM_BOOL_F;
+        scm_gc_protect_object(wind->selected_file);
+
+        update_file_page(wind);
+    }
+}
+
+
+/********************************************************************
+ * update_file_page
+ *
+ * Update the list of loaded files.
+ ********************************************************************/
+static void
+update_file_page(QIFImportWindow * wind)
+{
+    SCM       loaded_file_list = wind->imported_files;
+    SCM       scm_qiffile = SCM_BOOL_F;
+    SCM       qif_file_path;
+    int       row = 0;
+    const char  * row_text = NULL;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkTreeIter iter;
+    GtkTreePath *path;
+    GtkTreeRowReference *reference = NULL;
+
+    /* clear the list */
+    view = GTK_TREE_VIEW(wind->selected_file_view);
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+    gtk_list_store_clear(store);
+    qif_file_path = scm_c_eval_string("qif-file:path");
+
+    while (!scm_is_null(loaded_file_list))
+    {
+        scm_qiffile = SCM_CAR(loaded_file_list);
+        if (scm_is_string(scm_call_1(qif_file_path, scm_qiffile)))
+        {
+            char * str;
+
+            scm_dynwind_begin (0);
+            str = scm_to_locale_string (scm_call_1(qif_file_path, scm_qiffile));
+            row_text = g_strdup (str);
+            scm_dynwind_free (str);
+            scm_dynwind_end ();
+        }
+
+        gtk_list_store_append(store, &iter);
+        gtk_list_store_set(store, &iter,
+                           FILENAME_COL_INDEX, row++,
+                           FILENAME_COL_NAME, row_text,
+                           -1);
+        if (scm_qiffile == wind->selected_file)
+        {
+            path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
+            reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
+            gtk_tree_path_free(path);
+        }
+        loaded_file_list = SCM_CDR(loaded_file_list);
+    }
+
+    if (reference)
+    {
+        GtkTreeSelection* selection = gtk_tree_view_get_selection(view);
+        path = gtk_tree_row_reference_get_path(reference);
+        if (path)
+        {
+            gtk_tree_selection_select_path(selection, path);
+            gtk_tree_path_free(path);
+        }
+        gtk_tree_row_reference_free(reference);
+    }
+}
+
+
+/**********************************************
+ * Page 6 - Account Doc. Page Procedures
+ **********************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_account_doc_prepare
+ ********************************************************************/
+void
+gnc_ui_qif_import_account_doc_prepare (GtkAssistant *assistant,
+                                   gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+    gint total = gtk_assistant_get_n_pages (assistant);
+    gtk_assistant_update_buttons_state (assistant);
+
+    PINFO("Total Number of Assistant Pages is %d", gtk_assistant_get_n_pages (assistant));
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+
+    /* Jump to Summary page if load_stop TRUE */
+    if(wind->load_stop)
+        gtk_assistant_set_current_page (assistant, total - 1 );
+
+    /* Jump over doc page if show_doc_pages FALSE */
+    if(!wind->show_doc_pages)
+        gtk_assistant_set_current_page (assistant, num + 1 );
+}
+
+
+/******************************************
+ * Page 7 - Account Match Page Procedures
+ ******************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_account_match_prepare
+ *
+ * Get the matching pages ready for viewing.
+ ********************************************************************/
+void
+gnc_ui_qif_import_account_match_prepare(GtkAssistant *assistant,
+                                       gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    /* Prepare the matching pages. */
+    gnc_set_busy_cursor(NULL, TRUE);
+    update_account_page(wind);
+    update_category_page(wind);
+    update_memo_page(wind);
+    gnc_unset_busy_cursor(NULL);
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_account_rematch_cb
+ *
+ * This handler is invoked when the user clicks the "Change
+ * GnuCash account" button on the account mapping page. This
+ * button is an alternative to double-clicking a row.
+ ****************************************************************/
+void
+gnc_ui_qif_import_account_rematch_cb(GtkButton *button, gpointer user_data)
+{
+    QIFImportWindow  *wind = user_data;
+
+    g_return_if_fail(wind);
+
+    rematch_line(wind,
+                 gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->acct_view)),
+                 wind->acct_display_info,
+                 wind->acct_map_info,
+                 update_account_page);
+}
+
+
+/*******************************************
+ * Page 8 - Catagory Doc. Page Procedures
+ *******************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_catagory_doc_prepare
+ ********************************************************************/
+void
+gnc_ui_qif_import_catagory_doc_prepare (GtkAssistant *assistant,
+                                   gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+    gint total = gtk_assistant_get_n_pages (assistant);
+    gtk_assistant_update_buttons_state (assistant);
+
+    PINFO("Total Number of Assistant Pages is %d", gtk_assistant_get_n_pages (assistant));
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+
+    /* Jump to Summary page if load_stop TRUE */
+    if(wind->load_stop)
+        gtk_assistant_set_current_page (assistant, total - 1 );
+
+    /* Jump over doc page if show_doc_pages FALSE */
+    if(!wind->show_doc_pages)
+        gtk_assistant_set_current_page (assistant, num + 1 );
+
+    /* If there are no category mappings, jump the doc page. */
+    if (scm_is_list(wind->cat_display_info) && scm_is_null(wind->cat_display_info))
+        gtk_assistant_set_current_page (assistant, num + 1);
+}
+
+
+/******************************************
+ * Page 9 - Catagory Match Page Procedures
+ ******************************************/
+
+/****************************************************************
+ * gnc_ui_qif_import_catagory_match_prepare
+ *
+ * Find the next page to show, depending on whether there are
+ * category or payee/memo mappings to be dealt with.
+ ****************************************************************/
+void
+gnc_ui_qif_import_catagory_match_prepare(GtkAssistant *assistant,
+                                  gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+
+    /* If there are no category mappings, jump this step. */
+    if (scm_is_list(wind->cat_display_info) && scm_is_null(wind->cat_display_info))
+        gtk_assistant_set_current_page (assistant, num + 1);
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_category_rematch_cb
+ *
+ * This handler is invoked when the user clicks the "Change
+ * GnuCash account" button on the category mapping page. This
+ * button is an alternative to double-clicking a row.
+ ****************************************************************/
+void
+gnc_ui_qif_import_category_rematch_cb(GtkButton *button, gpointer user_data)
+{
+    QIFImportWindow  *wind = user_data;
+
+    g_return_if_fail(wind);
+
+    rematch_line(wind,
+                 gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->cat_view)),
+                 wind->cat_display_info,
+                 wind->cat_map_info,
+                 update_category_page);
+}
+
+
+/****************************************
+ * Page 10 - Memo Doc. Page Procedures
+ ****************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_memo_doc_prepare
+ ********************************************************************/
+void
+gnc_ui_qif_import_memo_doc_prepare (GtkAssistant *assistant,
+                                   gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+    gint total = gtk_assistant_get_n_pages (assistant);
+    gtk_assistant_update_buttons_state (assistant);
+
+    PINFO("Total Number of Assistant Pages is %d", gtk_assistant_get_n_pages (assistant));
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+
+    /* Jump to Summary page if load_stop TRUE */
+    if(wind->load_stop)
+        gtk_assistant_set_current_page (assistant, total - 1 );
+
+    /* Jump over doc page if show_doc_pages FALSE */
+    if(!wind->show_doc_pages)
+        gtk_assistant_set_current_page (assistant, num + 1 );
+
+    /* If there are no memo mappings, jump the doc page. */
+    if (scm_is_list(wind->memo_display_info) && scm_is_null(wind->memo_display_info))
+        gtk_assistant_set_current_page (assistant, num + 1);
+}
+
+
+/****************************************
+ * Page 11 - Memo Match Page Procedures
+ ****************************************/
+
+/****************************************************************
+ * gnc_ui_qif_import_memo_match_prepare
+ *
+ * Find the next page to show, depending on whether there are
+ * category or payee/memo mappings to be dealt with.
+ ****************************************************************/
+void
+gnc_ui_qif_import_memo_match_prepare (GtkAssistant *assistant,
+                                  gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+
+    /* If there are no memo mappings, jump this step. */
+    if (scm_is_list(wind->memo_display_info) && scm_is_null(wind->memo_display_info))
+        gtk_assistant_set_current_page (assistant, num + 1);
+}
+
+
+/****************************************************************
+ * gnc_ui_qif_import_memo_rematch_cb
+ *
+ * This handler is invoked when the user clicks the "Change
+ * GnuCash account" button on the memo mapping page. This
+ * button is an alternative to double-clicking a row.
+ ****************************************************************/
+void
+gnc_ui_qif_import_memo_rematch_cb(GtkButton *button, gpointer user_data)
+{
+    QIFImportWindow  *wind = user_data;
+
+    g_return_if_fail(wind);
+
+    rematch_line(wind,
+                 gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->memo_view)),
+                 wind->memo_display_info,
+                 wind->memo_map_info,
+                 update_memo_page);
+}
+
+
+/*****************************************
+ * Page 12  - Currency Page Procedures
+ ****************************************/
+
+/****************************************************************
+ * gnc_ui_qif_import_currency_prepare
+ *
+ * Find the next page to show, depending on whether there are
+ * category or payee/memo mappings to be dealt with.
+ ****************************************************************/
+void
+gnc_ui_qif_import_currency_prepare(GtkAssistant *assistant,
+                                  gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+}
+
+
+/**************************************************
+ * Page 13 - Commodity Doc. Page Procedures
+ **************************************************/
+
+/****************************************************************
+ * gnc_ui_qif_import_new_securities
+ *
+ * This function creates or updates the list of QIF securities
+ * for which no corresponding GnuCash commodity existed prior to
+ * import. If there are any such securities, TRUE is returned.
+ * Otherwise, FALSE is returned.
+ ****************************************************************/
+static gboolean
+gnc_ui_qif_import_new_securities(QIFImportWindow * wind)
+{
+    SCM updates;
+    SCM update_securities = scm_c_eval_string("qif-import:update-security-hash");
+
+    /* Get a list of any new QIF securities since the previous call. */
+    updates = scm_call_4(update_securities,
+                         wind->security_hash,
+                         wind->ticker_map,
+                         wind->acct_map_info,
+                         wind->security_prefs);
+    if (updates != SCM_BOOL_F)
+    {
+        /* A list of new QIF securities was returned. Save it. */
+        scm_gc_unprotect_object(wind->new_securities);
+        if (wind->new_securities != SCM_BOOL_F)
+            /* There is an existing list, so append the new list. */
+            wind->new_securities = scm_append(scm_list_2(wind->new_securities,
+                                              updates));
+        else
+            wind->new_securities = updates;
+        scm_gc_protect_object(wind->new_securities);
+
+        return TRUE;
+    }
+
+    if (wind->new_securities != SCM_BOOL_F)
+        return TRUE;
+
+    return FALSE;
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_commodity_doc_prepare
+ ********************************************************************/
+void
+gnc_ui_qif_import_commodity_doc_prepare (GtkAssistant *assistant,
+                                   gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+    gint total = gtk_assistant_get_n_pages (assistant);
+    gtk_assistant_update_buttons_state (assistant);
+
+    PINFO("Total Number of Assistant Pages is %d", gtk_assistant_get_n_pages (assistant));
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+
+    /* Jump to Summary page if load_stop TRUE */
+    if(wind->load_stop)
+        gtk_assistant_set_current_page (assistant, total - 1 );
+
+    /* If there are new securities, prepare the security pages. */
+    if (gnc_ui_qif_import_new_securities(wind))
+        prepare_security_pages(wind);
+    else
+        /* If there are no securities, jump the doc page */
+        gtk_assistant_set_current_page (assistant, num + 1 );
+
+    /* Jump over doc page if show_doc_pages FALSE */
+    if(!wind->show_doc_pages)
+        gtk_assistant_set_current_page (assistant, num + 1 );
+}
+
+
+/********************************************
+ * Page xx - Commodity New Pages Procedures
+ ********************************************/
+
+/********************************************
+ * gnc_ui_qif_import_commodity_new_prepare
+ *******************************************/
+void
+gnc_ui_qif_import_commodity_new_prepare (GtkAssistant *assistant,
+                                  gpointer user_data)
+{
+    QIFImportWindow     *wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    QIFAssistantPage    *qpage = g_object_get_data(G_OBJECT(page), "page_struct");
+    gchar               *ns;
+
+    /* Get any entered namespace. */
+    ns = gtk_combo_box_get_active_text(GTK_COMBO_BOX(qpage->namespace_combo));
+
+    /* Update the namespaces available to select. */
+    if (!ns || !ns[0])
+        gnc_ui_update_namespace_picker(
+            qpage->namespace_combo,
+            gnc_commodity_get_namespace(qpage->commodity),
+            DIAG_COMM_ALL);
+    else
+        gnc_ui_update_namespace_picker(qpage->namespace_combo, ns, DIAG_COMM_ALL);
+
+    g_free(ns);
+}
+
+
+/*********************************
+ * gnc_ui_qif_import_comm_valid
+ ********************************/
+static gboolean
+gnc_ui_qif_import_comm_valid (GtkAssistant *assistant,
+                               gpointer user_data)
+{
+    QIFImportWindow *wind = user_data;
+    gint num = gtk_assistant_get_current_page (GTK_ASSISTANT(wind->window));
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+    QIFAssistantPage    *qpage = g_object_get_data(G_OBJECT(page), "page_struct");
+
+    QofBook                 *book;
+    gnc_commodity_table     *table;
+    gnc_commodity_namespace *newns;
+
+    gchar       *namespace = gnc_ui_namespace_picker_ns(qpage->namespace_combo);
+    const gchar *name      = gtk_entry_get_text(GTK_ENTRY(qpage->name_entry));
+    const gchar *mnemonic  = gtk_entry_get_text(GTK_ENTRY(qpage->mnemonic_entry));
+
+    if (!name || (name[0] == 0))
+    {
+        gnc_warning_dialog(wind->window, "%s",
+                           _("Enter a name or short description, such as \"Red Hat Stock\"."));
+        g_free(namespace);
+        return FALSE;
+    }
+    else if (!mnemonic || (mnemonic[0] == 0))
+    {
+        gnc_warning_dialog(wind->window, "%s",
+                           _("Enter the ticker symbol or other well known abbreviation, such as"
+                             " \"RHT\". If there isn't one, or you don't know it, create your own."));
+        g_free(namespace);
+        return FALSE;
+    }
+    else if (!namespace || (namespace[0] == 0))
+    {
+        gnc_warning_dialog(wind->window, "%s",
+                           _("Select the exchange on which the symbol is traded, or select the"
+                             " type of investment (such as FUND for mutual funds.) If you don't"
+                             " see your exchange or an appropriate investment type, you can"
+                             " enter a new one."));
+        if (namespace)
+            g_free(namespace);
+        return FALSE;
+    }
+
+    /* FIXME: Should check whether a commodity with this namespace and
+     *        mnemonic already exists. If so, ask the user whether to use
+     *        the existing one, or go back and change what they've entered.
+     */
+
+    book = gnc_get_current_book();
+    table = gnc_commodity_table_get_table(book);
+    if (gnc_commodity_namespace_is_iso(namespace) &&
+            !gnc_commodity_table_lookup(table, namespace, mnemonic))
+    {
+        gnc_warning_dialog(wind->window, "%s",
+                           _("You must enter an existing national "
+                             "currency or enter a different type."));
+
+        g_free(namespace);
+        return FALSE;
+    }
+
+    /* Is the namespace a new one? */
+    if (!gnc_commodity_table_has_namespace(table, namespace))
+    {
+        /* Register it so that it will appear as an option on other pages. */
+        newns = gnc_commodity_table_add_namespace(table, namespace, book);
+
+        /* Remember it so it can be removed if the import gets canceled. */
+        if (newns)
+            wind->new_namespaces = g_list_prepend(wind->new_namespaces, namespace);
+        else
+        {
+            g_warning("QIF import: Couldn't create namespace %s", namespace);
+            g_free(namespace);
+        }
+    }
+    else
+        g_free(namespace);
+
+    return TRUE;
+}
+
+
+/*************************************
+ * gnc_ui_qif_import_comm_changed_cb
+ ************************************/
+void
+gnc_ui_qif_import_comm_changed_cb (GtkWidget *widget, gpointer user_data)
+{
+    QIFImportWindow *wind = user_data;
+    GtkAssistant *assistant = GTK_ASSISTANT(wind->window);
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    gtk_assistant_set_page_complete (assistant, page, gnc_ui_qif_import_comm_valid (assistant, user_data));
+}
+
+
+/**********************************************
+ * Page 14 - Convert progress Page Procedures
+ *********************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_convert_progress_pause_cb
+ *
+ * Invoked when the "Pause" button is clicked.
+ ********************************************************************/
+void
+gnc_ui_qif_import_convert_progress_pause_cb(GtkButton * button,
+                          gpointer user_data)
+{
+    QIFImportWindow *wind = user_data;
+    SCM toggle_pause      = scm_c_eval_string("qif-import:toggle-pause");
+    SCM progress;
+
+    if (!wind->busy)
+        return;
+
+    /* Create SCM for the progress helper. */
+    progress = SWIG_NewPointerObj(wind->convert_progress,
+                                  SWIG_TypeQuery("_p__GNCProgressDialog"),
+                                  0);
+
+    /* Pause (or resume) the currently running operation. */
+    scm_call_1(toggle_pause, progress);
+
+    /* Swap the button label between pause and resume. */
+    if (strcmp(gtk_button_get_label(button), _("_Resume")))
+    {
+        gtk_button_set_use_stock(button, FALSE);
+        gtk_button_set_use_underline(button, TRUE);
+        gtk_button_set_label(button, _("_Resume"));
+    }
+    else
+    {
+        gtk_button_set_use_stock(button, TRUE);
+        gtk_button_set_use_underline(button, FALSE);
+        gtk_button_set_label(button, "gtk-media-pause");
+    }
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_convert_progress_start_cb
+ *
+ * Invoked when the "Start" button is clicked.
+ ********************************************************************/
+void
+gnc_ui_qif_import_convert_progress_start_cb(GtkButton * button,
+                          gpointer user_data)
+{
+    QIFImportWindow   *wind = user_data;
+    gint num = gtk_assistant_get_current_page (GTK_ASSISTANT(wind->window));
+    GtkWidget *page = gtk_assistant_get_nth_page (GTK_ASSISTANT(wind->window), num);
+
+    SCM qif_to_gnc      = scm_c_eval_string("qif-import:qif-to-gnc");
+    SCM find_duplicates = scm_c_eval_string("gnc:account-tree-find-duplicates");
+    SCM retval;
+
+    /* SCM for the progress dialog. */
+    SCM progress = SWIG_NewPointerObj(wind->convert_progress,
+                                      SWIG_TypeQuery("_p__GNCProgressDialog"),
+                                      0);
+
+    /* The default currency. */
+    gchar *currname =
+        gtk_combo_box_get_active_text(GTK_COMBO_BOX(wind->currency_picker));
+
+    /* Raise the busy flag so the assistant can't be canceled unexpectedly. */
+    wind->busy = TRUE;
+    gtk_widget_set_sensitive(wind->convert_pause, TRUE);
+    gtk_widget_set_sensitive(wind->convert_start, FALSE);
+
+    /* Clear any previous pause or cancel state. */
+    scm_c_eval_string("(qif-import:reset-cancel-pause)");
+
+    /* Update the commodities. */
+    gnc_ui_qif_import_commodity_update(wind);
+
+    /*
+     * Convert the QIF data into GnuCash data.
+     *
+     * A Scheme function does all the work.  The return value is the
+     * root account of an account tree containing all the new accounts
+     * and transactions. Upon failure, #f is returned. If the user
+     * cancels, #t is returned.
+     */
+
+    /* This step will fill 70% of the bar. */
+    gnc_progress_dialog_push(wind->convert_progress, 0.7);
+    retval = scm_apply(qif_to_gnc,
+                       SCM_LIST8(wind->imported_files,
+                                 wind->acct_map_info,
+                                 wind->cat_map_info,
+                                 wind->memo_map_info,
+                                 wind->security_hash,
+                                 scm_makfrom0str(currname),
+                                 wind->transaction_status,
+                                 progress),
+                       SCM_EOL);
+    gnc_progress_dialog_pop(wind->convert_progress);
+    g_free(currname);
+
+    if (retval == SCM_BOOL_T)
+    {
+        /* Canceled by the user. */
+
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+
+        /* Remove any converted data. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
+        gnc_ui_qif_import_convert_undo(wind);
+
+        /* Inform the user. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Canceled"));
+        gnc_progress_dialog_reset_value(wind->convert_progress);
+
+        wind->busy = FALSE;
+        wind->load_stop = TRUE;
+    }
+    else if (retval == SCM_BOOL_F)
+    {
+        /* An bug was encountered during conversion. */
+
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+
+        /* Remove any converted data. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
+        gnc_ui_qif_import_convert_undo(wind);
+
+        /* Inform the user. */
+        gnc_progress_dialog_append_log(wind->convert_progress,
+                                       _( "A bug was detected while converting the QIF data."));
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
+        gnc_progress_dialog_reset_value(wind->convert_progress);
+        gnc_error_dialog(wind->window, "%s",
+                         _( "A bug was detected while converting the QIF data."));
+        /* FIXME: How should we request that the user report this problem? */
+
+        wind->busy = FALSE;
+        wind->load_stop = TRUE;
+    }
+    else if (scm_is_symbol(retval))
+    {
+        /* An error was encountered during conversion. */
+
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+
+        /* Remove any converted data. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
+        gnc_ui_qif_import_convert_undo(wind);
+
+        /* Inform the user. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
+        gnc_progress_dialog_reset_value(wind->convert_progress);
+
+        wind->busy = FALSE;
+        wind->load_stop = TRUE;
+    }
+
+    /* Save the imported account tree. */
+    scm_gc_unprotect_object(wind->imported_account_tree);
+    wind->imported_account_tree = retval;
+    scm_gc_protect_object(wind->imported_account_tree);
+
+    /*
+     * Detect potentially duplicated transactions.
+     */
+
+    /* This step will fill the remainder of the bar. */
+    gnc_progress_dialog_push(wind->convert_progress, 1);
+    retval = scm_call_3(find_duplicates,
+                        scm_c_eval_string("(gnc-get-current-root-account)"),
+                        wind->imported_account_tree, progress);
+    gnc_progress_dialog_pop(wind->convert_progress);
+
+    /* Save the results. */
+    scm_gc_unprotect_object(wind->match_transactions);
+    wind->match_transactions = retval;
+    scm_gc_protect_object(wind->match_transactions);
+
+    if (retval == SCM_BOOL_T)
+    {
+        /* Canceled by the user. */
+        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Canceling"));
+        wind->busy = FALSE;
+        wind->load_stop = TRUE;
+    }
+    else if (retval == SCM_BOOL_F)
+    {
+        /* An error occurred during duplicate checking. */
+
+        /* Remove any converted data. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
+        gnc_ui_qif_import_convert_undo(wind);
+
+        /* Inform the user. */
+        gnc_progress_dialog_append_log(wind->convert_progress,
+                                       _( "A bug was detected while detecting duplicates."));
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
+        gnc_progress_dialog_reset_value(wind->convert_progress);
+        gnc_error_dialog(wind->window, "%s",
+                         _( "A bug was detected while detecting duplicates."));
+        /* FIXME: How should we request that the user report this problem? */
+
+        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+        wind->busy = FALSE;
+        wind->load_stop = TRUE;
+    }
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (GTK_ASSISTANT(wind->window), page, TRUE);
+
+    /* Set Pause and Start buttons */
+    gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+    gtk_widget_set_sensitive(wind->convert_start, FALSE);
+
+    if(wind->load_stop == FALSE)
+    {
+        /* The conversion completed successfully. */
+        gnc_progress_dialog_set_sub(wind->convert_progress,
+                                _("Conversion completed"));
+        gnc_progress_dialog_set_value(wind->convert_progress, 1);
+
+        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+        wind->busy = FALSE;
+
+        /* If the log is empty, move on to the next page automatically. */
+        if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(wind->convert_log))) == 0)
+            gtk_assistant_set_current_page (GTK_ASSISTANT(wind->window), num + 1);
+    }
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_convert_progress_prepare
+ *
+ * Prepare the data conversion progress page for display.
+ ********************************************************************/
+void
+gnc_ui_qif_import_convert_progress_prepare(GtkAssistant *assistant,
+        gpointer user_data)
+{
+    QIFImportWindow   *wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    /* Recompute assistant Buttons */
+    gtk_assistant_update_buttons_state( assistant );
+
+    /* Reset the progress display. */
+    gnc_progress_dialog_set_primary(wind->convert_progress, "");
+    gnc_progress_dialog_set_secondary(wind->convert_progress,
+                                      _("When you press the Start Button, GnuCash will import your QIF data. If there are no errors or warnings, you will automatically proceed to the next step. Otherwise, the details will be shown below for your review."));
+    gnc_progress_dialog_set_sub(wind->convert_progress, " ");
+    gnc_progress_dialog_reset_value(wind->convert_progress);
+    gnc_progress_dialog_reset_log(wind->convert_progress);
+
+    /* Set Pause and Start buttons */
+    gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+    gtk_widget_set_sensitive(wind->convert_start, TRUE);
+
+    /* Enable the assistant buttons */
+    gtk_assistant_set_page_complete (assistant, page, FALSE);
+}
+
+
+/*****************************************
+ * Page 15 - Match Doc. Page Procedures
+ *****************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_duplicates_doc_prepare
+ ********************************************************************/
+void
+gnc_ui_qif_import_duplicates_doc_prepare (GtkAssistant *assistant,
+                                   gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+    gint total = gtk_assistant_get_n_pages (assistant);
+    gtk_assistant_update_buttons_state (assistant);
+
+    PINFO("Total Number of Assistant Pages is %d", gtk_assistant_get_n_pages (assistant));
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+
+    /* Jump to Summary page if load_stop TRUE */
+    if(wind->load_stop)
+        gtk_assistant_set_current_page (assistant, total - 1 );
+
+    /* Jump over doc page if show_doc_pages FALSE */
+    if(!wind->show_doc_pages)
+        gtk_assistant_set_current_page (assistant, num + 1 );
+
+    /* Don't show doc page if there are no duplicates */
+    if(scm_is_null(wind->match_transactions))
+        gtk_assistant_set_current_page (assistant, num + 1 );
+}
+
+
+/**********************************************
+ * Page 16 - Match Duplicates Page Procedures
+ **********************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_duplicates_match_prepare
+ ********************************************************************/
+void
+gnc_ui_qif_import_duplicates_match_prepare (GtkAssistant *assistant,
+                                   gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    GtkTreeView      *view;
+    GtkListStore     *store;
+    SCM               duplicates;
+    SCM               current_xtn;
+    Transaction      *gnc_xtn;
+    Split            *gnc_split;
+    GtkTreeIter       iter;
+    GtkTreeSelection *selection;
+    GtkTreePath      *path;
+    const gchar      *amount_str;
+    int               rownum = 0;
+
+    if(!scm_is_null(wind->match_transactions))
+    {
+        view = GTK_TREE_VIEW(wind->new_transaction_view);
+        store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+        gtk_list_store_clear(store);
+
+        if (!scm_is_list(wind->match_transactions))
+            return;
+
+        /* Loop through the list of new, potentially duplicate transactions. */
+        duplicates = wind->match_transactions;
+        while (!scm_is_null(duplicates))
+        {
+            current_xtn = SCM_CAAR(duplicates);
+#define FUNC_NAME "xaccTransCountSplits"
+            gnc_xtn = SWIG_MustGetPtr(current_xtn,
+                                      SWIG_TypeQuery("_p_Transaction"), 1, 0);
+#undef FUNC_NAME
+            if (xaccTransCountSplits(gnc_xtn) > 2)
+                amount_str = _("(split)");
+            else
+            {
+                gnc_split = xaccTransGetSplit(gnc_xtn, 0);
+                amount_str =
+                    xaccPrintAmount(gnc_numeric_abs(xaccSplitGetValue(gnc_split)),
+                                gnc_account_print_info
+                                (xaccSplitGetAccount(gnc_split), TRUE));
+            }
+            gtk_list_store_append(store, &iter);
+            gtk_list_store_set
+                (store, &iter,
+                QIF_TRANS_COL_INDEX, rownum++,
+                QIF_TRANS_COL_DATE,
+                gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
+                QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
+                QIF_TRANS_COL_AMOUNT, amount_str,
+                -1);
+
+            duplicates = SCM_CDR(duplicates);
+        }
+        selection = gtk_tree_view_get_selection(view);
+        path = gtk_tree_path_new_from_indices(0, -1);
+        gtk_tree_selection_select_path(selection, path);
+        gtk_tree_path_free(path);
+    }
+    else
+        gtk_assistant_set_current_page (assistant, num + 1 );
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+}
+
+
+/*************************************
+ * Page 17 - Apply Page Procedures
+ *************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_end_page_prepare
+ ********************************************************************/
+void
+gnc_ui_qif_import_end_page_prepare (GtkAssistant *assistant,
+                                   gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_finish_cb
+ *
+ * Invoked when the "Apply" button is clicked on the final page.
+ ********************************************************************/
+void
+gnc_ui_qif_import_finish_cb (GtkAssistant *gtkassistant,
+                            gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+
+    SCM save_map_prefs = scm_c_eval_string("qif-import:save-map-prefs");
+    SCM cat_and_merge = scm_c_eval_string("gnc:account-tree-catenate-and-merge");
+    SCM prune_xtns = scm_c_eval_string("gnc:prune-matching-transactions");
+    SCM scm_result;
+
+    GncPluginPage *page;
+    gboolean acct_tree_found = FALSE;
+
+    gnc_suspend_gui_refresh();
+
+    /* Prune any imported transactions that were determined to be duplicates. */
+    if (wind->match_transactions != SCM_BOOL_F)
+        scm_call_1(prune_xtns, wind->match_transactions);
+
+    /* Merge the imported account tree with the existing one. */
+    if (wind->imported_account_tree != SCM_BOOL_F)
+        scm_call_2(cat_and_merge,
+                   scm_c_eval_string("(gnc-get-current-root-account)"),
+                   wind->imported_account_tree);
+
+    gnc_resume_gui_refresh();
+
+    /* Save the user's mapping preferences. */
+    scm_result = scm_apply(save_map_prefs,
+                           SCM_LIST5(wind->acct_map_info, wind->cat_map_info,
+                                     wind->memo_map_info, wind->security_hash,
+                                     wind->security_prefs),
+                           SCM_EOL);
+
+    if (scm_result == SCM_BOOL_F)
+        gnc_warning_dialog(wind->window, "%s",
+                           _("GnuCash was unable to save your mapping preferences."));
+
+    /* Open an account tab in the main window if one doesn't exist already. */
+    gnc_main_window_foreach_page(gnc_ui_qif_import_check_acct_tree,
+                                 &acct_tree_found);
+
+    if (!acct_tree_found)
+    {
+        page = gnc_plugin_page_account_tree_new();
+        gnc_main_window_open_page(NULL, page);
+    }
+}
+
+
+/***************************************
+ * Page 18 - Summary Page Procedures
+ ***************************************/
+
+/********************************************************************
+ * gnc_ui_qif_import_summary_page_prepare
+ ********************************************************************/
+void
+gnc_ui_qif_import_summary_page_prepare (GtkAssistant *assistant,
+                                   gpointer user_data)
+{
+    QIFImportWindow * wind = user_data;
+    gint num = gtk_assistant_get_current_page (assistant);
+    GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
+
+    gchar *text;
+
+    if(wind->load_stop)
+	text = g_strdup_printf(_("There was a problem with the import."));
+    else
+	text = g_strdup_printf(_("QIF Import Completed."));
+
+    gtk_label_set_markup(GTK_LABEL(wind->summary_text), g_strdup_printf("<span size=\"large\"><b>%s</b></span>",text));
+
+    g_free(text);
+
+    /* Enable the Assistant Buttons */
+    gtk_assistant_set_page_complete (assistant, page, TRUE);
+}
+
+
+/********************************************************************
+ * Prepare callback for assistant pages.
+ ********************************************************************/
+void gnc_ui_qif_import_prepare_cb (GtkAssistant  *assistant, GtkWidget *page,
+                 gpointer user_data)
+{
+    QIFImportWindow   *wind = user_data;
+    gint currentpage = gtk_assistant_get_current_page(assistant);
+    GtkWidget *mypage = gtk_assistant_get_nth_page (assistant, currentpage);
+    const char *pagename = gtk_buildable_get_name(GTK_BUILDABLE(mypage));
+
+    PINFO("Builder Page Name is %s", gtk_buildable_get_name(GTK_BUILDABLE(mypage)));
+
+    if (!g_strcmp0 (pagename, "start_page"))
+    {
+        /* Current page is Intro page */
+        gnc_ui_qif_import_intro_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "load_file_page"))
+    {
+        /* Current page is File Load */
+        gnc_ui_qif_import_load_file_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "load_progress_page"))
+    {
+        /* Current page is Load Progress */
+        gnc_ui_qif_import_load_progress_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "date_format_page"))
+    {
+        /* Current page is date page */
+        gnc_ui_qif_import_date_format_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "account_name_page"))
+    {
+        /* Current page is account page */
+        gnc_ui_qif_import_account_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "loaded_files_page"))
+    {
+        /* Current page is loaded files page */
+        gnc_ui_qif_import_loaded_files_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "account_doc_page"))
+    {
+        /* Current page is  Account Doc. page */
+        gnc_ui_qif_import_account_doc_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "account_match_page"))
+    {
+        /* Current page is Account Match page */
+        gnc_ui_qif_import_account_match_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "category_doc_page"))
+    {
+        /* Current page is Catagory Doc. page */
+        gnc_ui_qif_import_catagory_doc_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "category_match_page"))
+    {
+        /* Current page is Catagory Match page */
+        gnc_ui_qif_import_catagory_match_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "memo_doc_page"))
+    {
+        /* Current page is Memo Doc. page */
+        gnc_ui_qif_import_memo_doc_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "memo_match_page"))
+    {
+        /* Current page is Memo Match page */
+        gnc_ui_qif_import_memo_match_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "currency_page"))
+    {
+        /* Current page is Currency page */
+        gnc_ui_qif_import_currency_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "commodity_doc_page"))
+    {
+        /* Current page is Commodity Doc. page */
+        gnc_ui_qif_import_commodity_doc_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "commodity_page"))
+    {
+        /* Current page is Commodity page */
+        /* gnc_ui_qif_import_commodity_prepare (assistant, user_data); */
+    }else if (!g_strcmp0 (pagename, "convert_progress_page"))
+    {
+        /* Current page is Conversion progress page */
+        gnc_ui_qif_import_convert_progress_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "duplicates_doc_page"))
+    {
+        /* Current page is Duplicates Doc page */
+        gnc_ui_qif_import_duplicates_doc_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "duplicates_match_page"))
+    {
+        /* Current page is Duplicates Match page */
+        gnc_ui_qif_import_duplicates_match_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "end_page"))
+    {
+        /* Current page is the end page */
+        gnc_ui_qif_import_end_page_prepare (assistant, user_data);
+    }else if (!g_strcmp0 (pagename, "summary_page"))
+    {
+        /* Current page is the summary page */
+        gnc_ui_qif_import_summary_page_prepare (assistant, user_data);
+    }else
+    {
+        /* Current page is a new commodity page */
+        gnc_ui_qif_import_commodity_new_prepare (assistant, user_data);
+    }
+}
+
+
+/********************************************************************
+ * get_assistant_widgets
+ *
+ * Get all builder-defined widgets that need to be actively managed.
+ ********************************************************************/
+static void
+get_assistant_widgets(QIFImportWindow *wind, GtkBuilder *builder)
+{
+    g_return_if_fail(wind);
+    g_return_if_fail(builder);
+
+    wind->window             = GTK_WIDGET(gtk_builder_get_object (builder, "QIF Import Assistant"));
+    wind->filename_entry     = GTK_WIDGET(gtk_builder_get_object (builder, "qif_filename_entry"));
+    wind->load_pause         = GTK_WIDGET(gtk_builder_get_object (builder, "load_progress_pause"));
+    wind->load_start         = GTK_WIDGET(gtk_builder_get_object (builder, "load_progress_start"));
+    wind->load_log           = GTK_WIDGET(gtk_builder_get_object (builder, "load_progress_log"));
+    wind->load_progress      = gnc_progress_dialog_custom(
+                                  GTK_LABEL(gtk_builder_get_object (builder, "load_progress_primary")),
+                                  GTK_LABEL(gtk_builder_get_object (builder, "load_progress_secondary")),
+                                  GTK_PROGRESS_BAR(gtk_builder_get_object (builder, "load_progress_bar")),
+                                  GTK_LABEL(gtk_builder_get_object (builder, "load_progress_sub")),
+                                  GTK_TEXT_VIEW(wind->load_log));
+    wind->acct_entry         = GTK_WIDGET(gtk_builder_get_object (builder, "qif_account_entry"));
+    wind->date_format_combo  = GTK_WIDGET(gtk_builder_get_object (builder, "date_format_combobox"));
+    wind->selected_file_view = GTK_WIDGET(gtk_builder_get_object (builder, "selected_file_view"));
+    wind->unload_file_btn    = GTK_WIDGET(gtk_builder_get_object (builder, "unload_file_button"));
+    wind->currency_picker    = GTK_WIDGET(gtk_builder_get_object (builder, "currency_comboboxentry"));
+    wind->acct_view          = GTK_WIDGET(gtk_builder_get_object (builder, "account_page_view"));
+    wind->acct_view_count    = GTK_WIDGET(gtk_builder_get_object (builder, "account_page_count"));
+    wind->acct_view_btn      = GTK_WIDGET(gtk_builder_get_object (builder, "account_page_change"));
+    wind->cat_view           = GTK_WIDGET(gtk_builder_get_object (builder, "category_page_view"));
+    wind->cat_view_count     = GTK_WIDGET(gtk_builder_get_object (builder, "category_page_count"));
+    wind->cat_view_btn       = GTK_WIDGET(gtk_builder_get_object (builder, "category_page_change"));
+    wind->memo_view          = GTK_WIDGET(gtk_builder_get_object (builder, "memo_page_view"));
+    wind->memo_view_count    = GTK_WIDGET(gtk_builder_get_object (builder, "memo_page_count"));
+    wind->memo_view_btn      = GTK_WIDGET(gtk_builder_get_object (builder, "memo_page_change"));
+    wind->convert_pause      = GTK_WIDGET(gtk_builder_get_object (builder, "convert_progress_pause"));
+    wind->convert_start      = GTK_WIDGET(gtk_builder_get_object (builder, "convert_progress_start"));
+    wind->convert_log        = GTK_WIDGET(gtk_builder_get_object (builder, "convert_progress_log"));
+    wind->convert_progress   = gnc_progress_dialog_custom(
+                                  GTK_LABEL(gtk_builder_get_object (builder, "convert_progress_primary")),
+                                  GTK_LABEL(gtk_builder_get_object (builder, "convert_progress_secondary")),
+                                  GTK_PROGRESS_BAR(gtk_builder_get_object (builder, "convert_progress_bar")),
+                                  GTK_LABEL(gtk_builder_get_object (builder, "convert_progress_sub")),
+                                  GTK_TEXT_VIEW(wind->convert_log));
+    wind->summary_text       = GTK_WIDGET(gtk_builder_get_object (builder, "summary_page"));
+
+    wind->new_transaction_view =
+        GTK_WIDGET(gtk_builder_get_object (builder, "new_transaction_view"));
+    wind->old_transaction_view =
+        GTK_WIDGET(gtk_builder_get_object (builder, "old_transaction_view"));
+
+    gnc_assistant_set_colors (GTK_ASSISTANT (wind->window));
+}
+
+
+/********************************************************************
+ * build_views
+ *
+ * Build the details of all GtkTreeView widgets.
+ ********************************************************************/
+static void
+build_views(QIFImportWindow *wind)
+{
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+    GtkTreeSelection *selection;
+
+    g_return_if_fail(wind);
+
+    /* Set up the selected file view */
+    view = GTK_TREE_VIEW(wind->selected_file_view);
+    store = gtk_list_store_new(NUM_FILENAME_COLS, G_TYPE_INT, G_TYPE_STRING);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes("unused",
+             renderer,
+             "text",
+             FILENAME_COL_NAME,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+
+    selection = gtk_tree_view_get_selection(view);
+    g_signal_connect(selection, "changed",
+                     G_CALLBACK(gnc_ui_qif_import_select_loaded_file_cb),
+                     wind);
+
+    /* Set up the QIF account to GnuCash account matcher. */
+    create_account_picker_view(wind->acct_view, _("QIF account name"),
+                               G_CALLBACK(gnc_ui_qif_import_account_activate_cb),
+                               G_CALLBACK(gnc_ui_qif_import_account_select_cb),
+                               wind);
+
+    /* Set up the QIF category to GnuCash account matcher. */
+    create_account_picker_view(wind->cat_view,  _("QIF category name"),
+                               G_CALLBACK(gnc_ui_qif_import_category_activate_cb),
+                               G_CALLBACK(gnc_ui_qif_import_category_select_cb),
+                               wind);
+
+    /* Set up the QIF payee/memo to GnuCash account matcher. */
+    create_account_picker_view(wind->memo_view, _("QIF payee/memo"),
+                               G_CALLBACK(gnc_ui_qif_import_memo_activate_cb),
+                               G_CALLBACK(gnc_ui_qif_import_memo_select_cb),
+                               wind);
+
+    /* Set up the new transaction view */
+    view = GTK_TREE_VIEW(wind->new_transaction_view);
+    store = gtk_list_store_new(NUM_QIF_TRANS_COLS, G_TYPE_INT, G_TYPE_STRING,
+                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Date"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_DATE,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Description"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_DESCRIPTION,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+    gtk_tree_view_column_set_expand(column, TRUE);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Amount"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_AMOUNT,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+
+    selection = gtk_tree_view_get_selection(view);
+    g_signal_connect(selection, "changed",
+                     G_CALLBACK(gnc_ui_qif_import_duplicate_new_select_cb),
+                     wind);
+
+    /* Set up the old transaction view */
+    view = GTK_TREE_VIEW(wind->old_transaction_view);
+    store = gtk_list_store_new(NUM_QIF_TRANS_COLS, G_TYPE_INT, G_TYPE_STRING,
+                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Date"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_DATE,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Description"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_DESCRIPTION,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+    gtk_tree_view_column_set_expand(column, TRUE);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Amount"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_AMOUNT,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+
+    renderer = gtk_cell_renderer_toggle_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Match?"),
+             renderer,
+             "active",
+             QIF_TRANS_COL_CHECKED,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+
+    selection = gtk_tree_view_get_selection(view);
+    g_signal_connect(selection, "changed",
+                     G_CALLBACK(gnc_ui_qif_import_duplicate_old_select_cb),
+                     wind);
+}
+
+
+/********************************************************************
+ * gnc_ui_qif_import_assistant_make
+ *
+ * Build a new QIF import assistant.
+ ********************************************************************/
+static GtkWidget * 
+gnc_ui_qif_import_assistant_make(QIFImportWindow *qif_win)
+{
+    GtkBuilder        *builder;
+    GtkWidget         *box;
+
+    builder = gtk_builder_new();
+    gnc_builder_add_from_file (builder,"assistant-qif-import.glade", "currency_liststore");
+    gnc_builder_add_from_file (builder,"assistant-qif-import.glade", "date_format_liststore");
+    gnc_builder_add_from_file (builder,"assistant-qif-import.glade", "QIF Import Assistant");
+
+    qif_win->new_namespaces       = NULL;
+    qif_win->selected_transaction = 0;
+    qif_win->busy                 = FALSE;
+
+    /* Get all user preferences related to QIF importing. */
+    get_preferences(qif_win);
+
+    /* Set up the Scheme side of things. */
+    initialize_scheme(qif_win);
+
+    /* Get all interesting builder-defined widgets. */
+    get_assistant_widgets(qif_win, builder);
+
+    /* Build the details of all GtkTreeView widgets. */
+    build_views(qif_win);
+
+    /* Currency Page */
+    /* Set a default currency for new accounts */
+    qif_win->currency_picker = gnc_currency_edit_new();
+    gnc_currency_edit_set_currency (GNC_CURRENCY_EDIT(qif_win->currency_picker), gnc_default_currency());
+    gtk_widget_show (qif_win->currency_picker);
+    box = GTK_WIDGET(gtk_builder_get_object (builder, "currency_picker_hbox"));
+    gtk_box_pack_start(GTK_BOX(box), qif_win->currency_picker, TRUE, TRUE, 0);
+
+    g_signal_connect( qif_win->window, "destroy",
+                      G_CALLBACK(gnc_ui_qif_import_assistant_destroy), qif_win );
+
+    gtk_builder_connect_signals(builder, qif_win);
+
+    g_object_unref(G_OBJECT(builder));
+
+    gtk_widget_show_all(qif_win->window);
+    gtk_window_present(GTK_WINDOW(qif_win->window));
+
+    return qif_win->window;
+}
+
+
+/********************************************
+ * gnc_ui_qif_import_assistant_close_handler
+ ********************************************/
+static void
+gnc_ui_qif_import_assistant_close_handler( gpointer user_data )
+{
+    QIFImportWindow *qif_win = user_data;
+    gtk_widget_destroy( qif_win->window );
+}
+
+
+/********************************************
+ * gnc_file_qif_import
+ ********************************************/
+void
+gnc_file_qif_import(void)
+{
+    QIFImportWindow *qif_win;
+    gint component_id;
+
+    qif_win = g_new0 (QIFImportWindow, 1);
+
+    /* pop up the QIF File Import dialog box */
+    gnc_ui_qif_import_assistant_make(qif_win);
+
+    component_id = gnc_register_gui_component (ASSISTANT_QIF_IMPORT_CM_CLASS,
+                   NULL, gnc_ui_qif_import_assistant_close_handler,
+                   qif_win);
+
+    gnc_gui_component_watch_entity_type (component_id,
+                                         GNC_ID_ACCOUNT,
+                                         QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
+
+    gtk_widget_show_all (qif_win->window);
+
+    gnc_window_adjust_for_screen (GTK_WINDOW(qif_win->window));
+}

Added: gnucash/trunk/src/import-export/qif-import/assistant-qif-import.glade
===================================================================
--- gnucash/trunk/src/import-export/qif-import/assistant-qif-import.glade	                        (rev 0)
+++ gnucash/trunk/src/import-export/qif-import/assistant-qif-import.glade	2011-12-02 20:55:43 UTC (rev 21653)
@@ -0,0 +1,1305 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy project-wide -->
+  <object class="GtkAssistant" id="QIF Import Assistant">
+    <property name="can_focus">False</property>
+    <property name="border_width">12</property>
+    <property name="title" translatable="yes">QIF Import Assistant</property>
+    <signal name="close" handler="gnc_ui_qif_import_close_cb" swapped="no"/>
+    <signal name="apply" handler="gnc_ui_qif_import_finish_cb" swapped="no"/>
+    <signal name="cancel" handler="gnc_ui_qif_import_cancel_cb" swapped="no"/>
+    <signal name="prepare" handler="gnc_ui_qif_import_prepare_cb" swapped="no"/>
+    <child>
+      <object class="GtkLabel" id="start_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">GnuCash can import financial data from QIF (Quicken Interchange Format) files written by Quicken/QuickBooks, MS Money, Moneydance, and many other programs. 
+
+The import process has several steps. Your GnuCash accounts will not be changed until you click "Apply" at the end of the process. 
+
+Click "Forward" to start loading your QIF data, or "Cancel" to abort the process. </property>
+        <property name="wrap">True</property>
+      </object>
+      <packing>
+        <property name="page_type">intro</property>
+        <property name="title" translatable="yes">Import QIF files</property>
+        <property name="complete">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="load_file_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkLabel" id="label822">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Please select a file to load. When you click "Forward", the file will be loaded and analyzed. You may need to answer some questions about the account(s) in the file.
+
+You will have the opportunity to load as many files as you wish, so don't  worry if your data is in multiple files. 
+</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">5</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="hbox69">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkEntry" id="qif_filename_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="editable">False</property>
+                <property name="invisible_char">&#x25CF;</property>
+                <property name="invisible_char_set">True</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+                <property name="primary_icon_sensitive">True</property>
+                <property name="secondary_icon_sensitive">True</property>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button71">
+                <property name="label" translatable="yes">_Select...</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_underline">True</property>
+                <signal name="clicked" handler="gnc_ui_qif_import_select_file_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">3</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Select a QIF file to load</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="load_progress_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <property name="spacing">12</property>
+        <child>
+          <object class="GtkLabel" id="load_progress_primary">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label"><span weight="bold" size="larger">Primary text</span></property>
+            <property name="use_markup">True</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="load_progress_secondary">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label">Secondary text.</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkVBox" id="load_progress_vbox1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkProgressBar" id="load_progress_bar">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="pulse_step">0.10000000149</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="load_progress_sub">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label"><span style="italic">Sub-operation text</span></property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHButtonBox" id="load_progress_hbuttonbox1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="layout_style">end</property>
+                <child>
+                  <object class="GtkButton" id="load_progress_start">
+                    <property name="label" translatable="yes">_Start</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="use_underline">True</property>
+                    <signal name="clicked" handler="gnc_ui_qif_import_load_progress_start_cb" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="load_progress_pause">
+                    <property name="label">gtk-media-pause</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="can_default">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="use_stock">True</property>
+                    <signal name="clicked" handler="gnc_ui_qif_import_load_progress_pause_cb" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">6</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow25">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">automatic</property>
+            <property name="vscrollbar_policy">automatic</property>
+            <property name="shadow_type">in</property>
+            <child>
+              <object class="GtkTextView" id="load_progress_log">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="editable">False</property>
+                <property name="wrap_mode">word</property>
+                <property name="cursor_visible">False</property>
+                <property name="accepts_tab">False</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Load QIF files</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="date_format_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkLabel" id="label841">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">The QIF file format does not specify which order the day, month, and year components of a date are printed.  In most cases, it is possible to automatically determine which format is in use in a particular file. However, in the file you have just imported there exist more than one possible format that fits the data.  
+
+Please select a date format for the file.  QIF files created by European software are likely  to be in "d-m-y" or day-month-year format, where US QIF files are likely to be "m-d-y" or month-day-year.    
+</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkComboBox" id="date_format_combobox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="model">date_format_liststore</property>
+            <signal name="changed" handler="gnc_ui_qif_import_date_valid_cb" swapped="no"/>
+            <child>
+              <object class="GtkCellRendererText" id="cellrenderertext1"/>
+              <attributes>
+                <attribute name="text">0</attribute>
+              </attributes>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label847713">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Click "Back" to cancel the loading of this file and choose another.</property>
+            <property name="justify">center</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Set a date format for this QIF file</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="account_name_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkLabel" id="label823">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">The QIF file that you just loaded appears to contain transactions for just one account, but the file does not specify a name for that account.  
+
+Please enter a name for the account. If the file was exported from another accounting program, you should use the same account name that was used  in that program.
+</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">4</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="hbox70">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkLabel" id="label824">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">1</property>
+                <property name="label" translatable="yes">Account name:</property>
+                <property name="justify">center</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="qif_account_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">&#x25CF;</property>
+                <property name="invisible_char_set">True</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+                <property name="primary_icon_sensitive">True</property>
+                <property name="secondary_icon_sensitive">True</property>
+                <signal name="changed" handler="gnc_ui_qif_import_acct_valid_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label847714">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Click "Back" to cancel the loading of this file and choose another.</property>
+            <property name="justify">center</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Set the default QIF account name</property>
+        <property name="complete">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="loaded_files_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <property name="spacing">4</property>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow26">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">automatic</property>
+            <property name="vscrollbar_policy">automatic</property>
+            <property name="shadow_type">in</property>
+            <child>
+              <object class="GtkTreeView" id="selected_file_view">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="headers_visible">False</property>
+                <property name="rules_hint">True</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label816">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Click "Load another file" if you have more data to import at this time. Do this if you have saved your accounts to separate QIF files.
+
+Click "Forward" to finish loading files and move to the next step of the QIF import process. </property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">3</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHButtonBox" id="hbox68">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">spread</property>
+            <child>
+              <object class="GtkButton" id="unload_file_button">
+                <property name="label" translatable="yes">_Unload selected file</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_underline">True</property>
+                <signal name="clicked" handler="gnc_ui_qif_import_unload_file_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button69">
+                <property name="label" translatable="yes">_Load another file</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_underline">True</property>
+                <signal name="clicked" handler="gnc_ui_qif_import_load_another_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="title" translatable="yes">QIF files you have loaded</property>
+        <property name="complete">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="account_doc_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkLabel" id="label830">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">On the next page, the accounts in your QIF files and any stocks or mutual funds you own will be matched with GnuCash accounts. If a GnuCash account already exists with the same name, or a similar name and compatible type, that account will be used as a match; otherwise, GnuCash will create a new account with the same name and type as the QIF account. If you do not like the suggested GnuCash account, double-click to change it.
+
+Note that GnuCash will be creating many accounts that did not exist on your other personal finance program, including a separate account for each stock you own, separate accounts for the brokerage commissions, special "Equity" accounts (subaccounts of Retained Earnings, by default) which are the source of your opening balances, etc. All of these accounts will appear on the next page so you can change them if you want to, but it is safe to leave them alone.
+</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Accounts and stock holdings</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="account_match_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkLabel" id="label7609">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">5</property>
+            <property name="label" translatable="yes">_Select the matchings you want to change:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">account_page_view</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">5</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow11">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">automatic</property>
+            <property name="vscrollbar_policy">automatic</property>
+            <property name="shadow_type">in</property>
+            <child>
+              <object class="GtkTreeView" id="account_page_view">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="rules_hint">True</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="hbox7609">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkLabel" id="label7610">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Matchings selected:</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="account_page_count">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label">0</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="padding">3</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="account_page_change">
+                <property name="label" translatable="yes">Change GnuCash _Account...</property>
+                <property name="visible">True</property>
+                <property name="sensitive">False</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_underline">True</property>
+                <signal name="clicked" handler="gnc_ui_qif_import_account_rematch_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Match QIF accounts with GnuCash accounts</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="category_doc_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkLabel" id="label840">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">GnuCash uses separate Income and Expense accounts rather than categories to classify your transactions. Each of the categories in your QIF file will be converted to a GnuCash account. 
+
+On the next page, you will have an opportunity to look at the suggested matches between QIF categories and GnuCash accounts. You may change matches that you do not like by double-clicking on the line containing the category name.
+
+If you change your mind later, you can reorganize the account structure safely within GnuCash.</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Income and Expense categories</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="category_match_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkLabel" id="label7611">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">5</property>
+            <property name="label" translatable="yes">_Select the matchings you want to change:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">category_page_view</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">5</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow12">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">automatic</property>
+            <property name="vscrollbar_policy">automatic</property>
+            <property name="shadow_type">in</property>
+            <child>
+              <object class="GtkTreeView" id="category_page_view">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="rules_hint">True</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="hbox7612">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkLabel" id="label7613">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Matchings selected:</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="category_page_count">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label">0</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="padding">3</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="category_page_change">
+                <property name="label" translatable="yes">Change GnuCash _Account...</property>
+                <property name="visible">True</property>
+                <property name="sensitive">False</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_underline">True</property>
+                <signal name="clicked" handler="gnc_ui_qif_import_category_rematch_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Match QIF categories with GnuCash accounts</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="memo_doc_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkLabel" id="label847707">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">QIF files downloaded from banks and other financial institutions may not have information about Accounts and Categories which would allow them to be correctly assigned to GnuCash accounts.  
+
+In the following page, you will see the text that appears in the Payee and Memo fields of transactions with no QIF Account or Category. By default these transactions are assigned to the 'Unspecified' account in GnuCash. If you select a different account, it will be remembered for future QIF files. </property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Payees and memos</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="memo_match_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkLabel" id="label7614">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="xpad">5</property>
+            <property name="label" translatable="yes">_Select the matchings you want to change:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">memo_page_view</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">5</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">automatic</property>
+            <property name="vscrollbar_policy">automatic</property>
+            <property name="shadow_type">in</property>
+            <child>
+              <object class="GtkTreeView" id="memo_page_view">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="rules_hint">True</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="hbox7615">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkLabel" id="label7616">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Matchings selected:</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="memo_page_count">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label">0</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="padding">3</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="memo_page_change">
+                <property name="label" translatable="yes">Change GnuCash _Account...</property>
+                <property name="visible">True</property>
+                <property name="sensitive">False</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_underline">True</property>
+                <signal name="clicked" handler="gnc_ui_qif_import_memo_rematch_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Match payees/memos to GnuCash accounts</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="currency_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkLabel" id="label831">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="yalign">0</property>
+            <property name="label" translatable="yes">The QIF importer cannot currently handle multi-currency QIF files. All the accounts you are importing must be denominated in the same currency.
+</property>
+            <property name="justify">center</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label832">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="yalign">0</property>
+            <property name="xpad">4</property>
+            <property name="label" translatable="yes">_Select the currency to use for all imported transactions:</property>
+            <property name="use_underline">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">5</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="currency_picker_hbox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="title" translatable="yes">Enter the QIF file currency</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="commodity_doc_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkLabel" id="label833">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">In the following pages you will be asked to provide information about stocks, mutual funds, and other investments that appear in the QIF file(s) you are importing. GnuCash needs some additional details about these investments that the QIF format does not provide. 
+
+Each stock, mutual fund, or other investment must have a name and an abbreviation, such as a stock symbol. Because some unrelated investments have the same abbreviation, you also need to indicate what type of abbreviation you have entered. For example, you could select the exchange that assigned the symbol (NASDAQ, NYSE, etc.), or select an investment type.
+
+If you don't see your exchange listed, or none of the available choices are appropriate, you can enter a new one.</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Tradable commodities</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="convert_progress_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <property name="spacing">12</property>
+        <child>
+          <object class="GtkLabel" id="convert_progress_primary">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label"><span weight="bold" size="larger">Primary text</span></property>
+            <property name="use_markup">True</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="convert_progress_secondary">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label">Secondary text.</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkVBox" id="convert_progress_vbox1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkProgressBar" id="convert_progress_bar">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="pulse_step">0.10000000149</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="convert_progress_sub">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label"><span style="italic">Sub-operation text</span></property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHButtonBox" id="convert_progress_hbuttonbox1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="layout_style">end</property>
+                <child>
+                  <object class="GtkButton" id="convert_progress_start">
+                    <property name="label" translatable="yes">_Start Import</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="use_underline">True</property>
+                    <signal name="clicked" handler="gnc_ui_qif_import_convert_progress_start_cb" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="convert_progress_pause">
+                    <property name="label">gtk-media-pause</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="can_default">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="use_stock">True</property>
+                    <signal name="clicked" handler="gnc_ui_qif_import_convert_progress_pause_cb" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">6</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow2">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">automatic</property>
+            <property name="vscrollbar_policy">automatic</property>
+            <property name="shadow_type">in</property>
+            <child>
+              <object class="GtkTextView" id="convert_progress_log">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="editable">False</property>
+                <property name="wrap_mode">word</property>
+                <property name="cursor_visible">False</property>
+                <property name="accepts_tab">False</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="title" translatable="yes">QIF Import</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="duplicates_doc_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">5</property>
+        <child>
+          <object class="GtkLabel" id="label847694">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">
+If you are importing a QIF file from a bank or other financial institution, some of the transactions may already exist in your GnuCash accounts. To avoid duplication, GnuCash has tried to identify matches and needs your help to review them.
+
+On the next page you will be shown a list of imported transactions. As you select each one, a list of possible matches will be shown below it. If you find a correct match, click on it. Your selection will be confirmed by a check mark in the "Match?" column.
+
+Click "Forward" to review the possible matches.</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Match existing transactions</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="duplicates_match_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkVBox" id="vbox94">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">2</property>
+            <child>
+              <object class="GtkFrame" id="frame45">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkScrolledWindow" id="scrolledwindow22">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">automatic</property>
+                    <property name="vscrollbar_policy">automatic</property>
+                    <property name="shadow_type">in</property>
+                    <child>
+                      <object class="GtkTreeView" id="new_transaction_view">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="rules_hint">True</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label847716">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">_Imported transactions needing review:</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">new_transaction_view</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame46">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkScrolledWindow" id="scrolledwindow23">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">automatic</property>
+                    <property name="vscrollbar_policy">automatic</property>
+                    <property name="shadow_type">in</property>
+                    <child>
+                      <object class="GtkTreeView" id="old_transaction_view">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="rules_hint">True</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label847717">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">_Possible matches for the selected transaction:</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">old_transaction_view</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="page_type">progress</property>
+        <property name="title" translatable="yes">Select possible duplicates</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkLabel" id="end_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Click "Apply" to import data from the staging area and update your GnuCash accounts. The account and category matching information you have entered will be saved and used for defaults the next time you use the QIF import facility. 
+
+Click "Back" to review your account and category matchings, to change currency and security settings for new accounts, or to add more files to the staging area.
+
+Click "Cancel" to abort the QIF import process.</property>
+        <property name="wrap">True</property>
+      </object>
+      <packing>
+        <property name="page_type">confirm</property>
+        <property name="title" translatable="yes">Update your GnuCash accounts</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkLabel" id="summary_page">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Summary Text</property>
+        <property name="use_markup">True</property>
+      </object>
+      <packing>
+        <property name="page_type">summary</property>
+        <property name="title" translatable="yes">Qif Import Summary</property>
+        <property name="complete">True</property>
+      </packing>
+    </child>
+  </object>
+  <object class="GtkListStore" id="currency_liststore">
+    <columns>
+      <!-- column-name item -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">Dummy</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="date_format_liststore">
+    <columns>
+      <!-- column-name item -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">Dummy</col>
+      </row>
+    </data>
+  </object>
+</interface>

Copied: gnucash/trunk/src/import-export/qif-import/assistant-qif-import.h (from rev 21651, gnucash/trunk/src/import-export/qif-import/druid-qif-import.h)
===================================================================
--- gnucash/trunk/src/import-export/qif-import/assistant-qif-import.h	                        (rev 0)
+++ gnucash/trunk/src/import-export/qif-import/assistant-qif-import.h	2011-12-02 20:55:43 UTC (rev 21653)
@@ -0,0 +1,45 @@
+/********************************************************************\
+ * assistant-qif-import.h -- window for import of QIF data          *
+ *                       (GnuCash)                                  *
+ * Copyright (C) 2000 Bill Gribble <grib at billgribble.com>           *
+ * Copyright (c) 2011 Robert Fewell                                 *
+ *                                                                  *
+ * 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, contact:                        *
+ *                                                                  *
+ * Free Software Foundation           Voice:  +1-617-542-5942       *
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
+ * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
+\********************************************************************/
+
+#ifndef ASSISTANT_QIF_IMPORT_H
+#define ASSISTANT_QIF_IMPORT_H
+
+#include <libguile.h>
+#include <gtk/gtk.h>
+
+/* QIF Import Windows ***********************************************/
+
+typedef struct _qifimportwindow QIFImportWindow;
+
+SCM               gnc_ui_qif_import_assistant_get_mappings(QIFImportWindow * w);
+
+/* The gnc_file_qif_import() routine will pop up a standard file
+ *     selection dialogue asking the user to pick a QIF file. If one
+ *     is selected then the QIF file is opened and read. It's contents
+ *     are merged into the existing session (if any). The current
+ *     session continues to remain open for editing. */
+void              gnc_file_qif_import (void);
+void              gnc_ui_qif_import_create_plugin(void);
+
+#endif

Modified: gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c	2011-12-02 11:09:16 UTC (rev 21652)
+++ gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c	2011-12-02 20:55:43 UTC (rev 21653)
@@ -31,7 +31,7 @@
 
 #include "dialog-account-picker.h"
 #include "dialog-utils.h"
-#include "druid-qif-import.h"
+#include "assistant-qif-import.h"
 #include "gnc-gui-query.h"
 #include "gnc-ui-util.h"
 #include "guile-mappings.h"
@@ -54,6 +54,7 @@
     gchar           * selected_name;
 };
 
+void gnc_ui_qif_account_picker_new_cb (GtkButton * w, gpointer user_data);
 
 /****************************************************************
  * acct_tree_add_accts
@@ -64,7 +65,6 @@
  * name matches search_name, then a GtkTreeRowReference* will be
  * returned in the reference parameter.
  ****************************************************************/
-
 static void
 acct_tree_add_accts(SCM accts,
                     GtkTreeStore *store,
@@ -160,7 +160,6 @@
  *
  * This function refreshes the contents of the account tree.
  ****************************************************************/
-
 static void
 build_acct_tree(QIFAccountPickerDialog * picker, QIFImportWindow * import)
 {
@@ -176,7 +175,7 @@
 
     /* Get an account tree with all existing and to-be-imported accounts. */
     acct_tree = scm_call_1(get_accts,
-                           gnc_ui_qif_import_druid_get_mappings(import));
+                           gnc_ui_qif_import_assistant_get_mappings(import));
 
     /* Rebuild the store.
      * NOTE: It is necessary to save a copy of the name to select, because
@@ -209,8 +208,7 @@
  * This handler is invoked when the user wishes to create a new
  * account.
  ****************************************************************/
-
-static void
+void
 gnc_ui_qif_account_picker_new_cb(GtkButton * w, gpointer user_data)
 {
     QIFAccountPickerDialog * wind = user_data;
@@ -260,6 +258,11 @@
     gtk_widget_grab_focus(GTK_WIDGET(wind->treeview));
 }
 
+
+/****************************************************************
+ * gnc_ui_qif_account_picker_changed_cb
+ *
+ ****************************************************************/
 static void
 gnc_ui_qif_account_picker_changed_cb(GtkTreeSelection *selection,
                                      gpointer          user_data)
@@ -284,6 +287,11 @@
     }
 }
 
+
+/****************************************************************
+ * gnc_ui_qif_account_picker_row_activated_cb
+ *
+ ****************************************************************/
 static void
 gnc_ui_qif_account_picker_row_activated_cb(GtkTreeView *view,
         GtkTreePath *path,
@@ -296,6 +304,11 @@
     gtk_dialog_response(GTK_DIALOG(wind->dialog), GTK_RESPONSE_OK);
 }
 
+
+/****************************************************************
+ * gnc_ui_qif_account_picker_map_cb
+ *
+ ****************************************************************/
 static int
 gnc_ui_qif_account_picker_map_cb(GtkWidget * w, gpointer user_data)
 {
@@ -317,7 +330,6 @@
  * user clicks OK, map_entry is changed and TRUE is returned.
  * If the clicks Cancel instead, FALSE is returned. Modal.
  ****************************************************************/
-
 gboolean
 qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry)
 {
@@ -326,7 +338,7 @@
     SCM set_gnc_name = scm_c_eval_string("qif-map-entry:set-gnc-name!");
     SCM orig_acct    = scm_call_1(gnc_name, map_entry);
     int response;
-    GladeXML *xml;
+    GtkBuilder *builder;
     GtkWidget *button;
 
     wind = g_new0(QIFAccountPickerDialog, 1);
@@ -347,18 +359,16 @@
         scm_dynwind_end ();
     }
 
-    xml = gnc_glade_xml_new("qif.glade", "QIF Import Account Picker");
+    builder = gtk_builder_new();
+    gnc_builder_add_from_file (builder, "dialog-account-picker.glade", "QIF Import Account Picker");
 
-    glade_xml_signal_connect_data(xml,
-                                  "gnc_ui_qif_account_picker_new_cb",
-                                  G_CALLBACK(gnc_ui_qif_account_picker_new_cb),
-                                  wind);
+    /* Connect all the signals */
+    gtk_builder_connect_signals (builder, wind);
 
-    wind->dialog     = glade_xml_get_widget(xml, "QIF Import Account Picker");
-    wind->treeview   = GTK_TREE_VIEW(glade_xml_get_widget(xml, "account_tree"));
+    wind->dialog     = GTK_WIDGET(gtk_builder_get_object (builder, "QIF Import Account Picker"));
+    wind->treeview   = GTK_TREE_VIEW(gtk_builder_get_object (builder, "account_tree"));
     wind->qif_wind   = qif_wind;
 
-
     {
         GtkTreeStore *store;
         GtkCellRenderer *renderer;
@@ -400,7 +410,7 @@
                            G_CALLBACK(gnc_ui_qif_account_picker_map_cb),
                            wind);
 
-    button = glade_xml_get_widget(xml, "newbutton");
+    button =  GTK_WIDGET(gtk_builder_get_object (builder, "newbutton"));
     gtk_button_set_use_stock(GTK_BUTTON(button), TRUE);
 
     /* this is to get the checkmarks set up right.. it will get called
@@ -413,6 +423,7 @@
     }
     while (response == GNC_RESPONSE_NEW);
     gtk_widget_destroy(wind->dialog);
+    g_object_unref(G_OBJECT(builder));
 
     scm_gc_unprotect_object(wind->map_entry);
     g_free(wind->selected_name);

Modified: gnucash/trunk/src/import-export/qif-import/dialog-account-picker.h
===================================================================
--- gnucash/trunk/src/import-export/qif-import/dialog-account-picker.h	2011-12-02 11:09:16 UTC (rev 21652)
+++ gnucash/trunk/src/import-export/qif-import/dialog-account-picker.h	2011-12-02 20:55:43 UTC (rev 21653)
@@ -26,7 +26,7 @@
 
 #include <libguile.h>
 
-#include "druid-qif-import.h"
+#include "assistant-qif-import.h"
 
 gboolean qif_account_picker_dialog(QIFImportWindow * wind, SCM initial_sel);
 

Deleted: gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/druid-qif-import.c	2011-12-02 11:09:16 UTC (rev 21652)
+++ gnucash/trunk/src/import-export/qif-import/druid-qif-import.c	2011-12-02 20:55:43 UTC (rev 21653)
@@ -1,3875 +0,0 @@
-/********************************************************************\
- * druid-qif-import.c -- window for importing QIF files             *
- *                        (GnuCash)                                 *
- * Copyright (C) 2000 Bill Gribble <grib at billgribble.com>           *
- * Copyright (c) 2006 David Hampton <hampton at employees.org>         *
- *                                                                  *
- * 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, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
-\********************************************************************/
-
-#include "config.h"
-
-#include <gnome.h>
-#include <glib/gi18n.h>
-#include <glib/gstdio.h>
-#include <libguile.h>
-#include <sys/time.h>
-#include <unistd.h>
-
-#include "Account.h"
-#include "Transaction.h"
-#include "dialog-account-picker.h"
-#include "dialog-commodity.h"
-#include "dialog-progress.h"
-#include "dialog-utils.h"
-#include "druid-qif-import.h"
-#include "druid-utils.h"
-#include "gnc-component-manager.h"
-#include "qof.h"
-#include "gnc-file.h"
-#include "gnc-gui-query.h"
-#include "gnc-ui-util.h"
-#include "gnc-gconf-utils.h"
-#include "gnc-gtk-utils.h"
-#include "gnc-main-window.h"
-#include "gnc-plugin-page-account-tree.h"
-#include "gnc-ui.h"
-#include "guile-mappings.h"
-
-#include "swig-runtime.h"
-
-#define DRUID_QIF_IMPORT_CM_CLASS "druid-qif-import"
-#define GCONF_SECTION "dialogs/import/qif"
-#define GCONF_NAME_SHOW_DOC "show_doc"
-#define GCONF_NAME_DEFAULT_TRANSACTION_STATUS "default_status"
-
-#define PREV_ROW "prev_row"
-
-enum filename_cols
-{
-    FILENAME_COL_INDEX = 0,
-    FILENAME_COL_NAME,
-    NUM_FILENAME_COLS
-};
-
-enum account_cols
-{
-    ACCOUNT_COL_INDEX = 0,
-    ACCOUNT_COL_QIF_NAME,
-    ACCOUNT_COL_GNC_NAME,
-    ACCOUNT_COL_NEW,
-    ACCOUNT_COL_ELLIPSIZE,
-    NUM_ACCOUNT_COLS
-};
-
-enum qif_trans_cols
-{
-    QIF_TRANS_COL_INDEX = 0,
-    QIF_TRANS_COL_DATE,
-    QIF_TRANS_COL_DESCRIPTION,
-    QIF_TRANS_COL_AMOUNT,
-    QIF_TRANS_COL_CHECKED,
-    NUM_QIF_TRANS_COLS
-};
-
-struct _qifimportwindow
-{
-    GtkWidget * window;
-    GtkWidget * druid;
-
-    /* Widgets on the file selection page. */
-    GtkWidget * filename_entry;
-
-    /* File loading progress page. */
-    GtkWidget * load_pause;
-    GtkWidget * load_log;
-    GNCProgressDialog *load_progress;
-
-    /* Widgets on the default account page. */
-    GtkWidget * acct_entry;
-
-    /* Widgets on the date format page. */
-    GtkWidget * date_format_combo;
-
-    /* Widgets on the files loaded page. */
-    GtkWidget * selected_file_view;
-
-    /* Widgets on the account matching page. */
-    GtkWidget * acct_view;
-    GtkWidget * acct_view_count;
-    GtkWidget * acct_view_btn;
-
-    /* Widgets on the category matching page. */
-    GtkWidget * cat_view;
-    GtkWidget * cat_view_count;
-    GtkWidget * cat_view_btn;
-
-    /* Widgets on the memo matching page. */
-    GtkWidget * memo_view;
-    GtkWidget * memo_view_count;
-    GtkWidget * memo_view_btn;
-
-    /* Widgets on the currency page. */
-    GtkWidget * currency_picker;
-
-    /* Conversion progress page. */
-    GtkWidget * convert_pause;
-    GtkWidget * convert_log;
-    GNCProgressDialog *convert_progress;
-
-    /* Widgets on the duplicates page. */
-    GtkWidget * new_transaction_view;
-    GtkWidget * old_transaction_view;
-
-    GList     * pre_comm_pages;
-    GList     * commodity_pages;
-    GList     * post_comm_pages;
-    GList     * doc_pages;
-
-    gboolean  show_doc_pages;
-    gboolean  ask_date_format;
-    gboolean  busy;
-
-    SCM       imported_files;
-    SCM       selected_file;
-
-    SCM       acct_map_info;
-    SCM       acct_display_info;
-
-    SCM       cat_map_info;
-    SCM       cat_display_info;
-
-    SCM       memo_map_info;
-    SCM       memo_display_info;
-
-    SCM       gnc_acct_info;
-    SCM       security_hash;
-    SCM       security_prefs;
-    SCM       new_securities;
-    GList   * new_namespaces;
-    SCM       ticker_map;
-
-    SCM       imported_account_tree;
-    SCM       match_transactions;
-    SCM       transaction_status;
-    int       selected_transaction;
-};
-
-struct _qifdruidpage
-{
-    GtkWidget     *page;
-    GtkWidget     *namespace_combo;
-    GtkWidget     *name_entry;
-    GtkWidget     *mnemonic_entry;
-    gnc_commodity *commodity;
-    SCM            hash_key;
-};
-
-typedef struct _qifdruidpage QIFDruidPage;
-
-static GdkColor std_bg_color = { 0, 39835, 49087, 40092 };
-static GdkColor std_logo_bg_color = { 0, 65535, 65535, 65535 };
-static GdkColor std_title_color =  { 0, 65535, 65535, 65535 };
-
-#define NUM_PRE_PAGES 14
-#define NUM_POST_PAGES 4
-#define NUM_DOC_PAGES  6
-
-static GnomeDruidPage *
-get_named_page(QIFImportWindow * w, const char * name)
-{
-    return GNOME_DRUID_PAGE(gnc_glade_lookup_widget(w->window, name));
-}
-
-
-/****************************************************************
- * update_account_picker_page
- *
- * Generic function to update an account_picker page.  This
- * generalizes the code shared whenever any QIF -> GNC mapper is
- * updating it's LIST STORE.  It asks the Scheme side to guess some account
- * translations and then shows the account name and suggested
- * translation in the Accounts page view (acount picker list).
- ****************************************************************/
-
-static void
-update_account_picker_page(QIFImportWindow * wind, SCM make_display,
-                           GtkWidget *view, SCM map_info, SCM * display_info)
-{
-
-    SCM  get_qif_name = scm_c_eval_string("qif-map-entry:qif-name");
-    SCM  get_gnc_name = scm_c_eval_string("qif-map-entry:gnc-name");
-    SCM  get_new      = scm_c_eval_string("qif-map-entry:new-acct?");
-    SCM  accts_left;
-    const gchar *qif_name = NULL;
-    const gchar *gnc_name = NULL;
-    gboolean checked;
-    gint row = 0;
-    gint prev_row;
-    GtkListStore *store;
-    GtkTreeIter iter;
-    GtkTreePath *path;
-    GtkTreeSelection *selection;
-
-    store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(view)));
-
-    /* now get the list of strings to display in the gtk_list_store widget */
-    accts_left = scm_call_3(make_display,
-                            wind->imported_files,
-                            map_info,
-                            wind->gnc_acct_info);
-
-    scm_gc_unprotect_object(*display_info);
-    *display_info = accts_left;
-    scm_gc_protect_object(*display_info);
-
-    /* clear the list */
-    gtk_list_store_clear(store);
-
-    while (!scm_is_null(accts_left))
-    {
-        if (scm_is_string(scm_call_1(get_qif_name, SCM_CAR(accts_left))))
-        {
-            char * str;
-
-            scm_dynwind_begin (0);
-            str = scm_to_locale_string (scm_call_1(get_qif_name, SCM_CAR(accts_left)));
-            qif_name = g_strdup (str);
-            scm_dynwind_free (str);
-            scm_dynwind_end ();
-        }
-        if (scm_is_string(scm_call_1(get_gnc_name, SCM_CAR(accts_left))))
-        {
-            char * str;
-
-            scm_dynwind_begin (0);
-            str = scm_to_locale_string (scm_call_1(get_gnc_name, SCM_CAR(accts_left)));
-            gnc_name = g_strdup (str);
-            scm_dynwind_free (str);
-            scm_dynwind_end ();
-        }
-        checked  = (scm_call_1(get_new, SCM_CAR(accts_left)) == SCM_BOOL_T);
-
-        gtk_list_store_append(store, &iter);
-        gtk_list_store_set(store, &iter,
-                           ACCOUNT_COL_INDEX,     row++,
-                           ACCOUNT_COL_QIF_NAME,  qif_name,
-                           ACCOUNT_COL_GNC_NAME,  gnc_name,
-                           ACCOUNT_COL_NEW,       checked,
-                           ACCOUNT_COL_ELLIPSIZE, PANGO_ELLIPSIZE_START,
-                           -1);
-        accts_left = SCM_CDR(accts_left);
-    }
-
-    /* move to the old selected row */
-    prev_row = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(store), PREV_ROW));
-    if (prev_row != -1)
-    {
-        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-        path = gtk_tree_path_new_from_indices(prev_row, -1);
-        gtk_tree_selection_select_path(selection, path);
-        gtk_tree_path_free(path);
-    }
-}
-
-
-/****************************************************************
- * update_account_page
- *
- * update the QIF account -> GNC Account picker
- ****************************************************************/
-
-static void
-update_account_page(QIFImportWindow * wind)
-{
-
-    SCM  make_account_display = scm_c_eval_string("qif-dialog:make-account-display");
-
-    update_account_picker_page(wind, make_account_display, wind->acct_view,
-                               wind->acct_map_info, &(wind->acct_display_info));
-}
-
-
-/****************************************************************
- * update_category_page
- *
- * update the QIF category -> GNC Account picker
- ****************************************************************/
-
-static void
-update_category_page(QIFImportWindow * wind)
-{
-    SCM  make_category_display = scm_c_eval_string("qif-dialog:make-category-display");
-
-    update_account_picker_page(wind, make_category_display, wind->cat_view,
-                               wind->cat_map_info, &(wind->cat_display_info));
-}
-
-
-/****************************************************************
- * update_memo_page
- *
- * update the QIF memo -> GNC Account picker
- ****************************************************************/
-
-static void
-update_memo_page(QIFImportWindow * wind)
-{
-    SCM  make_memo_display = scm_c_eval_string("qif-dialog:make-memo-display");
-
-    update_account_picker_page(wind, make_memo_display, wind->memo_view,
-                               wind->memo_map_info, &(wind->memo_display_info));
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_commodity_destroy
- *
- * This function destroys any commodity pages.
- ****************************************************************/
-
-static void
-gnc_ui_qif_import_commodity_destroy(QIFImportWindow * wind)
-{
-    GList          *pageptr;
-    GnomeDruidPage *gtkpage;
-    QIFDruidPage   *page;
-
-    for (pageptr = wind->commodity_pages; pageptr; pageptr = pageptr->next)
-    {
-        gtkpage   = GNOME_DRUID_PAGE(pageptr->data);
-        page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
-
-        /* Unprotect the Scheme hash key. */
-        scm_gc_unprotect_object(page->hash_key);
-
-        /* Free the memory allocated for the page's struct. */
-        g_free(page);
-    }
-
-    /* Free the list of pages. */
-    g_list_free(wind->commodity_pages);
-    wind->commodity_pages = NULL;
-}
-
-
-/********************************************************************\
- * gnc_ui_qif_import_druid_destroy
- * close the QIF Import druid window
-\********************************************************************/
-
-void
-gnc_ui_qif_import_druid_destroy(QIFImportWindow * wind)
-{
-    if (!wind)
-        return;
-
-    /* Destroy the progress dialog helpers. */
-    gnc_progress_dialog_destroy(wind->load_progress);
-
-    /* Destroy any commodity pages. */
-    gnc_ui_qif_import_commodity_destroy(wind);
-
-    gnc_unregister_gui_component_by_data(DRUID_QIF_IMPORT_CM_CLASS, wind);
-
-    gtk_widget_destroy(wind->window);
-
-    scm_gc_unprotect_object(wind->imported_files);
-    scm_gc_unprotect_object(wind->selected_file);
-    scm_gc_unprotect_object(wind->gnc_acct_info);
-    scm_gc_unprotect_object(wind->cat_display_info);
-    scm_gc_unprotect_object(wind->cat_map_info);
-    scm_gc_unprotect_object(wind->memo_display_info);
-    scm_gc_unprotect_object(wind->memo_map_info);
-    scm_gc_unprotect_object(wind->acct_display_info);
-    scm_gc_unprotect_object(wind->acct_map_info);
-    scm_gc_unprotect_object(wind->security_hash);
-    scm_gc_unprotect_object(wind->security_prefs);
-    scm_gc_unprotect_object(wind->new_securities);
-    scm_gc_unprotect_object(wind->ticker_map);
-    scm_gc_unprotect_object(wind->imported_account_tree);
-    scm_gc_unprotect_object(wind->match_transactions);
-
-    g_free(wind);
-}
-
-
-/********************************************************************\
- * get_next_druid_page
- *
- * Determine which page to show after the current page. If NULL is
- * ever returned, then a bug has been detected! (We really ought to
- * do a better job of notifying someone.)
-\********************************************************************/
-
-static GtkWidget *
-get_next_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
-{
-    GList     * current = NULL;
-    GList     * next;
-    int       where = 0;
-
-    /* Figure out which stage of the druid we're in. */
-    if ((current = g_list_find(wind->pre_comm_pages, page)) == NULL)
-    {
-        if ((current = g_list_find(wind->commodity_pages, page)) == NULL)
-        {
-            if ((current = g_list_find(wind->post_comm_pages, page)) == NULL)
-            {
-                /* Where are we? */
-                g_critical("QIF import: BUG DETECTED in get_next_druid_page! I'm lost!");
-                return FALSE;
-            }
-            else
-            {
-                where = 3;
-            }
-        }
-        else
-        {
-            where = 2;
-        }
-    }
-    else
-    {
-        where = 1;
-    }
-
-    next = current->next;
-    while (!next ||
-            (!wind->show_doc_pages && g_list_find(wind->doc_pages, next->data)) ||
-            (wind->new_securities == SCM_BOOL_F &&
-             GNOME_DRUID_PAGE(next->data) == get_named_page(wind, "commodity_doc_page")))
-    {
-        if (next && next->next)
-        {
-            next = next->next;
-        }
-        else
-        {
-            where ++;
-            switch (where)
-            {
-            case 2:
-                next = wind->commodity_pages;
-                break;
-            case 3:
-                next = wind->post_comm_pages;
-                break;
-            default:
-                g_critical("QIF import: BUG DETECTED in get_next_druid_page!");
-                next = NULL;
-                if (where > 3)
-                    return NULL;
-                break;
-            }
-        }
-    }
-
-    if (next)
-        return (GtkWidget *)next->data;
-
-    return NULL;
-}
-
-
-/********************************************************************
- * get_prev_druid_page
- *
- * Determine which page was shown before the current page. If NULL
- * is ever returned, then a bug has been detected! (We really ought
- * to do a better job of notifying someone.)
- ********************************************************************/
-
-static GtkWidget *
-get_prev_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
-{
-    GList     * current = NULL;
-    GList     * prev;
-    int       where = 0;
-
-    /* Figure out which stage of the druid we're in. */
-    if ((current = g_list_find(wind->pre_comm_pages, page)) == NULL)
-    {
-        if ((current = g_list_find(wind->commodity_pages, page)) == NULL)
-        {
-            if ((current = g_list_find(wind->post_comm_pages, page)) == NULL)
-            {
-                /* Where are we? */
-                g_critical("QIF import: BUG DETECTED in get_prev_druid_page! I'm lost!");
-                return NULL;
-            }
-            else
-            {
-                where = 3;
-            }
-        }
-        else
-        {
-            where = 2;
-        }
-    }
-    else
-    {
-        where = 1;
-    }
-
-    /* If no duplicates were found, skip all post-conversion pages. */
-    if (where == 3 && scm_is_null(wind->match_transactions))
-        prev = NULL;
-    else
-        prev = current->prev;
-
-    /* Keep going back through the sets of available pages as long as:
-     * (a) there are no remaining pages in this set, or
-     * (b) the page is a doc page and we're not supposed to show them, or
-     * (c) the page is commodity related and the are no new commodities. */
-    while (!prev ||
-            (!wind->show_doc_pages && g_list_find(wind->doc_pages, prev->data)) ||
-            (wind->new_securities == SCM_BOOL_F &&
-             GNOME_DRUID_PAGE(prev->data) == get_named_page(wind, "commodity_doc_page")))
-    {
-        /* We're either out of pages for this stage, or we've reached
-         * an optional doc page that shouldn't be shown. */
-
-        if (prev && prev->prev)
-        {
-            /* Go back another page within the same stage. */
-            prev = prev->prev;
-        }
-        else
-        {
-            /* Start looking at the end of the previous stage. */
-            where --;
-            switch (where)
-            {
-            case 1:
-                prev = g_list_last(wind->pre_comm_pages);
-                break;
-            case 2:
-                if (wind->new_securities != SCM_BOOL_F)
-                {
-                    prev = g_list_last(wind->commodity_pages);
-                }
-                else
-                {
-                    prev = g_list_last(wind->pre_comm_pages);
-                }
-                break;
-            default:
-                if (wind->show_doc_pages)
-                    g_critical("QIF import: BUG DETECTED in get_prev_druid_page!");
-                prev = NULL;
-                if (where < 1)
-                    return NULL;
-                break;
-            }
-        }
-    }
-
-    if (prev)
-        return (GtkWidget *)prev->data;
-
-    return NULL;
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_generic_next_cb
- *
- * Display the next druid page.
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_generic_next_cb(GnomeDruidPage * page, gpointer arg1,
-                                  gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-    GtkWidget * next_page = get_next_druid_page(wind, page);
-
-    if (next_page)
-    {
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             GNOME_DRUID_PAGE(next_page));
-        return TRUE;
-    }
-
-    return FALSE;
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_generic_back_cb
- *
- * Display the previous druid page.
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_generic_back_cb(GnomeDruidPage * page, gpointer arg1,
-                                  gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-    GtkWidget * back_page = get_prev_druid_page(wind, page);
-
-    if (back_page)
-    {
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             GNOME_DRUID_PAGE(back_page));
-        return TRUE;
-    }
-
-    return FALSE;
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_select_file_cb
- *
- * invoked when the "select file" button is clicked
- * this is just to pick a file name and reset-to-defaults all the
- * fields describing how to parse the file.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_select_file_cb(GtkButton * button,
-                                 gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-    GtkFileFilter *filter;
-    char * new_file_name;
-    char *file_name, *default_dir;
-
-    /* Default to whatever's already present */
-    default_dir = gnc_get_default_directory(GCONF_SECTION);
-
-    filter = gtk_file_filter_new();
-    gtk_file_filter_set_name(filter, "*.qif");
-    gtk_file_filter_add_pattern(filter, "*.[Qq][Ii][Ff]");
-    new_file_name = gnc_file_dialog(_("Select QIF File"),
-                                    g_list_prepend (NULL, filter),
-                                    default_dir,
-                                    GNC_FILE_DIALOG_IMPORT);
-
-    /* Insure valid data, and something that can be freed. */
-    if (new_file_name == NULL)
-    {
-        file_name = g_strdup(default_dir);
-    }
-    else if (!g_path_is_absolute(new_file_name))
-    {
-        file_name = g_build_filename(default_dir, new_file_name, NULL);
-        g_free(new_file_name);
-    }
-    else
-    {
-        file_name = new_file_name;
-        /* Update the working directory */
-        g_free(default_dir);
-        default_dir = g_path_get_dirname(file_name);
-        gnc_set_default_directory(GCONF_SECTION, default_dir);
-    }
-    g_free(default_dir);
-
-    /* set the filename entry for what was selected */
-    gtk_entry_set_text(GTK_ENTRY(wind->filename_entry), file_name);
-    g_free(file_name);
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_load_file_back_cb
- *
- * Invoked when the "back" button is clicked on the load file page.
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_load_file_back_cb(GnomeDruidPage * page, gpointer arg1,
-                                    gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    if (scm_is_list(wind->imported_files) &&
-            (scm_ilength(wind->imported_files) > 0))
-    {
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             get_named_page(wind, "loaded_files_page"));
-        return TRUE;
-    }
-
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "start_page"));
-    return TRUE;
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_load_file_next_cb
- *
- * Invoked when the "next" button is clicked on the load file page.
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_load_file_next_cb(GnomeDruidPage * page,
-                                    gpointer arg1,
-                                    gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-    const gchar * path_to_load;
-
-    /* Get the file name. */
-    path_to_load = gtk_entry_get_text(GTK_ENTRY(wind->filename_entry));
-
-    /* Validate the chosen filename. */
-    if (strlen(path_to_load) == 0)
-        gnc_error_dialog(wind->window, "%s", _("Please select a file to load."));
-    else if (g_access(path_to_load, R_OK) < 0)
-        gnc_error_dialog(wind->window, "%s",
-                         _("File not found or read permission denied. "
-                           "Please select another file."));
-    else
-    {
-        SCM qif_file_loaded = scm_c_eval_string("qif-dialog:qif-file-loaded?");
-
-        /* See if the file is already loaded. */
-        if (scm_call_2(qif_file_loaded,
-                       scm_makfrom0str(path_to_load),
-                       wind->imported_files) == SCM_BOOL_T)
-            gnc_error_dialog(wind->window, "%s",
-                             _("That QIF file is already loaded. "
-                               "Please select another file."));
-        else
-        {
-            /* Passed all checks; proceed to the next page. */
-            return gnc_ui_qif_import_generic_next_cb(page, arg1, wind);
-        }
-    }
-
-    /* Stay on this page. */
-    return TRUE;
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_load_progress_prepare_cb
- *
- * Prepare the file loading progress page for display.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_load_progress_prepare_cb(GnomeDruidPage * page,
-        gpointer arg1,
-        gpointer user_data)
-{
-    QIFImportWindow   *wind = user_data;
-
-    /* Reset the progress display. */
-    gnc_progress_dialog_set_primary(wind->load_progress, "");
-    gnc_progress_dialog_set_secondary(wind->load_progress,
-                                      _("GnuCash will now load your QIF file. If there are no errors or warnings, you will automatically proceed to the next step. Otherwise, the details will be shown below for your review."));
-    gnc_progress_dialog_set_sub(wind->load_progress, " ");
-    gnc_progress_dialog_reset_value(wind->load_progress);
-    gnc_progress_dialog_reset_log(wind->load_progress);
-
-    /* Disable the "Forward" button for now.
-     *
-     * NOTE: Due to bug 91001 in GnomeDruid, gnome_druid_set_buttons_sensitive()
-     *       will not work in prepare callbacks unless they are run AFTER the
-     *       standard one. Make sure the Glade line has the callback set up with
-     *       after=yes. For example:
-     *         <signal name="prepare" handler="my_prepare_cb" after="yes"/>   */
-    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                      TRUE, FALSE, TRUE, TRUE);
-
-    /* Generate a show signal once the page is displayed. This
-     * will kick off our (potentially) long-running operations. */
-    gtk_widget_hide(GTK_WIDGET(page));
-    gtk_widget_set_sensitive(GTK_WIDGET(page), TRUE);
-    gtk_widget_show(GTK_WIDGET(page));
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_load_progress_show_cb
- *
- * Start the long-running operation.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_load_progress_show_cb(GtkWidget *widget,
-                                        gpointer user_data)
-{
-    QIFImportWindow   *wind = user_data;
-    const gchar * path_to_load;
-
-    SCM make_qif_file   = scm_c_eval_string("make-qif-file");
-    SCM qif_file_load   = scm_c_eval_string("qif-file:read-file");
-    SCM qif_file_parse  = scm_c_eval_string("qif-file:parse-fields");
-    SCM unload_qif_file = scm_c_eval_string("qif-dialog:unload-qif-file");
-    SCM parse_results   = scm_c_eval_string("qif-file:parse-fields-results");
-    SCM scm_qiffile;
-    SCM imported_files = SCM_EOL;
-    SCM load_return, parse_return;
-    SCM progress;
-
-    /* Raise the busy flag so the druid can't be canceled unexpectedly. */
-    wind->busy = TRUE;
-    gtk_widget_set_sensitive(wind->load_pause, TRUE);
-
-    /* Get the file name. */
-    path_to_load = gtk_entry_get_text(GTK_ENTRY(wind->filename_entry));
-
-    /* Create the <qif-file> object. */
-    scm_qiffile          = scm_call_0(make_qif_file);
-    scm_gc_unprotect_object(wind->selected_file);
-    wind->selected_file  = scm_qiffile;
-    scm_gc_protect_object(wind->selected_file);
-    imported_files       = scm_cons(scm_qiffile, wind->imported_files);
-
-    /* Create SCM for the progress helper. */
-    progress = SWIG_NewPointerObj(wind->load_progress,
-                                  SWIG_TypeQuery("_p__GNCProgressDialog"),
-                                  0);
-
-    /* Clear any previous pause or cancel state. */
-    scm_c_eval_string("(qif-import:reset-cancel-pause)");
-
-
-    /*
-     * Load the file.
-     *
-     * The loader returns:
-     *  success:   ()
-     *  failure:   (#f error-message)
-     *  warning:   (#t error-message)
-     *  cancel:    #t
-     *  exception: #f
-     */
-
-    /* This step will fill 70% of the bar. */
-    gnc_progress_dialog_push(wind->load_progress, 0.7);
-    load_return = scm_call_4(qif_file_load,
-                             SCM_CAR(imported_files),
-                             scm_makfrom0str(path_to_load),
-                             wind->ticker_map,
-                             progress);
-    gnc_progress_dialog_pop(wind->load_progress);
-    if (load_return == SCM_BOOL_T)
-    {
-        /* Canceled by the user. */
-
-        /* Disable the pause button. */
-        gtk_widget_set_sensitive(wind->load_pause, FALSE);
-
-        /* Inform the user. */
-        gnc_progress_dialog_set_sub(wind->load_progress, _("Canceled"));
-
-        wind->busy = FALSE;
-        return;
-    }
-    else if (load_return == SCM_BOOL_F || !scm_is_list(load_return))
-    {
-        /* A bug was detected. */
-
-        /* Disable the pause button. */
-        gtk_widget_set_sensitive(wind->load_pause, FALSE);
-
-        /* Inform the user. */
-        gnc_progress_dialog_append_log(wind->load_progress,
-                                       _( "An error occurred while loading the QIF file."));
-        gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
-        gnc_progress_dialog_reset_value(wind->load_progress);
-        gnc_error_dialog(wind->window, "%s",
-                         _( "An error occurred while loading the QIF file."));
-        /* FIXME: How should we request that the user report this problem? */
-
-        wind->busy = FALSE;
-        return;
-    }
-    else if (!scm_is_null(load_return))
-    {
-        /* since the result of scm_to_locale_string doesn't appear to be used */
-        /* can we just delete the whole if statement? */
-        if (scm_is_string(SCM_CADR(load_return)))
-        {
-            char * str;
-
-            scm_dynwind_begin (0);
-            str = scm_to_locale_string (SCM_CADR(load_return));
-            /* str doesn't seem to be used anywhere, so go ahead and free it */
-            scm_dynwind_free (str);
-            scm_dynwind_end ();
-        }
-
-        if (SCM_CAR(load_return) == SCM_BOOL_F)
-        {
-            imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
-            scm_gc_unprotect_object(wind->imported_files);
-            wind->imported_files = imported_files;
-            scm_gc_protect_object(wind->imported_files);
-
-            gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
-            gnc_progress_dialog_reset_value(wind->load_progress);
-
-            gtk_widget_set_sensitive(wind->load_pause, FALSE);
-            wind->busy = FALSE;
-            return;
-        }
-    }
-
-
-    /*
-     * Parse the fields.
-     *
-     * The parser returns:
-     *   success:   ()
-     *   failure:   (#f . ((type . error) ...))
-     *   warning:   (#t . ((type . error) ...))
-     *   cancel:    #t
-     *   exception: #f
-     */
-
-    /* This step will fill the remainder of the bar. */
-    gnc_progress_dialog_push(wind->load_progress, 1);
-    parse_return = scm_call_2(qif_file_parse, SCM_CAR(imported_files), progress);
-    gnc_progress_dialog_pop(wind->load_progress);
-    wind->ask_date_format = FALSE;
-    if (parse_return == SCM_BOOL_T)
-    {
-        /* Canceled by the user. */
-
-        /* Disable the pause button. */
-        gtk_widget_set_sensitive(wind->load_pause, FALSE);
-
-        /* Unload the file. */
-        gnc_progress_dialog_set_sub(wind->load_progress, _("Cleaning up"));
-        imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
-
-        /* Inform the user. */
-        gnc_progress_dialog_set_sub(wind->load_progress, _("Canceled"));
-
-        wind->busy = FALSE;
-        return;
-    }
-    else if (parse_return == SCM_BOOL_F || !scm_is_list(parse_return))
-    {
-        /* A bug was detected. */
-
-        /* Disable the pause button. */
-        gtk_widget_set_sensitive(wind->load_pause, FALSE);
-
-        /* Unload the file. */
-        gnc_progress_dialog_set_sub(wind->load_progress, _("Cleaning up"));
-        imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
-
-        /* Inform the user. */
-        gnc_progress_dialog_append_log(wind->load_progress,
-                                       _( "A bug was detected while parsing the QIF file."));
-        gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
-        gnc_progress_dialog_reset_value(wind->load_progress);
-        gnc_error_dialog(wind->window, "%s",
-                         _( "A bug was detected while parsing the QIF file."));
-        /* FIXME: How should we request that the user report this problem? */
-
-        wind->busy = FALSE;
-        return;
-    }
-    else if (!scm_is_null(parse_return))
-    {
-        /* Are there only warnings? */
-        if (SCM_CAR(parse_return) == SCM_BOOL_T)
-        {
-            SCM date_formats;
-
-            /* A warning means that (potentially) the date format is
-             * ambiguous.  So search the results for the "date" type and if
-             * it's found, set up the format selector page. */
-            if ((date_formats = scm_call_2(parse_results,
-                                           SCM_CDR(parse_return),
-                                           scm_str2symbol("date"))) != SCM_BOOL_F)
-            {
-                gint n_items;
-
-                /* Clear the date format combo box. */
-                gtk_combo_box_set_active(GTK_COMBO_BOX(wind->date_format_combo), -1);
-                n_items = gtk_tree_model_iter_n_children(
-                              gtk_combo_box_get_model(GTK_COMBO_BOX(wind->date_format_combo)),
-                              NULL);
-                while (n_items-- > 0)
-                    gtk_combo_box_remove_text(GTK_COMBO_BOX(wind->date_format_combo), 0);
-
-                /* Add the formats for the user to select from. */
-                while (scm_is_list(date_formats) && !scm_is_null(date_formats))
-                {
-                    gtk_combo_box_append_text(GTK_COMBO_BOX(wind->date_format_combo),
-                                              SCM_SYMBOL_CHARS(SCM_CAR(date_formats)));
-                    date_formats = SCM_CDR(date_formats);
-                }
-                gtk_combo_box_set_active(GTK_COMBO_BOX(wind->date_format_combo), 0);
-
-                wind->ask_date_format = TRUE;
-            }
-        }
-        else
-        {
-            /* Parsing failed. */
-            imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
-            gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
-            gnc_progress_dialog_reset_value(wind->load_progress);
-
-            gtk_widget_set_sensitive(wind->load_pause, FALSE);
-            wind->busy = FALSE;
-            return;
-        }
-    }
-
-    /* The file was loaded successfully. */
-    gnc_progress_dialog_set_sub(wind->load_progress, _("Loading completed"));
-    gnc_progress_dialog_set_value(wind->load_progress, 1);
-
-    scm_gc_unprotect_object(wind->imported_files);
-    wind->imported_files = imported_files;
-    scm_gc_protect_object(wind->imported_files);
-
-    /* Enable all buttons. */
-    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                      TRUE, TRUE, TRUE, TRUE);
-
-    /* If the log is empty, move on to the next page automatically. */
-    if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(wind->load_log))) == 0)
-        gnome_druid_page_next(GNOME_DRUID_PAGE(widget));
-
-    gtk_widget_set_sensitive(wind->load_pause, FALSE);
-    wind->busy = FALSE;
-    return;
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_load_progress_pause_cb
- *
- * Invoked when the "Pause" button is clicked.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_load_progress_pause_cb(GtkButton * button,
-        gpointer user_data)
-{
-    QIFImportWindow *wind = user_data;
-    SCM toggle_pause      = scm_c_eval_string("qif-import:toggle-pause");
-    SCM progress;
-
-    if (!wind->busy)
-        return;
-
-    /* Create SCM for the progress helper. */
-    progress = SWIG_NewPointerObj(wind->load_progress,
-                                  SWIG_TypeQuery("_p__GNCProgressDialog"),
-                                  0);
-
-    /* Pause (or resume) the currently running operation. */
-    scm_call_1(toggle_pause, progress);
-
-    /* Swap the button label between pause and resume. */
-    if (strcmp(gtk_button_get_label(button), _("_Resume")))
-    {
-        gtk_button_set_use_stock(button, FALSE);
-        gtk_button_set_use_underline(button, TRUE);
-        gtk_button_set_label(button, _("_Resume"));
-    }
-    else
-    {
-        gtk_button_set_use_stock(button, TRUE);
-        gtk_button_set_use_underline(button, FALSE);
-        gtk_button_set_label(button, "gtk-media-pause");
-    }
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_load_progress_next_cb
- *
- * Determine the next page after loading a file successfully.
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_load_progress_next_cb(GnomeDruidPage * page,
-                                        gpointer arg1,
-                                        gpointer user_data)
-{
-    QIFImportWindow *wind = user_data;
-    SCM check_from_acct   = scm_c_eval_string("qif-file:check-from-acct");
-
-    if (wind->ask_date_format)
-    {
-        /* We need to get a date format, so go to the next page. */
-        return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
-    }
-    else if (scm_call_1(check_from_acct, wind->selected_file) != SCM_BOOL_T)
-    {
-        SCM default_acct = scm_c_eval_string("qif-file:path-to-accountname");
-        const gchar * default_acctname = NULL;
-
-        /* Go to the "ask account name" page. */
-        if (scm_is_string(scm_call_1(default_acct, wind->selected_file)))
-        {
-            char * str;
-
-            scm_dynwind_begin (0);
-            str = scm_to_locale_string (scm_call_1(default_acct, wind->selected_file));
-            default_acctname = g_strdup (str);
-            scm_dynwind_free (str);
-            scm_dynwind_end ();
-        }
-        gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
-
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             get_named_page(wind, "account_name_page"));
-        return TRUE;
-    }
-
-    /* Skip ahead to the "loaded files" page. */
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "loaded_files_page"));
-
-    return TRUE;
-}
-
-
-/****************************************************************
- * load_progress_back_timeout_cb
- *
- * This timer callback function waits until the busy flag
- * has been cleared before going back to the previous page.
- ****************************************************************/
-
-static gboolean
-load_progress_back_timeout_cb(gpointer data)
-{
-    QIFImportWindow *wind = data;
-
-    if (wind->busy)
-        /* Wait for timer to go off again. */
-        return TRUE;
-
-    /* The busy flag was lowered. Go back to the previous page. */
-    gnome_druid_page_back(get_named_page(wind, "load_progress_page"));
-
-    /* Cancel the timer. */
-    return FALSE;
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_load_progress_back_cb
- *
- * Return to the previous page, waiting if necessary.
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_load_progress_back_cb(GnomeDruidPage * page,
-                                        gpointer arg1,
-                                        gpointer user_data)
-{
-    QIFImportWindow *wind = user_data;
-
-    if (wind->busy)
-    {
-        /* Cancel any long-running Scheme operation. */
-        scm_c_eval_string("(qif-import:cancel)");
-
-        /* Wait for the busy flag to be lowered. */
-        g_timeout_add(200, load_progress_back_timeout_cb, user_data);
-
-        return TRUE;
-    }
-
-    return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
-}
-
-
-static gboolean
-gnc_ui_qif_import_date_format_next_cb(GnomeDruidPage * page,
-                                      gpointer arg1,
-                                      gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    SCM  reparse_dates   = scm_c_eval_string("qif-file:reparse-dates");
-    SCM  check_from_acct = scm_c_eval_string("qif-file:check-from-acct");
-    SCM  format_sym;
-    gchar *text;
-
-    /* Get the selected date format. */
-    text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(wind->date_format_combo));
-    if (!text)
-    {
-        g_critical("QIF import: BUG DETECTED in gnc_ui_qif_import_date_format_next_cb. Format is NULL.");
-        return TRUE;
-    }
-    format_sym = scm_str2symbol(text);
-    g_free(text);
-
-    /* Reparse the dates using the selected format. */
-    scm_call_2(reparse_dates, wind->selected_file, format_sym);
-
-    /* Determine the next page to display. */
-    if (scm_call_1(check_from_acct, wind->selected_file) != SCM_BOOL_T)
-    {
-        /* There is an account name missing. Ask the user to provide one. */
-        SCM default_acct = scm_c_eval_string("qif-file:path-to-accountname");
-        const gchar * default_acctname = NULL;
-
-        if (scm_is_string(scm_call_1(default_acct, wind->selected_file)))
-        {
-            char * str;
-
-            scm_dynwind_begin (0);
-            str = scm_to_locale_string (scm_call_1(default_acct,
-                                                   wind->selected_file));
-            default_acctname = g_strdup (str);
-            scm_dynwind_free (str);
-            scm_dynwind_end ();
-        }
-        gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
-
-        return FALSE;
-    }
-    else
-    {
-        /* Skip ahead to the "loaded files" page. */
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             get_named_page(wind, "loaded_files_page"));
-
-        return TRUE;
-    }
-}
-
-
-/********************************************************************
- * update_file_page
- *
- * Update the list of loaded files.
- ********************************************************************/
-
-static void
-update_file_page(QIFImportWindow * wind)
-{
-
-    SCM       loaded_file_list = wind->imported_files;
-    SCM       scm_qiffile = SCM_BOOL_F;
-    SCM       qif_file_path;
-    int       row = 0;
-    const char  * row_text = NULL;
-    GtkTreeView *view;
-    GtkListStore *store;
-    GtkTreeIter iter;
-    GtkTreePath *path;
-    GtkTreeRowReference *reference = NULL;
-
-    /* clear the list */
-    view = GTK_TREE_VIEW(wind->selected_file_view);
-    store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
-    gtk_list_store_clear(store);
-    qif_file_path = scm_c_eval_string("qif-file:path");
-
-    while (!scm_is_null(loaded_file_list))
-    {
-        scm_qiffile = SCM_CAR(loaded_file_list);
-        if (scm_is_string(scm_call_1(qif_file_path, scm_qiffile)))
-        {
-            char * str;
-
-            scm_dynwind_begin (0);
-            str = scm_to_locale_string (scm_call_1(qif_file_path, scm_qiffile));
-            row_text = g_strdup (str);
-            scm_dynwind_free (str);
-            scm_dynwind_end ();
-        }
-
-        gtk_list_store_append(store, &iter);
-        gtk_list_store_set(store, &iter,
-                           FILENAME_COL_INDEX, row++,
-                           FILENAME_COL_NAME, row_text,
-                           -1);
-        if (scm_qiffile == wind->selected_file)
-        {
-            path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
-            reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
-            gtk_tree_path_free(path);
-        }
-
-        loaded_file_list = SCM_CDR(loaded_file_list);
-    }
-
-    if (reference)
-    {
-        GtkTreeSelection* selection = gtk_tree_view_get_selection(view);
-        path = gtk_tree_row_reference_get_path(reference);
-        if (path)
-        {
-            gtk_tree_selection_select_path(selection, path);
-            gtk_tree_path_free(path);
-        }
-        gtk_tree_row_reference_free(reference);
-    }
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_select_loaded_file_cb
- * callback when a file is clicked in the "loaded files" page
- ****************************************************************/
-
-static void
-gnc_ui_qif_import_select_loaded_file_cb(GtkTreeSelection *selection,
-                                        gpointer          user_data)
-{
-    QIFImportWindow * wind = user_data;
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-    gint row;
-    GtkWidget *button;
-
-    button = gnc_glade_lookup_widget(wind->window, "unload_file_button");
-    if (gtk_tree_selection_get_selected(selection, &model, &iter))
-    {
-        gtk_tree_model_get(model, &iter, FILENAME_COL_INDEX, &row, -1);
-        if (scm_is_list(wind->imported_files) &&
-                (scm_ilength(wind->imported_files) > row))
-        {
-            scm_gc_unprotect_object(wind->selected_file);
-            wind->selected_file = scm_list_ref(wind->imported_files,
-                                               scm_int2num(row));
-            scm_gc_protect_object(wind->selected_file);
-            g_object_set(button, "sensitive", TRUE, (gchar*)NULL);
-            gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                              TRUE, TRUE, TRUE, TRUE);
-        }
-    }
-    else
-    {
-        scm_gc_unprotect_object(wind->selected_file);
-        wind->selected_file = SCM_BOOL_F;
-        scm_gc_protect_object(wind->selected_file);
-        g_object_set(button, "sensitive", FALSE, (gchar*)NULL);
-        gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                          FALSE, TRUE, TRUE, TRUE);
-    }
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_loaded_files_prepare_cb
- *
- * Get the loaded files page ready for viewing
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_loaded_files_prepare_cb(GnomeDruidPage * page,
-        gpointer arg1,
-        gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                      FALSE, TRUE, TRUE, TRUE);
-    update_file_page(wind);
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_load_another_cb
- * Invoked when the "load another" button is clicked on the loaded
- * files page.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_load_another_cb(GtkButton * button,
-                                  gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "load_file_page"));
-    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                      TRUE, TRUE, TRUE, TRUE);
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_unload_cb
- * Invoked when the "unload" button is clicked on the loaded files
- * page.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_unload_file_cb(GtkButton * button,
-                                 gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    SCM unload_qif_file = scm_c_eval_string("qif-dialog:unload-qif-file");
-    SCM imported_files;
-
-    if (wind->selected_file != SCM_BOOL_F)
-    {
-        imported_files =
-            scm_call_2(unload_qif_file, wind->selected_file, wind->imported_files);
-
-        scm_gc_unprotect_object(wind->imported_files);
-        wind->imported_files = imported_files;
-        scm_gc_protect_object(wind->imported_files);
-
-        scm_gc_unprotect_object(wind->selected_file);
-        wind->selected_file = SCM_BOOL_F;
-        scm_gc_protect_object(wind->selected_file);
-
-        update_file_page(wind);
-    }
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_loaded_files_next_cb
- *
- * Get the matching pages ready for viewing.
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_loaded_files_next_cb(GnomeDruidPage * page,
-                                       gpointer arg1,
-                                       gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    /* Prepare the matching pages. */
-    gnc_set_busy_cursor(NULL, TRUE);
-    update_account_page(wind);
-    update_category_page(wind);
-    update_memo_page(wind);
-    gnc_unset_busy_cursor(NULL);
-
-    return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_default_acct_next_cb
- *
- * Invoked when the "next" button is clicked on the default acct page.
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_default_acct_next_cb(GnomeDruidPage * page,
-                                       gpointer arg1,
-                                       gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-    const gchar * acct_name = gtk_entry_get_text(GTK_ENTRY(wind->acct_entry));
-    SCM    fix_default = scm_c_eval_string("qif-import:fix-from-acct");
-    SCM    scm_name;
-
-    g_return_val_if_fail(wind->selected_file != SCM_BOOL_F, FALSE);
-    if (!acct_name || acct_name[0] == 0)
-    {
-        gnc_warning_dialog(wind->window, "%s", _("You must enter an account name."));
-        return TRUE;
-    }
-    else
-    {
-        scm_name = scm_makfrom0str(acct_name);
-        scm_call_2(fix_default, wind->selected_file, scm_name);
-        return FALSE;
-    }
-}
-
-/********************************************************************
- * gnc_ui_qif_import_default_acct_back_cb
- *
- * Invoked when the "back" button is clicked on the default acct page.
- * this unloads the current file.
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_default_acct_back_cb(GnomeDruidPage * page,
-                                       gpointer arg1,
-                                       gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-    SCM unload = scm_c_eval_string("qif-dialog:unload-qif-file");
-    SCM files_list;
-
-    files_list = scm_call_2(unload, wind->selected_file, wind->imported_files);
-
-    scm_gc_unprotect_object(wind->imported_files);
-    wind->imported_files = files_list;
-    scm_gc_protect_object(wind->imported_files);
-
-    scm_gc_unprotect_object(wind->selected_file);
-    wind->selected_file = SCM_BOOL_F;
-    scm_gc_protect_object(wind->selected_file);
-
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "load_file_page"));
-    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                      TRUE, TRUE, TRUE, TRUE);
-    return TRUE;
-}
-
-
-/********************************************************************
- ********************************************************************/
-
-static void
-create_account_picker_view(GtkWidget *widget,
-                           const gchar *col_name,
-                           GCallback activate_cb,
-                           GCallback select_cb,
-                           gpointer user_data)
-{
-    GtkTreeView *view = GTK_TREE_VIEW(widget);
-    GtkTreeSelection *selection = gtk_tree_view_get_selection(view);
-    GtkListStore *store;
-    GtkCellRenderer *renderer;
-    GtkTreeViewColumn *column;
-
-    store = gtk_list_store_new(NUM_ACCOUNT_COLS, G_TYPE_INT, G_TYPE_STRING,
-                               G_TYPE_STRING, G_TYPE_BOOLEAN,
-                               PANGO_TYPE_ELLIPSIZE_MODE);
-    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-    g_object_unref(store);
-
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(col_name,
-             renderer,
-             "text",
-             ACCOUNT_COL_QIF_NAME,
-             "ellipsize",
-             ACCOUNT_COL_ELLIPSIZE,
-             NULL);
-    g_object_set(column, "expand", TRUE, NULL);
-    gtk_tree_view_column_set_resizable(column, TRUE);
-    gtk_tree_view_append_column(view, column);
-
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("GnuCash account name"),
-             renderer,
-             "text",
-             ACCOUNT_COL_GNC_NAME,
-             "ellipsize",
-             ACCOUNT_COL_ELLIPSIZE,
-             NULL);
-    g_object_set(column, "expand", TRUE, NULL);
-    gtk_tree_view_column_set_resizable(column, TRUE);
-    gtk_tree_view_append_column(view, column);
-
-    renderer = gtk_cell_renderer_toggle_new();
-    g_object_set(renderer, "activatable", FALSE, NULL);
-    column = gtk_tree_view_column_new_with_attributes(_("New?"),
-             renderer,
-             "active",
-             ACCOUNT_COL_NEW,
-             NULL);
-    gtk_tree_view_append_column(view, column);
-
-    g_object_set_data(G_OBJECT(store), PREV_ROW, GINT_TO_POINTER(-1));
-
-    /* Connect the signal handlers. */
-    g_signal_connect(view, "row-activated", G_CALLBACK(activate_cb), user_data);
-    g_signal_connect(selection, "changed", G_CALLBACK(select_cb), user_data);
-
-    /* Allow multiple rows to be selected. */
-    gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
-}
-
-
-/********************************************************************
- * rematch_line
- *
- * This is a helper function for tree controls used by some druid
- * pages for mapping QIF values to GnuCash accounts. It processes
- * the selected rows when a user tries to edit the account mappings.
- * The account picker is displayed, and the chosen GnuCash account
- * becomes the new mapping for each row.  Finally, the update_page
- * function is called.
- ********************************************************************/
-
-static void
-rematch_line(QIFImportWindow *wind, GtkTreeSelection *selection,
-             SCM display_info, SCM map_info,
-             void (*update_page)(QIFImportWindow *))
-{
-    SCM           get_qif_name = scm_c_eval_string("qif-map-entry:qif-name");
-    SCM           get_gnc_name = scm_c_eval_string("qif-map-entry:gnc-name");
-    SCM           set_gnc_name = scm_c_eval_string("qif-map-entry:set-gnc-name!");
-    SCM           map_entry;
-    SCM           gnc_name;
-    GList        *pathlist;
-    GList        *current;
-    GtkTreeModel *model;
-    GtkTreeIter   iter;
-    gint          row;
-
-    /* Get a list of selected rows. */
-    pathlist = gtk_tree_selection_get_selected_rows(selection, &model);
-    if (!pathlist)
-        return;
-
-
-    /*
-     * Update the first selected row.
-     */
-
-    /* Get the row number of the first selected row. */
-    if (!gtk_tree_model_get_iter(model, &iter, (GtkTreePath *) pathlist->data))
-        return;
-    gtk_tree_model_get(model, &iter, ACCOUNT_COL_INDEX, &row, -1);
-
-    /* Save the row number. */
-    g_object_set_data(G_OBJECT(model), PREV_ROW, GINT_TO_POINTER(row));
-    if (row == -1)
-        return;
-
-    /* Find the <qif-map-entry> corresponding to the selected row. */
-    map_entry = scm_list_ref(display_info, scm_int2num(row));
-
-    /* Call the account picker to update it. */
-    if (!qif_account_picker_dialog(wind, map_entry))
-        return;
-    gnc_name = scm_call_1(get_gnc_name, map_entry);
-
-    /* Update the mapping hash table. */
-    scm_hash_set_x(map_info, scm_call_1(get_qif_name, map_entry), map_entry);
-
-
-    /*
-     * Map all other selected rows to the same GnuCash account.
-     */
-    for (current = pathlist->next; current; current = current->next)
-    {
-        /* Get the row number. */
-        gtk_tree_model_get_iter(model, &iter, (GtkTreePath *) current->data);
-        gtk_tree_model_get(model, &iter, ACCOUNT_COL_INDEX, &row, -1);
-
-        /* Update the <qif-map-entry> for the selected row. */
-        map_entry = scm_list_ref(display_info, scm_int2num(row));
-        scm_call_2(set_gnc_name, map_entry, gnc_name);
-
-        /* Update the mapping hash table. */
-        scm_hash_set_x(map_info, scm_call_1(get_qif_name, map_entry), map_entry);
-    }
-
-    /* Free the path list. */
-    g_list_foreach(pathlist, (GFunc) gtk_tree_path_free, NULL);
-    g_list_free(pathlist);
-
-    /* Update the display. */
-    update_page(wind);
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_account_activate_cb
- *
- * This handler is invoked when a row is double-clicked in the "Match
- * QIF accounts to GnuCash accounts" page.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_account_activate_cb(GtkTreeView *view, GtkTreePath *path,
-                                      GtkTreeViewColumn *column,
-                                      gpointer user_data)
-{
-    QIFImportWindow  *wind = user_data;
-
-    g_return_if_fail(wind);
-
-    rematch_line(wind, gtk_tree_view_get_selection(view),
-                 wind->acct_display_info, wind->acct_map_info,
-                 update_account_page);
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_account_select_cb
- *
- * This handler is invoked when the selection of account matchings
- * has changed.  It updates the selection count and enables/disables
- * the "Change" button.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_account_select_cb(GtkTreeSelection *selection,
-                                    gpointer user_data)
-{
-    QIFImportWindow  *wind = user_data;
-    gint              count = gtk_tree_selection_count_selected_rows(selection);
-    gchar            *count_str;
-
-    g_return_if_fail(wind);
-
-    /* Update the "items selected" count. */
-    if (wind->acct_view_count)
-    {
-        count_str = g_strdup_printf("%d", count);
-        gtk_label_set_text(GTK_LABEL(wind->acct_view_count), count_str);
-        g_free(count_str);
-    }
-
-    /* Enable/disable the Change button. */
-    if (wind->acct_view_btn)
-    {
-        if (count)
-            gtk_widget_set_sensitive(wind->acct_view_btn, TRUE);
-        else
-            gtk_widget_set_sensitive(wind->acct_view_btn, FALSE);
-    }
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_category_activate_cb
- *
- * This handler is invoked when a row is double-clicked in the "Match
- * QIF categories to GnuCash accounts" page.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_category_activate_cb(GtkTreeView *view, GtkTreePath *path,
-                                       GtkTreeViewColumn *column,
-                                       gpointer user_data)
-{
-    QIFImportWindow *wind = user_data;
-    GtkTreeSelection *selection;
-
-    g_return_if_fail(view && wind);
-    selection = gtk_tree_view_get_selection(view);
-
-    rematch_line(wind, selection, wind->cat_display_info, wind->cat_map_info,
-                 update_category_page);
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_category_select_cb
- *
- * This handler is invoked when the selection of category matchings
- * has changed.  It updates the selection count and enables/disables
- * the "Change" button.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_category_select_cb(GtkTreeSelection *selection,
-                                     gpointer user_data)
-{
-    QIFImportWindow  *wind = user_data;
-    gint              count = gtk_tree_selection_count_selected_rows(selection);
-    gchar            *count_str;
-
-    g_return_if_fail(wind);
-
-    /* Update the "items selected" count. */
-    if (wind->cat_view_count)
-    {
-        count_str = g_strdup_printf("%d", count);
-        gtk_label_set_text(GTK_LABEL(wind->cat_view_count), count_str);
-        g_free(count_str);
-    }
-
-    /* Enable/disable the Change button. */
-    if (wind->cat_view_btn)
-    {
-        if (count)
-            gtk_widget_set_sensitive(wind->cat_view_btn, TRUE);
-        else
-            gtk_widget_set_sensitive(wind->cat_view_btn, FALSE);
-    }
-}
-
-
-/********************************************************************
- *  gnc_ui_qif_import_memo_activate_cb
- *
- * This handler is invoked when a row is double-clicked in the "Match
- * QIF payee/memo to GnuCash accounts" page.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_memo_activate_cb(GtkTreeView *view, GtkTreePath *path,
-                                   GtkTreeViewColumn *column,
-                                   gpointer user_data)
-{
-    QIFImportWindow *wind = user_data;
-    GtkTreeSelection *selection;
-
-    g_return_if_fail(view && wind);
-    selection = gtk_tree_view_get_selection(view);
-
-    rematch_line(wind, selection, wind->memo_display_info, wind->memo_map_info,
-                 update_memo_page);
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_memo_select_cb
- *
- * This handler is invoked when the selection of memo matchings
- * has changed.  It updates the selection count and enables/disables
- * the "Change" button.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_memo_select_cb(GtkTreeSelection *selection,
-                                 gpointer user_data)
-{
-    QIFImportWindow  *wind = user_data;
-    gint              count = gtk_tree_selection_count_selected_rows(selection);
-    gchar            *count_str;
-
-    g_return_if_fail(wind);
-
-    /* Update the "items selected" count. */
-    if (wind->memo_view_count)
-    {
-        count_str = g_strdup_printf("%d", count);
-        gtk_label_set_text(GTK_LABEL(wind->memo_view_count), count_str);
-        g_free(count_str);
-    }
-
-    /* Enable/disable the Change button. */
-    if (wind->memo_view_btn)
-    {
-        if (count)
-            gtk_widget_set_sensitive(wind->memo_view_btn, TRUE);
-        else
-            gtk_widget_set_sensitive(wind->memo_view_btn, FALSE);
-    }
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_account_rematch_cb
- *
- * This handler is invoked when the user clicks the "Change
- * GnuCash account" button on the account mapping page. This
- * button is an alternative to double-clicking a row.
- ****************************************************************/
-
-static void
-gnc_ui_qif_import_account_rematch_cb(GtkButton *button, gpointer user_data)
-{
-    QIFImportWindow  *wind = user_data;
-
-    g_return_if_fail(wind);
-
-    rematch_line(wind,
-                 gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->acct_view)),
-                 wind->acct_display_info,
-                 wind->acct_map_info,
-                 update_account_page);
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_account_next_cb
- *
- * Find the next page to show, depending on whether there are
- * category or payee/memo mappings to be dealt with.
- ****************************************************************/
-
-static gboolean
-gnc_ui_qif_import_account_next_cb(GnomeDruidPage * page,
-                                  gpointer arg1,
-                                  gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    /* If there are category mappings then proceed as usual. */
-    if (scm_is_list(wind->cat_display_info) && !scm_is_null(wind->cat_display_info))
-        return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
-
-    /* If there are memo mappings then skip to that step. */
-    if (scm_is_list(wind->memo_display_info) && !scm_is_null(wind->memo_display_info))
-    {
-        if (wind->show_doc_pages)
-            gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                                 get_named_page(wind, "memo_doc_page"));
-        else
-            gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                                 get_named_page(wind, "memo_match_page"));
-        return TRUE;
-    }
-
-    /* Skip ahead to the currency page. */
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "currency_page"));
-    return TRUE;
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_category_rematch_cb
- *
- * This handler is invoked when the user clicks the "Change
- * GnuCash account" button on the category mapping page. This
- * button is an alternative to double-clicking a row.
- ****************************************************************/
-
-static void
-gnc_ui_qif_import_category_rematch_cb(GtkButton *button, gpointer user_data)
-{
-    QIFImportWindow  *wind = user_data;
-
-    g_return_if_fail(wind);
-
-    rematch_line(wind,
-                 gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->cat_view)),
-                 wind->cat_display_info,
-                 wind->cat_map_info,
-                 update_category_page);
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_category_next_cb
- *
- * Check to see if there are any memo or payee mappings to show.
- * If not, skip that step.
- ****************************************************************/
-
-static gboolean
-gnc_ui_qif_import_category_next_cb(GnomeDruidPage * page,
-                                   gpointer arg1,
-                                   gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    /* If there aren't any payee/memo mappings then skip that step. */
-    if (!scm_is_list(wind->memo_display_info) || scm_is_null(wind->memo_display_info))
-    {
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             get_named_page(wind, "currency_page"));
-        return TRUE;
-    }
-
-    return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_memo_rematch_cb
- *
- * This handler is invoked when the user clicks the "Change
- * GnuCash account" button on the memo mapping page. This
- * button is an alternative to double-clicking a row.
- ****************************************************************/
-
-static void
-gnc_ui_qif_import_memo_rematch_cb(GtkButton *button, gpointer user_data)
-{
-    QIFImportWindow  *wind = user_data;
-
-    g_return_if_fail(wind);
-
-    rematch_line(wind,
-                 gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->memo_view)),
-                 wind->memo_display_info,
-                 wind->memo_map_info,
-                 update_memo_page);
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_memo_doc_back_cb
- *
- * Figure out which page went before payee/memo documentation.
- ****************************************************************/
-
-static gboolean
-gnc_ui_qif_import_memo_doc_back_cb(GnomeDruidPage * page, gpointer arg1,
-                                   gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    /* If there are no categories to show, go to account matching. */
-    if (!scm_is_list(wind->cat_display_info) || scm_is_null(wind->cat_display_info))
-    {
-
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             get_named_page(wind, "account_match_page"));
-        return TRUE;
-    }
-
-    return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_memo_back_cb
- *
- * Figure out which page went before payee/memo mapping.
- ****************************************************************/
-
-static gboolean
-gnc_ui_qif_import_memo_back_cb(GnomeDruidPage * page, gpointer arg1,
-                               gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    /* If documentation is off and there are no categories to show,
-     * skip directly to account matching. */
-    if (!wind->show_doc_pages &&
-            (!scm_is_list(wind->cat_display_info) || scm_is_null(wind->cat_display_info)))
-    {
-
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             get_named_page(wind, "account_match_page"));
-        return TRUE;
-    }
-
-    return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_new_securities
- *
- * This function creates or updates the list of QIF securities
- * for which no corresponding GnuCash commodity existed prior to
- * import. If there are any such securities, TRUE is returned.
- * Otherwise, FALSE is returned.
- ****************************************************************/
-
-static gboolean
-gnc_ui_qif_import_new_securities(QIFImportWindow * wind)
-{
-    SCM updates;
-    SCM update_securities = scm_c_eval_string("qif-import:update-security-hash");
-
-    /* Get a list of any new QIF securities since the previous call. */
-    updates = scm_call_4(update_securities,
-                         wind->security_hash,
-                         wind->ticker_map,
-                         wind->acct_map_info,
-                         wind->security_prefs);
-    if (updates != SCM_BOOL_F)
-    {
-        /* A list of new QIF securities was returned. Save it. */
-        scm_gc_unprotect_object(wind->new_securities);
-        if (wind->new_securities != SCM_BOOL_F)
-            /* There is an existing list, so append the new list. */
-            wind->new_securities = scm_append(scm_list_2(wind->new_securities,
-                                              updates));
-        else
-            wind->new_securities = updates;
-        scm_gc_protect_object(wind->new_securities);
-
-        return TRUE;
-    }
-
-    if (wind->new_securities != SCM_BOOL_F)
-        return TRUE;
-
-    return FALSE;
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_currency_back_cb
- *
- * Set the next page depending on whether there are payee/memo
- * or category mappings to show.
- ****************************************************************/
-
-static gboolean
-gnc_ui_qif_import_currency_back_cb(GnomeDruidPage * page,
-                                   gpointer arg1,
-                                   gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    /* If there are payee/memo mappings to display, go there. */
-    if (scm_is_list(wind->memo_display_info) && !scm_is_null(wind->memo_display_info))
-    {
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             get_named_page(wind, "memo_match_page"));
-        return TRUE;
-    }
-
-    /* If there are category mappings to display, go there. */
-    if (scm_is_list(wind->cat_display_info) && !scm_is_null(wind->cat_display_info))
-    {
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             get_named_page(wind, "category_match_page"));
-        return TRUE;
-    }
-
-    /* Go to account matching. */
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "account_match_page"));
-    return TRUE;
-}
-
-
-static void
-gnc_ui_qif_import_comm_prepare_cb(GnomeDruidPage * page,
-                                  gpointer arg1,
-                                  gpointer user_data)
-{
-    QIFImportWindow *wind = user_data;
-    QIFDruidPage    *qpage = g_object_get_data(G_OBJECT(page), "page_struct");
-    gchar           *ns;
-
-    /* Get any entered namespace. */
-    ns = gtk_combo_box_get_active_text(GTK_COMBO_BOX(qpage->namespace_combo));
-
-    /* Update the namespaces available to select. */
-    if (!ns || !ns[0])
-        gnc_ui_update_namespace_picker(
-            qpage->namespace_combo,
-            gnc_commodity_get_namespace(qpage->commodity),
-            DIAG_COMM_ALL);
-    else
-        gnc_ui_update_namespace_picker(qpage->namespace_combo, ns, DIAG_COMM_ALL);
-
-    g_free(ns);
-}
-
-
-static gboolean
-gnc_ui_qif_import_comm_next_cb(GnomeDruidPage * page,
-                               gpointer arg1,
-                               gpointer user_data)
-{
-    QIFImportWindow *wind = user_data;
-    QIFDruidPage    *qpage = g_object_get_data(G_OBJECT(page), "page_struct");
-
-    QofBook                 *book;
-    gnc_commodity_table     *table;
-    gnc_commodity_namespace *newns;
-
-    gchar       *namespace = gnc_ui_namespace_picker_ns(qpage->namespace_combo);
-    const gchar *name      = gtk_entry_get_text(GTK_ENTRY(qpage->name_entry));
-    const gchar *mnemonic  = gtk_entry_get_text(GTK_ENTRY(qpage->mnemonic_entry));
-
-    if (!name || (name[0] == 0))
-    {
-        gnc_warning_dialog(wind->window, "%s",
-                           _("Enter a name or short description, such as \"Red Hat Stock\"."));
-        g_free(namespace);
-        return TRUE;
-    }
-    else if (!mnemonic || (mnemonic[0] == 0))
-    {
-        gnc_warning_dialog(wind->window, "%s",
-                           _("Enter the ticker symbol or other well known abbreviation, such as"
-                             " \"RHT\". If there isn't one, or you don't know it, create your own."));
-        g_free(namespace);
-        return TRUE;
-    }
-    else if (!namespace || (namespace[0] == 0))
-    {
-        gnc_warning_dialog(wind->window, "%s",
-                           _("Select the exchange on which the symbol is traded, or select the"
-                             " type of investment (such as FUND for mutual funds.) If you don't"
-                             " see your exchange or an appropriate investment type, you can"
-                             " enter a new one."));
-        if (namespace)
-            g_free(namespace);
-        return TRUE;
-    }
-
-    /* FIXME: Should check whether a commodity with this namespace and
-     *        mnemonic already exists. If so, ask the user whether to use
-     *        the existing one, or go back and change what they've entered.
-     */
-
-    book = gnc_get_current_book();
-    table = gnc_commodity_table_get_table(book);
-    if (gnc_commodity_namespace_is_iso(namespace) &&
-            !gnc_commodity_table_lookup(table, namespace, mnemonic))
-    {
-        gnc_warning_dialog(wind->window, "%s",
-                           _("You must enter an existing national "
-                             "currency or enter a different type."));
-
-        g_free(namespace);
-        return TRUE;
-    }
-
-    /* Is the namespace a new one? */
-    if (!gnc_commodity_table_has_namespace(table, namespace))
-    {
-        /* Register it so that it will appear as an option on other pages. */
-        newns = gnc_commodity_table_add_namespace(table, namespace, book);
-
-        /* Remember it so it can be removed if the import gets canceled. */
-        if (newns)
-            wind->new_namespaces = g_list_prepend(wind->new_namespaces, namespace);
-        else
-        {
-            g_warning("QIF import: Couldn't create namespace %s", namespace);
-            g_free(namespace);
-        }
-    }
-    else
-        g_free(namespace);
-
-    return FALSE;
-}
-
-
-static QIFDruidPage *
-new_security_page(SCM security_hash_key, gnc_commodity *comm)
-{
-
-    QIFDruidPage *retval = g_new0(QIFDruidPage, 1);
-    GtkWidget    *table;
-    GtkWidget    *label;
-    gchar        *title = NULL;
-    const char   *str;
-    GnomeDruidPageStandard *page;
-    char         *name_tooltip =
-        _("Enter a name or short description, such as \"Red Hat Stock\".");
-    char         *mnemonic_tooltip =
-        _("Enter the ticker symbol or other well known abbreviation, such as"
-          " \"RHT\". If there isn't one, or you don't know it, create your own.");
-    char         *namespace_tooltip =
-        _("Select the exchange on which the symbol is traded, or select the"
-          " type of investment (such as FUND for mutual funds.) If you don't"
-          " see your exchange or an appropriate investment type, you can"
-          " enter a new one.");
-#if GTK_CHECK_VERSION(2, 12, 0)
-    /* Use the GtkTooltip API */
-#elif GTK_CHECK_VERSION(2, 6, 0)
-    /* Use the deprecated GtkTooltips API */
-    GtkTooltips  *tooltips = gtk_tooltips_new();
-#endif
-
-    /* Make the page widget. */
-    retval->page = gnome_druid_page_standard_new_with_vals("", NULL, NULL);
-    g_object_set_data(G_OBJECT(retval->page), "page_struct", retval);
-    page = GNOME_DRUID_PAGE_STANDARD(retval->page);
-
-    /* Save the commodity and the hash table key. */
-    retval->commodity = comm;
-    retval->hash_key = security_hash_key;
-    scm_gc_protect_object(retval->hash_key);
-
-    /* Set the page title. */
-    str = gnc_commodity_get_mnemonic(comm);
-    str = str ? str : "";
-    title = g_markup_printf_escaped(_("Enter information about \"%s\""), str);
-    gnome_druid_page_standard_set_title(page, title);
-    g_free(title);
-
-    /* Set the page colors. */
-    gnome_druid_page_standard_set_background(page, &std_bg_color);
-    gnome_druid_page_standard_set_logo_background(page, &std_logo_bg_color);
-    gnome_druid_page_standard_set_title_foreground(page, &std_title_color);
-
-    /*
-     * Add all the widgets to the page.
-     */
-    table = gtk_table_new(3, 2, FALSE);
-    gtk_table_set_row_spacings(GTK_TABLE(table), 6);
-    gtk_table_set_col_spacings(GTK_TABLE(table), 12);
-
-    /* Name entry */
-    retval->name_entry = gtk_entry_new();
-    gtk_entry_set_text(GTK_ENTRY(retval->name_entry),
-                       gnc_commodity_get_fullname(comm));
-    label = gtk_label_new_with_mnemonic(_("_Name or description:"));
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->name_entry);
-    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-#if GTK_CHECK_VERSION(2, 12, 0)
-    gtk_widget_set_tooltip_text(label, name_tooltip);
-    gtk_widget_set_tooltip_text(retval->name_entry, name_tooltip);
-#elif GTK_CHECK_VERSION(2, 6, 0)
-    gtk_tooltips_set_tip(tooltips, label,
-                         name_tooltip, NULL);
-    gtk_tooltips_set_tip(tooltips, retval->name_entry,
-                         name_tooltip, NULL);
-#endif
-    gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
-                     GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-    gtk_table_attach_defaults(GTK_TABLE(table), retval->name_entry,
-                              1, 2, 0, 1);
-    /* Mnemonic entry */
-    retval->mnemonic_entry = gtk_entry_new();
-    gtk_entry_set_text(GTK_ENTRY(retval->mnemonic_entry),
-                       gnc_commodity_get_mnemonic(comm));
-    label = gtk_label_new_with_mnemonic(
-                _("_Ticker symbol or other abbreviation:"));
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->mnemonic_entry);
-    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-#if GTK_CHECK_VERSION(2, 12, 0)
-    gtk_widget_set_tooltip_text(label, mnemonic_tooltip);
-    gtk_widget_set_tooltip_text(retval->mnemonic_entry, mnemonic_tooltip);
-#elif GTK_CHECK_VERSION(2, 6, 0)
-    gtk_tooltips_set_tip(tooltips, label,
-                         mnemonic_tooltip, NULL);
-    gtk_tooltips_set_tip(tooltips, retval->mnemonic_entry,
-                         mnemonic_tooltip, NULL);
-#endif
-    gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2,
-                     GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-    gtk_table_attach_defaults(GTK_TABLE(table), retval->mnemonic_entry,
-                              1, 2, 1, 2);
-
-    /* Namespace entry */
-    retval->namespace_combo = gtk_combo_box_entry_new_text();
-    gnc_cbe_add_completion(GTK_COMBO_BOX_ENTRY(retval->namespace_combo));
-    label = gtk_label_new_with_mnemonic(
-                _("_Exchange or abbreviation type:"));
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->namespace_combo);
-    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-#if GTK_CHECK_VERSION(2, 12, 0)
-    gtk_widget_set_tooltip_text(label, namespace_tooltip);
-    gtk_widget_set_tooltip_text(retval->namespace_combo, namespace_tooltip);
-#elif GTK_CHECK_VERSION(2, 6, 0)
-    gtk_tooltips_set_tip(tooltips, label,
-                         namespace_tooltip, NULL);
-    gtk_tooltips_set_tip(tooltips, retval->namespace_combo,
-                         namespace_tooltip, NULL);
-#endif
-    gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
-                     GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-    gtk_table_attach_defaults(GTK_TABLE(table), retval->namespace_combo,
-                              1, 2, 2, 3);
-
-    gtk_box_pack_start(GTK_BOX(page->vbox), table, FALSE, FALSE, 0);
-
-    return retval;
-}
-
-
-/********************************************************************
- * prepare_security_pages
- *
- * Prepare the druid page for each security.
- ********************************************************************/
-
-static void
-prepare_security_pages(QIFImportWindow * wind)
-{
-    SCM   hash_ref  = scm_c_eval_string("hash-ref");
-    SCM   securities;
-    SCM   comm_ptr_token;
-
-    GList          * current;
-    gnc_commodity  * commodity;
-    GnomeDruidPage * back_page = get_named_page(wind, "commodity_doc_page");
-    QIFDruidPage   * new_page;
-
-    /*
-     * Make druid pages for each new QIF security.
-     */
-    gnc_set_busy_cursor(NULL, TRUE);
-    securities = wind->new_securities;
-    current = wind->commodity_pages;
-    while (!scm_is_null(securities) && (securities != SCM_BOOL_F))
-    {
-        if (current)
-        {
-            /* The page has already been made. */
-            back_page = GNOME_DRUID_PAGE(current->data);
-            current = current->next;
-        }
-        else
-        {
-            /* Get the GnuCash commodity corresponding to the new QIF security. */
-            comm_ptr_token = scm_call_2(hash_ref,
-                                        wind->security_hash,
-                                        SCM_CAR(securities));
-#define FUNC_NAME "new_security_page"
-            commodity = SWIG_MustGetPtr(comm_ptr_token,
-                                        SWIG_TypeQuery("_p_gnc_commodity"), 1, 0);
-#undef FUNC_NAME
-
-            /* Build a new security page. */
-            new_page = new_security_page(SCM_CAR(securities), commodity);
-
-            /* Connect the signals. */
-            g_signal_connect(new_page->page, "prepare",
-                             G_CALLBACK(gnc_ui_qif_import_comm_prepare_cb),
-                             wind);
-
-            g_signal_connect(new_page->page, "back",
-                             G_CALLBACK(gnc_ui_qif_import_generic_back_cb),
-                             wind);
-
-            g_signal_connect(new_page->page, "next",
-                             G_CALLBACK(gnc_ui_qif_import_comm_next_cb),
-                             wind);
-
-            /* Add it to the list of security pages. */
-            wind->commodity_pages = g_list_append(wind->commodity_pages,
-                                                  new_page->page);
-
-            /* Add the new page to the druid. */
-            gnome_druid_insert_page(GNOME_DRUID(wind->druid),
-                                    back_page,
-                                    GNOME_DRUID_PAGE(new_page->page));
-
-            back_page = GNOME_DRUID_PAGE(new_page->page);
-            gtk_widget_show_all(new_page->page);
-        }
-
-        securities = SCM_CDR(securities);
-    }
-    gnc_unset_busy_cursor(NULL);
-
-    gnc_druid_set_colors(GNOME_DRUID(wind->druid));
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_currency_next_cb
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_currency_next_cb(GnomeDruidPage * page,
-                                   gpointer arg1,
-                                   gpointer user_data)
-{
-    QIFImportWindow * wind = user_data;
-
-    /* If there are new securities, prepare the security pages. */
-    if (gnc_ui_qif_import_new_securities(wind))
-        prepare_security_pages(wind);
-
-    return gnc_ui_qif_import_generic_next_cb(page, arg1, wind);
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_commodity_update
- *
- * This function updates the commodities based on the values for
- * mnemonic, namespace, and name approved by the user.
- ****************************************************************/
-
-static void
-gnc_ui_qif_import_commodity_update(QIFImportWindow * wind)
-{
-    GList          *pageptr;
-    GnomeDruidPage *gtkpage;
-    QIFDruidPage   *page;
-    const gchar    *mnemonic = NULL;
-    gchar          *namespace = NULL;
-    const gchar    *fullname = NULL;
-    gnc_commodity  *tab_commodity;
-
-    for (pageptr = wind->commodity_pages; pageptr; pageptr = pageptr->next)
-    {
-        gtkpage   = GNOME_DRUID_PAGE(pageptr->data);
-        page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
-
-        /* Get any changes from the commodity page. */
-        mnemonic  = gtk_entry_get_text(GTK_ENTRY(page->mnemonic_entry));
-        namespace = gnc_ui_namespace_picker_ns(page->namespace_combo);
-        fullname  = gtk_entry_get_text(GTK_ENTRY(page->name_entry));
-
-        /* Update the commodity with the new values. */
-        gnc_commodity_set_namespace(page->commodity, namespace);
-        gnc_commodity_set_fullname(page->commodity, fullname);
-        gnc_commodity_set_mnemonic(page->commodity, mnemonic);
-
-        /* Add the commodity to the commodity table (if it isn't a duplicate). */
-        tab_commodity = gnc_commodity_table_lookup(gnc_get_current_commodities(),
-                        namespace, mnemonic);
-        if (!tab_commodity || tab_commodity == page->commodity)
-            tab_commodity = gnc_commodity_table_insert(gnc_get_current_commodities(),
-                            page->commodity);
-
-        /* Update the security hash table. */
-        scm_hash_set_x(wind->security_hash,
-                       page->hash_key,
-                       SWIG_NewPointerObj(tab_commodity,
-                                          SWIG_TypeQuery("_p_gnc_commodity"), 0));
-
-        g_free(namespace);
-    }
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_prepare_duplicates
- *
- * This function prepares the duplicates checking page.
- ****************************************************************/
-
-static void
-gnc_ui_qif_import_prepare_duplicates(QIFImportWindow * wind)
-{
-    GtkTreeView      *view;
-    GtkListStore     *store;
-    SCM               duplicates;
-    SCM               current_xtn;
-    Transaction      *gnc_xtn;
-    Split            *gnc_split;
-    GtkTreeIter       iter;
-    GtkTreeSelection *selection;
-    GtkTreePath      *path;
-    const gchar      *amount_str;
-    int               rownum = 0;
-
-    view = GTK_TREE_VIEW(wind->new_transaction_view);
-    store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
-    gtk_list_store_clear(store);
-
-    if (!scm_is_list(wind->match_transactions))
-        return;
-
-    /* Loop through the list of new, potentially duplicate transactions. */
-    duplicates = wind->match_transactions;
-    while (!scm_is_null(duplicates))
-    {
-        current_xtn = SCM_CAAR(duplicates);
-#define FUNC_NAME "xaccTransCountSplits"
-        gnc_xtn     = SWIG_MustGetPtr(current_xtn,
-                                      SWIG_TypeQuery("_p_Transaction"), 1, 0);
-#undef FUNC_NAME
-        if (xaccTransCountSplits(gnc_xtn) > 2)
-            amount_str = _("(split)");
-        else
-        {
-            gnc_split = xaccTransGetSplit(gnc_xtn, 0);
-            amount_str =
-                xaccPrintAmount(gnc_numeric_abs(xaccSplitGetValue(gnc_split)),
-                                gnc_account_print_info
-                                (xaccSplitGetAccount(gnc_split), TRUE));
-        }
-
-        gtk_list_store_append(store, &iter);
-        gtk_list_store_set
-        (store, &iter,
-         QIF_TRANS_COL_INDEX, rownum++,
-         QIF_TRANS_COL_DATE,
-         gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
-         QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
-         QIF_TRANS_COL_AMOUNT, amount_str,
-         -1);
-
-        duplicates = SCM_CDR(duplicates);
-    }
-
-    selection = gtk_tree_view_get_selection(view);
-    path = gtk_tree_path_new_from_indices(0, -1);
-    gtk_tree_selection_select_path(selection, path);
-    gtk_tree_path_free(path);
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_convert_undo
- *
- * This function launches the Scheme procedure that un-imports
- * any imported accounts and transactions.
- ****************************************************************/
-
-static void
-gnc_ui_qif_import_convert_undo(QIFImportWindow * wind)
-{
-    SCM undo = scm_c_eval_string("qif-import:qif-to-gnc-undo");
-
-    gnc_set_busy_cursor(NULL, TRUE);
-
-    /* Undo the conversion. */
-    scm_call_1(undo, wind->imported_account_tree);
-
-    /* There's no imported account tree any more. */
-    scm_gc_unprotect_object(wind->imported_account_tree);
-    wind->imported_account_tree = SCM_BOOL_F;
-    scm_gc_protect_object(wind->imported_account_tree);
-
-
-    /* Get rid of the list of matched transactions. */
-    scm_gc_unprotect_object(wind->match_transactions);
-    wind->match_transactions = SCM_BOOL_F;
-    scm_gc_protect_object(wind->match_transactions);
-
-    gnc_unset_busy_cursor(NULL);
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_convert_progress_prepare_cb
- *
- * Prepare the data conversion progress page for display.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_convert_progress_prepare_cb(GnomeDruidPage * page,
-        gpointer arg1,
-        gpointer user_data)
-{
-    QIFImportWindow   *wind = user_data;
-
-    /* Reset the progress display. */
-    gnc_progress_dialog_set_primary(wind->convert_progress, "");
-    gnc_progress_dialog_set_secondary(wind->convert_progress,
-                                      _("GnuCash is now importing your QIF data. If there are no errors or warnings, you will automatically proceed to the next step. Otherwise, the details will be shown below for your review."));
-    gnc_progress_dialog_set_sub(wind->convert_progress, " ");
-    gnc_progress_dialog_reset_value(wind->convert_progress);
-    gnc_progress_dialog_reset_log(wind->convert_progress);
-
-    /* Disable the "Forward" button for now.
-     *
-     * NOTE: Due to bug 91001 in GnomeDruid, gnome_druid_set_buttons_sensitive()
-     *       will not work in prepare callbacks unless they are run AFTER the
-     *       standard one. Make sure the Glade line has the callback set up with
-     *       after=yes. For example:
-     *         <signal name="prepare" handler="my_prepare_cb" after="yes"/>   */
-    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                      TRUE, FALSE, TRUE, TRUE);
-
-    /* Generate a show signal once the page is displayed. This
-     * will kick off our (potentially) long-running operations. */
-    gtk_widget_hide(GTK_WIDGET(page));
-    gtk_widget_set_sensitive(GTK_WIDGET(page), TRUE);
-    gtk_widget_show(GTK_WIDGET(page));
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_convert_progress_show_cb
- *
- * Perform the conversion.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_convert_progress_show_cb(GtkWidget *widget,
-        gpointer user_data)
-{
-    QIFImportWindow   *wind = user_data;
-    SCM qif_to_gnc      = scm_c_eval_string("qif-import:qif-to-gnc");
-    SCM find_duplicates = scm_c_eval_string("gnc:account-tree-find-duplicates");
-    SCM retval;
-
-    /* SCM for the progress dialog. */
-    SCM progress = SWIG_NewPointerObj(wind->convert_progress,
-                                      SWIG_TypeQuery("_p__GNCProgressDialog"),
-                                      0);
-
-    /* The default currency. */
-    gchar *currname =
-        gtk_combo_box_get_active_text(GTK_COMBO_BOX(wind->currency_picker));
-
-    /* Raise the busy flag so the druid can't be canceled unexpectedly. */
-    wind->busy = TRUE;
-    gtk_widget_set_sensitive(wind->convert_pause, TRUE);
-
-    /* Clear any previous pause or cancel state. */
-    scm_c_eval_string("(qif-import:reset-cancel-pause)");
-
-    /* Update the commodities. */
-    gnc_ui_qif_import_commodity_update(wind);
-
-
-    /*
-     * Convert the QIF data into GnuCash data.
-     *
-     * A Scheme function does all the work.  The return value is the
-     * root account of an account tree containing all the new accounts
-     * and transactions. Upon failure, #f is returned. If the user
-     * cancels, #t is returned.
-     */
-
-    /* This step will fill 70% of the bar. */
-    gnc_progress_dialog_push(wind->convert_progress, 0.7);
-    retval = scm_apply(qif_to_gnc,
-                       SCM_LIST8(wind->imported_files,
-                                 wind->acct_map_info,
-                                 wind->cat_map_info,
-                                 wind->memo_map_info,
-                                 wind->security_hash,
-                                 scm_makfrom0str(currname),
-                                 wind->transaction_status,
-                                 progress),
-                       SCM_EOL);
-    gnc_progress_dialog_pop(wind->convert_progress);
-    g_free(currname);
-
-    if (retval == SCM_BOOL_T)
-    {
-        /* Canceled by the user. */
-
-        /* Disable the pause button. */
-        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
-
-        /* Remove any converted data. */
-        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
-        gnc_ui_qif_import_convert_undo(wind);
-
-        /* Inform the user. */
-        gnc_progress_dialog_set_sub(wind->convert_progress, _("Canceled"));
-        gnc_progress_dialog_reset_value(wind->convert_progress);
-
-        wind->busy = FALSE;
-        return;
-    }
-    else if (retval == SCM_BOOL_F)
-    {
-        /* An bug was encountered during conversion. */
-
-        /* Disable the pause button. */
-        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
-
-        /* Remove any converted data. */
-        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
-        gnc_ui_qif_import_convert_undo(wind);
-
-        /* Inform the user. */
-        gnc_progress_dialog_append_log(wind->convert_progress,
-                                       _( "A bug was detected while converting the QIF data."));
-        gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
-        gnc_progress_dialog_reset_value(wind->convert_progress);
-        gnc_error_dialog(wind->window, "%s",
-                         _( "A bug was detected while converting the QIF data."));
-        /* FIXME: How should we request that the user report this problem? */
-
-        wind->busy = FALSE;
-        return;
-    }
-    else if (scm_is_symbol(retval))
-    {
-        /* An error was encountered during conversion. */
-
-        /* Disable the pause button. */
-        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
-
-        /* Remove any converted data. */
-        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
-        gnc_ui_qif_import_convert_undo(wind);
-
-        /* Inform the user. */
-        gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
-        gnc_progress_dialog_reset_value(wind->convert_progress);
-
-        wind->busy = FALSE;
-        return;
-    }
-
-
-    /* Save the imported account tree. */
-    scm_gc_unprotect_object(wind->imported_account_tree);
-    wind->imported_account_tree = retval;
-    scm_gc_protect_object(wind->imported_account_tree);
-
-
-    /*
-     * Detect potentially duplicated transactions.
-     */
-
-    /* This step will fill the remainder of the bar. */
-    gnc_progress_dialog_push(wind->convert_progress, 1);
-    retval = scm_call_3(find_duplicates,
-                        scm_c_eval_string("(gnc-get-current-root-account)"),
-                        wind->imported_account_tree, progress);
-    gnc_progress_dialog_pop(wind->convert_progress);
-
-    /* Save the results. */
-    scm_gc_unprotect_object(wind->match_transactions);
-    wind->match_transactions = retval;
-    scm_gc_protect_object(wind->match_transactions);
-
-    if (retval == SCM_BOOL_T)
-    {
-        /* Canceled by the user. */
-        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
-        gnc_progress_dialog_set_sub(wind->convert_progress, _("Canceling"));
-        wind->busy = FALSE;
-        return;
-    }
-    else if (retval == SCM_BOOL_F)
-    {
-        /* An error occurred during duplicate checking. */
-
-        /* Remove any converted data. */
-        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
-        gnc_ui_qif_import_convert_undo(wind);
-
-        /* Inform the user. */
-        gnc_progress_dialog_append_log(wind->convert_progress,
-                                       _( "A bug was detected while detecting duplicates."));
-        gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
-        gnc_progress_dialog_reset_value(wind->convert_progress);
-        gnc_error_dialog(wind->window, "%s",
-                         _( "A bug was detected while detecting duplicates."));
-        /* FIXME: How should we request that the user report this problem? */
-
-        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
-        wind->busy = FALSE;
-        return;
-    }
-
-
-    /* The conversion completed successfully. */
-    gnc_progress_dialog_set_sub(wind->convert_progress,
-                                _("Conversion completed"));
-    gnc_progress_dialog_set_value(wind->convert_progress, 1);
-
-    /* Enable all buttons. */
-    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                      TRUE, TRUE, TRUE, TRUE);
-
-    /* If the log is empty, move on to the next page automatically. */
-    if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(wind->convert_log))) == 0)
-        gnome_druid_page_next(GNOME_DRUID_PAGE(widget));
-
-    gtk_widget_set_sensitive(wind->convert_pause, FALSE);
-    wind->busy = FALSE;
-    return;
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_convert_progress_pause_cb
- *
- * Invoked when the "Pause" button is clicked.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_convert_progress_pause_cb(GtkButton * button,
-        gpointer user_data)
-{
-    QIFImportWindow *wind = user_data;
-    SCM toggle_pause      = scm_c_eval_string("qif-import:toggle-pause");
-    SCM progress;
-
-    if (!wind->busy)
-        return;
-
-    /* Create SCM for the progress helper. */
-    progress = SWIG_NewPointerObj(wind->convert_progress,
-                                  SWIG_TypeQuery("_p__GNCProgressDialog"),
-                                  0);
-
-    /* Pause (or resume) the currently running operation. */
-    scm_call_1(toggle_pause, progress);
-
-    /* Swap the button label between pause and resume. */
-    if (strcmp(gtk_button_get_label(button), _("_Resume")))
-    {
-        gtk_button_set_use_stock(button, FALSE);
-        gtk_button_set_use_underline(button, TRUE);
-        gtk_button_set_label(button, _("_Resume"));
-    }
-    else
-    {
-        gtk_button_set_use_stock(button, TRUE);
-        gtk_button_set_use_underline(button, FALSE);
-        gtk_button_set_label(button, "gtk-media-pause");
-    }
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_convert_progress_next_cb
- *
- * Determine the next page after converting successfully.
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_convert_progress_next_cb(GnomeDruidPage * page,
-        gpointer arg1,
-        gpointer user_data)
-{
-    QIFImportWindow *wind = user_data;
-
-    if (scm_is_null(wind->match_transactions))
-    {
-        /* No potential duplicates, so skip to the last page. */
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             get_named_page(wind, "end_page"));
-        return TRUE;
-    }
-
-    /* Prepare the duplicates page. */
-    gnc_ui_qif_import_prepare_duplicates(wind);
-
-    /* Display the next page. */
-    return gnc_ui_qif_import_generic_next_cb(page, arg1, wind);
-}
-
-
-/****************************************************************
- * convert_progress_back_timeout_cb
- *
- * This timer callback function waits until the busy flag
- * has been cleared before going back to the previous page.
- ****************************************************************/
-
-static gboolean
-convert_progress_back_timeout_cb(gpointer data)
-{
-    QIFImportWindow *wind = data;
-
-    if (wind->busy)
-        /* Wait for timer to go off again. */
-        return TRUE;
-
-    /* The busy flag was lowered. Go back to the previous page. */
-    gnome_druid_page_back(get_named_page(wind, "convert_progress_page"));
-
-    /* Cancel the timer. */
-    return FALSE;
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_convert_progress_back_cb
- *
- * Return to the previous page, waiting if necessary.
- ********************************************************************/
-
-static gboolean
-gnc_ui_qif_import_convert_progress_back_cb(GnomeDruidPage * page,
-        gpointer arg1,
-        gpointer user_data)
-{
-    QIFImportWindow *wind = user_data;
-
-    if (wind->busy)
-    {
-        /* Cancel any long-running Scheme operation. */
-        scm_c_eval_string("(qif-import:cancel)");
-
-        /* Wait for the busy flag to be lowered. */
-        g_timeout_add(200, convert_progress_back_timeout_cb, user_data);
-
-        return TRUE;
-    }
-
-    return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
-}
-
-
-static void
-refresh_old_transactions(QIFImportWindow * wind, int selection)
-{
-    SCM          possible_matches;
-    SCM          current_xtn;
-    SCM          selected;
-    Transaction  * gnc_xtn;
-    Split        * gnc_split;
-    const gchar  * amount_str;
-    int          rownum = 0;
-    GtkTreeView *view;
-    GtkListStore *store;
-    GtkTreeIter iter;
-
-    view = GTK_TREE_VIEW(wind->old_transaction_view);
-    store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
-    gtk_list_store_clear(store);
-
-    if (wind->match_transactions != SCM_BOOL_F)
-    {
-        possible_matches = SCM_CDR(scm_list_ref(wind->match_transactions,
-                                                scm_int2num(wind->selected_transaction)));
-        scm_call_2(scm_c_eval_string("qif-import:refresh-match-selection"),
-                   possible_matches, scm_int2num(selection));
-
-        while (!scm_is_null(possible_matches))
-        {
-            current_xtn = SCM_CAR(possible_matches);
-#define FUNC_NAME "xaccTransCountSplits"
-            gnc_xtn     = SWIG_MustGetPtr(SCM_CAR(current_xtn),
-                                          SWIG_TypeQuery("_p_Transaction"), 1, 0);
-#undef FUNC_NAME
-            selected    = SCM_CDR(current_xtn);
-
-            if (xaccTransCountSplits(gnc_xtn) > 2)
-            {
-                amount_str = _("(split)");
-            }
-            else
-            {
-                gnc_split = xaccTransGetSplit(gnc_xtn, 0);
-                amount_str =
-                    xaccPrintAmount(gnc_numeric_abs(xaccSplitGetValue(gnc_split)),
-                                    gnc_account_print_info
-                                    (xaccSplitGetAccount(gnc_split), TRUE));
-            }
-
-            gtk_list_store_append(store, &iter);
-            gtk_list_store_set
-            (store, &iter,
-             QIF_TRANS_COL_INDEX, rownum++,
-             QIF_TRANS_COL_DATE, gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
-             QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
-             QIF_TRANS_COL_AMOUNT, amount_str,
-             QIF_TRANS_COL_CHECKED, selected != SCM_BOOL_F,
-             -1);
-
-            possible_matches = SCM_CDR(possible_matches);
-        }
-    }
-}
-
-static void
-gnc_ui_qif_import_duplicate_new_select_cb(GtkTreeSelection *selection,
-        QIFImportWindow  *wind)
-{
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-
-    if (gtk_tree_selection_get_selected(selection, &model, &iter))
-        gtk_tree_model_get(model, &iter,
-                           QIF_TRANS_COL_INDEX, &wind->selected_transaction,
-                           -1);
-    refresh_old_transactions(wind, -1);
-}
-
-static gboolean
-reset_ignore_old_select(gboolean *ignore)
-{
-    *ignore = FALSE;
-    return FALSE;
-}
-
-static void
-gnc_ui_qif_import_duplicate_old_select_cb(GtkTreeSelection *selection,
-        QIFImportWindow  *wind)
-{
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-    gint row;
-    static gboolean ignore_old_select = FALSE;
-
-    /* Get the current selection then clear it.  We're about to clear
-     * the entire list store and rebuild it so this prevents errors. */
-    if (!gtk_tree_selection_get_selected(selection, &model, &iter))
-        return;
-    gtk_tree_selection_unselect_all(selection);
-
-    /* Getting a weird double call the first time a line is clicked.
-     * Once via gtk_tree_view_button_press and then again via
-     * gtk_tree_view_grab_focus. */
-    if (ignore_old_select)
-        return;
-    ignore_old_select = TRUE;
-    g_idle_add((GSourceFunc)reset_ignore_old_select, &ignore_old_select);
-
-    /* Get the row the user clicked on and update the scheme
-     * code/rebuild the list store.  */
-    gtk_tree_model_get(model, &iter,
-                       QIF_TRANS_COL_INDEX, &row,
-                       -1);
-    refresh_old_transactions(wind, row);
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_check_acct_tree
- *
- * Designed for use with gnc_main_window_foreach_page(), this
- * function determines whether an account tab is open in the main
- * window. The parameter user_data must point to a gboolean.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_check_acct_tree(GncPluginPage *page, gpointer user_data)
-{
-    gboolean *found = user_data;
-
-    if (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page) && found)
-        *found = TRUE;
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_finish_cb
- *
- * Invoked when the "Apply" button is clicked on the final page.
- ********************************************************************/
-
-static void
-gnc_ui_qif_import_finish_cb(GnomeDruidPage * gpage,
-                            gpointer arg1,
-                            gpointer user_data)
-{
-    SCM save_map_prefs = scm_c_eval_string("qif-import:save-map-prefs");
-    SCM cat_and_merge = scm_c_eval_string("gnc:account-tree-catenate-and-merge");
-    SCM prune_xtns = scm_c_eval_string("gnc:prune-matching-transactions");
-    SCM scm_result;
-
-    QIFImportWindow * wind = user_data;
-    GncPluginPage *page;
-    gboolean acct_tree_found = FALSE;
-
-    gnc_suspend_gui_refresh();
-
-    /* Prune any imported transactions that were determined to be duplicates. */
-    if (wind->match_transactions != SCM_BOOL_F)
-        scm_call_1(prune_xtns, wind->match_transactions);
-
-    /* Merge the imported account tree with the existing one. */
-    if (wind->imported_account_tree != SCM_BOOL_F)
-        scm_call_2(cat_and_merge,
-                   scm_c_eval_string("(gnc-get-current-root-account)"),
-                   wind->imported_account_tree);
-
-    gnc_resume_gui_refresh();
-
-    /* Save the user's mapping preferences. */
-    scm_result = scm_apply(save_map_prefs,
-                           SCM_LIST5(wind->acct_map_info, wind->cat_map_info,
-                                     wind->memo_map_info, wind->security_hash,
-                                     wind->security_prefs),
-                           SCM_EOL);
-    if (scm_result == SCM_BOOL_F)
-        gnc_warning_dialog(wind->window, "%s",
-                           _("GnuCash was unable to save your mapping preferences."));
-
-    /* Open an account tab in the main window if one doesn't exist already. */
-    gnc_main_window_foreach_page(gnc_ui_qif_import_check_acct_tree,
-                                 &acct_tree_found);
-    if (!acct_tree_found)
-    {
-        page = gnc_plugin_page_account_tree_new();
-        gnc_main_window_open_page(NULL, page);
-    }
-
-    gnc_ui_qif_import_druid_destroy(wind);
-}
-
-
-/****************************************************************
- * do_cancel
- *
- * Clears out any imported data and shuts down the importer.
- ****************************************************************/
-
-static void
-do_cancel(QIFImportWindow * wind)
-{
-    GList               *pageptr;
-    GnomeDruidPage      *gtkpage;
-    QIFDruidPage        *page;
-    gnc_commodity_table *table;
-
-    gnc_set_busy_cursor(NULL, TRUE);
-
-    /* Remove any converted data. */
-    gnc_ui_qif_import_convert_undo(wind);
-
-    /* Remove any commodities created for druid pages. */
-    for (pageptr = wind->commodity_pages; pageptr; pageptr = pageptr->next)
-    {
-        gtkpage   = GNOME_DRUID_PAGE(pageptr->data);
-        page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
-        gnc_commodity_destroy(page->commodity);
-    }
-
-    /* Remove any namespaces created by the user. */
-    table = gnc_get_current_commodities();
-    while (wind->new_namespaces)
-    {
-        gnc_commodity_table_delete_namespace(table, (gchar *) wind->new_namespaces->data);
-
-        /* Free the data and the list element. */
-        g_free(wind->new_namespaces->data);
-        wind->new_namespaces = g_list_delete_link(wind->new_namespaces,
-                               wind->new_namespaces);
-    }
-
-    gnc_unset_busy_cursor(NULL);
-
-    /* Destroy the druid. */
-    gnc_ui_qif_import_druid_destroy(wind);
-}
-
-
-/****************************************************************
- * cancel_timeout_cb
- *
- * This timer callback function waits until the busy flag
- * has been cleared before acting to cancel the import.
- ****************************************************************/
-
-static gboolean
-cancel_timeout_cb(gpointer data)
-{
-    QIFImportWindow *wind = data;
-
-    if (wind->busy)
-        /* Wait for timer to go off again. */
-        return TRUE;
-
-    /* The busy flag was lowered. Perform the cancel. */
-    do_cancel(wind);
-
-    /* Cancel the timer. */
-    return FALSE;
-}
-
-
-/****************************************************************
- * gnc_ui_qif_import_cancel_cb
- *
- * Invoked when the "Cancel" button is clicked.
- ****************************************************************/
-
-static void
-gnc_ui_qif_import_cancel_cb(GnomeDruid * druid, gpointer user_data)
-{
-    QIFImportWindow     *wind = user_data;
-
-    if (wind->busy)
-    {
-        /* Cancel any long-running Scheme operation. */
-        scm_c_eval_string("(qif-import:cancel)");
-
-        /* Wait for the busy flag to be lowered. */
-        g_timeout_add(200, cancel_timeout_cb, user_data);
-    }
-    else
-        do_cancel(wind);
-}
-
-
-SCM
-gnc_ui_qif_import_druid_get_mappings(QIFImportWindow * w)
-{
-    return SCM_LIST3(w->acct_map_info,
-                     w->cat_map_info,
-                     w->memo_map_info);
-}
-
-
-
-/* ================================================================== */
-/*                                                                    */
-/*                         IMPORTER CREATION                          */
-/*                                                                    */
-/* ================================================================== */
-
-
-/********************************************************************
- * get_preferences
- *
- * Get all user preferences related to QIF import.
- ********************************************************************/
-
-static void
-get_preferences(QIFImportWindow *wind)
-{
-    GError * err = NULL;
-    gchar *status_pref = NULL;
-    gchar tmp_transaction_status = 'n';
-
-    g_return_if_fail(wind);
-
-    /* Get the user's preference for showing documentation pages. */
-    wind->show_doc_pages =
-        gnc_gconf_get_bool(GCONF_SECTION, GCONF_NAME_SHOW_DOC, &err);
-    if (err != NULL)
-    {
-        g_warning("QIF import: gnc_gconf_get_bool error: %s", err->message);
-        g_error_free(err);
-
-        /* Show documentation pages by default. */
-        g_warning("QIF import: Couldn't get %s setting from gconf.",
-                  GCONF_NAME_SHOW_DOC);
-        g_warning("QIF import: Documentation pages will be shown by default.");
-        wind->show_doc_pages = TRUE;
-    }
-
-    /* Clear / Reconcile transaction if not specified in QIF file. */
-    status_pref = gnc_gconf_get_string(
-                      GCONF_SECTION, GCONF_NAME_DEFAULT_TRANSACTION_STATUS, &err);
-    if (err != NULL)
-    {
-        g_warning("QIF import: gnc_gconf_get_string error: %s", err->message);
-        g_error_free(err);
-        g_warning("QIF import: Couldn't get %s setting from gconf.",
-                  GCONF_NAME_DEFAULT_TRANSACTION_STATUS);
-    }
-    else
-    {
-        if (g_strcmp0(status_pref, "cleared") == 0)
-        {
-            tmp_transaction_status = 'c';
-        }
-        else if (g_strcmp0(status_pref, "reconciled") == 0)
-        {
-            tmp_transaction_status = 'y';
-        }
-    }
-    g_free(status_pref);
-    wind->transaction_status = SCM_MAKE_CHAR(tmp_transaction_status);
-}
-
-
-/********************************************************************
- * initialize_scheme
- *
- * Initialize all Scheme-controlled objects.
- ********************************************************************/
-
-static void
-initialize_scheme(QIFImportWindow *wind)
-{
-    SCM  load_map_prefs;
-    SCM  mapping_info;
-    SCM  create_ticker_map;
-
-    g_return_if_fail(wind);
-
-    /* Initialize Scheme variables. */
-    wind->imported_files        = SCM_EOL;
-    wind->selected_file         = SCM_BOOL_F;
-    wind->gnc_acct_info         = SCM_BOOL_F;
-    wind->cat_display_info      = SCM_BOOL_F;
-    wind->cat_map_info          = SCM_BOOL_F;
-    wind->acct_display_info     = SCM_BOOL_F;
-    wind->acct_map_info         = SCM_BOOL_F;
-    wind->memo_display_info     = SCM_BOOL_F;
-    wind->memo_map_info         = SCM_BOOL_F;
-    wind->security_hash         = SCM_BOOL_F;
-    wind->security_prefs        = SCM_BOOL_F;
-    wind->new_securities        = SCM_BOOL_F;
-    wind->ticker_map            = SCM_BOOL_F;
-    wind->imported_account_tree = SCM_BOOL_F;
-    wind->match_transactions    = SCM_BOOL_F;
-
-    /* Get the saved state of mappings from Quicken accounts and
-     * categories to GnuCash accounts. */
-    load_map_prefs = scm_c_eval_string("qif-import:load-map-prefs");
-    mapping_info = scm_call_0(load_map_prefs);
-    wind->gnc_acct_info         = scm_list_ref(mapping_info, scm_int2num(0));
-    wind->acct_map_info         = scm_list_ref(mapping_info, scm_int2num(1));
-    wind->cat_map_info          = scm_list_ref(mapping_info, scm_int2num(2));
-    wind->memo_map_info         = scm_list_ref(mapping_info, scm_int2num(3));
-    wind->security_hash         = scm_list_ref(mapping_info, scm_int2num(4));
-    wind->security_prefs        = scm_list_ref(mapping_info, scm_int2num(5));
-
-    /* Get the initial ticker map. */
-    create_ticker_map = scm_c_eval_string("make-ticker-map");
-    wind->ticker_map            = scm_call_0(create_ticker_map);
-
-    /* Protect our data from garbage collection. */
-    scm_gc_protect_object(wind->imported_files);
-    scm_gc_protect_object(wind->selected_file);
-    scm_gc_protect_object(wind->gnc_acct_info);
-    scm_gc_protect_object(wind->cat_display_info);
-    scm_gc_protect_object(wind->cat_map_info);
-    scm_gc_protect_object(wind->memo_display_info);
-    scm_gc_protect_object(wind->memo_map_info);
-    scm_gc_protect_object(wind->acct_display_info);
-    scm_gc_protect_object(wind->acct_map_info);
-    scm_gc_protect_object(wind->security_hash);
-    scm_gc_protect_object(wind->security_prefs);
-    scm_gc_protect_object(wind->new_securities);
-    scm_gc_protect_object(wind->ticker_map);
-    scm_gc_protect_object(wind->imported_account_tree);
-    scm_gc_protect_object(wind->match_transactions);
-}
-
-
-/********************************************************************
- * build_page_lists
- *
- * Build the lists of druid pages.
- ********************************************************************/
-
-static void
-build_page_lists(QIFImportWindow *wind, GladeXML *xml)
-{
-    int  i;
-
-    /* Pages that may appear prior to security-related pages. */
-    char * pre_page_names[NUM_PRE_PAGES] =
-    {
-        "start_page", "load_file_page", "load_progress_page",
-        "date_format_page", "account_name_page",
-        "loaded_files_page", "account_doc_page", "account_match_page",
-        "category_doc_page", "category_match_page", "memo_doc_page",
-        "memo_match_page", "currency_page", "commodity_doc_page"
-    };
-
-    /* Pages that may appear after security-related pages. */
-    char * post_page_names[NUM_POST_PAGES] =
-    {
-        "convert_progress_page", "match_doc_page", "match_duplicates_page",
-        "end_page"
-    };
-
-    /* Optional pages that only show documention. */
-    char * doc_page_names[NUM_DOC_PAGES] =
-    {
-        "start_page", "account_doc_page", "category_doc_page",
-        "commodity_doc_page", "memo_doc_page", "match_doc_page"
-    };
-
-    g_return_if_fail(wind);
-
-    wind->pre_comm_pages   = NULL;
-    wind->post_comm_pages  = NULL;
-    wind->doc_pages        = NULL;
-    wind->commodity_pages = NULL;
-
-    g_return_if_fail(xml);
-
-    /* Build the page lists. */
-    for (i = 0; i < NUM_PRE_PAGES; i++)
-    {
-        wind->pre_comm_pages =
-            g_list_append(wind->pre_comm_pages,
-                          glade_xml_get_widget(xml, pre_page_names[i]));
-    }
-    for (i = 0; i < NUM_POST_PAGES; i++)
-    {
-        wind->post_comm_pages =
-            g_list_append(wind->post_comm_pages,
-                          glade_xml_get_widget(xml, post_page_names[i]));
-    }
-    for (i = 0; i < NUM_DOC_PAGES; i++)
-    {
-        wind->doc_pages =
-            g_list_append(wind->doc_pages,
-                          glade_xml_get_widget(xml, doc_page_names[i]));
-    }
-}
-
-
-/********************************************************************
- * get_glade_widgets
- *
- * Get all glade-defined widgets that need to be actively managed.
- ********************************************************************/
-
-static void
-get_glade_widgets(QIFImportWindow *wind, GladeXML *xml)
-{
-    g_return_if_fail(wind);
-    g_return_if_fail(xml);
-
-    wind->window            = glade_xml_get_widget(xml, "QIF Import Druid");
-    wind->druid             = glade_xml_get_widget(xml, "qif_import_druid");
-    wind->filename_entry    = glade_xml_get_widget(xml, "qif_filename_entry");
-    wind->load_pause        = glade_xml_get_widget(xml, "load_progress_pause");
-    wind->load_log          = glade_xml_get_widget(xml, "load_progress_log");
-    wind->load_progress     = gnc_progress_dialog_custom(
-                                  GTK_LABEL(glade_xml_get_widget(xml, "load_progress_primary")),
-                                  GTK_LABEL(glade_xml_get_widget(xml, "load_progress_secondary")),
-                                  GTK_PROGRESS_BAR(glade_xml_get_widget(xml, "load_progress_bar")),
-                                  GTK_LABEL(glade_xml_get_widget(xml, "load_progress_sub")),
-                                  GTK_TEXT_VIEW(wind->load_log));
-    wind->acct_entry        = glade_xml_get_widget(xml, "qif_account_entry");
-    wind->date_format_combo = glade_xml_get_widget(xml, "date_format_combobox");
-    wind->selected_file_view = glade_xml_get_widget(xml, "selected_file_view");
-    wind->currency_picker   = glade_xml_get_widget(xml, "currency_comboboxentry");
-    wind->acct_view         = glade_xml_get_widget(xml, "account_page_view");
-    wind->acct_view_count   = glade_xml_get_widget(xml, "account_page_count");
-    wind->acct_view_btn     = glade_xml_get_widget(xml, "account_page_change");
-    wind->cat_view          = glade_xml_get_widget(xml, "category_page_view");
-    wind->cat_view_count    = glade_xml_get_widget(xml, "category_page_count");
-    wind->cat_view_btn      = glade_xml_get_widget(xml, "category_page_change");
-    wind->memo_view         = glade_xml_get_widget(xml, "memo_page_view");
-    wind->memo_view_count   = glade_xml_get_widget(xml, "memo_page_count");
-    wind->memo_view_btn     = glade_xml_get_widget(xml, "memo_page_change");
-    wind->convert_pause     = glade_xml_get_widget(xml, "convert_progress_pause");
-    wind->convert_log       = glade_xml_get_widget(xml, "convert_progress_log");
-    wind->convert_progress  = gnc_progress_dialog_custom(
-                                  GTK_LABEL(glade_xml_get_widget(xml, "convert_progress_primary")),
-                                  GTK_LABEL(glade_xml_get_widget(xml, "convert_progress_secondary")),
-                                  GTK_PROGRESS_BAR(glade_xml_get_widget(xml, "convert_progress_bar")),
-                                  GTK_LABEL(glade_xml_get_widget(xml, "convert_progress_sub")),
-                                  GTK_TEXT_VIEW(wind->convert_log));
-    wind->new_transaction_view =
-        glade_xml_get_widget(xml, "new_transaction_view");
-    wind->old_transaction_view =
-        glade_xml_get_widget(xml, "old_transaction_view");
-}
-
-
-/********************************************************************
- * connect_glade_signals
- *
- * Connect all glade-defined signals to their handlers.
- ********************************************************************/
-
-static void
-connect_glade_signals(QIFImportWindow *wind, GladeXML *xml)
-{
-    g_return_if_fail(wind);
-    g_return_if_fail(xml);
-
-    /*
-     * Connect all glade-defined signals to their handlers.
-     */
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_cancel_cb",
-     G_CALLBACK(gnc_ui_qif_import_cancel_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_generic_next_cb",
-     G_CALLBACK(gnc_ui_qif_import_generic_next_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_generic_back_cb",
-     G_CALLBACK(gnc_ui_qif_import_generic_back_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_select_file_cb",
-     G_CALLBACK(gnc_ui_qif_import_select_file_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_load_file_back_cb",
-     G_CALLBACK(gnc_ui_qif_import_load_file_back_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_load_file_next_cb",
-     G_CALLBACK(gnc_ui_qif_import_load_file_next_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_load_progress_prepare_cb",
-     G_CALLBACK(gnc_ui_qif_import_load_progress_prepare_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_load_progress_show_cb",
-     G_CALLBACK(gnc_ui_qif_import_load_progress_show_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_load_progress_pause_cb",
-     G_CALLBACK(gnc_ui_qif_import_load_progress_pause_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_load_progress_next_cb",
-     G_CALLBACK(gnc_ui_qif_import_load_progress_next_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_load_progress_back_cb",
-     G_CALLBACK(gnc_ui_qif_import_load_progress_back_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_date_format_next_cb",
-     G_CALLBACK(gnc_ui_qif_import_date_format_next_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_loaded_files_prepare_cb",
-     G_CALLBACK(gnc_ui_qif_import_loaded_files_prepare_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_load_another_cb",
-     G_CALLBACK(gnc_ui_qif_import_load_another_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_unload_file_cb",
-     G_CALLBACK(gnc_ui_qif_import_unload_file_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_loaded_files_next_cb",
-     G_CALLBACK(gnc_ui_qif_import_loaded_files_next_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_default_acct_next_cb",
-     G_CALLBACK(gnc_ui_qif_import_default_acct_next_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_default_acct_back_cb",
-     G_CALLBACK(gnc_ui_qif_import_default_acct_back_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_account_rematch_cb",
-     G_CALLBACK(gnc_ui_qif_import_account_rematch_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_account_next_cb",
-     G_CALLBACK(gnc_ui_qif_import_account_next_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_category_rematch_cb",
-     G_CALLBACK(gnc_ui_qif_import_category_rematch_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_category_next_cb",
-     G_CALLBACK(gnc_ui_qif_import_category_next_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_memo_doc_back_cb",
-     G_CALLBACK(gnc_ui_qif_import_memo_doc_back_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_memo_rematch_cb",
-     G_CALLBACK(gnc_ui_qif_import_memo_rematch_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_memo_back_cb",
-     G_CALLBACK(gnc_ui_qif_import_memo_back_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_currency_back_cb",
-     G_CALLBACK(gnc_ui_qif_import_currency_back_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_currency_next_cb",
-     G_CALLBACK(gnc_ui_qif_import_currency_next_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_convert_progress_prepare_cb",
-     G_CALLBACK(gnc_ui_qif_import_convert_progress_prepare_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_convert_progress_show_cb",
-     G_CALLBACK(gnc_ui_qif_import_convert_progress_show_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_convert_progress_pause_cb",
-     G_CALLBACK(gnc_ui_qif_import_convert_progress_pause_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_convert_progress_next_cb",
-     G_CALLBACK(gnc_ui_qif_import_convert_progress_next_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_convert_progress_back_cb",
-     G_CALLBACK(gnc_ui_qif_import_convert_progress_back_cb), wind);
-
-    glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_finish_cb",
-     G_CALLBACK(gnc_ui_qif_import_finish_cb), wind);
-}
-
-
-/********************************************************************
- * build_views
- *
- * Build the details of all GtkTreeView widgets.
- ********************************************************************/
-
-static void
-build_views(QIFImportWindow *wind)
-{
-    GtkTreeView *view;
-    GtkListStore *store;
-    GtkCellRenderer *renderer;
-    GtkTreeViewColumn *column;
-    GtkTreeSelection *selection;
-
-    g_return_if_fail(wind);
-
-    /* Set up the selected file view */
-    view = GTK_TREE_VIEW(wind->selected_file_view);
-    store = gtk_list_store_new(NUM_FILENAME_COLS, G_TYPE_INT, G_TYPE_STRING);
-    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-    g_object_unref(store);
-
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes("unused",
-             renderer,
-             "text",
-             FILENAME_COL_NAME,
-             NULL);
-    gtk_tree_view_append_column(view, column);
-
-    selection = gtk_tree_view_get_selection(view);
-    g_signal_connect(selection, "changed",
-                     G_CALLBACK(gnc_ui_qif_import_select_loaded_file_cb),
-                     wind);
-
-    /* Set up the QIF account to GnuCash account matcher. */
-    create_account_picker_view(wind->acct_view, _("QIF account name"),
-                               G_CALLBACK(gnc_ui_qif_import_account_activate_cb),
-                               G_CALLBACK(gnc_ui_qif_import_account_select_cb),
-                               wind);
-
-    /* Set up the QIF category to GnuCash account matcher. */
-    create_account_picker_view(wind->cat_view,  _("QIF category name"),
-                               G_CALLBACK(gnc_ui_qif_import_category_activate_cb),
-                               G_CALLBACK(gnc_ui_qif_import_category_select_cb),
-                               wind);
-
-    /* Set up the QIF payee/memo to GnuCash account matcher. */
-    create_account_picker_view(wind->memo_view, _("QIF payee/memo"),
-                               G_CALLBACK(gnc_ui_qif_import_memo_activate_cb),
-                               G_CALLBACK(gnc_ui_qif_import_memo_select_cb),
-                               wind);
-
-    /* Set up the new transaction view */
-    view = GTK_TREE_VIEW(wind->new_transaction_view);
-    store = gtk_list_store_new(NUM_QIF_TRANS_COLS, G_TYPE_INT, G_TYPE_STRING,
-                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
-    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-    g_object_unref(store);
-
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Date"),
-             renderer,
-             "text",
-             QIF_TRANS_COL_DATE,
-             NULL);
-    gtk_tree_view_append_column(view, column);
-
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Description"),
-             renderer,
-             "text",
-             QIF_TRANS_COL_DESCRIPTION,
-             NULL);
-    gtk_tree_view_append_column(view, column);
-    gtk_tree_view_column_set_expand(column, TRUE);
-
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Amount"),
-             renderer,
-             "text",
-             QIF_TRANS_COL_AMOUNT,
-             NULL);
-    gtk_tree_view_append_column(view, column);
-
-    selection = gtk_tree_view_get_selection(view);
-    g_signal_connect(selection, "changed",
-                     G_CALLBACK(gnc_ui_qif_import_duplicate_new_select_cb),
-                     wind);
-
-
-    /* Set up the old transaction view */
-    view = GTK_TREE_VIEW(wind->old_transaction_view);
-    store = gtk_list_store_new(NUM_QIF_TRANS_COLS, G_TYPE_INT, G_TYPE_STRING,
-                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
-    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-    g_object_unref(store);
-
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Date"),
-             renderer,
-             "text",
-             QIF_TRANS_COL_DATE,
-             NULL);
-    gtk_tree_view_append_column(view, column);
-
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Description"),
-             renderer,
-             "text",
-             QIF_TRANS_COL_DESCRIPTION,
-             NULL);
-    gtk_tree_view_append_column(view, column);
-    gtk_tree_view_column_set_expand(column, TRUE);
-
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Amount"),
-             renderer,
-             "text",
-             QIF_TRANS_COL_AMOUNT,
-             NULL);
-    gtk_tree_view_append_column(view, column);
-
-    renderer = gtk_cell_renderer_toggle_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Match?"),
-             renderer,
-             "active",
-             QIF_TRANS_COL_CHECKED,
-             NULL);
-    gtk_tree_view_append_column(view, column);
-
-    selection = gtk_tree_view_get_selection(view);
-    g_signal_connect(selection, "changed",
-                     G_CALLBACK(gnc_ui_qif_import_duplicate_old_select_cb),
-                     wind);
-}
-
-
-/********************************************************************
- * gnc_ui_qif_import_druid_make
- *
- * Build a new QIF import druid.
- ********************************************************************/
-
-QIFImportWindow *
-gnc_ui_qif_import_druid_make(void)
-{
-    QIFImportWindow * wind;
-    GladeXML        * xml;
-
-    /* Allocate space for the druid and load its design. */
-    wind = g_new0(QIFImportWindow, 1);
-    xml = gnc_glade_xml_new("qif.glade", "QIF Import Druid");
-
-    wind->new_namespaces       = NULL;
-    wind->selected_transaction = 0;
-    wind->busy                 = FALSE;
-
-    /* Get all user preferences related to QIF importing. */
-    get_preferences(wind);
-
-    /* Set up the Scheme side of things. */
-    initialize_scheme(wind);
-
-    /* Build lists of the druid pages. */
-    build_page_lists(wind, xml);
-
-    /* Get all interesting glade-defined widgets. */
-    get_glade_widgets(wind, xml);
-
-    /* Connect all glade-defined signals to their handlers. */
-    connect_glade_signals(wind, xml);
-
-    /* Build the details of all GtkTreeView widgets. */
-    build_views(wind);
-
-    /* Set a default currency for new accounts */
-    gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(wind->currency_picker));
-    gnc_ui_update_commodity_picker(wind->currency_picker,
-                                   GNC_COMMODITY_NS_CURRENCY,
-                                   gnc_commodity_get_printname(
-                                       gnc_default_currency()));
-
-    /* If desired, skip the initial documentation pages. */
-    if (!wind->show_doc_pages)
-        gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                             get_named_page(wind, "load_file_page"));
-
-    gnc_druid_set_colors(GNOME_DRUID(wind->druid));
-
-    gnc_register_gui_component(DRUID_QIF_IMPORT_CM_CLASS, NULL, NULL, wind);
-
-    gtk_widget_show_all(wind->window);
-    gtk_window_present(GTK_WINDOW(wind->window));
-
-    return wind;
-}
-
-
-static gboolean
-show_handler(const char *class, gint component_id,
-             gpointer user_data, gpointer iter_data)
-{
-    QIFImportWindow *qif_win = user_data;
-
-    if (!qif_win)
-        return(FALSE);
-    gtk_window_present(GTK_WINDOW(qif_win->window));
-    return(TRUE);
-}
-
-void
-gnc_file_qif_import(void)
-{
-    if (gnc_forall_gui_components(DRUID_QIF_IMPORT_CM_CLASS,
-                                  show_handler, NULL))
-        return;
-
-    /* pop up the QIF File Import dialog box */
-    gnc_ui_qif_import_druid_make();
-}

Deleted: gnucash/trunk/src/import-export/qif-import/druid-qif-import.h
===================================================================
--- gnucash/trunk/src/import-export/qif-import/druid-qif-import.h	2011-12-02 11:09:16 UTC (rev 21652)
+++ gnucash/trunk/src/import-export/qif-import/druid-qif-import.h	2011-12-02 20:55:43 UTC (rev 21653)
@@ -1,46 +0,0 @@
-/********************************************************************\
- * dialog-qif-import.h -- window for controlling import of QIF data *
- *                       (GnuCash)                                  *
- * Copyright (C) 2000 Bill Gribble <grib at billgribble.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, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
-\********************************************************************/
-
-#ifndef DIALOG_QIF_IMPORT_H
-#define DIALOG_QIF_IMPORT_H
-
-#include <libguile.h>
-#include <gtk/gtk.h>
-
-/* QIF Import Windows ***********************************************/
-
-typedef struct _qifimportwindow QIFImportWindow;
-
-QIFImportWindow * gnc_ui_qif_import_druid_make(void);
-void              gnc_ui_qif_import_druid_destroy (QIFImportWindow * window);
-SCM               gnc_ui_qif_import_druid_get_mappings(QIFImportWindow * w);
-
-/* The gnc_file_qif_import() routine will pop up a standard file
- *     selection dialogue asking the user to pick a QIF file. If one
- *     is selected the the QIF file is opened and read. It's contents
- *     are merged into the existing session (if any). The current
- *     session continues to remain open for editing. */
-void              gnc_file_qif_import (void);
-void              gnc_ui_qif_import_create_plugin(void);
-
-#endif

Modified: gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c	2011-12-02 11:09:16 UTC (rev 21652)
+++ gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c	2011-12-02 20:55:43 UTC (rev 21653)
@@ -27,7 +27,7 @@
 #include <glib/gi18n.h>
 
 #include "dialog-preferences.h"
-#include "druid-qif-import.h"
+#include "assistant-qif-import.h"
 #include "gnc-druid-test.h"
 #include "gnc-plugin-manager.h"
 #include "gnc-plugin-qif-import.h"
@@ -155,7 +155,7 @@
 gnc_plugin_qif_import_cmd_new_qif_import (GtkAction *action,
         GncMainWindowActionData *data)
 {
-    gnc_ui_qif_import_druid_make ();
+      gnc_file_qif_import();
 }
 
 /*

Modified: gnucash/trunk/src/import-export/qif-import/gncmod-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/gncmod-qif-import.c	2011-12-02 11:09:16 UTC (rev 21652)
+++ gnucash/trunk/src/import-export/qif-import/gncmod-qif-import.c	2011-12-02 20:55:43 UTC (rev 21653)
@@ -11,7 +11,7 @@
 
 #include "gnc-module.h"
 #include "gnc-module-api.h"
-#include "druid-qif-import.h"
+#include "assistant-qif-import.h"
 #include "dialog-new-user.h"
 
 #include "gnc-plugin-qif-import.h"
@@ -57,13 +57,13 @@
         return FALSE;
     }
 
-    /* If the recount == 0 then register the qif-import-druid for the new-user
+    /* If the recount == 0 then register the qif-import-assistant for the new-user
      * dialog.
      */
     if (refcount == 0)
     {
-        gnc_new_user_dialog_register_qif_druid
-        ((void (*)())gnc_ui_qif_import_druid_make);
+        gnc_new_user_dialog_register_qif_assistant
+        ((void (*)())gnc_file_qif_import);
     }
 
     scm_c_eval_string("(use-modules (gnucash import-export qif-import))");

Deleted: gnucash/trunk/src/import-export/qif-import/qif.glade
===================================================================
--- gnucash/trunk/src/import-export/qif-import/qif.glade	2011-12-02 11:09:16 UTC (rev 21652)
+++ gnucash/trunk/src/import-export/qif-import/qif.glade	2011-12-02 20:55:43 UTC (rev 21653)
@@ -1,1461 +0,0 @@
-<?xml version="1.0"?>
-<glade-interface>
-  <!-- interface-requires gtk+ 2.10 -->
-  <requires lib="gnome"/>
-  <!-- interface-requires gnome 2564.24808 -->
-  <!-- interface-naming-policy toplevel-contextual -->
-  <widget class="GtkDialog" id="QIF Import Account Picker">
-    <property name="visible">True</property>
-    <property name="title" translatable="yes">Select Account</property>
-    <property name="default_width">300</property>
-    <property name="default_height">400</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <widget class="GtkVBox" id="vbox1">
-        <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">8</property>
-        <child>
-          <widget class="GtkVBox" id="vbox2">
-            <property name="visible">True</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <widget class="GtkLabel" id="label1">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="xpad">5</property>
-                <property name="label" translatable="yes">_Select or add a GnuCash account:</property>
-                <property name="mnemonic_widget">account_tree</property>
-                <property name="use_underline">True</property>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="padding">5</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkScrolledWindow" id="scrolledwindow24">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="hscrollbar_policy">automatic</property>
-                <property name="vscrollbar_policy">automatic</property>
-                <property name="shadow_type">in</property>
-                <child>
-                  <widget class="GtkTreeView" id="account_tree">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="rules_hint">True</property>
-                  </widget>
-                </child>
-              </widget>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="hbuttonbox1">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <widget class="GtkButton" id="newbutton">
-                <property name="label">gnc-new-account</property>
-                <property name="response_id">1</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_underline">True</property>
-                <signal name="clicked" handler="gnc_ui_qif_account_picker_new_cb"/>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkButton" id="cancelbutton">
-                <property name="label">gtk-cancel</property>
-                <property name="response_id">-6</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkButton" id="okbutton">
-                <property name="label">gtk-ok</property>
-                <property name="response_id">-5</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </widget>
-    </child>
-  </widget>
-  <widget class="GtkWindow" id="QIF Import Druid">
-    <property name="visible">True</property>
-    <property name="title" translatable="yes">QIF Import</property>
-    <child>
-      <widget class="GnomeDruid" id="qif_import_druid">
-        <property name="visible">True</property>
-        <property name="border_width">4</property>
-        <signal name="cancel" handler="gnc_ui_qif_import_cancel_cb"/>
-        <child>
-          <widget class="GnomeDruidPageEdge" id="start_page">
-            <property name="visible">True</property>
-            <property name="position">Edge Start</property>
-            <property name="title" translatable="yes">Import QIF files</property>
-            <property name="text" translatable="yes">GnuCash can import financial data from QIF (Quicken Interchange Format) files written by Quicken/QuickBooks, MS Money, Moneydance, and many other programs. 
-
-The import process has several steps. Your GnuCash accounts will not be changed until you click "Apply" at the end of the process. 
-
-Click "Forward" to start loading your QIF data, or "Cancel" to abort the process. </property>
-            <signal name="next" handler="gnc_ui_qif_import_generic_next_cb"/>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="load_file_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Select a QIF file to load</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_load_file_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_load_file_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox8">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label822">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">Please select a file to load. When you click "Forward", the file will be loaded and analyzed. You may need to answer some questions about the account(s) in the file.
-
-You will have the opportunity to load as many files as you wish, so don't  worry if your data is in multiple files. 
-</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="padding">5</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkHBox" id="hbox69">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkEntry" id="qif_filename_entry">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="can_default">True</property>
-                        <property name="has_default">True</property>
-                      </widget>
-                      <packing>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkButton" id="button71">
-                        <property name="label" translatable="yes">_Select...</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <signal name="clicked" handler="gnc_ui_qif_import_select_file_cb"/>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="padding">3</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="load_progress_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Load QIF files</property>
-            <signal name="prepare" handler="gnc_ui_qif_import_load_progress_prepare_cb" after="yes"/>
-            <signal name="next" handler="gnc_ui_qif_import_load_progress_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_load_progress_back_cb"/>
-            <signal name="show" handler="gnc_ui_qif_import_load_progress_show_cb" after="yes"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox7609">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <property name="spacing">12</property>
-                <child>
-                  <widget class="GtkLabel" id="load_progress_primary">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label"><span weight="bold" size="larger">Primary text</span></property>
-                    <property name="use_markup">True</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="load_progress_secondary">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label">Secondary text.</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkVBox" id="load_progress_vbox1">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <child>
-                      <widget class="GtkProgressBar" id="load_progress_bar">
-                        <property name="visible">True</property>
-                        <property name="pulse_step">0.10000000149</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkLabel" id="load_progress_sub">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label"><span style="italic">Sub-operation text</span></property>
-                        <property name="use_markup">True</property>
-                        <property name="wrap">True</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkHButtonBox" id="load_progress_hbuttonbox1">
-                        <property name="visible">True</property>
-                        <property name="layout_style">end</property>
-                        <child>
-                          <widget class="GtkButton" id="load_progress_pause">
-                            <property name="label">gtk-media-pause</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="can_default">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_stock">True</property>
-                            <signal name="clicked" handler="gnc_ui_qif_import_load_progress_pause_cb"/>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="padding">6</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkScrolledWindow" id="scrolledwindow25">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="hscrollbar_policy">automatic</property>
-                    <property name="vscrollbar_policy">automatic</property>
-                    <property name="shadow_type">in</property>
-                    <child>
-                      <widget class="GtkTextView" id="load_progress_log">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="editable">False</property>
-                        <property name="wrap_mode">word</property>
-                        <property name="cursor_visible">False</property>
-                        <property name="accepts_tab">False</property>
-                        <property name="text">Log for errors and warnings</property>
-                      </widget>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="position">3</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="date_format_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Set a date format for this QIF file</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_date_format_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_default_acct_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox22">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label841">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">The QIF file format does not specify which order the day, month, and year components of a date are printed.  In most cases, it is possible to automatically determine which format is in use in a particular file. However, in the file you have just imported there exist more than one possible format that fits the data.  
-
-Please select a date format for the file.  QIF files created by European software are likely  to be in "d-m-y" or day-month-year format, where US QIF files are likely to be "m-d-y" or month-day-year.    
-</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkComboBox" id="date_format_combobox">
-                    <property name="visible">True</property>
-                    <property name="items">Dummy Date Entry</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label847713">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">Click "Back" to cancel the loading of this file and choose another.</property>
-                    <property name="justify">center</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="pack_type">end</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="account_name_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Set the default QIF account name</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_default_acct_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_default_acct_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox9">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label823">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">The QIF file that you just loaded appears to contain transactions for just one account, but the file does not specify a name for that account.  
-
-Please enter a name for the account. If the file was exported from another accounting program, you should use the same account name that was used  in that program.
-</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="padding">4</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkHBox" id="hbox70">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkLabel" id="label824">
-                        <property name="visible">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">Account name:</property>
-                        <property name="justify">center</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="padding">4</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkEntry" id="qif_account_entry">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                      </widget>
-                      <packing>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label847714">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">Click "Back" to cancel the loading of this file and choose another.</property>
-                    <property name="justify">center</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="pack_type">end</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="loaded_files_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">QIF files you have loaded</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="prepare" handler="gnc_ui_qif_import_loaded_files_prepare_cb" after="yes"/>
-            <signal name="next" handler="gnc_ui_qif_import_loaded_files_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox1">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <property name="spacing">4</property>
-                <child>
-                  <widget class="GtkScrolledWindow" id="scrolledwindow26">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="hscrollbar_policy">automatic</property>
-                    <property name="vscrollbar_policy">automatic</property>
-                    <property name="shadow_type">in</property>
-                    <child>
-                      <widget class="GtkTreeView" id="selected_file_view">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="headers_visible">False</property>
-                        <property name="rules_hint">True</property>
-                      </widget>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label816">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">Click "Load another file" if you have more data to import at this time. Do this if you have saved your accounts to separate QIF files.
-
-Click "Forward" to finish loading files and move to the next step of the QIF import process. </property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="padding">3</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkHButtonBox" id="hbox68">
-                    <property name="visible">True</property>
-                    <property name="layout_style">spread</property>
-                    <child>
-                      <widget class="GtkButton" id="unload_file_button">
-                        <property name="label" translatable="yes">_Unload selected file</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <signal name="clicked" handler="gnc_ui_qif_import_unload_file_cb"/>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkButton" id="button69">
-                        <property name="label" translatable="yes">_Load another file</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <signal name="clicked" handler="gnc_ui_qif_import_load_another_cb"/>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="account_doc_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Accounts and stock holdings</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_generic_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox13">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label830">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">On the next page, the accounts in your QIF files and any stocks or mutual funds you own will be matched with GnuCash accounts. If a GnuCash account already exists with the same name, or a similar name and compatible type, that account will be used as a match; otherwise, GnuCash will create a new account with the same name and type as the QIF account. If you do not like the suggested GnuCash account, double-click to change it.
-
-Note that GnuCash will be creating many accounts that did not exist on your other personal finance program, including a separate account for each stock you own, separate accounts for the brokerage commissions, special "Equity" accounts (subaccounts of Retained Earnings, by default) which are the source of your opening balances, etc. All of these accounts will appear on the next page so you can change them if you want to, but it is safe to leave them alone.
-</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="account_match_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Match QIF accounts with GnuCash accounts</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_account_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox3">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label7609">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="xpad">5</property>
-                    <property name="label" translatable="yes">_Select the matchings you want to change:</property>
-                    <property name="mnemonic_widget">account_page_view</property>
-                    <property name="use_underline">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="padding">5</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkScrolledWindow" id="scrolledwindow11">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="hscrollbar_policy">automatic</property>
-                    <property name="vscrollbar_policy">automatic</property>
-                    <property name="shadow_type">in</property>
-                    <child>
-                      <widget class="GtkTreeView" id="account_page_view">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="rules_hint">True</property>
-                      </widget>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkHBox" id="hbox7609">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkLabel" id="label7610">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Matchings selected:</property>
-                        <property name="wrap">True</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkLabel" id="account_page_count">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label">0</property>
-                        <property name="wrap">True</property>
-                      </widget>
-                      <packing>
-                        <property name="padding">3</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkButton" id="account_page_change">
-                        <property name="label" translatable="yes">Change GnuCash _Account...</property>
-                        <property name="visible">True</property>
-                        <property name="sensitive">False</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <signal name="clicked" handler="gnc_ui_qif_import_account_rematch_cb"/>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="category_doc_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Income and Expense categories</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_generic_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox18">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label840">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">GnuCash uses separate Income and Expense accounts rather than categories to classify your transactions. Each of the categories in your QIF file will be converted to a GnuCash account. 
-
-On the next page, you will have an opportunity to look at the suggested matches between QIF categories and GnuCash accounts. You may change matches that you do not like by double-clicking on the line containing the category name.
-
-If you change your mind later, you can reorganize the account structure safely within GnuCash.</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="category_match_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Match QIF categories with GnuCash accounts</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_category_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox4">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label7611">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="xpad">5</property>
-                    <property name="label" translatable="yes">_Select the matchings you want to change:</property>
-                    <property name="mnemonic_widget">category_page_view</property>
-                    <property name="use_underline">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="padding">5</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkScrolledWindow" id="scrolledwindow12">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="hscrollbar_policy">automatic</property>
-                    <property name="vscrollbar_policy">automatic</property>
-                    <property name="shadow_type">in</property>
-                    <child>
-                      <widget class="GtkTreeView" id="category_page_view">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="rules_hint">True</property>
-                      </widget>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkHBox" id="hbox7612">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkLabel" id="label7613">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Matchings selected:</property>
-                        <property name="wrap">True</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkLabel" id="category_page_count">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label">0</property>
-                        <property name="wrap">True</property>
-                      </widget>
-                      <packing>
-                        <property name="padding">3</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkButton" id="category_page_change">
-                        <property name="label" translatable="yes">Change GnuCash _Account...</property>
-                        <property name="visible">True</property>
-                        <property name="sensitive">False</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <signal name="clicked" handler="gnc_ui_qif_import_category_rematch_cb"/>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="memo_doc_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Payees and memos</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_generic_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_memo_doc_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox39">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label847707">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">QIF files downloaded from banks and other financial institutions may not have information about Accounts and Categories which would allow them to be correctly assigned to GnuCash accounts.  
-
-In the following page, you will see the text that appears in the Payee and Memo fields of transactions with no QIF Account or Category. By default these transactions are assigned to the 'Unspecified' account in GnuCash. If you select a different account, it will be remembered for future QIF files. </property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="memo_match_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Match payees/memos to GnuCash accounts</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_generic_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_memo_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox40">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label7614">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="xpad">5</property>
-                    <property name="label" translatable="yes">_Select the matchings you want to change:</property>
-                    <property name="mnemonic_widget">memo_page_view</property>
-                    <property name="use_underline">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="padding">5</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkScrolledWindow" id="scrolledwindow1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="hscrollbar_policy">automatic</property>
-                    <property name="vscrollbar_policy">automatic</property>
-                    <property name="shadow_type">in</property>
-                    <child>
-                      <widget class="GtkTreeView" id="memo_page_view">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="rules_hint">True</property>
-                      </widget>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkHBox" id="hbox7615">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkLabel" id="label7616">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Matchings selected:</property>
-                        <property name="wrap">True</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkLabel" id="memo_page_count">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label">0</property>
-                        <property name="wrap">True</property>
-                      </widget>
-                      <packing>
-                        <property name="padding">3</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkButton" id="memo_page_change">
-                        <property name="label" translatable="yes">Change GnuCash _Account...</property>
-                        <property name="visible">True</property>
-                        <property name="sensitive">False</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <signal name="clicked" handler="gnc_ui_qif_import_memo_rematch_cb"/>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="currency_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Enter the QIF file currency</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_currency_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_currency_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox16">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label831">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">The QIF importer cannot currently handle multi-currency QIF files. All the accounts you are importing must be denominated in the same currency.
-</property>
-                    <property name="justify">center</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label832">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="xpad">4</property>
-                    <property name="label" translatable="yes">_Select the currency to use for all imported transactions:</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">currency_comboboxentry</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkComboBoxEntry" id="currency_comboboxentry">
-                    <property name="visible">True</property>
-                    <property name="items">Dummy currency entry</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="commodity_doc_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Tradable commodities</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_generic_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox17">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label833">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">In the following pages you will be asked to provide information about stocks, mutual funds, and other investments that appear in the QIF file(s) you are importing. GnuCash needs some additional details about these investments that the QIF format does not provide. 
-
-Each stock, mutual fund, or other investment must have a name and an abbreviation, such as a stock symbol. Because some unrelated investments have the same abbreviation, you also need to indicate what type of abbreviation you have entered. For example, you could select the exchange that assigned the symbol (NASDAQ, NYSE, etc.), or select an investment type.
-
-If you don't see your exchange listed, or none of the available choices are appropriate, you can enter a new one.</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="convert_progress_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">QIF Import</property>
-            <signal name="prepare" handler="gnc_ui_qif_import_convert_progress_prepare_cb" after="yes"/>
-            <signal name="next" handler="gnc_ui_qif_import_convert_progress_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_convert_progress_back_cb"/>
-            <signal name="show" handler="gnc_ui_qif_import_convert_progress_show_cb" after="yes"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="convert_progress_vbox7609">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <property name="spacing">12</property>
-                <child>
-                  <widget class="GtkLabel" id="convert_progress_primary">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label"><span weight="bold" size="larger">Primary text</span></property>
-                    <property name="use_markup">True</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="convert_progress_secondary">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label">Secondary text.</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkVBox" id="convert_progress_vbox1">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <child>
-                      <widget class="GtkProgressBar" id="convert_progress_bar">
-                        <property name="visible">True</property>
-                        <property name="pulse_step">0.10000000149</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkLabel" id="convert_progress_sub">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label"><span style="italic">Sub-operation text</span></property>
-                        <property name="use_markup">True</property>
-                        <property name="wrap">True</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkHButtonBox" id="convert_progress_hbuttonbox1">
-                        <property name="visible">True</property>
-                        <property name="layout_style">end</property>
-                        <child>
-                          <widget class="GtkButton" id="convert_progress_pause">
-                            <property name="label">gtk-media-pause</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="can_default">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_stock">True</property>
-                            <signal name="clicked" handler="gnc_ui_qif_import_convert_progress_pause_cb"/>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="padding">6</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkScrolledWindow" id="scrolledwindow2">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="hscrollbar_policy">automatic</property>
-                    <property name="vscrollbar_policy">automatic</property>
-                    <property name="shadow_type">in</property>
-                    <child>
-                      <widget class="GtkTextView" id="convert_progress_log">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="editable">False</property>
-                        <property name="wrap_mode">word</property>
-                        <property name="cursor_visible">False</property>
-                        <property name="accepts_tab">False</property>
-                        <property name="text">Log for errors and warnings</property>
-                      </widget>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="position">3</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="match_doc_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Match existing transactions</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_generic_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox34">
-                <property name="visible">True</property>
-                <property name="border_width">5</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkLabel" id="label847694">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">If you are importing a QIF file from a bank or other financial institution, some of the transactions may already exist in your GnuCash accounts. To avoid duplication, GnuCash has tried to identify matches and needs your help to review them.
-
-On the next page you will be shown a list of imported transactions. As you select each one, a list of possible matches will be shown below it. If you find a correct match, click on it. Your selection will be confirmed by a check mark in the "Match?" column.
-
-Click "Forward" to review the possible matches.</property>
-                    <property name="wrap">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageStandard" id="match_duplicates_page">
-            <property name="visible">True</property>
-            <property name="title" translatable="yes">Select possible duplicates</property>
-            <property name="title_foreground_gdk">#f5f5f5f5f5f5</property>
-            <signal name="next" handler="gnc_ui_qif_import_generic_next_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
-            <child internal-child="vbox">
-              <widget class="GtkVBox" id="druid-vbox35">
-                <property name="visible">True</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <widget class="GtkVBox" id="vbox94">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">2</property>
-                    <child>
-                      <widget class="GtkFrame" id="frame45">
-                        <property name="visible">True</property>
-                        <property name="label_xalign">0</property>
-                        <property name="shadow_type">none</property>
-                        <child>
-                          <widget class="GtkScrolledWindow" id="scrolledwindow22">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="hscrollbar_policy">automatic</property>
-                            <property name="vscrollbar_policy">automatic</property>
-                            <property name="shadow_type">in</property>
-                            <child>
-                              <widget class="GtkTreeView" id="new_transaction_view">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="rules_hint">True</property>
-                              </widget>
-                            </child>
-                          </widget>
-                        </child>
-                        <child>
-                          <widget class="GtkLabel" id="label847716">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">_Imported transactions needing review:</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">new_transaction_view</property>
-                          </widget>
-                          <packing>
-                            <property name="type">label_item</property>
-                          </packing>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkFrame" id="frame46">
-                        <property name="visible">True</property>
-                        <property name="label_xalign">0</property>
-                        <property name="shadow_type">none</property>
-                        <child>
-                          <widget class="GtkScrolledWindow" id="scrolledwindow23">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="hscrollbar_policy">automatic</property>
-                            <property name="vscrollbar_policy">automatic</property>
-                            <property name="shadow_type">in</property>
-                            <child>
-                              <widget class="GtkTreeView" id="old_transaction_view">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="rules_hint">True</property>
-                              </widget>
-                            </child>
-                          </widget>
-                        </child>
-                        <child>
-                          <widget class="GtkLabel" id="label847717">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">_Possible matches for the selected transaction:</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">old_transaction_view</property>
-                          </widget>
-                          <packing>
-                            <property name="type">label_item</property>
-                          </packing>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-        </child>
-        <child>
-          <widget class="GnomeDruidPageEdge" id="end_page">
-            <property name="visible">True</property>
-            <property name="position">GNOME_EDGE_FINISH</property>
-            <property name="title" translatable="yes">Update your GnuCash accounts</property>
-            <property name="text" translatable="yes">Click "Apply" to import data from the staging area and update your GnuCash accounts. The account and category matching information you have entered will be saved and used for defaults the next time you use the QIF import  facility. 
-
-Click "Back" to review your account and category matchings, to change currency and security settings for new accounts, or to add more files to the staging area.
-
-Click "Cancel" to abort the QIF import process.</property>
-            <signal name="finish" handler="gnc_ui_qif_import_finish_cb"/>
-            <signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
-          </widget>
-        </child>
-      </widget>
-    </child>
-  </widget>
-  <widget class="GtkWindow" id="Preferences">
-    <property name="visible">True</property>
-    <property name="title" translatable="yes">Preferences</property>
-    <child>
-      <widget class="GtkTable" id="prefs_table">
-        <property name="visible">True</property>
-        <property name="n_rows">2</property>
-        <property name="n_columns">4</property>
-        <child>
-          <widget class="GtkLabel" id="label847718">
-            <property name="visible">True</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes"><b>QIF Import</b></property>
-            <property name="use_markup">True</property>
-          </widget>
-          <packing>
-            <property name="x_options">GTK_FILL</property>
-            <property name="y_options"></property>
-          </packing>
-        </child>
-        <child>
-          <widget class="GtkCheckButton" id="gconf/dialogs/import/qif/show_doc">
-            <property name="label" translatable="yes">_Show documentation</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="tooltip" translatable="yes">Show some documentation-only pages in QIF Import assistant.</property>
-            <property name="use_underline">True</property>
-            <property name="draw_indicator">True</property>
-          </widget>
-          <packing>
-            <property name="right_attach">4</property>
-            <property name="top_attach">1</property>
-            <property name="bottom_attach">2</property>
-            <property name="x_options">GTK_FILL</property>
-            <property name="y_options"></property>
-            <property name="x_padding">12</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="GtkRadioButton" id="gconf/dialogs/import/qif/default_status/reconciled">
-            <property name="label" translatable="yes">_Reconciled</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="tooltip" translatable="yes">When the status is not specified in a QIF file, the transactions are marked as reconciled.</property>
-            <property name="use_underline">True</property>
-            <property name="draw_indicator">True</property>
-          </widget>
-          <packing>
-            <property name="top_attach">6</property>
-            <property name="bottom_attach">7</property>
-            <property name="x_options">GTK_FILL</property>
-            <property name="y_options"></property>
-            <property name="x_padding">12</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="GtkRadioButton" id="gconf/dialogs/import/qif/default_status/cleared">
-            <property name="label" translatable="yes">_Cleared</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="tooltip" translatable="yes">When the status is not specified in a QIF file, the transactions are marked as cleared.</property>
-            <property name="use_underline">True</property>
-            <property name="draw_indicator">True</property>
-            <property name="group">gconf/dialogs/import/qif/default_status/reconciled</property>
-          </widget>
-          <packing>
-            <property name="top_attach">5</property>
-            <property name="bottom_attach">6</property>
-            <property name="x_options">GTK_FILL</property>
-            <property name="y_options"></property>
-            <property name="x_padding">12</property>
-          </packing>
-        </child>
-         <child>
-             <widget class="GtkRadioButton" id="gconf/dialogs/import/qif/default_status/not_cleared">
-            <property name="label" translatable="yes">_Not cleared</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="tooltip" translatable="yes">When the status is not specified in a QIF file, the transactions are marked as not cleared.</property>
-            <property name="use_underline">True</property>
-            <property name="draw_indicator">True</property>
-            <property name="group">gconf/dialogs/import/qif/default_status/reconciled</property>
-          </widget>
-          <packing>
-            <property name="top_attach">4</property>
-            <property name="bottom_attach">5</property>
-            <property name="x_options">GTK_FILL</property>
-            <property name="y_options"></property>
-            <property name="x_padding">12</property>
-          </packing>
-        </child>
-        <child>
-           <widget class="GtkLabel" id="qif_default_transation_status">
-             <property name="visible">True</property>
-             <property name="xalign">0</property>
-             <property name="label" translatable="yes">Default transaction status (overridden by the status given by the QIF file):</property>
-           </widget>
-           <packing>
-             <property name="right_attach">4</property>
-             <property name="top_attach">2</property>
-             <property name="bottom_attach">3</property>
-             <property name="x_options">GTK_FILL</property>
-             <property name="y_options"></property>
-           </packing>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-      </widget>
-    </child>
-  </widget>
-</glade-interface>



More information about the gnucash-changes mailing list