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
This commit is contained in:
David Hampton 2003-01-04 06:29:26 +00:00
parent 5164ae147f
commit f4a1432582
2 changed files with 32 additions and 2 deletions

View File

@ -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 * 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", (xml, "gnc_ui_qif_import_select_file_cb",
GTK_SIGNAL_FUNC (gnc_ui_qif_import_select_file_cb), retval); 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 glade_xml_signal_connect_data
(xml, "gnc_ui_qif_import_load_file_next_cb", (xml, "gnc_ui_qif_import_load_file_next_cb",
GTK_SIGNAL_FUNC (gnc_ui_qif_import_load_file_next_cb), retval); 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); 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_widget_show_all(retval->window);
gtk_window_present (GTK_WINDOW(retval->window)); gtk_window_present (GTK_WINDOW(retval->window));

View File

@ -228,9 +228,9 @@ to abort the process. </text>
</signal> </signal>
<signal> <signal>
<name>back</name> <name>back</name>
<handler>gnc_ui_qif_import_generic_back_cb</handler> <handler>gnc_ui_qif_import_load_file_back_cb</handler>
<data>QIF_Import_Druid</data> <data>QIF_Import_Druid</data>
<last_modification_time>Tue, 06 Feb 2001 17:05:58 GMT</last_modification_time> <last_modification_time>Sat, 04 Jan 2003 05:05:30 GMT</last_modification_time>
</signal> </signal>
<title>Select a QIF file to load</title> <title>Select a QIF file to load</title>
<title_color>255,255,255</title_color> <title_color>255,255,255</title_color>