Bug #512173: Skip the "match payees/memos" step of the QIF druid if no mappings

are needed. Patch from Ian Lewis.
BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16956 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Charles Day
2008-02-24 17:12:40 +00:00
parent 0d2a91ef03
commit 8340f0dbdb
2 changed files with 70 additions and 5 deletions

View File

@@ -1205,6 +1205,41 @@ gnc_ui_qif_import_categories_prepare_cb(GnomeDruidPage * page,
gnc_unset_busy_cursor(NULL);
}
/****************************************************************
* gnc_ui_qif_import_categories_next_cb
* Check to see if there are any payees and memos to show. If not
* jump to currency page.
****************************************************************/
static gboolean
gnc_ui_qif_import_categories_next_cb(GnomeDruidPage * page,
gpointer arg1,
gpointer user_data)
{
QIFImportWindow * wind = user_data;
SCM make_memo_display = scm_c_eval_string("qif-dialog:make-memo-display");
SCM accts_left;
gnc_set_busy_cursor(NULL, TRUE);
/*
* Hack. Call make-memo-display to see if there are any memos to display.
* This will get called again when we actually do make the memo display.
*/
accts_left = scm_call_3(make_memo_display,
wind->imported_files,
wind->memo_map_info,
wind->gnc_acct_info);
gnc_unset_busy_cursor(NULL);
if (SCM_NULLP(accts_left)) {
gnome_druid_set_page(GNOME_DRUID(wind->druid),
get_named_page(wind, "currency_page"));
return TRUE;
} else {
return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
}
}
/********************************************************************
* gnc_ui_qif_import_memo_prepare_cb
********************************************************************/
@@ -1447,7 +1482,29 @@ gnc_ui_qif_import_memo_next_cb(GnomeDruidPage * page,
}
}
/****************************************************************
* gnc_ui_qif_import_currency_back_cb
* Check to see if there are any payees and memos to show. If not
* jump to category match page.
****************************************************************/
static gboolean
gnc_ui_qif_import_currency_back_cb(GnomeDruidPage * page, gpointer arg1,
gpointer user_data)
{
QIFImportWindow * wind = user_data;
if (!wind->memo_display_info ||
(wind->memo_display_info == SCM_BOOL_F) ||
SCM_NULLP(wind->memo_display_info))
{
gnome_druid_set_page(GNOME_DRUID(wind->druid),
get_named_page(wind, "category_match_page"));
return TRUE;
} else {
return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
}
}
/********************************************************************
* gnc_ui_qif_import_currency_next_cb
********************************************************************/
@@ -2053,7 +2110,11 @@ gnc_ui_qif_import_druid_make(void)
glade_xml_signal_connect_data
(xml, "gnc_ui_qif_import_categories_prepare_cb",
G_CALLBACK (gnc_ui_qif_import_categories_prepare_cb), retval);
glade_xml_signal_connect_data
(xml, "gnc_ui_qif_import_categories_next_cb",
G_CALLBACK (gnc_ui_qif_import_categories_next_cb), retval);
glade_xml_signal_connect_data
(xml, "gnc_ui_qif_import_memo_prepare_cb",
G_CALLBACK (gnc_ui_qif_import_memo_prepare_cb), retval);
@@ -2061,7 +2122,11 @@ gnc_ui_qif_import_druid_make(void)
glade_xml_signal_connect_data
(xml, "gnc_ui_qif_import_memo_next_cb",
G_CALLBACK (gnc_ui_qif_import_memo_next_cb), retval);
glade_xml_signal_connect_data
(xml, "gnc_ui_qif_import_currency_back_cb",
G_CALLBACK (gnc_ui_qif_import_currency_back_cb), retval);
glade_xml_signal_connect_data
(xml, "gnc_ui_qif_import_currency_next_cb",
G_CALLBACK (gnc_ui_qif_import_currency_next_cb), retval);

View File

@@ -43,7 +43,7 @@
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">1</property>
<signal name="clicked" handler="gnc_ui_qif_account_picker_new_cb" last_modification_time="Sat, 25 Oct 2003 19:44:39 GMT"/>
<signal name="clicked" handler="gnc_ui_qif_account_picker_new_cb"/>
</widget>
</child>
@@ -799,7 +799,7 @@ If you change your mind later, you can reorganize the account structure safely w
<property name="title" translatable="yes">Match QIF categories with GnuCash accounts</property>
<property name="title_foreground">#f5f5f5f5f5f5</property>
<signal name="prepare" handler="gnc_ui_qif_import_categories_prepare_cb"/>
<signal name="next" handler="gnc_ui_qif_import_generic_next_cb"/>
<signal name="next" handler="gnc_ui_qif_import_categories_next_cb"/>
<signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
<child internal-child="vbox">
@@ -968,7 +968,7 @@ In the following page, you will see the text that appears in the Payee and Memo
<property name="title" translatable="yes">Enter the QIF file currency</property>
<property name="title_foreground">#f5f5f5f5f5f5</property>
<signal name="next" handler="gnc_ui_qif_import_currency_next_cb"/>
<signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
<signal name="back" handler="gnc_ui_qif_import_currency_back_cb"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="druid-vbox16">