mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug #503166: Correct the QIF druid flow such that the duplicates page and the
commodities doc page are not shown going backwards if they were not shown going forwards. BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16962 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
40219aea95
commit
c47e0cd53b
@ -198,6 +198,13 @@ gnc_ui_qif_import_druid_destroy (QIFImportWindow * window)
|
|||||||
g_free(window);
|
g_free(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/********************************************************************\
|
||||||
|
* get_next_druid_page
|
||||||
|
*
|
||||||
|
* Determine which page should be shown after the current page.
|
||||||
|
\********************************************************************/
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
get_next_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
|
get_next_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
|
||||||
{
|
{
|
||||||
@ -205,10 +212,11 @@ get_next_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
|
|||||||
GList * next;
|
GList * next;
|
||||||
int where = 0;
|
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->pre_comm_pages, page)) == NULL) {
|
||||||
if((current = g_list_find(wind->commodity_pages, page)) == NULL) {
|
if((current = g_list_find(wind->commodity_pages, page)) == NULL) {
|
||||||
if((current = g_list_find(wind->post_comm_pages, page)) == NULL) {
|
if((current = g_list_find(wind->post_comm_pages, page)) == NULL) {
|
||||||
/* where are we? */
|
/* Where are we? */
|
||||||
printf("QIF import: I'm lost!\n");
|
printf("QIF import: I'm lost!\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -225,9 +233,10 @@ get_next_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
|
|||||||
}
|
}
|
||||||
|
|
||||||
next = current->next;
|
next = current->next;
|
||||||
while(!next ||
|
while (!next ||
|
||||||
(!wind->show_doc_pages &&
|
(!wind->show_doc_pages && g_list_find(wind->doc_pages, next->data)) ||
|
||||||
g_list_find(wind->doc_pages, next->data))) {
|
(wind->new_stocks == SCM_BOOL_F &&
|
||||||
|
GNOME_DRUID_PAGE(next->data) == get_named_page(wind, "commodity_doc_page"))) {
|
||||||
if(next && next->next) {
|
if(next && next->next) {
|
||||||
next = next->next;
|
next = next->next;
|
||||||
}
|
}
|
||||||
@ -254,6 +263,13 @@ get_next_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
|
|||||||
else return NULL;
|
else return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/********************************************************************\
|
||||||
|
* get_prev_druid_page
|
||||||
|
*
|
||||||
|
* Determine which page was shown before the current page.
|
||||||
|
\********************************************************************/
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
get_prev_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
|
get_prev_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
|
||||||
{
|
{
|
||||||
@ -261,10 +277,11 @@ get_prev_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
|
|||||||
GList * prev;
|
GList * prev;
|
||||||
int where = 0;
|
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->pre_comm_pages, page)) == NULL) {
|
||||||
if((current = g_list_find(wind->commodity_pages, page)) == NULL) {
|
if((current = g_list_find(wind->commodity_pages, page)) == NULL) {
|
||||||
if((current = g_list_find(wind->post_comm_pages, page)) == NULL) {
|
if((current = g_list_find(wind->post_comm_pages, page)) == NULL) {
|
||||||
/* where are we? */
|
/* Where are we? */
|
||||||
printf("QIF import: I'm lost!\n");
|
printf("QIF import: I'm lost!\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -280,14 +297,26 @@ get_prev_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
|
|||||||
where = 1;
|
where = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
prev = current->prev;
|
/* If no duplicates were found, skip all post-conversion pages. */
|
||||||
while(!prev ||
|
if (where == 3 && SCM_NULLP(wind->match_transactions))
|
||||||
(!wind->show_doc_pages &&
|
prev = NULL;
|
||||||
g_list_find(wind->doc_pages, prev->data))) {
|
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_stocks == SCM_BOOL_F &&
|
||||||
|
GNOME_DRUID_PAGE(prev->data) == get_named_page(wind, "commodity_doc_page"))) {
|
||||||
if(prev && prev->prev) {
|
if(prev && prev->prev) {
|
||||||
|
/* Go back another page within the same stage. */
|
||||||
prev = prev->prev;
|
prev = prev->prev;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
/* Start looking at the end of the previous stage. */
|
||||||
where --;
|
where --;
|
||||||
switch(where) {
|
switch(where) {
|
||||||
case 1:
|
case 1:
|
||||||
@ -1692,6 +1721,10 @@ gnc_ui_qif_import_commodity_prepare_cb(GnomeDruidPage * page,
|
|||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
new_page = make_qif_druid_page(commodity);
|
new_page = make_qif_druid_page(commodity);
|
||||||
|
|
||||||
|
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_signal_connect(new_page->page, "next",
|
||||||
G_CALLBACK(gnc_ui_qif_import_comm_check_cb),
|
G_CALLBACK(gnc_ui_qif_import_comm_check_cb),
|
||||||
wind);
|
wind);
|
||||||
|
Loading…
Reference in New Issue
Block a user