From f4a1432582b0811027a3bfbed421aadb8e2f8e2c Mon Sep 17 00:00:00 2001 From: David Hampton Date: Sat, 4 Jan 2003 06:29:26 +0000 Subject: [PATCH] Do the right thing when going "back" from the "load a file" page. If there are any files loaded should return to the "loaded files" page instead of the initial druid page. #101818 git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7766 57a11ea4-9604-0410-9ed3-97b8803252fd --- .../qif-import/druid-qif-import.c | 30 +++++++++++++++++++ src/import-export/qif-import/qif.glade | 4 +-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/import-export/qif-import/druid-qif-import.c b/src/import-export/qif-import/druid-qif-import.c index 4dc7328561..613873eacb 100644 --- a/src/import-export/qif-import/druid-qif-import.c +++ b/src/import-export/qif-import/druid-qif-import.c @@ -381,6 +381,31 @@ gnc_ui_qif_import_select_file_cb(GtkButton * button, } +/******************************************************************** + * 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 (gh_list_p(wind->imported_files) && + (gh_length(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 * @@ -1806,6 +1831,10 @@ gnc_ui_qif_import_druid_make(void) { (xml, "gnc_ui_qif_import_select_file_cb", GTK_SIGNAL_FUNC (gnc_ui_qif_import_select_file_cb), retval); + glade_xml_signal_connect_data + (xml, "gnc_ui_qif_import_load_file_back_cb", + GTK_SIGNAL_FUNC (gnc_ui_qif_import_load_file_back_cb), retval); + glade_xml_signal_connect_data (xml, "gnc_ui_qif_import_load_file_next_cb", GTK_SIGNAL_FUNC (gnc_ui_qif_import_load_file_next_cb), retval); @@ -1994,6 +2023,7 @@ gnc_ui_qif_import_druid_make(void) { gnc_register_gui_component(DRUID_QIF_IMPORT_CM_CLASS, NULL, NULL, retval); + gnome_window_icon_set_from_default(retval->window); gtk_widget_show_all(retval->window); gtk_window_present (GTK_WINDOW(retval->window)); diff --git a/src/import-export/qif-import/qif.glade b/src/import-export/qif-import/qif.glade index ce25c2e596..5d13f68049 100644 --- a/src/import-export/qif-import/qif.glade +++ b/src/import-export/qif-import/qif.glade @@ -228,9 +228,9 @@ to abort the process. back - gnc_ui_qif_import_generic_back_cb + gnc_ui_qif_import_load_file_back_cb QIF_Import_Druid - Tue, 06 Feb 2001 17:05:58 GMT + Sat, 04 Jan 2003 05:05:30 GMT Select a QIF file to load 255,255,255