From 5b5cded2783c9776833482c66a4e75cdc497a762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoit=20Gr=C3=A9goire?= Date: Mon, 21 Oct 2002 01:39:47 +0000 Subject: [PATCH] =?UTF-8?q?2002-10-20=20=20Benoit=20Gr=EF=BF=BDgoire=20=20?= =?UTF-8?q?=20=09*=20src/import-export/Trasaction-ma?= =?UTF-8?q?tcher.c:=20Fix=20compiler=20warnings.=20=09*=20src/import-expor?= =?UTF-8?q?t/ofx/gnc-ofx-import.c:=20Give=20the=20user=20more=20informatio?= =?UTF-8?q?n=20for=20account=20creation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7366 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 4 ++++ src/import-export/Transaction-matcher.c | 12 +++++------ src/import-export/generic-import.glade | 2 +- src/import-export/ofx/Makefile.am | 3 ++- src/import-export/ofx/gnc-ofx-import.c | 27 +++++++++++++++++++++++-- 5 files changed, 38 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2100b8a19f..e00a2ab10b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-10-20 Benoit Grégoire + * src/import-export/Trasaction-matcher.c: Fix compiler warnings. + * src/import-export/ofx/gnc-ofx-import.c: Give the user more information for account creation. + 2002-10-20 Derek Atkins * configure.in -- remove -Wno-uninitialized -Wno-unused, in preparation for the "new g-wrap" which should output code that wont cause these diff --git a/src/import-export/Transaction-matcher.c b/src/import-export/Transaction-matcher.c index ea21b37765..aed752d90f 100644 --- a/src/import-export/Transaction-matcher.c +++ b/src/import-export/Transaction-matcher.c @@ -33,7 +33,7 @@ #include -#include +#include #include #include "gnc-generic-import.h" #include "Account.h" @@ -108,7 +108,7 @@ struct _transactioninfo char action_text[10]; char date_text[20]; char amount_text[20]; - char * clist_text[NUM_COLUMNS_DOWNLOADED_CLIST]; + const char * clist_text[NUM_COLUMNS_DOWNLOADED_CLIST]; GList * match_list; struct _matchinfo * selected_match_info; Action action; @@ -125,7 +125,7 @@ struct _matchinfo char probability_text[10]; char date_text[20]; char amount_text[20]; - char * clist_text[NUM_COLUMNS_MATCHER_CLIST]; + const char * clist_text[NUM_COLUMNS_MATCHER_CLIST]; }; static void downloaded_transaction_refresh_gui( struct _transmatcherdialog * matcher,struct _transactioninfo * transaction_info) @@ -177,7 +177,7 @@ if(transaction_info==matcher->selected_trans_info) gnc_numeric_to_double(xaccSplitGetAmount(transaction_info->first_split))); transaction_info->clist_text[DOWNLOADED_CLIST_AMOUNT]=transaction_info->amount_text; - transaction_info->clist_text[DOWNLOADED_CLIST_DESCRIPTION]=xaccTransGetDescription(transaction_info->trans); + transaction_info->clist_text[DOWNLOADED_CLIST_DESCRIPTION]==xaccTransGetDescription(transaction_info->trans); transaction_info->clist_text[DOWNLOADED_CLIST_MEMO]=xaccSplitGetMemo(transaction_info->first_split); @@ -218,7 +218,7 @@ downloaded_transaction_select_cb (GtkCList *clist, { match_info = list_element->data; row_number = gtk_clist_append(matcher->match_clist, - match_info->clist_text); + (char **)(match_info->clist_text)); gtk_clist_set_row_data (matcher->match_clist, row_number, match_info); @@ -757,7 +757,7 @@ void gnc_import_add_trans(Transaction *trans) } row_number = gtk_clist_append(matcher->downloaded_clist, - transaction_info->clist_text); + (char **)(transaction_info->clist_text)); gtk_clist_set_row_data_full(matcher->downloaded_clist, row_number, transaction_info, diff --git a/src/import-export/generic-import.glade b/src/import-export/generic-import.glade index e5641c5ccf..305aaad477 100644 --- a/src/import-export/generic-import.glade +++ b/src/import-export/generic-import.glade @@ -102,7 +102,7 @@ online_id_label GTK_JUSTIFY_CENTER - True + False 0.5 0.5 0 diff --git a/src/import-export/ofx/Makefile.am b/src/import-export/ofx/Makefile.am index 9e87a62f0a..2bd44a6ec8 100644 --- a/src/import-export/ofx/Makefile.am +++ b/src/import-export/ofx/Makefile.am @@ -42,7 +42,8 @@ AM_CFLAGS = \ -I${top_srcdir}/src/gnome-utils \ -I${top_srcdir}/src/import-export \ ${GLIB_CFLAGS} \ - ${LIBOFX_CFLAGS} + ${LIBOFX_CFLAGS} \ + ${GTKHTML_CFLAGS} EXTRA_DIST = \ .cvsignore diff --git a/src/import-export/ofx/gnc-ofx-import.c b/src/import-export/ofx/gnc-ofx-import.c index 89d622c63c..633c6cfe4b 100644 --- a/src/import-export/ofx/gnc-ofx-import.c +++ b/src/import-export/ofx/gnc-ofx-import.c @@ -23,6 +23,19 @@ #define _GNU_SOURCE + + + + + + + + + + + + + #include "config.h" #include @@ -43,6 +56,10 @@ #include "gnc-book.h" #include "gnc-ui-util.h" + +#include "dialog-utils.h" + + static short module = MOD_IMPORT; /********************************************************************\ * gnc_file_ofx_import @@ -76,7 +93,7 @@ void gnc_file_ofx_import (void) gnc_should_log(MOD_IMPORT, GNC_LOG_TRACE); DEBUG("gnc_file_ofx_import(): Begin...\n"); -selected_filename = gnc_file_dialog("Select an OFX/QFX file to process", +selected_filename = gnc_file_dialog(_("Select an OFX/QFX file to process"), NULL, NULL); @@ -131,6 +148,7 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data) time_t current_time; Account *account; Account *investment_account; + gchar investment_account_text[256] = ""; gnc_commodity *investment_commodity; GNCBook *book; Transaction *transaction; @@ -289,7 +307,12 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data) NULL); if(investment_commodity!=NULL) { - investment_account = gnc_import_select_account(data.unique_id, 1, data.security_data_ptr->secname, investment_commodity, STOCK); + strncat(investment_account_text, + _("A Stock or Mutual Fund account for the following security: \""), + sizeof(investment_account_text)-strlen(investment_account_text)); + strncat(investment_account_text,data.security_data_ptr->secname,sizeof(investment_account_text)-strlen(investment_account_text)); + strncat(investment_account_text,_("\"\nWarning: Ofx investment transactions require two accounts."),sizeof(investment_account_text)-strlen(investment_account_text)); + investment_account = gnc_import_select_account(data.unique_id, 1, investment_account_text, investment_commodity, STOCK); if(investment_account!=NULL&&data.unitprice_valid==true&&data.units_valid==true) {