Skip to content

Commit b7f2310

Browse files
committed
Qif import assistant: Use Enter and Leave macros
Instead of "Visibility Page" and "Builder Page" which don't communicate well what function is running.
1 parent dcb24a2 commit b7f2310

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

gnucash/import-export/qif-imp/assistant-qif-import.c

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,62 +1488,64 @@ static gboolean
14881488
gnc_ui_qif_import_assistant_skip_page (GtkAssistant *assistant, GtkWidget *page, QIFImportWindow *wind)
14891489
{
14901490
const char *pagename = gtk_buildable_get_name (GTK_BUILDABLE(page));
1491+
gboolean rv = FALSE;
14911492

1492-
PINFO ("Visibility page name is %s", gtk_buildable_get_name (GTK_BUILDABLE(page)));
1493+
ENTER("Page %s", pagename);
14931494

14941495
if (!g_strcmp0 (pagename, "date_format_page"))
14951496
{
14961497
/* Current page is date page */
1497-
return gnc_ui_qif_import_skip_date_format (assistant, wind);
1498+
rv = gnc_ui_qif_import_skip_date_format (assistant, wind);
14981499
}
14991500
else if (!g_strcmp0 (pagename, "account_name_page"))
15001501
{
15011502
/* Current page is account page */
1502-
return gnc_ui_qif_import_skip_account (assistant, wind);
1503+
rv = gnc_ui_qif_import_skip_account (assistant, wind);
15031504
}
15041505
else if (!g_strcmp0 (pagename, "account_doc_page"))
15051506
{
15061507
/* Current page is Account Doc. page */
1507-
return gnc_ui_qif_import_skip_account_doc (wind);
1508+
rv = gnc_ui_qif_import_skip_account_doc (wind);
15081509
}
15091510
else if (!g_strcmp0 (pagename, "category_doc_page"))
15101511
{
15111512
/* Current page is Category Doc. page */
1512-
return gnc_ui_qif_import_skip_category_doc (wind);
1513+
rv = gnc_ui_qif_import_skip_category_doc (wind);
15131514
}
15141515
else if (!g_strcmp0 (pagename, "category_match_page"))
15151516
{
15161517
/* Current page is Category Match page */
1517-
return gnc_ui_qif_import_skip_category_match (wind);
1518+
rv = gnc_ui_qif_import_skip_category_match (wind);
15181519
}
15191520
else if (!g_strcmp0 (pagename, "memo_doc_page"))
15201521
{
15211522
/* Current page is Memo Doc. page */
1522-
return gnc_ui_qif_import_skip_memo_doc (wind);
1523+
rv = gnc_ui_qif_import_skip_memo_doc (wind);
15231524
}
15241525
else if (!g_strcmp0 (pagename, "memo_match_page"))
15251526
{
15261527
/* Current page is Memo Match page */
1527-
return gnc_ui_qif_import_skip_memo_match (wind);
1528+
rv = gnc_ui_qif_import_skip_memo_match (wind);
15281529
}
15291530
else if (!g_strcmp0 (pagename, "commodity_page"))
15301531
{
15311532
/* Current page is Commodity page */
1532-
return gnc_ui_qif_import_skip_commodity (wind);
1533+
rv = gnc_ui_qif_import_skip_commodity (wind);
15331534
}
15341535
else if (!g_strcmp0 (pagename, "duplicates_doc_page"))
15351536
{
15361537
/* Current page is Duplicates Doc page */
1537-
return gnc_ui_qif_import_skip_duplicates_doc (wind);
1538+
rv = gnc_ui_qif_import_skip_duplicates_doc (wind);
15381539
}
15391540
else if (!g_strcmp0 (pagename, "duplicates_match_page"))
15401541
{
15411542
/* Current page is Duplicates Match page */
1542-
return gnc_ui_qif_import_skip_duplicates_match (wind);
1543+
rv = gnc_ui_qif_import_skip_duplicates_match (wind);
15431544
}
15441545

15451546
/* By default, we do not skip */
1546-
return FALSE;
1547+
LEAVE("%s", rv ? "Skipped" : "Not Skipped");
1548+
return rv;
15471549
}
15481550

15491551

@@ -2520,7 +2522,6 @@ gnc_ui_qif_import_account_doc_prepare (GtkAssistant *assistant,
25202522
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
25212523
gtk_assistant_update_buttons_state (assistant);
25222524

2523-
PINFO ("Total Number of Assistant Pages is %d", gtk_assistant_get_n_pages (assistant));
25242525

25252526
/* Enable the Assistant "Next" Button */
25262527
gtk_assistant_set_page_complete (assistant, page, TRUE);
@@ -2603,8 +2604,6 @@ gnc_ui_qif_import_category_doc_prepare (GtkAssistant *assistant,
26032604
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
26042605
gtk_assistant_update_buttons_state (assistant);
26052606

2606-
PINFO ("Total Number of Assistant Pages is %d", gtk_assistant_get_n_pages (assistant));
2607-
26082607
/* Enable the Assistant "Next" Button */
26092608
gtk_assistant_set_page_complete (assistant, page, TRUE);
26102609
}
@@ -2702,8 +2701,6 @@ gnc_ui_qif_import_memo_doc_prepare (GtkAssistant *assistant, gpointer user_data)
27022701
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
27032702
gtk_assistant_update_buttons_state (assistant);
27042703

2705-
PINFO ("Total Number of Assistant Pages is %d", gtk_assistant_get_n_pages (assistant));
2706-
27072704
/* Enable the Assistant "Next" Button */
27082705
gtk_assistant_set_page_complete (assistant, page, TRUE);
27092706

@@ -2953,8 +2950,6 @@ gnc_ui_qif_import_commodity_prepare (GtkAssistant *assistant, gpointer user_data
29532950

29542951
gtk_assistant_update_buttons_state (assistant);
29552952

2956-
PINFO ("Total Number of Assistant Pages is %d", gtk_assistant_get_n_pages (assistant));
2957-
29582953
/* Enable the Assistant "Next" Button */
29592954
gtk_assistant_set_page_complete (assistant, page,
29602955
gnc_ui_qif_import_commodity_all_notebook_pages_complete (wind));
@@ -3417,8 +3412,6 @@ gnc_ui_qif_import_duplicates_doc_prepare (GtkAssistant *assistant,
34173412
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
34183413
gtk_assistant_update_buttons_state (assistant);
34193414

3420-
PINFO ("Total Number of Assistant Pages is %d", gtk_assistant_get_n_pages (assistant));
3421-
34223415
/* Enable the Assistant "Next" Button */
34233416
gtk_assistant_set_page_complete (assistant, page, TRUE);
34243417

@@ -3658,7 +3651,7 @@ void gnc_ui_qif_import_prepare_cb (GtkAssistant *assistant, GtkWidget *page,
36583651
GtkWidget *mypage = gtk_assistant_get_nth_page (assistant, currentpage);
36593652
const char *pagename = gtk_buildable_get_name (GTK_BUILDABLE(mypage));
36603653

3661-
PINFO ("Builder Page Name is %s", gtk_buildable_get_name (GTK_BUILDABLE(mypage)));
3654+
ENTER("Page %s", pagename);
36623655

36633656
if (!g_strcmp0 (pagename, "start_page"))
36643657
{
@@ -3755,6 +3748,7 @@ void gnc_ui_qif_import_prepare_cb (GtkAssistant *assistant, GtkWidget *page,
37553748
/* Current page is the summary page */
37563749
gnc_ui_qif_import_summary_page_prepare (assistant, user_data);
37573750
}
3751+
LEAVE("");
37583752
}
37593753

37603754

@@ -4016,15 +4010,17 @@ gnc_ui_qif_import_assistant_make (QIFImportWindow *qif_win)
40164010

40174011
/* Get all interesting builder-defined widgets. */
40184012
get_assistant_widgets (qif_win, builder);
4013+
GtkAssistant *assistant = GTK_ASSISTANT(qif_win->window);
40194014

40204015
/* Make this window stay on top */
40214016
gtk_window_set_transient_for (GTK_WINDOW(qif_win->window), gnc_ui_get_main_window (NULL));
40224017

40234018
/* Build the details of all GtkTreeView widgets. */
40244019
build_views (qif_win);
4020+
PINFO ("Total Number of Assistant Pages is %d", gtk_assistant_get_n_pages (assistant));
40254021

40264022
/* Establish a custom next page function. */
4027-
gtk_assistant_set_forward_page_func(GTK_ASSISTANT(qif_win->window),
4023+
gtk_assistant_set_forward_page_func(assistant,
40284024
gnc_ui_qif_import_assistant_page_forward, qif_win, NULL);
40294025

40304026
/* Currency Page */

0 commit comments

Comments
 (0)