From 31f35dd2f76f727868470d29eec6cf1d94ad6997 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Sat, 3 Jun 2000 09:21:22 +0000 Subject: [PATCH] Auto-completion, bug fixes. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2400 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 19 +- make-gnucash-patch.in | 15 +- po/gnucash.pot | 1898 +++++++++++------------ src/MultiLedger.c | 4 - src/SplitLedger.c | 1682 ++++++++++++++------ src/SplitLedger.h | 14 +- src/engine/Account.h | 18 +- src/engine/FileIO.c | 6 +- src/engine/Transaction.h | 8 +- src/engine/TransactionP.h | 2 +- src/engine/guid.c | 1 - src/engine/guid/guid.c | 450 ++++++ src/gnome/window-register.c | 8 +- src/optional/swig/Makefile.am | 2 +- src/optional/swig/Makefile.in | 2 +- src/register/basiccell.c | 11 + src/register/basiccell.h | 2 + src/register/cellblock.h | 2 +- src/register/gnome/gnucash-header.c | 5 +- src/register/left_arrow_small.xpm | 103 -- src/register/splitreg.c | 222 ++- src/register/splitreg.h | 44 + src/register/table-allgui.c | 6 - src/scm/engine-interface.scm | 9 +- src/scm/extensions.scm | 7 - src/scm/prefs.scm | 11 + src/scm/report/transaction-report-2.scm | 2 +- 27 files changed, 2881 insertions(+), 1672 deletions(-) create mode 100644 src/engine/guid/guid.c delete mode 100644 src/register/left_arrow_small.xpm diff --git a/ChangeLog b/ChangeLog index 421ebb37d5..6e13e515a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-06-02 Dave Peticolas + + * src/register/splitreg.c: added functions for getting cell types + and getting the locations for cell types. + + * src/SplitLedger.c: add functionality for auto-completion + 2000-06-02 Rob Browning * quite a few bugfixes to the automake stuff. @@ -54,8 +61,7 @@ acconfig.h - aclocal.m4 is now autogenerated, so use this instead. Various libtool files automagically added by libtool. src/examples/xacc-shell.c -> old/xacc-shell.c - - + * src/scm/startup.scm: load depend.scm here. * src/scm/report/average-balance.scm: handle new possible #f @@ -68,6 +74,15 @@ * src/scm/engine-utilities.scm: new file. +2000-05-31 Dave Peticolas + + * src/register/splitreg.c (configLabels): label the straight xfer + and xfer to cells as 'Account', label the mirrored xfer as just + 'Transfer'. + + * src/register/gnome/gnucash-header.c + (gnucash_header_reconfigure): also redraw if the style changes. + 2000-05-30 Dave Peticolas * src/register/quickfillcell.c: if a quickfill attempt fails, diff --git a/make-gnucash-patch.in b/make-gnucash-patch.in index 887fbec959..46c7fb8452 100644 --- a/make-gnucash-patch.in +++ b/make-gnucash-patch.in @@ -83,8 +83,8 @@ exit(0); __DATA__ obj -g-wrap-install Makefile +Makefile.in Makefile.init config.cache config.log @@ -109,32 +109,27 @@ stamp-h configure .deps .libs -*.i +gnucash.engine.i gnucash.pm gnucash-engine-perl5_wrap.c g-wrap-guile libgwrapguile.la libgwraprs.la gnc-autogen.h -src/g-wrap/gnc.c -src/g-wrap/gnc.h -src/g-wrap/gnc.html +src/guile/gnc.c +src/guile/gnc.h +src/guile/gnc.html src/guile/gnucash.c src/scm/bootstrap.scm src/swig/perl5/gnucash.engine_wrap.doc g-wrap.info -lib/g-wrap/Makefile.in -lib/g-wrap/rscheme/g-wrap-rs src/quotes/gnc-prices -gtksheet* *.wrap *.orig *.rej -src/reports/pathconfig.h *.moc *.gmo *.mo -po/Makefile.in POTFILES cat-id-tbl.c gnucash.pot diff --git a/po/gnucash.pot b/po/gnucash.pot index 78bfd3d6a3..f6dfbfde00 100644 --- a/po/gnucash.pot +++ b/po/gnucash.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-05-19 01:27-0700\n" +"POT-Creation-Date: 2000-06-02 12:12-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -226,59 +226,78 @@ msgstr "" #: messages-i18n.c:45 #, c-format -msgid "QIF file load failed. %s" +msgid "" +"QIF file load failed:\n" +"%s" msgstr "" #: messages-i18n.c:46 -msgid "QIF file load failed. Check settings and reload." +#, c-format +msgid "" +"QIF file load warning:\n" +"%s" msgstr "" #: messages-i18n.c:47 -msgid "The source for price quotes" +#, c-format +msgid "" +"QIF file parse failed:\n" +"%s" msgstr "" #: messages-i18n.c:48 +#, c-format +msgid "" +"QIF file parse warning:\n" +"%s" +msgstr "" + +#: messages-i18n.c:49 +msgid "The source for price quotes" +msgstr "" + +#: messages-i18n.c:50 msgid "" "The account is not balanced.\n" "Are you sure you want to finish?" msgstr "" -#: messages-i18n.c:49 +#: messages-i18n.c:51 msgid "" "You have made changes to this reconcile window.\n" "Are you sure you want to cancel?" msgstr "" -#: messages-i18n.c:50 +#: messages-i18n.c:52 msgid "Warning! This is a reconciled transaction. Do you want do continue?" msgstr "" -#: messages-i18n.c:51 +#: messages-i18n.c:53 #, c-format msgid "" "You cannot transfer funds from the %s account.\n" "It does not have a matching currency." msgstr "" -#: messages-i18n.c:52 +#: messages-i18n.c:54 msgid "Error executing scheme report." msgstr "" -#: messages-i18n.c:53 +#: messages-i18n.c:55 msgid "This report has no parameters." msgstr "" -#: messages-i18n.c:54 +#: messages-i18n.c:56 msgid "Show the income and expense accounts." msgstr "" -#: messages-i18n.c:55 +#: messages-i18n.c:57 msgid "" "The current transaction has been changed.\n" "Would you like to record it?" msgstr "" -#: messages-i18n.c:56 +#: messages-i18n.c:58 #, c-format msgid "" "Are you sure you want to delete\n" @@ -287,21 +306,21 @@ msgid "" " %s ?" msgstr "" -#: messages-i18n.c:57 +#: messages-i18n.c:59 msgid "Are you sure you want to delete the current transaction?" msgstr "" -#: messages-i18n.c:58 +#: messages-i18n.c:60 msgid "Recalculate Transaction" msgstr "" -#: messages-i18n.c:59 +#: messages-i18n.c:61 msgid "" "The values entered for this transaction are inconsistent.\n" "Which value would you like to have recalculated?\n" msgstr "" -#: messages-i18n.c:60 +#: messages-i18n.c:62 #, c-format msgid "" "The types of all the parent accounts and their subaccounts must be changed " @@ -309,1393 +328,1381 @@ msgid "" "Is that what you want to do?" msgstr "" -#: messages-i18n.c:61 +#: messages-i18n.c:63 #, c-format msgid "" "The types of all the subaccounts must be changed to %s.\n" "Is that what you want to do?" msgstr "" -#: messages-i18n.c:62 +#: messages-i18n.c:64 msgid "The following changes must be made. Continue?" msgstr "" -#: messages-i18n.c:63 +#: messages-i18n.c:65 msgid "" "There must be at least two accounts\n" "created before you can transfer funds." msgstr "" -#: messages-i18n.c:64 +#: messages-i18n.c:66 msgid "" "You cannot transfer between those accounts.\n" "They do not have a common currency." msgstr "" -#: messages-i18n.c:65 +#: messages-i18n.c:67 msgid "" "The \"From\" and \"To\" accounts\n" " must be different!" msgstr "" -#: messages-i18n.c:66 +#: messages-i18n.c:68 msgid "You can't transfer from and to the same account!" msgstr "" -#: messages-i18n.c:67 +#: messages-i18n.c:69 msgid "" "You must specify an account to transfer from,\n" "or to, or both, for this transaction.\n" "Otherwise, it will not be recorded." msgstr "" -#: messages-i18n.c:68 +#: messages-i18n.c:70 msgid "Adjust the balance of the selected account" msgstr "" -#: messages-i18n.c:69 +#: messages-i18n.c:71 msgid "Enter the new balance" msgstr "" -#: messages-i18n.c:70 +#: messages-i18n.c:72 msgid "Enter the date you want the balance adjusted" msgstr "" -#: messages-i18n.c:71 +#: messages-i18n.c:73 msgid "Adjust the ending balance" msgstr "" -#: messages-i18n.c:72 +#: messages-i18n.c:74 msgid "Adjust the balance of the main account for this register" msgstr "" -#: messages-i18n.c:73 po/guile_strings.txt:119 +#: messages-i18n.c:75 po/guile_strings.txt:119 msgid "Double line mode with a multi-line cursor" msgstr "" -#: messages-i18n.c:74 po/guile_strings.txt:120 +#: messages-i18n.c:76 po/guile_strings.txt:120 msgid "Single line mode with a multi-line cursor" msgstr "" -#: messages-i18n.c:75 +#: messages-i18n.c:77 msgid "Move to the blank transaction at the bottom of the register" msgstr "" -#: messages-i18n.c:76 +#: messages-i18n.c:78 msgid "Cancel the current transaction" msgstr "" -#: messages-i18n.c:77 +#: messages-i18n.c:79 msgid "Close this HTML window" msgstr "" -#: messages-i18n.c:78 +#: messages-i18n.c:80 msgid "Close this register window" msgstr "" -#: messages-i18n.c:79 +#: messages-i18n.c:81 msgid "Copy the selected transaction" msgstr "" -#: messages-i18n.c:80 -msgid "Cut the selected transaction" -msgstr "" - -#: messages-i18n.c:81 -msgid "Set the date range of this register" -msgstr "" - #: messages-i18n.c:82 -msgid "Delete selected account" +msgid "Enter a 3-letter ISO currency code such as USD (US Dollars)" msgstr "" #: messages-i18n.c:83 -msgid "Delete the current transaction" +msgid "Cut the selected transaction" msgstr "" -#: messages-i18n.c:84 po/guile_strings.txt:147 -msgid "Show transactions on two lines with more information" +#: messages-i18n.c:84 +msgid "Set the date range of this register" msgstr "" #: messages-i18n.c:85 -msgid "Make a copy of the current transaction" +msgid "Delete selected account" msgstr "" #: messages-i18n.c:86 -msgid "Edit the selected account" +msgid "Delete the current transaction" msgstr "" -#: messages-i18n.c:87 -msgid "Edit the main account for this register" +#: messages-i18n.c:87 po/guile_strings.txt:147 +msgid "Show transactions on two lines with more information" msgstr "" #: messages-i18n.c:88 -msgid "Edit the current transaction" +msgid "Make a copy of the current transaction" msgstr "" #: messages-i18n.c:89 -msgid "Exit GnuCash" +msgid "Edit the selected account" msgstr "" #: messages-i18n.c:90 -msgid "Export HTML-formatted report to file" +msgid "Edit the main account for this register" msgstr "" #: messages-i18n.c:91 -msgid "Find transactions with a search." +msgid "Edit the current transaction" msgstr "" #: messages-i18n.c:92 -msgid "Open the GnuCash help window" +msgid "Exit GnuCash" msgstr "" #: messages-i18n.c:93 -msgid "Move back one step in the history" +msgid "Export HTML-formatted report to file" msgstr "" #: messages-i18n.c:94 -msgid "Move forward one step in the history" +msgid "Find transactions with a search." msgstr "" #: messages-i18n.c:95 -msgid "Import a Quicken QIF file" +msgid "Open the GnuCash help window" msgstr "" #: messages-i18n.c:96 -msgid "Jump to the corresponding transaction in the other account" +msgid "Move back one step in the history" msgstr "" #: messages-i18n.c:97 -msgid "Open the GnuCash Manual" +msgid "Move forward one step in the history" msgstr "" #: messages-i18n.c:98 -msgid "Show transactions on multiple lines with one line for each split" +msgid "Import a Quicken QIF file" msgstr "" #: messages-i18n.c:99 +msgid "Jump to the corresponding transaction in the other account" +msgstr "" + +#: messages-i18n.c:100 +msgid "Open the GnuCash Manual" +msgstr "" + +#: messages-i18n.c:101 +msgid "Show transactions on multiple lines with one line for each split" +msgstr "" + +#: messages-i18n.c:102 msgid "" "This transaction has multiple splits; switch to multi-line mode to see them " "all" msgstr "" -#: messages-i18n.c:100 +#: messages-i18n.c:103 msgid "Create a new account" msgstr "" -#: messages-i18n.c:101 +#: messages-i18n.c:104 msgid "Create a new file" msgstr "" -#: messages-i18n.c:102 +#: messages-i18n.c:105 msgid "Add a new transaction to the account" msgstr "" -#: messages-i18n.c:103 +#: messages-i18n.c:106 msgid "Open the selected account" msgstr "" -#: messages-i18n.c:104 +#: messages-i18n.c:107 msgid "Open the account" msgstr "" -#: messages-i18n.c:105 +#: messages-i18n.c:108 msgid "Open the selected account and all its subaccounts" msgstr "" -#: messages-i18n.c:106 +#: messages-i18n.c:109 msgid "Open a file" msgstr "" -#: messages-i18n.c:107 +#: messages-i18n.c:110 msgid "Paste the transaction clipboard" msgstr "" -#: messages-i18n.c:108 +#: messages-i18n.c:111 msgid "Open the global preferences dialog" msgstr "" -#: messages-i18n.c:109 +#: messages-i18n.c:112 msgid "Print a check using a standard format" msgstr "" -#: messages-i18n.c:110 +#: messages-i18n.c:113 msgid "Reconcile the selected account" msgstr "" -#: messages-i18n.c:111 +#: messages-i18n.c:114 msgid "Cancel the reconciliation of this account" msgstr "" -#: messages-i18n.c:112 +#: messages-i18n.c:115 msgid "Finish the reconciliation of this account" msgstr "" -#: messages-i18n.c:113 +#: messages-i18n.c:116 msgid "" "Change the reconcile information including statement date and ending balance." msgstr "" -#: messages-i18n.c:114 +#: messages-i18n.c:117 msgid "Reconcile the main account for this register" msgstr "" -#: messages-i18n.c:115 +#: messages-i18n.c:118 msgid "Record the current transaction" msgstr "" -#: messages-i18n.c:116 +#: messages-i18n.c:119 msgid "Set the parameters for this report" msgstr "" -#: messages-i18n.c:117 +#: messages-i18n.c:120 msgid "Save the file to disk" msgstr "" -#: messages-i18n.c:118 +#: messages-i18n.c:121 msgid "Identify and fix problems in the account" msgstr "" -#: messages-i18n.c:119 +#: messages-i18n.c:122 msgid "Identify and fix problems in all the accounts" msgstr "" -#: messages-i18n.c:120 +#: messages-i18n.c:123 msgid "Identify and fix problems in the account and its subaccounts" msgstr "" -#: messages-i18n.c:121 +#: messages-i18n.c:124 msgid "Identify and fix problems in the accounts of this register" msgstr "" -#: messages-i18n.c:122 +#: messages-i18n.c:125 msgid "Set the option to its default value" msgstr "" -#: messages-i18n.c:123 +#: messages-i18n.c:126 msgid "Show all of the transactions in the account" msgstr "" -#: messages-i18n.c:124 po/guile_strings.txt:151 +#: messages-i18n.c:127 po/guile_strings.txt:151 msgid "Show transactions on single lines" msgstr "" -#: messages-i18n.c:125 -msgid "Sort by Amount, then Date, then Num" -msgstr "" - -#: messages-i18n.c:126 -msgid "Sort by Date, then Num, then Amount" -msgstr "" - -#: messages-i18n.c:127 -msgid "Sort by Description, then Date, then Num" -msgstr "" - -#: messages-i18n.c:128 -msgid "Sort by the date of entry" -msgstr "" - -#: messages-i18n.c:129 -msgid "Sort by Memo, then Date, then Num" -msgstr "" - -#: messages-i18n.c:130 -msgid "Sort by Num, then Date, then Amount" -msgstr "" - -#: messages-i18n.c:131 -msgid "Sort by the statement date (unreconciled items last" -msgstr "" - -#: messages-i18n.c:132 -msgid "Keep normal account order" -msgstr "" - -#: messages-i18n.c:133 -msgid "Transfer funds from one account to another" -msgstr "" - -#: messages-i18n.c:134 -msgid "Enter the type of transaction, or choose one from the list" -msgstr "" - -#: messages-i18n.c:135 -msgid "Enter a description of the transaction" -msgstr "" - -#: messages-i18n.c:136 -msgid "Enter a description of the split" -msgstr "" - -#: messages-i18n.c:137 -msgid "Enter the transaction number, such as the check number" -msgstr "" - -#: messages-i18n.c:138 -msgid "Enter the share price" -msgstr "" - -#: messages-i18n.c:139 -msgid "Enter the number of shares sold" -msgstr "" - -#: messages-i18n.c:140 -msgid "Enter the total value of the shares" -msgstr "" - -#: messages-i18n.c:141 -msgid "Enter the account to transfer from, or choose one from the list" -msgstr "" - -#: messages-i18n.c:142 -msgid "Enter the account to transfer to, or choose one from the list" -msgstr "" - -#: messages-i18n.c:143 -msgid "_Account" -msgstr "" - -#: messages-i18n.c:144 -msgid "_Accounts" -msgstr "" - -#: messages-i18n.c:145 -msgid "_Adjust Balance" -msgstr "" - -#: messages-i18n.c:146 -msgid "_Adjust Balance..." -msgstr "" - -#: messages-i18n.c:147 -msgid "_Blank" -msgstr "" - -#: messages-i18n.c:148 -msgid "_Cancel" -msgstr "" - -#: messages-i18n.c:149 -msgid "Copy Transaction" -msgstr "" - -#: messages-i18n.c:150 -msgid "Cut Transaction" -msgstr "" - -#: messages-i18n.c:151 -msgid "_Date Range" -msgstr "" - -#: messages-i18n.c:152 -msgid "_Delete Account" -msgstr "" - -#: messages-i18n.c:153 -msgid "_Delete" -msgstr "" - -#: messages-i18n.c:154 -msgid "D_uplicate" -msgstr "" - -#: messages-i18n.c:155 -msgid "_Edit" -msgstr "" - -#: messages-i18n.c:156 -msgid "_Edit Account" -msgstr "" - -#: messages-i18n.c:157 -msgid "_Ending Balance" -msgstr "" - -#: messages-i18n.c:158 -msgid "_Ending Balance..." -msgstr "" - -#: messages-i18n.c:159 -msgid "_Finish" -msgstr "" - -#: messages-i18n.c:160 -msgid "_Help" -msgstr "" - -#: messages-i18n.c:161 -msgid "_Jump" -msgstr "" - -#: messages-i18n.c:162 -msgid "_Manual" -msgstr "" - -#: messages-i18n.c:163 -msgid "_New" -msgstr "" - -#: messages-i18n.c:164 -msgid "_New Account" -msgstr "" - -#: messages-i18n.c:165 -msgid "_New Account..." -msgstr "" - -#: messages-i18n.c:166 -msgid "_Open Account" -msgstr "" - -#: messages-i18n.c:167 -msgid "Open S_ubaccounts" -msgstr "" - -#: messages-i18n.c:168 -msgid "Paste Transaction" -msgstr "" - -#: messages-i18n.c:169 -msgid "_Preferences" -msgstr "" - -#: messages-i18n.c:170 -msgid "_Preferences..." -msgstr "" - -#: messages-i18n.c:171 -msgid "_Print Check... (unfinished!)" -msgstr "" - -#: messages-i18n.c:172 -msgid "_Reconcile Information..." -msgstr "" - -#: messages-i18n.c:173 -msgid "_Reconcile..." -msgstr "" - -#: messages-i18n.c:174 -msgid "_Reconcile" -msgstr "" - -#: messages-i18n.c:175 -msgid "_Record" -msgstr "" - -#: messages-i18n.c:176 -msgid "_Register" -msgstr "" - -#: messages-i18n.c:177 -msgid "_Scrub" -msgstr "" - -#: messages-i18n.c:178 -msgid "Scrub A_ccount" -msgstr "" - -#: messages-i18n.c:179 -msgid "Scrub A_ll" -msgstr "" - -#: messages-i18n.c:180 -msgid "Scrub Su_baccounts" -msgstr "" - -#: messages-i18n.c:181 -msgid "Set _Range..." -msgstr "" - -#: messages-i18n.c:182 -msgid "Set _Range" -msgstr "" - -#: messages-i18n.c:183 -msgid "Show _All" -msgstr "" - -#: messages-i18n.c:184 -msgid "Sort _Order" -msgstr "" - -#: messages-i18n.c:185 -msgid "_Style" -msgstr "" - -#: messages-i18n.c:186 -msgid "_Transaction" -msgstr "" - -#: messages-i18n.c:187 -msgid "_Transfer" -msgstr "" - -#: messages-i18n.c:188 -msgid "_Transfer..." -msgstr "" - -#: messages-i18n.c:189 -msgid "Account Code" -msgstr "" - -#: messages-i18n.c:190 po/guile_strings.txt:7 -msgid "Account Name" -msgstr "" - -#: messages-i18n.c:191 -msgid "Account Type" -msgstr "" - -#: messages-i18n.c:192 -msgid "Adjust Balance" -msgstr "" - -#: messages-i18n.c:193 po/guile_strings.txt:310 -msgid "Auto Double" -msgstr "" - -#: messages-i18n.c:194 po/guile_strings.txt:70 -msgid "Auto Single" -msgstr "" - -#: messages-i18n.c:195 -msgid "Clear All" -msgstr "" - -#: messages-i18n.c:196 -msgid "Close Window" -msgstr "" - -#: messages-i18n.c:197 -msgid "Credit Card" -msgstr "" - -#: messages-i18n.c:198 -msgid "Credit Line" -msgstr "" - -#: messages-i18n.c:199 -msgid "Date Range" -msgstr "" - -#: messages-i18n.c:200 -msgid "Delete Account" -msgstr "" - -#: messages-i18n.c:201 -msgid "Delete Transaction" -msgstr "" - -#: messages-i18n.c:202 po/guile_strings.txt:22 -msgid "Double Line" -msgstr "" - -#: messages-i18n.c:203 -msgid "Edit Account" -msgstr "" - -#: messages-i18n.c:204 -msgid "Ending Balance" -msgstr "" - -#: messages-i18n.c:205 -msgid "End date" -msgstr "" - -#: messages-i18n.c:206 -msgid "Export To" -msgstr "" - -#: messages-i18n.c:207 -msgid "Finish" -msgstr "" - -#: messages-i18n.c:208 -msgid "From Now" -msgstr "" - -#: messages-i18n.c:209 -msgid "General Ledger" -msgstr "" - -#: messages-i18n.c:210 -msgid "Hide Inc/Exp" -msgstr "" - -#: messages-i18n.c:211 -msgid "Import QIF..." -msgstr "" - -#: messages-i18n.c:212 -msgid "Import QIF" -msgstr "" - -#: messages-i18n.c:213 -msgid "Lost Accounts" -msgstr "" - -#: messages-i18n.c:214 -msgid "Money Market" -msgstr "" - -#: messages-i18n.c:215 po/guile_strings.txt:58 -msgid "Multi Line" -msgstr "" - -#: messages-i18n.c:216 po/guile_strings.txt:4 -msgid "Mutual Fund" -msgstr "" - -#: messages-i18n.c:217 -msgid "New Account" -msgstr "" - -#: messages-i18n.c:218 -msgid "New Balance" -msgstr "" - -#: messages-i18n.c:219 -msgid "New File" -msgstr "" - -#: messages-i18n.c:220 -msgid "New top level account" -msgstr "" - -#: messages-i18n.c:221 -msgid "New Value" -msgstr "" - -#: messages-i18n.c:222 -msgid "No description" -msgstr "" - -#: messages-i18n.c:223 -msgid "Old Value" -msgstr "" - -#: messages-i18n.c:224 -msgid "Open Account" -msgstr "" - -#: messages-i18n.c:225 -msgid "Opening Balance" -msgstr "" - -#: messages-i18n.c:226 -msgid "Open File" -msgstr "" - -#: messages-i18n.c:227 -msgid "Open Subaccounts" -msgstr "" - -#: messages-i18n.c:228 -msgid "Pick One" -msgstr "" - -#: messages-i18n.c:229 -msgid "Parent Account" -msgstr "" - -#: messages-i18n.c:230 -msgid "Previous Balance" -msgstr "" - -#: messages-i18n.c:231 -msgid "Purch Price" -msgstr "" - -#: messages-i18n.c:232 -msgid "Price Quote Source" -msgstr "" - -#: messages-i18n.c:233 -msgid "Reconciled Balance" -msgstr "" - -#: messages-i18n.c:234 -msgid "Reconcile Information" -msgstr "" - -#: messages-i18n.c:235 -msgid "Register date ranges" -msgstr "" - -#: messages-i18n.c:236 -msgid "Sale Price" -msgstr "" - -#: messages-i18n.c:237 -msgid "Save As" -msgstr "" - -#: messages-i18n.c:238 -msgid "Scrub Account" -msgstr "" - -#: messages-i18n.c:239 -msgid "Scrub All" -msgstr "" - -#: messages-i18n.c:240 -msgid "Scrub Subaccounts" -msgstr "" - -#: messages-i18n.c:241 -msgid "Select All" -msgstr "" - -#: messages-i18n.c:242 -msgid "Select Default" -msgstr "" - -#: messages-i18n.c:243 -msgid "Set Date Range" -msgstr "" - -#: messages-i18n.c:244 -msgid "Set Range" -msgstr "" - -#: messages-i18n.c:245 -msgid "Set to default" -msgstr "" - -#: messages-i18n.c:246 -msgid "Set Up Account" -msgstr "" - -#: messages-i18n.c:247 -msgid "Show All" -msgstr "" - -#: messages-i18n.c:248 -msgid "Show Inc/Exp" -msgstr "" - -#: messages-i18n.c:249 -msgid "Show Categories" -msgstr "" - -#: messages-i18n.c:250 -msgid "Show Earliest" -msgstr "" - -#: messages-i18n.c:251 -msgid "Show Latest" -msgstr "" - -#: messages-i18n.c:252 po/guile_strings.txt:190 -msgid "Single Line" -msgstr "" - -#: messages-i18n.c:253 +#: messages-i18n.c:128 messages-i18n.c:256 msgid "Sort by Amount" msgstr "" -#: messages-i18n.c:254 +#: messages-i18n.c:129 messages-i18n.c:257 msgid "Sort by Date" msgstr "" -#: messages-i18n.c:255 +#: messages-i18n.c:130 messages-i18n.c:258 msgid "Sort by Description" msgstr "" -#: messages-i18n.c:256 -msgid "Sort by date of entry" +#: messages-i18n.c:131 +msgid "Sort by the date of entry" msgstr "" -#: messages-i18n.c:257 +#: messages-i18n.c:132 messages-i18n.c:260 msgid "Sort by Memo" msgstr "" -#: messages-i18n.c:258 +#: messages-i18n.c:133 messages-i18n.c:261 msgid "Sort by Num" msgstr "" +#: messages-i18n.c:134 +msgid "Sort by the statement date (unreconciled items last" +msgstr "" + +#: messages-i18n.c:135 +msgid "Keep normal account order" +msgstr "" + +#: messages-i18n.c:136 +msgid "Transfer funds from one account to another" +msgstr "" + +#: messages-i18n.c:137 +msgid "Enter the type of transaction, or choose one from the list" +msgstr "" + +#: messages-i18n.c:138 +msgid "Enter a description of the transaction" +msgstr "" + +#: messages-i18n.c:139 +msgid "Enter a description of the split" +msgstr "" + +#: messages-i18n.c:140 +msgid "Enter the transaction number, such as the check number" +msgstr "" + +#: messages-i18n.c:141 +msgid "Enter the share price" +msgstr "" + +#: messages-i18n.c:142 +msgid "Enter the number of shares sold" +msgstr "" + +#: messages-i18n.c:143 +msgid "Enter the total value of the shares" +msgstr "" + +#: messages-i18n.c:144 +msgid "Enter the account to transfer from, or choose one from the list" +msgstr "" + +#: messages-i18n.c:145 +msgid "Enter the account to transfer to, or choose one from the list" +msgstr "" + +#: messages-i18n.c:146 +msgid "_Account" +msgstr "" + +#: messages-i18n.c:147 +msgid "_Accounts" +msgstr "" + +#: messages-i18n.c:148 +msgid "_Adjust Balance" +msgstr "" + +#: messages-i18n.c:149 +msgid "_Adjust Balance..." +msgstr "" + +#: messages-i18n.c:150 +msgid "_Blank" +msgstr "" + +#: messages-i18n.c:151 +msgid "_Cancel" +msgstr "" + +#: messages-i18n.c:152 +msgid "Copy Transaction" +msgstr "" + +#: messages-i18n.c:153 +msgid "Cut Transaction" +msgstr "" + +#: messages-i18n.c:154 +msgid "_Date Range" +msgstr "" + +#: messages-i18n.c:155 +msgid "_Delete Account" +msgstr "" + +#: messages-i18n.c:156 +msgid "_Delete" +msgstr "" + +#: messages-i18n.c:157 +msgid "D_uplicate" +msgstr "" + +#: messages-i18n.c:158 +msgid "_Edit" +msgstr "" + +#: messages-i18n.c:159 +msgid "_Edit Account" +msgstr "" + +#: messages-i18n.c:160 +msgid "_Ending Balance" +msgstr "" + +#: messages-i18n.c:161 +msgid "_Ending Balance..." +msgstr "" + +#: messages-i18n.c:162 +msgid "_Finish" +msgstr "" + +#: messages-i18n.c:163 +msgid "_Help" +msgstr "" + +#: messages-i18n.c:164 +msgid "_Jump" +msgstr "" + +#: messages-i18n.c:165 +msgid "_Manual" +msgstr "" + +#: messages-i18n.c:166 +msgid "_New" +msgstr "" + +#: messages-i18n.c:167 +msgid "_New Account" +msgstr "" + +#: messages-i18n.c:168 +msgid "_New Account..." +msgstr "" + +#: messages-i18n.c:169 +msgid "_Open Account" +msgstr "" + +#: messages-i18n.c:170 +msgid "Open S_ubaccounts" +msgstr "" + +#: messages-i18n.c:171 +msgid "Paste Transaction" +msgstr "" + +#: messages-i18n.c:172 +msgid "_Preferences" +msgstr "" + +#: messages-i18n.c:173 +msgid "_Preferences..." +msgstr "" + +#: messages-i18n.c:174 +msgid "_Print Check... (unfinished!)" +msgstr "" + +#: messages-i18n.c:175 +msgid "_Reconcile Information..." +msgstr "" + +#: messages-i18n.c:176 +msgid "_Reconcile..." +msgstr "" + +#: messages-i18n.c:177 +msgid "_Reconcile" +msgstr "" + +#: messages-i18n.c:178 +msgid "_Record" +msgstr "" + +#: messages-i18n.c:179 +msgid "_Register" +msgstr "" + +#: messages-i18n.c:180 +msgid "_Scrub" +msgstr "" + +#: messages-i18n.c:181 +msgid "Scrub A_ccount" +msgstr "" + +#: messages-i18n.c:182 +msgid "Scrub A_ll" +msgstr "" + +#: messages-i18n.c:183 +msgid "Scrub Su_baccounts" +msgstr "" + +#: messages-i18n.c:184 +msgid "Set _Range..." +msgstr "" + +#: messages-i18n.c:185 +msgid "Set _Range" +msgstr "" + +#: messages-i18n.c:186 +msgid "Show _All" +msgstr "" + +#: messages-i18n.c:187 +msgid "Sort _Order" +msgstr "" + +#: messages-i18n.c:188 +msgid "_Style" +msgstr "" + +#: messages-i18n.c:189 +msgid "_Transaction" +msgstr "" + +#: messages-i18n.c:190 +msgid "_Transfer" +msgstr "" + +#: messages-i18n.c:191 +msgid "_Transfer..." +msgstr "" + +#: messages-i18n.c:192 +msgid "Account Code" +msgstr "" + +#: messages-i18n.c:193 po/guile_strings.txt:7 +msgid "Account Name" +msgstr "" + +#: messages-i18n.c:194 +msgid "Account Type" +msgstr "" + +#: messages-i18n.c:195 +msgid "Adjust Balance" +msgstr "" + +#: messages-i18n.c:196 po/guile_strings.txt:310 +msgid "Auto Double" +msgstr "" + +#: messages-i18n.c:197 po/guile_strings.txt:70 +msgid "Auto Single" +msgstr "" + +#: messages-i18n.c:198 +msgid "Clear All" +msgstr "" + +#: messages-i18n.c:199 +msgid "Close Window" +msgstr "" + +#: messages-i18n.c:200 +msgid "Credit Card" +msgstr "" + +#: messages-i18n.c:201 +msgid "Credit Line" +msgstr "" + +#: messages-i18n.c:202 +msgid "Date Range" +msgstr "" + +#: messages-i18n.c:203 +msgid "Delete Account" +msgstr "" + +#: messages-i18n.c:204 +msgid "Delete Transaction" +msgstr "" + +#: messages-i18n.c:205 po/guile_strings.txt:22 +msgid "Double Line" +msgstr "" + +#: messages-i18n.c:206 +msgid "Edit Account" +msgstr "" + +#: messages-i18n.c:207 +msgid "Ending Balance" +msgstr "" + +#: messages-i18n.c:208 +msgid "End date" +msgstr "" + +#: messages-i18n.c:209 +msgid "Export To" +msgstr "" + +#: messages-i18n.c:210 +msgid "Finish" +msgstr "" + +#: messages-i18n.c:211 +msgid "From Now" +msgstr "" + +#: messages-i18n.c:212 +msgid "General Ledger" +msgstr "" + +#: messages-i18n.c:213 +msgid "Hide Inc/Exp" +msgstr "" + +#: messages-i18n.c:214 +msgid "Import QIF..." +msgstr "" + +#: messages-i18n.c:215 +msgid "Import QIF" +msgstr "" + +#: messages-i18n.c:216 +msgid "Lost Accounts" +msgstr "" + +#: messages-i18n.c:217 +msgid "Money Market" +msgstr "" + +#: messages-i18n.c:218 po/guile_strings.txt:58 +msgid "Multi Line" +msgstr "" + +#: messages-i18n.c:219 po/guile_strings.txt:4 +msgid "Mutual Fund" +msgstr "" + +#: messages-i18n.c:220 +msgid "New Account" +msgstr "" + +#: messages-i18n.c:221 +msgid "New Balance" +msgstr "" + +#: messages-i18n.c:222 +msgid "New File" +msgstr "" + +#: messages-i18n.c:223 +msgid "New top level account" +msgstr "" + +#: messages-i18n.c:224 +msgid "New Value" +msgstr "" + +#: messages-i18n.c:225 +msgid "No description" +msgstr "" + +#: messages-i18n.c:226 +msgid "Old Value" +msgstr "" + +#: messages-i18n.c:227 +msgid "Open Account" +msgstr "" + +#: messages-i18n.c:228 +msgid "Opening Balance" +msgstr "" + +#: messages-i18n.c:229 +msgid "Open File" +msgstr "" + +#: messages-i18n.c:230 +msgid "Open Subaccounts" +msgstr "" + +#: messages-i18n.c:231 +msgid "Pick One" +msgstr "" + +#: messages-i18n.c:232 +msgid "Parent Account" +msgstr "" + +#: messages-i18n.c:233 +msgid "Previous Balance" +msgstr "" + +#: messages-i18n.c:234 +msgid "Purch Price" +msgstr "" + +#: messages-i18n.c:235 +msgid "Price Quote Source" +msgstr "" + +#: messages-i18n.c:236 +msgid "Reconciled Balance" +msgstr "" + +#: messages-i18n.c:237 +msgid "Reconcile Information" +msgstr "" + +#: messages-i18n.c:238 +msgid "Register date ranges" +msgstr "" + +#: messages-i18n.c:239 +msgid "Sale Price" +msgstr "" + +#: messages-i18n.c:240 +msgid "Save As" +msgstr "" + +#: messages-i18n.c:241 +msgid "Scrub Account" +msgstr "" + +#: messages-i18n.c:242 +msgid "Scrub All" +msgstr "" + +#: messages-i18n.c:243 +msgid "Scrub Subaccounts" +msgstr "" + +#: messages-i18n.c:244 +msgid "Select All" +msgstr "" + +#: messages-i18n.c:245 +msgid "Select Default" +msgstr "" + +#: messages-i18n.c:246 +msgid "Set Date Range" +msgstr "" + +#: messages-i18n.c:247 +msgid "Set Range" +msgstr "" + +#: messages-i18n.c:248 +msgid "Set to default" +msgstr "" + +#: messages-i18n.c:249 +msgid "Set Up Account" +msgstr "" + +#: messages-i18n.c:250 +msgid "Show All" +msgstr "" + +#: messages-i18n.c:251 +msgid "Show Inc/Exp" +msgstr "" + +#: messages-i18n.c:252 +msgid "Show Categories" +msgstr "" + +#: messages-i18n.c:253 +msgid "Show Earliest" +msgstr "" + +#: messages-i18n.c:254 +msgid "Show Latest" +msgstr "" + +#: messages-i18n.c:255 po/guile_strings.txt:190 +msgid "Single Line" +msgstr "" + #: messages-i18n.c:259 -msgid "Sort by statement date" -msgstr "" - -#: messages-i18n.c:260 -msgid "Sort Order" -msgstr "" - -#: messages-i18n.c:261 -msgid "Start date" +msgid "Sort by date of entry" msgstr "" #: messages-i18n.c:262 -msgid "Starting Balance" +msgid "Sort by statement date" msgstr "" #: messages-i18n.c:263 -msgid "Standard order" +msgid "Sort Order" msgstr "" #: messages-i18n.c:264 -msgid "Statement Date:" +msgid "Start date" msgstr "" #: messages-i18n.c:265 -msgid "Top level account" +msgid "Starting Balance" msgstr "" #: messages-i18n.c:266 -msgid "Total Shares" +msgid "Standard order" msgstr "" #: messages-i18n.c:267 -msgid "Verify Changes" +msgid "Statement Date:" msgstr "" #: messages-i18n.c:268 -msgid "Transfer Information" +msgid "Top level account" msgstr "" #: messages-i18n.c:269 -msgid "Transfer Money" +msgid "Total Shares" msgstr "" #: messages-i18n.c:270 -msgid "Transfer From" +msgid "Verify Changes" msgstr "" #: messages-i18n.c:271 -msgid "Transfer To" +msgid "Transfer Information" msgstr "" #: messages-i18n.c:272 -msgid "About" +msgid "Transfer Money" msgstr "" -#: messages-i18n.c:273 po/guile_strings.txt:64 -#: src/gnome/glade-gnc-dialogs.c:1844 -msgid "Account" +#: messages-i18n.c:273 +msgid "Transfer From" msgstr "" -#: messages-i18n.c:274 src/gnome/glade-gnc-dialogs.c:369 -#: src/gnome/glade-gnc-dialogs.c:529 -msgid "Accounts" +#: messages-i18n.c:274 +msgid "Transfer To" msgstr "" #: messages-i18n.c:275 -msgid "Account Information" +msgid "About" msgstr "" -#: messages-i18n.c:276 -msgid "AutoDep" +#: messages-i18n.c:276 po/guile_strings.txt:64 +#: src/gnome/glade-gnc-dialogs.c:1777 +msgid "Account" msgstr "" -#: messages-i18n.c:277 src/gnome/glade-gnc-dialogs.c:2458 -msgid "Action" +#: messages-i18n.c:277 src/gnome/glade-gnc-dialogs.c:302 +#: src/gnome/glade-gnc-dialogs.c:462 +msgid "Accounts" msgstr "" #: messages-i18n.c:278 -msgid "Activities" +msgid "Account Information" msgstr "" #: messages-i18n.c:279 -msgid "Ago" +msgid "AutoDep" msgstr "" -#: messages-i18n.c:280 po/guile_strings.txt:57 -#: src/gnome/glade-gnc-dialogs.c:2198 -msgid "Amount" +#: messages-i18n.c:280 src/gnome/glade-gnc-dialogs.c:2391 +msgid "Action" msgstr "" -#: messages-i18n.c:281 po/guile_strings.txt:239 -msgid "Appreciation" +#: messages-i18n.c:281 +msgid "Activities" msgstr "" #: messages-i18n.c:282 -msgid "Phone" +msgid "Ago" msgstr "" -#: messages-i18n.c:283 po/guile_strings.txt:173 -#: src/gnome/glade-gnc-dialogs.c:634 -msgid "Asset" +#: messages-i18n.c:283 po/guile_strings.txt:57 +#: src/gnome/glade-gnc-dialogs.c:2131 +msgid "Amount" msgstr "" -#: messages-i18n.c:284 -msgid "Assets" +#: messages-i18n.c:284 po/guile_strings.txt:239 +msgid "Appreciation" msgstr "" #: messages-i18n.c:285 +msgid "Phone" +msgstr "" + +#: messages-i18n.c:286 po/guile_strings.txt:173 +#: src/gnome/glade-gnc-dialogs.c:567 +msgid "Asset" +msgstr "" + +#: messages-i18n.c:287 +msgid "Assets" +msgstr "" + +#: messages-i18n.c:288 msgid "ATM" msgstr "" -#: messages-i18n.c:286 +#: messages-i18n.c:289 msgid "Back" msgstr "" -#: messages-i18n.c:287 messages-i18n.c:288 po/guile_strings.txt:13 +#: messages-i18n.c:290 messages-i18n.c:291 po/guile_strings.txt:13 msgid "Balance" msgstr "" -#: messages-i18n.c:289 po/guile_strings.txt:107 -#: src/gnome/glade-gnc-dialogs.c:628 +#: messages-i18n.c:292 po/guile_strings.txt:107 +#: src/gnome/glade-gnc-dialogs.c:561 msgid "Bank" msgstr "" -#: messages-i18n.c:290 +#: messages-i18n.c:293 msgid "Blank" msgstr "" -#: messages-i18n.c:291 po/guile_strings.txt:123 +#: messages-i18n.c:294 po/guile_strings.txt:123 msgid "Bought" msgstr "" -#: messages-i18n.c:292 +#: messages-i18n.c:295 msgid "Buy" msgstr "" -#: messages-i18n.c:293 +#: messages-i18n.c:296 msgid "Cancel" msgstr "" -#: messages-i18n.c:294 po/guile_strings.txt:136 -#: src/gnome/glade-gnc-dialogs.c:631 +#: messages-i18n.c:297 po/guile_strings.txt:136 +#: src/gnome/glade-gnc-dialogs.c:564 msgid "Cash" msgstr "" -#: messages-i18n.c:295 +#: messages-i18n.c:298 msgid "Changed" msgstr "" -#: messages-i18n.c:296 po/guile_strings.txt:205 +#: messages-i18n.c:299 po/guile_strings.txt:205 msgid "Charge" msgstr "" -#: messages-i18n.c:297 +#: messages-i18n.c:300 msgid "Check" msgstr "" -#: messages-i18n.c:298 +#: messages-i18n.c:301 msgid "Checking" msgstr "" -#: messages-i18n.c:299 +#: messages-i18n.c:302 msgid "Cleared" msgstr "" -#: messages-i18n.c:300 +#: messages-i18n.c:303 msgid "Close" msgstr "" -#: messages-i18n.c:301 +#: messages-i18n.c:304 msgid "Commit" msgstr "" -#: messages-i18n.c:302 +#: messages-i18n.c:305 msgid "Create" msgstr "" -#: messages-i18n.c:303 po/guile_strings.txt:254 -#: src/gnome/glade-gnc-dialogs.c:637 src/gnome/glade-gnc-dialogs.c:2142 +#: messages-i18n.c:306 po/guile_strings.txt:254 +#: src/gnome/glade-gnc-dialogs.c:570 src/gnome/glade-gnc-dialogs.c:2075 msgid "Credit" msgstr "" -#: messages-i18n.c:304 +#: messages-i18n.c:307 msgid "Credits" msgstr "" -#: messages-i18n.c:305 po/guile_strings.txt:133 -#: src/gnome/glade-gnc-dialogs.c:649 +#: messages-i18n.c:308 po/guile_strings.txt:133 +#: src/gnome/glade-gnc-dialogs.c:582 msgid "Currency" msgstr "" -#: messages-i18n.c:306 po/guile_strings.txt:6 -#: src/gnome/glade-gnc-dialogs.c:1980 +#: messages-i18n.c:309 po/guile_strings.txt:6 +#: src/gnome/glade-gnc-dialogs.c:1913 msgid "Date" msgstr "" -#: messages-i18n.c:307 +#: messages-i18n.c:310 msgid "Days" msgstr "" -#: messages-i18n.c:308 po/guile_strings.txt:38 -#: src/gnome/glade-gnc-dialogs.c:2145 +#: messages-i18n.c:311 po/guile_strings.txt:38 +#: src/gnome/glade-gnc-dialogs.c:2078 msgid "Debit" msgstr "" -#: messages-i18n.c:309 +#: messages-i18n.c:312 msgid "Debits" msgstr "" -#: messages-i18n.c:310 +#: messages-i18n.c:313 msgid "Decrease" msgstr "" -#: messages-i18n.c:311 +#: messages-i18n.c:314 msgid "Deficit" msgstr "" -#: messages-i18n.c:312 src/gnome/glade-gnc-dialogs.c:2877 +#: messages-i18n.c:315 src/gnome/glade-gnc-dialogs.c:2810 msgid "Delete" msgstr "" -#: messages-i18n.c:313 po/guile_strings.txt:200 +#: messages-i18n.c:316 po/guile_strings.txt:200 msgid "Deposit" msgstr "" -#: messages-i18n.c:314 po/guile_strings.txt:159 +#: messages-i18n.c:317 po/guile_strings.txt:159 msgid "Depreciation" msgstr "" -#: messages-i18n.c:315 po/guile_strings.txt:152 -#: src/gnome/glade-gnc-dialogs.c:2038 +#: messages-i18n.c:318 po/guile_strings.txt:152 +#: src/gnome/glade-gnc-dialogs.c:1971 msgid "Description" msgstr "" -#: messages-i18n.c:316 +#: messages-i18n.c:319 msgid "Difference" msgstr "" -#: messages-i18n.c:317 +#: messages-i18n.c:320 msgid "Direct Debit" msgstr "" -#: messages-i18n.c:318 +#: messages-i18n.c:321 msgid "Dist" msgstr "" -#: messages-i18n.c:319 +#: messages-i18n.c:322 msgid "Div" msgstr "" -#: messages-i18n.c:320 +#: messages-i18n.c:323 msgid "Duplicate" msgstr "" -#: messages-i18n.c:321 +#: messages-i18n.c:324 msgid "Edit" msgstr "" -#: messages-i18n.c:322 po/guile_strings.txt:8 -#: src/gnome/glade-gnc-dialogs.c:658 +#: messages-i18n.c:325 po/guile_strings.txt:8 +#: src/gnome/glade-gnc-dialogs.c:591 msgid "Equity" msgstr "" -#: messages-i18n.c:323 +#: messages-i18n.c:326 msgid "Exit" msgstr "" -#: messages-i18n.c:324 po/guile_strings.txt:327 -#: src/gnome/glade-gnc-dialogs.c:655 +#: messages-i18n.c:327 po/guile_strings.txt:327 +#: src/gnome/glade-gnc-dialogs.c:588 msgid "Expense" msgstr "" -#: messages-i18n.c:325 +#: messages-i18n.c:328 msgid "Export" msgstr "" -#: messages-i18n.c:326 po/guile_strings.txt:356 +#: messages-i18n.c:329 po/guile_strings.txt:356 msgid "Extensions" msgstr "" -#: messages-i18n.c:327 +#: messages-i18n.c:330 msgid "Fee" msgstr "" -#: messages-i18n.c:328 +#: messages-i18n.c:331 msgid "Field" msgstr "" -#: messages-i18n.c:329 +#: messages-i18n.c:332 msgid "File" msgstr "" -#: messages-i18n.c:330 src/gnome/glade-gnc-dialogs.c:2532 +#: messages-i18n.c:333 src/gnome/glade-gnc-dialogs.c:2465 msgid "Find" msgstr "" -#: messages-i18n.c:331 +#: messages-i18n.c:334 msgid "Forward" msgstr "" -#: messages-i18n.c:332 po/guile_strings.txt:125 +#: messages-i18n.c:335 po/guile_strings.txt:125 msgid "From" msgstr "" -#: messages-i18n.c:333 +#: messages-i18n.c:336 msgid "GnuCash Preferences" msgstr "" -#: messages-i18n.c:334 +#: messages-i18n.c:337 msgid "Help" msgstr "" -#: messages-i18n.c:335 +#: messages-i18n.c:338 msgid "Imbalance" msgstr "" -#: messages-i18n.c:336 +#: messages-i18n.c:339 msgid "Import" msgstr "" -#: messages-i18n.c:337 po/guile_strings.txt:244 -#: src/gnome/glade-gnc-dialogs.c:652 +#: messages-i18n.c:340 po/guile_strings.txt:244 +#: src/gnome/glade-gnc-dialogs.c:585 msgid "Income" msgstr "" -#: messages-i18n.c:338 +#: messages-i18n.c:341 msgid "Increase" msgstr "" -#: messages-i18n.c:339 +#: messages-i18n.c:342 msgid "Int" msgstr "" -#: messages-i18n.c:340 +#: messages-i18n.c:343 msgid "Jump" msgstr "" -#: messages-i18n.c:341 po/guile_strings.txt:194 -#: src/gnome/glade-gnc-dialogs.c:640 +#: messages-i18n.c:344 po/guile_strings.txt:194 +#: src/gnome/glade-gnc-dialogs.c:573 msgid "Liability" msgstr "" -#: messages-i18n.c:342 +#: messages-i18n.c:345 msgid "License" msgstr "" -#: messages-i18n.c:343 +#: messages-i18n.c:346 msgid "Loan" msgstr "" -#: messages-i18n.c:344 +#: messages-i18n.c:347 msgid "LTCG" msgstr "" -#: messages-i18n.c:345 po/guile_strings.txt:32 -#: src/gnome/glade-gnc-dialogs.c:2256 +#: messages-i18n.c:348 po/guile_strings.txt:32 +#: src/gnome/glade-gnc-dialogs.c:2189 msgid "Memo" msgstr "" -#: messages-i18n.c:346 +#: messages-i18n.c:349 msgid "Months" msgstr "" -#: messages-i18n.c:347 +#: messages-i18n.c:350 msgid "New" msgstr "" -#: messages-i18n.c:348 +#: messages-i18n.c:351 msgid "No" msgstr "" -#: messages-i18n.c:349 src/gnome/print-session.c:111 +#: messages-i18n.c:352 src/gnome/print-session.c:111 #: src/gnome/print-session.c:200 msgid "(none)" msgstr "" -#: messages-i18n.c:350 po/guile_strings.txt:209 +#: messages-i18n.c:353 po/guile_strings.txt:209 msgid "Notes" msgstr "" -#: messages-i18n.c:351 po/guile_strings.txt:175 +#: messages-i18n.c:354 po/guile_strings.txt:175 msgid "Num" msgstr "" -#: messages-i18n.c:352 +#: messages-i18n.c:355 msgid "Ok" msgstr "" -#: messages-i18n.c:353 +#: messages-i18n.c:356 msgid "Online" msgstr "" -#: messages-i18n.c:354 +#: messages-i18n.c:357 msgid "Open" msgstr "" -#: messages-i18n.c:355 +#: messages-i18n.c:358 msgid "Orphan" msgstr "" -#: messages-i18n.c:356 +#: messages-i18n.c:359 msgid "Parameters" msgstr "" -#: messages-i18n.c:357 po/guile_strings.txt:113 +#: messages-i18n.c:360 po/guile_strings.txt:113 msgid "Payment" msgstr "" -#: messages-i18n.c:358 +#: messages-i18n.c:361 msgid "Portfolio" msgstr "" -#: messages-i18n.c:359 +#: messages-i18n.c:362 msgid "POS" msgstr "" -#: messages-i18n.c:360 +#: messages-i18n.c:363 msgid "Preferences" msgstr "" -#: messages-i18n.c:361 src/gnome/glade-gnc-dialogs.c:2400 +#: messages-i18n.c:364 src/gnome/glade-gnc-dialogs.c:2333 msgid "Price" msgstr "" -#: messages-i18n.c:362 src/gnome/glade-gnc-dialogs.c:1004 +#: messages-i18n.c:365 src/gnome/glade-gnc-dialogs.c:937 msgid "Print" msgstr "" -#: messages-i18n.c:363 +#: messages-i18n.c:366 msgid "Profits" msgstr "" -#: messages-i18n.c:364 +#: messages-i18n.c:367 msgid "Quit" msgstr "" -#: messages-i18n.c:365 po/guile_strings.txt:18 +#: messages-i18n.c:368 po/guile_strings.txt:18 msgid "Rebate" msgstr "" -#: messages-i18n.c:366 po/guile_strings.txt:191 +#: messages-i18n.c:369 po/guile_strings.txt:191 msgid "Receive" msgstr "" -#: messages-i18n.c:367 +#: messages-i18n.c:370 msgid "Reconcile" msgstr "" -#: messages-i18n.c:368 +#: messages-i18n.c:371 msgid "Record" msgstr "" -#: messages-i18n.c:369 po/guile_strings.txt:215 +#: messages-i18n.c:372 po/guile_strings.txt:215 msgid "Register" msgstr "" -#: messages-i18n.c:370 po/guile_strings.txt:208 +#: messages-i18n.c:373 po/guile_strings.txt:208 msgid "Report" msgstr "" -#: messages-i18n.c:371 +#: messages-i18n.c:374 msgid "Reports" msgstr "" -#: messages-i18n.c:372 +#: messages-i18n.c:375 msgid "Save" msgstr "" -#: messages-i18n.c:373 +#: messages-i18n.c:376 msgid "Savings" msgstr "" -#: messages-i18n.c:374 +#: messages-i18n.c:377 msgid "Scrub" msgstr "" -#: messages-i18n.c:375 +#: messages-i18n.c:378 msgid "Search Results" msgstr "" -#: messages-i18n.c:376 po/guile_strings.txt:189 +#: messages-i18n.c:379 po/guile_strings.txt:189 msgid "Security" msgstr "" -#: messages-i18n.c:377 +#: messages-i18n.c:380 msgid "Sell" msgstr "" -#: messages-i18n.c:378 +#: messages-i18n.c:381 msgid "Settings" msgstr "" -#: messages-i18n.c:379 +#: messages-i18n.c:382 msgid "Simple" msgstr "" -#: messages-i18n.c:380 po/guile_strings.txt:313 +#: messages-i18n.c:383 po/guile_strings.txt:313 msgid "Sold" msgstr "" -#: messages-i18n.c:381 po/guile_strings.txt:51 +#: messages-i18n.c:384 po/guile_strings.txt:51 msgid "Spend" msgstr "" -#: messages-i18n.c:382 +#: messages-i18n.c:385 msgid "Split" msgstr "" -#: messages-i18n.c:383 +#: messages-i18n.c:386 msgid "STCG" msgstr "" -#: messages-i18n.c:384 po/guile_strings.txt:354 -#: src/gnome/glade-gnc-dialogs.c:643 +#: messages-i18n.c:387 po/guile_strings.txt:354 +#: src/gnome/glade-gnc-dialogs.c:576 msgid "Stock" msgstr "" -#: messages-i18n.c:385 po/guile_strings.txt:246 +#: messages-i18n.c:388 po/guile_strings.txt:246 msgid "Style" msgstr "" -#: messages-i18n.c:386 +#: messages-i18n.c:389 msgid "Surplus" msgstr "" -#: messages-i18n.c:387 +#: messages-i18n.c:390 msgid "Teller" msgstr "" -#: messages-i18n.c:388 po/guile_strings.txt:302 +#: messages-i18n.c:391 po/guile_strings.txt:302 msgid "To" msgstr "" -#: messages-i18n.c:389 src/gnome/glade-gnc-dialogs.c:2624 +#: messages-i18n.c:392 src/gnome/glade-gnc-dialogs.c:2557 msgid "Today" msgstr "" -#: messages-i18n.c:390 messages-i18n.c:391 po/guile_strings.txt:207 +#: messages-i18n.c:393 messages-i18n.c:394 po/guile_strings.txt:207 msgid "Total" msgstr "" -#: messages-i18n.c:392 po/guile_strings.txt:304 -#: src/gnome/glade-gnc-dialogs.c:362 src/gnome/glade-gnc-dialogs.c:416 +#: messages-i18n.c:395 po/guile_strings.txt:304 +#: src/gnome/glade-gnc-dialogs.c:295 src/gnome/glade-gnc-dialogs.c:349 msgid "Type" msgstr "" -#: messages-i18n.c:393 +#: messages-i18n.c:396 msgid "Transaction" msgstr "" -#: messages-i18n.c:394 +#: messages-i18n.c:397 msgid "Transfer" msgstr "" -#: messages-i18n.c:395 po/guile_strings.txt:65 +#: messages-i18n.c:398 po/guile_strings.txt:65 msgid "Value" msgstr "" -#: messages-i18n.c:396 +#: messages-i18n.c:399 msgid "WARNING" msgstr "" -#: messages-i18n.c:397 +#: messages-i18n.c:400 msgid "Weeks" msgstr "" -#: messages-i18n.c:398 +#: messages-i18n.c:401 msgid "Wire" msgstr "" -#: messages-i18n.c:399 +#: messages-i18n.c:402 msgid "Withdraw" msgstr "" -#: messages-i18n.c:400 +#: messages-i18n.c:403 +msgid "Withdrawal" +msgstr "" + +#: messages-i18n.c:404 msgid "Years" msgstr "" -#: messages-i18n.c:401 +#: messages-i18n.c:405 msgid "Yes" msgstr "" @@ -2388,7 +2395,7 @@ msgstr "" msgid "Help for first option" msgstr "" -#: po/guile_strings.txt:203 src/gnome/glade-gnc-dialogs.c:2096 +#: po/guile_strings.txt:203 src/gnome/glade-gnc-dialogs.c:2029 msgid "Number" msgstr "" @@ -2647,8 +2654,8 @@ msgstr "" msgid "Plot Type" msgstr "" -#: po/guile_strings.txt:275 src/gnome/glade-gnc-dialogs.c:2733 -#: src/gnome/glade-gnc-dialogs.c:2741 +#: po/guile_strings.txt:275 src/gnome/glade-gnc-dialogs.c:2666 +#: src/gnome/glade-gnc-dialogs.c:2674 msgid "Budget" msgstr "" @@ -2716,7 +2723,7 @@ msgstr "" msgid "Report end date" msgstr "" -#: po/guile_strings.txt:292 src/gnome/glade-gnc-dialogs.c:1823 +#: po/guile_strings.txt:292 src/gnome/glade-gnc-dialogs.c:1756 msgid "None" msgstr "" @@ -2806,7 +2813,7 @@ msgstr "" msgid "Profit/Loss" msgstr "" -#: po/guile_strings.txt:318 src/gnome/glade-gnc-dialogs.c:2328 +#: po/guile_strings.txt:318 src/gnome/glade-gnc-dialogs.c:2261 msgid "Shares" msgstr "" @@ -2910,7 +2917,7 @@ msgstr "" msgid "Display" msgstr "" -#: po/guile_strings.txt:345 src/gnome/glade-gnc-dialogs.c:3123 +#: po/guile_strings.txt:345 src/gnome/glade-gnc-dialogs.c:3056 msgid "Nominal" msgstr "" @@ -2964,573 +2971,536 @@ msgstr "" msgid "All Accounts" msgstr "" -#: src/gnome/dialog-qif-import.c:224 +#: src/gnome/dialog-qif-import.c:190 msgid "Select QIF File" msgstr "" -#: src/gnome/dialog-qif-import.c:313 +#: src/gnome/dialog-qif-import.c:251 msgid "You must specify a file to load." msgstr "" -#: src/gnome/dialog-qif-import.c:317 +#: src/gnome/dialog-qif-import.c:255 msgid "You must specify a currency." msgstr "" -#: src/gnome/dialog-qif-import.c:331 src/gnome/dialog-qif-import.c:667 -#: src/gnome/dialog-qif-import.c:769 src/gnome/dialog-qif-import.c:867 +#: src/gnome/dialog-qif-import.c:270 src/gnome/dialog-qif-import.c:638 +#: src/gnome/dialog-qif-import.c:701 src/gnome/dialog-qif-import.c:799 msgid "QIF File scheme code not loaded properly." msgstr "" -#: src/gnome/dialog-qif-import.c:354 +#: src/gnome/dialog-qif-import.c:291 msgid "QIF File already loaded. Reload with current settings?" msgstr "" -#: src/gnome/dialog-qif-import.c:797 src/gnome/dialog-qif-import.c:895 +#: src/gnome/dialog-qif-import.c:729 src/gnome/dialog-qif-import.c:827 msgid "Something is very wrong with QIF Importing." msgstr "" -#: src/gnome/glade-gnc-dialogs.c:75 +#: src/gnome/glade-gnc-dialogs.c:68 msgid "Import QIF Files" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:97 +#: src/gnome/glade-gnc-dialogs.c:90 msgid "Loaded Files" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:128 +#: src/gnome/glade-gnc-dialogs.c:121 msgid "File Info" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:156 +#: src/gnome/glade-gnc-dialogs.c:149 msgid "QIF Filename:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:165 +#: src/gnome/glade-gnc-dialogs.c:158 msgid "Default QIF acct:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:174 +#: src/gnome/glade-gnc-dialogs.c:167 msgid "Currency:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:183 -msgid "Radix format:" -msgstr "" - -#: src/gnome/glade-gnc-dialogs.c:192 src/gnome/glade-gnc-dialogs.c:1239 -#: src/gnome/glade-gnc-dialogs.c:1409 -msgid "Date format:" -msgstr "" - -#: src/gnome/glade-gnc-dialogs.c:223 src/gnome/glade-gnc-dialogs.c:1921 -#: src/gnome/glade-gnc-dialogs.c:1973 +#: src/gnome/glade-gnc-dialogs.c:198 src/gnome/glade-gnc-dialogs.c:1854 +#: src/gnome/glade-gnc-dialogs.c:1906 msgid "Select ..." msgstr "" -#: src/gnome/glade-gnc-dialogs.c:244 +#: src/gnome/glade-gnc-dialogs.c:219 msgid "Auto" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:266 -msgid "Autodetect" -msgstr "" - -#: src/gnome/glade-gnc-dialogs.c:269 -msgid "Decimal (1,000.00)" -msgstr "" - -#: src/gnome/glade-gnc-dialogs.c:272 -msgid "Comma (1.000,00)" -msgstr "" - -#: src/gnome/glade-gnc-dialogs.c:284 -msgid "Autodetect " -msgstr "" - -#: src/gnome/glade-gnc-dialogs.c:287 -msgid "MM/DD/YYYY" -msgstr "" - -#: src/gnome/glade-gnc-dialogs.c:290 -msgid "DD/MM/YYYY" -msgstr "" - -#: src/gnome/glade-gnc-dialogs.c:293 -msgid "YYYY/MM/DD" -msgstr "" - -#: src/gnome/glade-gnc-dialogs.c:296 -msgid "YYYY/DD/MM" -msgstr "" - -#: src/gnome/glade-gnc-dialogs.c:308 +#: src/gnome/glade-gnc-dialogs.c:241 msgid "Load file" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:315 +#: src/gnome/glade-gnc-dialogs.c:248 msgid "Files" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:341 +#: src/gnome/glade-gnc-dialogs.c:274 msgid "QIF Account" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:348 src/gnome/glade-gnc-dialogs.c:402 +#: src/gnome/glade-gnc-dialogs.c:281 src/gnome/glade-gnc-dialogs.c:335 msgid "Transactions" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:355 src/gnome/glade-gnc-dialogs.c:409 +#: src/gnome/glade-gnc-dialogs.c:288 src/gnome/glade-gnc-dialogs.c:342 msgid "GNUCash Account Name" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:395 +#: src/gnome/glade-gnc-dialogs.c:328 msgid "QIF Category" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:423 +#: src/gnome/glade-gnc-dialogs.c:356 msgid "Categories" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:514 +#: src/gnome/glade-gnc-dialogs.c:447 msgid "Select Account" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:572 +#: src/gnome/glade-gnc-dialogs.c:505 msgid "Selected account:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:581 src/gnome/glade-gnc-dialogs.c:2940 -#: src/gnome/glade-gnc-dialogs.c:3027 +#: src/gnome/glade-gnc-dialogs.c:514 src/gnome/glade-gnc-dialogs.c:2873 +#: src/gnome/glade-gnc-dialogs.c:2960 msgid "Description:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:590 +#: src/gnome/glade-gnc-dialogs.c:523 msgid "Account type:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:646 +#: src/gnome/glade-gnc-dialogs.c:579 msgid "Mutual" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:711 src/gnome/glade-gnc-dialogs.c:719 +#: src/gnome/glade-gnc-dialogs.c:644 src/gnome/glade-gnc-dialogs.c:652 msgid "Print Preview" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:761 +#: src/gnome/glade-gnc-dialogs.c:694 msgid "Zoom in" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:769 +#: src/gnome/glade-gnc-dialogs.c:702 msgid "Zoom out" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:819 +#: src/gnome/glade-gnc-dialogs.c:752 msgid "Print Setup" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:841 +#: src/gnome/glade-gnc-dialogs.c:774 msgid "Printer:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:849 +#: src/gnome/glade-gnc-dialogs.c:782 msgid "Paper size:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:857 +#: src/gnome/glade-gnc-dialogs.c:790 msgid "Pages to print:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:902 src/gnome/glade-gnc-dialogs.c:1817 +#: src/gnome/glade-gnc-dialogs.c:835 src/gnome/glade-gnc-dialogs.c:1750 msgid "All" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:910 +#: src/gnome/glade-gnc-dialogs.c:843 msgid "Selected" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:932 +#: src/gnome/glade-gnc-dialogs.c:865 msgid "From:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:947 +#: src/gnome/glade-gnc-dialogs.c:880 msgid "To:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:969 src/gnome/glade-gnc-dialogs.c:976 +#: src/gnome/glade-gnc-dialogs.c:902 src/gnome/glade-gnc-dialogs.c:909 msgid "Select..." msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1012 +#: src/gnome/glade-gnc-dialogs.c:945 msgid "Preview" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1069 +#: src/gnome/glade-gnc-dialogs.c:1002 msgid "Select Paper Size" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1194 +#: src/gnome/glade-gnc-dialogs.c:1127 msgid "Print Check" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1223 +#: src/gnome/glade-gnc-dialogs.c:1156 msgid "Check format:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1231 src/gnome/glade-gnc-dialogs.c:1401 +#: src/gnome/glade-gnc-dialogs.c:1164 src/gnome/glade-gnc-dialogs.c:1334 msgid "Check position:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1261 +#: src/gnome/glade-gnc-dialogs.c:1172 src/gnome/glade-gnc-dialogs.c:1342 +msgid "Date format:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:1194 msgid "Quicken/QuickBooks (tm) US-Letter" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1264 src/gnome/glade-gnc-dialogs.c:1285 -#: src/gnome/glade-gnc-dialogs.c:1321 +#: src/gnome/glade-gnc-dialogs.c:1197 src/gnome/glade-gnc-dialogs.c:1218 +#: src/gnome/glade-gnc-dialogs.c:1254 msgid "Custom" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1276 +#: src/gnome/glade-gnc-dialogs.c:1209 msgid "Top" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1279 +#: src/gnome/glade-gnc-dialogs.c:1212 msgid "Middle" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1282 +#: src/gnome/glade-gnc-dialogs.c:1215 msgid "Bottom" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1297 +#: src/gnome/glade-gnc-dialogs.c:1230 msgid "December 31, 2000" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1300 +#: src/gnome/glade-gnc-dialogs.c:1233 msgid "31 December, 2000" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1303 +#: src/gnome/glade-gnc-dialogs.c:1236 msgid "Dec 31, 2000" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1306 +#: src/gnome/glade-gnc-dialogs.c:1239 msgid "31 Dec, 2000" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1309 +#: src/gnome/glade-gnc-dialogs.c:1242 msgid "12/31/2000" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1312 +#: src/gnome/glade-gnc-dialogs.c:1245 msgid "12/31/00" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1315 +#: src/gnome/glade-gnc-dialogs.c:1248 msgid "31/12/2000" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1318 +#: src/gnome/glade-gnc-dialogs.c:1251 msgid "31/12/00" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1326 +#: src/gnome/glade-gnc-dialogs.c:1259 msgid "Custom check parameters" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1361 +#: src/gnome/glade-gnc-dialogs.c:1294 msgid "Payee:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1369 +#: src/gnome/glade-gnc-dialogs.c:1302 msgid "Date:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1377 +#: src/gnome/glade-gnc-dialogs.c:1310 msgid "Amount (words):" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1385 +#: src/gnome/glade-gnc-dialogs.c:1318 msgid "Amount (numbers):" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1393 +#: src/gnome/glade-gnc-dialogs.c:1326 msgid "Memo:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1417 +#: src/gnome/glade-gnc-dialogs.c:1350 msgid "Units:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1432 +#: src/gnome/glade-gnc-dialogs.c:1365 msgid "x" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1509 +#: src/gnome/glade-gnc-dialogs.c:1442 msgid "Inches" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1512 +#: src/gnome/glade-gnc-dialogs.c:1445 msgid "Centimeters" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1515 +#: src/gnome/glade-gnc-dialogs.c:1448 msgid "Millimeters" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1518 +#: src/gnome/glade-gnc-dialogs.c:1451 msgid "Points" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1531 +#: src/gnome/glade-gnc-dialogs.c:1464 msgid "y" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1590 +#: src/gnome/glade-gnc-dialogs.c:1523 msgid " " msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1597 +#: src/gnome/glade-gnc-dialogs.c:1530 msgid " " msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1767 +#: src/gnome/glade-gnc-dialogs.c:1700 msgid "Find Transactions" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1782 +#: src/gnome/glade-gnc-dialogs.c:1715 msgid "Match Accounts" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1803 +#: src/gnome/glade-gnc-dialogs.c:1736 msgid "Find transactions affecting" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1820 +#: src/gnome/glade-gnc-dialogs.c:1753 msgid "Any" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1829 +#: src/gnome/glade-gnc-dialogs.c:1762 msgid "selected accounts:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1851 +#: src/gnome/glade-gnc-dialogs.c:1784 msgid "Match Date" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1866 +#: src/gnome/glade-gnc-dialogs.c:1799 msgid "Find transactions occurring between the dates:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1890 src/gnome/glade-gnc-dialogs.c:1906 -#: src/gnome/glade-gnc-dialogs.c:1943 src/gnome/glade-gnc-dialogs.c:1958 +#: src/gnome/glade-gnc-dialogs.c:1823 src/gnome/glade-gnc-dialogs.c:1839 +#: src/gnome/glade-gnc-dialogs.c:1876 src/gnome/glade-gnc-dialogs.c:1891 msgid "/" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:1987 src/gnome/glade-gnc-dialogs.c:2045 +#: src/gnome/glade-gnc-dialogs.c:1920 src/gnome/glade-gnc-dialogs.c:1978 msgid "Match Description" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2002 +#: src/gnome/glade-gnc-dialogs.c:1935 msgid "Find transactions whose Description matches:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2024 src/gnome/glade-gnc-dialogs.c:2082 -#: src/gnome/glade-gnc-dialogs.c:2242 src/gnome/glade-gnc-dialogs.c:2444 +#: src/gnome/glade-gnc-dialogs.c:1957 src/gnome/glade-gnc-dialogs.c:2015 +#: src/gnome/glade-gnc-dialogs.c:2175 src/gnome/glade-gnc-dialogs.c:2377 msgid "Case sensitive" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2031 src/gnome/glade-gnc-dialogs.c:2089 -#: src/gnome/glade-gnc-dialogs.c:2249 src/gnome/glade-gnc-dialogs.c:2451 +#: src/gnome/glade-gnc-dialogs.c:1964 src/gnome/glade-gnc-dialogs.c:2022 +#: src/gnome/glade-gnc-dialogs.c:2182 src/gnome/glade-gnc-dialogs.c:2384 msgid "Regular expression" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2060 +#: src/gnome/glade-gnc-dialogs.c:1993 msgid "Find transactions whose Number matches:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2103 +#: src/gnome/glade-gnc-dialogs.c:2036 msgid "Match Amount" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2125 +#: src/gnome/glade-gnc-dialogs.c:2058 msgid "Find " msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2139 +#: src/gnome/glade-gnc-dialogs.c:2072 msgid "Credit or Debit" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2150 +#: src/gnome/glade-gnc-dialogs.c:2083 msgid "splits having amounts of:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2171 src/gnome/glade-gnc-dialogs.c:2300 -#: src/gnome/glade-gnc-dialogs.c:2372 +#: src/gnome/glade-gnc-dialogs.c:2104 src/gnome/glade-gnc-dialogs.c:2233 +#: src/gnome/glade-gnc-dialogs.c:2305 msgid "At least" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2174 +#: src/gnome/glade-gnc-dialogs.c:2107 msgid "At most " msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2177 src/gnome/glade-gnc-dialogs.c:2306 -#: src/gnome/glade-gnc-dialogs.c:2378 +#: src/gnome/glade-gnc-dialogs.c:2110 src/gnome/glade-gnc-dialogs.c:2239 +#: src/gnome/glade-gnc-dialogs.c:2311 msgid "Exactly" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2205 +#: src/gnome/glade-gnc-dialogs.c:2138 msgid "Match Memo" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2220 +#: src/gnome/glade-gnc-dialogs.c:2153 msgid "Find splits whose Memo matches:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2263 +#: src/gnome/glade-gnc-dialogs.c:2196 msgid "Match number of shares" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2278 +#: src/gnome/glade-gnc-dialogs.c:2211 msgid "Find securities transactions of:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2303 src/gnome/glade-gnc-dialogs.c:2375 +#: src/gnome/glade-gnc-dialogs.c:2236 src/gnome/glade-gnc-dialogs.c:2308 msgid "At most" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2320 +#: src/gnome/glade-gnc-dialogs.c:2253 msgid "shares" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2335 +#: src/gnome/glade-gnc-dialogs.c:2268 msgid "Match share price" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2350 +#: src/gnome/glade-gnc-dialogs.c:2283 msgid "Find securities transactions with share price of:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2407 +#: src/gnome/glade-gnc-dialogs.c:2340 msgid "Match Action" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2422 +#: src/gnome/glade-gnc-dialogs.c:2355 msgid "Find transactions whose Action matches:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2479 +#: src/gnome/glade-gnc-dialogs.c:2412 msgid "Type of search" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2493 +#: src/gnome/glade-gnc-dialogs.c:2426 msgid "New search" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2501 +#: src/gnome/glade-gnc-dialogs.c:2434 msgid "Refine current search" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2509 +#: src/gnome/glade-gnc-dialogs.c:2442 msgid "Add results to current search" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2517 +#: src/gnome/glade-gnc-dialogs.c:2450 msgid "Delete results from current search" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2599 +#: src/gnome/glade-gnc-dialogs.c:2532 msgid "Select Date" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2765 +#: src/gnome/glade-gnc-dialogs.c:2698 msgid "Name:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2787 +#: src/gnome/glade-gnc-dialogs.c:2720 msgid "The name of this budget" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2796 +#: src/gnome/glade-gnc-dialogs.c:2729 msgid "Budget Entries" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2844 +#: src/gnome/glade-gnc-dialogs.c:2777 msgid "label773" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2868 +#: src/gnome/glade-gnc-dialogs.c:2801 msgid "Add" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2875 +#: src/gnome/glade-gnc-dialogs.c:2808 msgid "Add a new entry or subentry" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2884 +#: src/gnome/glade-gnc-dialogs.c:2817 msgid "Delete the selected entry or subentry" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2899 +#: src/gnome/glade-gnc-dialogs.c:2832 msgid "Move the selected item up" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2907 +#: src/gnome/glade-gnc-dialogs.c:2840 msgid "Move the selected item down" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2916 +#: src/gnome/glade-gnc-dialogs.c:2849 msgid "Entry" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2949 +#: src/gnome/glade-gnc-dialogs.c:2882 msgid "Type:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2988 +#: src/gnome/glade-gnc-dialogs.c:2921 msgid "Normal" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2991 +#: src/gnome/glade-gnc-dialogs.c:2924 msgid "No Total" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:2996 +#: src/gnome/glade-gnc-dialogs.c:2929 msgid "Matching Transactions..." msgstr "" -#: src/gnome/glade-gnc-dialogs.c:3003 +#: src/gnome/glade-gnc-dialogs.c:2936 msgid "Subentry" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:3036 +#: src/gnome/glade-gnc-dialogs.c:2969 msgid "Amount:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:3045 +#: src/gnome/glade-gnc-dialogs.c:2978 msgid "Period:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:3054 +#: src/gnome/glade-gnc-dialogs.c:2987 msgid "Mechanism:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:3063 +#: src/gnome/glade-gnc-dialogs.c:2996 msgid "Bill Day:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:3072 +#: src/gnome/glade-gnc-dialogs.c:3005 msgid "Grace Period:" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:3126 +#: src/gnome/glade-gnc-dialogs.c:3059 msgid "Bill" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:3129 +#: src/gnome/glade-gnc-dialogs.c:3062 msgid "Recurring" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:3132 +#: src/gnome/glade-gnc-dialogs.c:3065 msgid "Contingency" msgstr "" diff --git a/src/MultiLedger.c b/src/MultiLedger.c index 4f1b0f9a0c..50a5116a1e 100644 --- a/src/MultiLedger.c +++ b/src/MultiLedger.c @@ -666,10 +666,6 @@ xaccLedgerDisplayClose (xaccLedgerDisplay *regData) if (!regData) return; acc = regData->leader; - /* Save any unsaved changes */ - if (xaccSRSaveRegEntry (regData->ledger, NULL)) - xaccSRRedrawRegEntry (regData->ledger); - xaccDestroySplitRegister (regData->ledger); /* whether this is a single or multi-account window, remove it */ diff --git a/src/SplitLedger.c b/src/SplitLedger.c index 75cd83d0b8..ac3289577b 100644 --- a/src/SplitLedger.c +++ b/src/SplitLedger.c @@ -20,7 +20,7 @@ /* * FILE: - * SplitLedger.c + * SplitLedger.c * * FUNCTION: * copy transaction data from engine into split-register object. @@ -91,7 +91,9 @@ * * * HISTORY: - * Copyright (c) 1998-2000 Linas Vepstas */ + * Copyright (c) 1998-2000 Linas Vepstas + * Copyright (c) 2000 Dave Peticolas + */ #define _GNU_SOURCE @@ -115,16 +117,15 @@ #include "messages.h" #include "util.h" -#define BUFSIZE 1024 typedef struct _SRInfo SRInfo; struct _SRInfo { /* The blank split at the bottom of the register */ - Split * blank_split; + GUID blank_split_guid; /* The currently open transaction, if any */ - Transaction *pending_trans; + GUID pending_trans_guid; /* A transaction used to remember where to put the cursor */ Transaction *cursor_hint_trans; @@ -147,6 +148,9 @@ struct _SRInfo /* The last date recorded in the blank split */ time_t last_date_entered; + /* true if the current blank split has been edited and commited */ + gncBoolean blank_split_edited; + /* User data for users of SplitRegisters */ void *user_data; @@ -194,7 +198,9 @@ static CursorType copied_type = CURSOR_NONE; static SCM copied_item = SCM_UNDEFINED; static GUID copied_leader_guid; -/* static prototypes */ + +/** static prototypes *****************************************************/ + static Split * xaccSRGetTransSplit (SplitRegister *reg, int phys_row, int phys_col); static void xaccSRLoadRegEntry (SplitRegister *reg, Split *split); @@ -203,8 +209,12 @@ static gncBoolean xaccSRSaveRegEntryToSCM (SplitRegister *reg, static Transaction * xaccSRGetTrans (SplitRegister *reg, int phys_row, int phys_col); static Split * xaccSRGetCurrentTransSplit (SplitRegister *reg); +static GList * xaccSRSaveChangedCells (SplitRegister *reg, Transaction *trans, + Split *split); +/** implementations *******************************************************/ + /* The routines below create, access, and destroy the SRInfo structure * used by SplitLedger routines to store data for a particular register. * This is the only code that should access the user_data member of a @@ -376,7 +386,8 @@ gnc_copy_split_onto_split(Split *from, Split *to) /* Uses the scheme transaction copying routines */ static void -gnc_copy_trans_onto_trans(Transaction *from, Transaction *to) +gnc_copy_trans_onto_trans(Transaction *from, Transaction *to, + gncBoolean do_commit) { SCM trans_scm; @@ -387,26 +398,221 @@ gnc_copy_trans_onto_trans(Transaction *from, Transaction *to) if (trans_scm == SCM_UNDEFINED) return; - gnc_copy_trans_scm_onto_trans(trans_scm, to); + gnc_copy_trans_scm_onto_trans(trans_scm, to, do_commit); +} + +static Split * +gnc_find_split_in_trans_by_memo(Transaction *trans, const char *memo, + Transaction *dest_trans, gboolean unit_price) +{ + int num_splits = xaccTransCountSplits(trans); + int i; + + for (i = num_splits - 1; i >= 0; i--) + { + Split *split = xaccTransGetSplit(trans, i); + + if (unit_price && (xaccSplitGetSharePrice(split) != 1.0)) + continue; + + if (safe_strcmp(memo, xaccSplitGetMemo(split)) == 0) + { + Account *account = xaccSplitGetAccount(split); + const char *currency, *security; + + if (account == NULL) + return split; + + currency = xaccAccountGetCurrency(account); + if (xaccTransIsCommonCurrency(dest_trans, currency)) + return split; + + security = xaccAccountGetSecurity(account); + if (xaccTransIsCommonCurrency(dest_trans, security)) + return split; + } + } + + return NULL; +} + +/* This routine is for finding a matching split in an account or related + * accounts by matching on the memo field. This routine is used for auto- + * filling in registers with a default leading account. The dest_trans + * is a transaction used for currency checking. */ +static Split * +gnc_find_split_in_account_by_memo(Account *account, const char *memo, + Transaction *dest_trans, gboolean unit_price) +{ + Split **splits; + Split **orig; + + if (account == NULL) + return NULL; + + splits = xaccAccountGetSplitList(account); + if ((splits == NULL) || (*splits == NULL)) + return NULL; + + orig = splits; + + while (*splits != NULL) + splits++; + + do + { + Transaction *trans; + Split *split; + + splits--; + + trans = xaccSplitGetParent(*splits); + + split = gnc_find_split_in_trans_by_memo(trans, memo, dest_trans, + unit_price); + if (split != NULL) + return split; + + } while (splits != orig); + + return NULL; +} + +/* This routine is for finding a matching transaction in an account by + * matching on the description field. This routine is used for auto-filling + * in registers with a default leading account. The dest_trans is a + * transaction used for currency checking. */ +static Transaction * +gnc_find_trans_in_account_by_desc(Account *account, const char *description) +{ + Split **splits; + Split **orig; + + if (account == NULL) + return NULL; + + splits = xaccAccountGetSplitList(account); + if ((splits == NULL) || (*splits == NULL)) + return NULL; + + orig = splits; + + while (*splits != NULL) + splits++; + + do + { + Transaction *trans; + + splits--; + + trans = xaccSplitGetParent(*splits); + + if (safe_strcmp(description, xaccTransGetDescription(trans)) == 0) + return trans; + + } while (splits != orig); + + return NULL; +} + +static Split * +gnc_find_split_in_reg_by_memo(SplitRegister *reg, const char *memo, + Transaction *dest_tran, gboolean unit_price) +{ + Table *table; + int virt_row, virt_col; + int num_rows, num_cols; + Transaction *last_trans; + + if (reg == NULL) + return NULL; + + table = reg->table; + if (table == NULL) + return NULL; + + num_rows = table->num_virt_rows; + num_cols = table->num_virt_cols; + + last_trans = NULL; + + for (virt_row = num_rows - 1; virt_row >= 0; virt_row--) + for (virt_col = num_cols - 1; virt_col >= 0; virt_col--) + { + Split *split = table->user_data[virt_row][virt_col]; + Transaction *trans = xaccSplitGetParent(split); + + if (trans == last_trans) + continue; + + split = gnc_find_split_in_trans_by_memo(trans, memo, dest_tran, + unit_price); + if (split != NULL) + return split; + + last_trans = trans; + } + + return NULL; +} + +static Transaction * +gnc_find_trans_in_reg_by_desc(SplitRegister *reg, const char *description) +{ + Table *table; + int virt_row, virt_col; + int num_rows, num_cols; + Transaction *last_trans; + + if (reg == NULL) + return NULL; + + table = reg->table; + if (table == NULL) + return NULL; + + num_rows = table->num_virt_rows; + num_cols = table->num_virt_cols; + + last_trans = NULL; + + for (virt_row = num_rows - 1; virt_row >= 0; virt_row--) + for (virt_col = num_cols - 1; virt_col >= 0; virt_col--) + { + Split *split = table->user_data[virt_row][virt_col]; + Transaction *trans = xaccSplitGetParent(split); + + if (trans == last_trans) + continue; + + if (safe_strcmp(description, xaccTransGetDescription(trans)) == 0) + return trans; + + last_trans = trans; + } + + return NULL; } /* ======================================================== */ -/* this callback gets called when the user clicks on the gui +/* This callback gets called when the user clicks on the gui * in such a way as to leave the current virtual cursor, and * go to a new one. So, save the current transaction. * * This callback is centrally involved in the redraw sequence. - * When the user moves from one cell to another, the following + * When the user moves from one cell to another, causing a + * change in the current virtual cursor, the following * sequence of events get triggered and cascade down: - * VerifyCursorPosition() { - * MoveCursor() { + * xaccVerifyCursorPosition() { + * doMoveCursor() { * callback for move() which is this function (LedgerMoveCursor) { - * SaveRegEntry() {...} + * xaccSRSaveRegEntry() {...} * RedrawRegEntry() { * SRLoadRegister() { - * SRLoadRegEntry() { - * MoveCursor () { } - * } + * SRLoadRegEntry() + * xaccMoveCursor() + * ... * } * }}}} */ @@ -421,7 +627,7 @@ LedgerMoveCursor (Table *table, int new_phys_col = *p_new_phys_col; SplitRegister *reg = client_data; SRInfo *info = xaccSRGetInfo(reg); - Transaction *pending_trans; + Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid); Transaction *new_trans; Transaction *trans; Split *trans_split; @@ -462,24 +668,32 @@ LedgerMoveCursor (Table *table, } /* The cell offset we are moving to */ - locator = table->locators[new_phys_row][new_phys_col]; - new_cell_row = locator->phys_row_offset; - new_cell_col = locator->phys_col_offset; + if ((new_phys_row < 0) || (new_phys_col < 0) || + (new_phys_row >= table->num_phys_rows) || + (new_phys_col >= table->num_phys_cols)) + { + new_cell_row = 0; + new_cell_col = 0; + } + else + { + locator = table->locators[new_phys_row][new_phys_col]; + new_cell_row = locator->phys_row_offset; + new_cell_col = locator->phys_col_offset; + } /* commit the contents of the cursor into the database */ - saved = xaccSRSaveRegEntry (reg, new_trans); - if ((info->pending_trans != NULL) && - (info->pending_trans == trans) && + saved = xaccSRSaveRegEntry (reg, trans != new_trans); + if ((pending_trans != NULL) && + (pending_trans == trans) && (trans != new_trans)) { if (xaccTransIsOpen(trans)) xaccTransCommitEdit (trans); - info->pending_trans = NULL; + info->pending_trans_guid = *xaccGUIDNULL(); pending_trans = NULL; saved = GNC_T; } - else - pending_trans = info->pending_trans; /* redrawing the register can muck everything up */ if (saved) { @@ -487,13 +701,6 @@ LedgerMoveCursor (Table *table, xaccSRRedrawRegEntry (reg); - /* if the transaction is no longer in the register, - * we commit it now. This is a hack that can go away - * once we have transaction ids. */ - if ((pending_trans != info->pending_trans) && - xaccTransIsOpen(pending_trans)) - xaccTransCommitEdit (pending_trans); - /* if the split we were going to is still in the register, * then it may have moved. Find out where it is now. */ if (xaccSRGetTransSplitRowCol (reg, new_trans, trans_split, new_split, @@ -516,26 +723,26 @@ LedgerMoveCursor (Table *table, new_phys_row = table->current_cursor_phys_row + phys_row_offset; new_phys_col = table->current_cursor_phys_col + phys_col_offset; } - - /* just because I'm paranoid doesn't - * mean they're not out to get me! */ - if (new_phys_row < reg->num_header_rows) - new_phys_row = reg->num_header_rows; - else if (new_phys_row >= table->num_phys_rows) - new_phys_row = table->num_phys_rows - 1; - - if (new_phys_col < 0) - new_phys_col = 0; - else if (new_phys_col >= table->num_phys_cols) - new_phys_col = table->num_phys_cols - 1; - - gnc_table_find_valid_cell_horiz(table, &new_phys_row, - &new_phys_col, GNC_F); - - *p_new_phys_row = new_phys_row; - *p_new_phys_col = new_phys_col; } + /* just because I'm paranoid doesn't + * mean they're not out to get me! */ + if (new_phys_row < reg->num_header_rows) + new_phys_row = reg->num_header_rows; + else if (new_phys_row >= table->num_phys_rows) + new_phys_row = table->num_phys_rows - 1; + + if (new_phys_col < 0) + new_phys_col = 0; + else if (new_phys_col >= table->num_phys_cols) + new_phys_col = table->num_phys_cols - 1; + + gnc_table_find_valid_cell_horiz(table, &new_phys_row, + &new_phys_col, GNC_F); + + *p_new_phys_row = new_phys_row; + *p_new_phys_col = new_phys_col; + PINFO ("after redraw %d %d \n", new_phys_row, new_phys_col); @@ -588,6 +795,253 @@ LedgerMoveCursor (Table *table, info->hint_set_by_traverse = GNC_F; } +/* This function determines if auto-completion is appropriate and, + * if so, performs it. This should only be called by LedgerTraverse. */ +static void +LedgerAutoCompletion(SplitRegister *reg, gncTableTraversalDir dir, + int *p_new_phys_row, int *p_new_phys_col) +{ + SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); + Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid); + CursorType cursor_type; + unsigned int changed; + CellType cell_type; + Transaction *trans; + double amount; + Split *split; + int new_row; + int new_col; + + /* auto-completion is only triggered by a tab out */ + if (dir != GNC_TABLE_TRAVERSE_RIGHT) + return; + + split = xaccSRGetCurrentSplit(reg); + trans = xaccSRGetCurrentTrans(reg); + if (trans == NULL) + return; + + cursor_type = xaccSplitRegisterGetCursorType(reg); + cell_type = xaccSplitRegisterGetCellType(reg); + changed = xaccSplitRegisterGetChangeFlag(reg); + + switch (cursor_type) + { + case CURSOR_TRANS: { + Transaction *auto_trans; + GList *refresh_accounts; + char *desc; + + /* we must be on the blank split */ + if (split != blank_split) + return; + + /* and leaving the description cell */ + if (cell_type != DESC_CELL) + return; + + /* nothing but the date, num, and description should be changed */ + if ((changed & ~(MOD_DATE | MOD_NUM | MOD_DESC)) != 0) + return; + + /* and the description should be changed */ + if ((changed & MOD_DESC) == 0) + return; + + /* to a non-empty value */ + desc = reg->descCell->cell.value; + if ((desc == NULL) || (*desc == '\0')) + return; + + /* find a transaction to auto-complete on */ + if (info->default_source_account != NULL) + { + Account *account = info->default_source_account; + + auto_trans = gnc_find_trans_in_account_by_desc(account, desc); + } + else + auto_trans = gnc_find_trans_in_reg_by_desc(reg, desc); + + if (auto_trans == NULL) + return; + + gnc_copy_trans_onto_trans(auto_trans, trans, GNC_F); + + if (info->default_source_account != NULL) + { + int num_splits; + int i; + + blank_split = NULL; + + num_splits = xaccTransCountSplits(trans); + for (i = 0; i < num_splits; i++) + { + Split *s = xaccTransGetSplit(trans, i); + + if (info->default_source_account == xaccSplitGetAccount(s)) + { + blank_split = s; + info->blank_split_guid = *xaccSplitGetGUID(blank_split); + break; + } + } + + if (blank_split == NULL) + { + blank_split = xaccTransGetSplit(trans, 0); + info->blank_split_guid = *xaccSplitGetGUID(blank_split); + } + } + else + { + blank_split = xaccTransGetSplit(trans, 0); + info->blank_split_guid = *xaccSplitGetGUID(blank_split); + } + + if ((pending_trans != NULL) && (pending_trans != trans)) + if (xaccTransIsOpen(pending_trans)) + xaccTransCommitEdit(pending_trans); + + pending_trans = trans; + info->pending_trans_guid = *xaccTransGetGUID(pending_trans); + + info->blank_split_edited = GNC_T; + + refresh_accounts = xaccSRSaveChangedCells(reg, trans, blank_split); + + /* Refresh the GUI. */ + refresh_accounts = gnc_trans_prepend_account_list(trans, + refresh_accounts); + + gnc_account_glist_ui_refresh(refresh_accounts); + gnc_refresh_main_window(); + + g_list_free(refresh_accounts); + + /* now move to the non-empty amount column */ + amount = xaccSplitGetShareAmount (blank_split); + cell_type = (amount >= 0) ? DEBT_CELL : CRED_CELL; + + if (xaccSplitRegisterGetCellRowCol (reg, cell_type, &new_row, &new_col)) + { + *p_new_phys_row = new_row; + *p_new_phys_col = new_col; + } + } + + break; + + case CURSOR_SPLIT: { + SplitRegisterType typo = reg->type & REG_TYPE_MASK; + char *memo, *fullname; + gboolean unit_price; + Split *auto_split; + + /* we must be on a blank split of a transaction */ + if (split != NULL) + return; + + /* and leaving the memo cell */ + if (cell_type != MEMO_CELL) + return; + + /* nothing but the action and memo should be changed */ + if ((changed & ~(MOD_ACTN | MOD_MEMO)) != 0) + return; + + /* and the memo should be changed */ + if ((changed & MOD_MEMO) == 0) + return; + + /* to a non-empty value */ + memo = reg->memoCell->cell.value; + if ((memo == NULL) || (*memo == '\0')) + return; + + /* if there is no price field, only auto-complete from splits with + * a unit share price. */ + unit_price = !xaccSplitRegisterGetCellRowCol(reg, PRIC_CELL, NULL, NULL); + + /* find a split to auto-complete on */ + if (info->default_source_account != NULL) + { + Account *account = info->default_source_account; + + auto_split = gnc_find_split_in_account_by_memo(account, memo, trans, + unit_price); + } + else + auto_split = gnc_find_split_in_reg_by_memo(reg, memo, trans, + unit_price); + + if (auto_split == NULL) + return; + + /* the auto-complete code below is taken from xaccSRLoadRegEntry */ + + /* auto-complete the action field if it wasn't changed */ + if (!(MOD_ACTN & changed)) + xaccSetComboCellValue (reg->actionCell, + xaccSplitGetAction (auto_split)); + + /* auto-complete the account name */ + fullname = xaccAccountGetFullName (xaccSplitGetAccount (auto_split), + account_separator); + xaccSetComboCellValue (reg->xfrmCell, fullname); + xaccBasicCellSetChanged(&(reg->xfrmCell->cell), GNC_T); + + /* auto-complete the amounts */ + if ((EQUITY_REGISTER == typo) || + (STOCK_REGISTER == typo) || + (CURRENCY_REGISTER == typo) || + (PORTFOLIO_LEDGER == typo)) + amount = xaccSplitGetShareAmount (auto_split); + else + amount = xaccSplitGetValue (auto_split); + + xaccSetDebCredCellValue (reg->debitCell, reg->creditCell, amount); + xaccBasicCellSetChanged(&(reg->debitCell->cell), GNC_T); + xaccBasicCellSetChanged(&(reg->creditCell->cell), GNC_T); + + xaccSetDebCredCellValue (reg->ndebitCell, reg->ncreditCell, -amount); + xaccBasicCellSetChanged(&(reg->ndebitCell->cell), GNC_T); + xaccBasicCellSetChanged(&(reg->ncreditCell->cell), GNC_T); + + amount = xaccSplitGetSharePrice (auto_split); + xaccSetPriceCellValue (reg->priceCell, amount); + xaccBasicCellSetChanged(&(reg->priceCell->cell), GNC_T); + + amount = xaccSplitGetValue (auto_split); + xaccSetPriceCellValue (reg->valueCell, amount); + xaccBasicCellSetChanged(&(reg->valueCell->cell), GNC_T); + + /* copy cursor contents into the table */ + xaccCommitCursor (reg->table); + + /* and refresh the gui */ + xaccRefreshTableGUI (reg->table); + + /* now move to the non-empty amount column */ + amount = xaccSplitGetShareAmount (auto_split); + cell_type = (amount < 0) ? NDEBT_CELL : NCRED_CELL; + + if (xaccSplitRegisterGetCellRowCol (reg, cell_type, &new_row, &new_col)) + { + *p_new_phys_row = new_row; + *p_new_phys_col = new_col; + } + } + + break; + + default: + break; + } +} + /* ======================================================== */ /* This callback gets called when the user clicks on the gui * in such a way as to leave the current transaction, and to @@ -604,6 +1058,7 @@ LedgerTraverse (Table *table, { SplitRegister *reg = client_data; SRInfo *info = xaccSRGetInfo(reg); + Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid); Transaction *trans, *new_trans; int phys_row = *p_new_phys_row; int phys_col = *p_new_phys_col; @@ -617,12 +1072,28 @@ LedgerTraverse (Table *table, if (trans == NULL) return; - /* no changes, no worries */ + /* no changes, make sure we aren't going off the end */ changed = xaccSplitRegisterGetChangeFlag(reg); - if (!changed && (info->pending_trans != trans)) - return; + if (!changed && (pending_trans != trans)) + { + if (gnc_register_cell_valid(table, phys_row, phys_col, GNC_F)) + return; - /* Now see if we are changing cursors. If not, no problems */ + if (phys_row < reg->num_header_rows) + phys_row = reg->num_header_rows; + if (phys_row >= table->num_phys_rows) + phys_row = table->num_phys_rows - 1; + + gnc_table_find_valid_cell_horiz(table, &phys_row, &phys_col, GNC_F); + + *p_new_phys_row = phys_row; + *p_new_phys_col = phys_col; + + return; + } + + /* Now see if we are changing cursors. If not, we may be able to + * auto-complete. */ if ((phys_row >= 0) && (phys_col >= 0) && (phys_row < table->num_phys_rows) && (phys_col < table->num_phys_cols)) { @@ -631,14 +1102,12 @@ LedgerTraverse (Table *table, if ((virt_row == table->current_cursor_virt_row) && (virt_col == table->current_cursor_virt_col)) + { + LedgerAutoCompletion(reg, dir, p_new_phys_row, p_new_phys_col); return; + } } - /* Same transaction, no problem */ - new_trans = xaccSRGetTrans(reg, phys_row, phys_col); - if (trans == new_trans) - return; - if (changed && (split == NULL) && (dir == GNC_TABLE_TRAVERSE_RIGHT)) { /* If we are here, then: (a) the current cursor has been @@ -656,6 +1125,28 @@ LedgerTraverse (Table *table, return; } + /* Check for going off the end */ + if (phys_row < reg->num_header_rows) + { + phys_row = reg->num_header_rows; + gnc_table_find_valid_cell_horiz(table, &phys_row, &phys_col, GNC_F); + } + if (phys_row >= table->num_phys_rows) + { + phys_row = table->num_phys_rows - 1; + gnc_table_find_valid_cell_horiz(table, &phys_row, &phys_col, GNC_F); + } + + /* Same transaction, no problem */ + new_trans = xaccSRGetTrans(reg, phys_row, phys_col); + if (trans == new_trans) + { + *p_new_phys_row = phys_row; + *p_new_phys_col = phys_col; + + return; + } + /* Ok, we are changing transactions and the current transaction has * changed. See what the user wants to do. */ @@ -723,33 +1214,38 @@ static void LedgerDestroy (SplitRegister *reg) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); + Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid); Transaction *trans; /* be sure to destroy the "blank split" */ - if (info->blank_split) { + if (blank_split != NULL) { /* split destroy will automatically remove it * from its parent account */ - trans = xaccSplitGetParent (info->blank_split); + trans = xaccSplitGetParent (blank_split); /* Make sure we don't commit this below */ - if (trans == info->pending_trans) - info->pending_trans = NULL; + if (trans == pending_trans) + { + info->pending_trans_guid = *xaccGUIDNULL(); + pending_trans = NULL; + } xaccTransBeginEdit (trans, 1); xaccTransDestroy (trans); xaccTransCommitEdit (trans); - info->blank_split = NULL; + info->blank_split_guid = *xaccGUIDNULL(); + blank_split = NULL; } /* be sure to take care of any open transactions */ - if (info->pending_trans) { - /* Committing this should have been taken care of by - * xaccLedgerDisplayClose. But, we'll check again. */ - if (xaccTransIsOpen(info->pending_trans)) - xaccTransCommitEdit (info->pending_trans); + if (pending_trans != NULL) { + if (xaccTransIsOpen(pending_trans)) + xaccTransRollbackEdit (pending_trans); - info->pending_trans = NULL; + info->pending_trans_guid = *xaccGUIDNULL(); + pending_trans = NULL; } xaccSRDestroyRegisterData(reg); @@ -940,8 +1436,9 @@ Split * xaccSRGetBlankSplit (SplitRegister *reg) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); - return info->blank_split; + return blank_split; } /* ======================================================== */ @@ -989,7 +1486,6 @@ xaccSRGetTransSplitRowCol (SplitRegister *reg, Transaction *trans, Transaction *t; Split *s; - for (v_row = 1; v_row < table->num_virt_rows; v_row++) for (v_col = 0; v_col < table->num_virt_cols; v_col++) { @@ -1034,6 +1530,7 @@ Split * xaccSRDuplicateCurrent (SplitRegister *reg) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); CursorType cursor_type; unsigned int changed; Transaction *trans; @@ -1063,7 +1560,7 @@ xaccSRDuplicateCurrent (SplitRegister *reg) /* See if we were asked to duplicate an unchanged blank split. * There's no point in doing that! */ - if (!changed && ((split == NULL) || (split == info->blank_split))) + if (!changed && ((split == NULL) || (split == blank_split))) return NULL; /* If the cursor has been edited, we are going to have to commit @@ -1079,7 +1576,7 @@ xaccSRDuplicateCurrent (SplitRegister *reg) if (result == GNC_VERIFY_CANCEL) return NULL; - xaccSRSaveRegEntry(reg, NULL); + xaccSRSaveRegEntry(reg, GNC_T); /* If the split is NULL, then we were on a blank split row * in an expanded transaction. The new split (created by @@ -1127,7 +1624,7 @@ xaccSRDuplicateCurrent (SplitRegister *reg) new_trans = xaccMallocTransaction(); - gnc_copy_trans_onto_trans(trans, new_trans); + gnc_copy_trans_onto_trans(trans, new_trans, GNC_T); xaccTransBeginEdit(new_trans, GNC_T); xaccTransSetDateSecs(new_trans, info->last_date_entered); @@ -1158,6 +1655,7 @@ void xaccSRCopyCurrent (SplitRegister *reg) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); CursorType cursor_type; unsigned int changed; Transaction *trans; @@ -1184,7 +1682,7 @@ xaccSRCopyCurrent (SplitRegister *reg) changed = xaccSplitRegisterGetChangeFlag(reg); /* See if we were asked to copy an unchanged blank split. Don't. */ - if (!changed && ((split == NULL) || (split == info->blank_split))) + if (!changed && ((split == NULL) || (split == blank_split))) return; /* Ok, we are now ready to make the copy. */ @@ -1246,6 +1744,7 @@ void xaccSRCutCurrent (SplitRegister *reg) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); CursorType cursor_type; unsigned int changed; Transaction *trans; @@ -1271,7 +1770,7 @@ xaccSRCutCurrent (SplitRegister *reg) changed = xaccSplitRegisterGetChangeFlag(reg); /* See if we were asked to cut an unchanged blank split. Don't. */ - if (!changed && ((split == NULL) || (split == info->blank_split))) + if (!changed && ((split == NULL) || (split == blank_split))) return; xaccSRCopyCurrent(reg); @@ -1288,6 +1787,7 @@ void xaccSRPasteCurrent (SplitRegister *reg) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); GList *accounts = NULL; CursorType cursor_type; Transaction *trans; @@ -1345,8 +1845,11 @@ xaccSRPasteCurrent (SplitRegister *reg) accounts = gnc_trans_prepend_account_list(trans, NULL); /* in pasting, the old split is deleted. */ - if (split == info->blank_split) - info->blank_split = NULL; + if (split == blank_split) + { + info->blank_split_guid = *xaccGUIDNULL(); + blank_split = NULL; + } split_index = gnc_trans_split_index(trans, split); trans_split_index = gnc_trans_split_index(trans, trans_split); @@ -1357,10 +1860,10 @@ xaccSRPasteCurrent (SplitRegister *reg) new_guid = xaccAccountGetGUID(info->default_source_account); gnc_copy_trans_scm_onto_trans_swap_accounts(copied_item, trans, &copied_leader_guid, - new_guid); + new_guid, GNC_T); } else - gnc_copy_trans_scm_onto_trans(copied_item, trans); + gnc_copy_trans_scm_onto_trans(copied_item, trans, GNC_T); num_splits = xaccTransCountSplits(trans); if (split_index >= num_splits) @@ -1387,6 +1890,8 @@ void xaccSRDeleteCurrentSplit (SplitRegister *reg) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); + Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid); Transaction *trans; Account *account; GList *accounts; @@ -1400,7 +1905,7 @@ xaccSRDeleteCurrentSplit (SplitRegister *reg) /* If we are deleting the blank split, just cancel. The user is * allowed to delete the blank split as a method for discarding * any edits they may have made to it. */ - if (split == info->blank_split) + if (split == blank_split) { xaccSRCancelCursorSplitChanges(reg); return; @@ -1422,8 +1927,11 @@ xaccSRDeleteCurrentSplit (SplitRegister *reg) xaccTransCommitEdit(trans); /* Check pending transaction */ - if (trans == info->pending_trans) - info->pending_trans = NULL; + if (trans == pending_trans) + { + info->pending_trans_guid = *xaccGUIDNULL(); + pending_trans = NULL; + } gnc_account_glist_ui_refresh(accounts); @@ -1438,6 +1946,8 @@ void xaccSRDeleteCurrentTrans (SplitRegister *reg) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); + Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid); Transaction *trans; Account *account; GList *accounts; @@ -1451,20 +1961,24 @@ xaccSRDeleteCurrentTrans (SplitRegister *reg) /* If we just deleted the blank split, clean up. The user is * allowed to delete the blank split as a method for discarding * any edits they may have made to it. */ - if (split == info->blank_split) + if (split == blank_split) { - trans = xaccSplitGetParent (info->blank_split); + trans = xaccSplitGetParent (blank_split); account = xaccSplitGetAccount(split); /* Make sure we don't commit this later on */ - if (trans == info->pending_trans) - info->pending_trans = NULL; + if (trans == pending_trans) + { + info->pending_trans_guid = *xaccGUIDNULL(); + pending_trans = NULL; + } xaccTransBeginEdit (trans, 1); xaccTransDestroy (trans); xaccTransCommitEdit (trans); - info->blank_split = NULL; + info->blank_split_guid = *xaccGUIDNULL(); + blank_split = NULL; xaccAccountDisplayRefresh(account); return; @@ -1482,8 +1996,11 @@ xaccSRDeleteCurrentTrans (SplitRegister *reg) xaccTransCommitEdit(trans); /* Check pending transaction */ - if (trans == info->pending_trans) - info->pending_trans = NULL; + if (trans == pending_trans) + { + info->pending_trans_guid = *xaccGUIDNULL(); + pending_trans = NULL; + } gnc_account_glist_ui_refresh(accounts); @@ -1498,6 +2015,8 @@ void xaccSREmptyCurrentTrans (SplitRegister *reg) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); + Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid); Transaction *trans; Account *account; GList *accounts; @@ -1513,20 +2032,24 @@ xaccSREmptyCurrentTrans (SplitRegister *reg) /* If we just deleted the blank split, clean up. The user is * allowed to delete the blank split as a method for discarding * any edits they may have made to it. */ - if (split == info->blank_split) + if (split == blank_split) { - trans = xaccSplitGetParent (info->blank_split); + trans = xaccSplitGetParent (blank_split); account = xaccSplitGetAccount(split); /* Make sure we don't commit this later on */ - if (trans == info->pending_trans) - info->pending_trans = NULL; + if (trans == pending_trans) + { + info->pending_trans_guid = *xaccGUIDNULL(); + pending_trans = NULL; + } xaccTransBeginEdit (trans, 1); xaccTransDestroy (trans); xaccTransCommitEdit (trans); - info->blank_split = NULL; + info->blank_split_guid = *xaccGUIDNULL(); + blank_split = NULL; xaccAccountDisplayRefresh(account); return; @@ -1547,8 +2070,11 @@ xaccSREmptyCurrentTrans (SplitRegister *reg) xaccTransCommitEdit(trans); /* Check pending transaction */ - if (trans == info->pending_trans) - info->pending_trans = NULL; + if (trans == pending_trans) + { + info->pending_trans_guid = *xaccGUIDNULL(); + pending_trans = NULL; + } gnc_account_glist_ui_refresh(accounts); @@ -1590,13 +2116,14 @@ void xaccSRCancelCursorTransChanges (SplitRegister *reg) { SRInfo *info = xaccSRGetInfo(reg); + Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid); Transaction *trans; GList *accounts; /* Get the currently open transaction, rollback the edits on it, and * then repaint everything. To repaint everything, make a note of * all of the accounts that will be affected by this rollback. */ - trans = info->pending_trans; + trans = pending_trans; if (!xaccTransIsOpen(trans)) { @@ -1614,7 +2141,8 @@ xaccSRCancelCursorTransChanges (SplitRegister *reg) g_list_free(accounts); - info->pending_trans = NULL; + info->pending_trans_guid = *xaccGUIDNULL(); + pending_trans = NULL; gnc_refresh_main_window (); } @@ -1804,23 +2332,15 @@ xaccSRSaveRegEntryToSCM (SplitRegister *reg, SCM trans_scm, SCM split_scm) /* Copy from the register object to the engine */ gncBoolean -xaccSRSaveRegEntry (SplitRegister *reg, Transaction *new_trans) +xaccSRSaveRegEntry (SplitRegister *reg, gncBoolean do_commit) { - GList *refresh_accounts = NULL; + GList *refresh_accounts; SRInfo *info = xaccSRGetInfo(reg); - Split *split; - Transaction *trans; + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); + Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid); unsigned int changed; - int style; - - /* use the changed flag to avoid heavy-weight updates - * of the split & transaction fields. This will help - * cut down on uneccessary register redraws. */ - changed = xaccSplitRegisterGetChangeFlag (reg); - if (!changed) - return GNC_F; - - style = (reg->type) & REG_STYLE_MASK; + Transaction *trans; + Split *split; /* get the handle to the current split and transaction */ split = xaccSRGetCurrentSplit (reg); @@ -1828,20 +2348,55 @@ xaccSRSaveRegEntry (SplitRegister *reg, Transaction *new_trans) if (trans == NULL) return GNC_F; + /* use the changed flag to avoid heavy-weight updates + * of the split & transaction fields. This will help + * cut down on uneccessary register redraws. */ + changed = xaccSplitRegisterGetChangeFlag (reg); + if (!changed) + { + Transaction *blank_trans; + + if (!xaccTransIsOpen(trans)) + return GNC_F; + + if (!do_commit) + return GNC_F; + + blank_trans = xaccSplitGetParent(blank_split); + + if (trans == blank_trans) + { + info->last_date_entered = xaccTransGetDate(trans); + info->blank_split_guid = *xaccGUIDNULL(); + blank_split = NULL; + } + + xaccTransCommitEdit(trans); + + if (pending_trans == trans) + { + pending_trans = NULL; + info->pending_trans_guid = *xaccGUIDNULL(); + } + + return GNC_T; + } + ENTER ("xaccSRSaveRegEntry(): save split is %p \n", split); /* determine whether we should commit the pending transaction */ - if (info->pending_trans != trans) { - if (xaccTransIsOpen (info->pending_trans)) - xaccTransCommitEdit (info->pending_trans); + if (pending_trans != trans) { + if (xaccTransIsOpen (pending_trans)) + xaccTransCommitEdit (pending_trans); xaccTransBeginEdit (trans, 0); - info->pending_trans = trans; + pending_trans = trans; + info->pending_trans_guid = *xaccTransGetGUID(trans); } /* If we are committing the blank split, add it to the account now */ - if (xaccTransGetSplit(trans, 0) == info->blank_split) + if (xaccTransGetSplit(trans, 0) == blank_split) { - xaccAccountInsertSplit (info->default_source_account, info->blank_split); + xaccAccountInsertSplit (info->default_source_account, blank_split); xaccTransSetDateEnteredSecs(trans, time(NULL)); } @@ -1872,343 +2427,7 @@ xaccSRSaveRegEntry (SplitRegister *reg, Transaction *new_trans) DEBUG ("updating trans addr=%p\n", trans); - /* copy the contents from the cursor to the split */ - if (MOD_DATE & changed) { - /* commit any pending changes */ - xaccCommitDateCell (reg->dateCell); - DEBUG ("MOD_DATE DMY= %2d/%2d/%4d \n", - reg->dateCell->date.tm_mday, - reg->dateCell->date.tm_mon+1, - reg->dateCell->date.tm_year+1900); - - xaccTransSetDate (trans, reg->dateCell->date.tm_mday, - reg->dateCell->date.tm_mon+1, - reg->dateCell->date.tm_year+1900); - } - - if (MOD_NUM & changed) { - DEBUG ("MOD_NUM: %s\n", reg->numCell->cell.value); - xaccTransSetNum (trans, reg->numCell->cell.value); - xaccSetNumCellLastNum(reg->numCell, reg->numCell->cell.value); - } - - if (MOD_DESC & changed) { - DEBUG ("MOD_DESC: %s\n", - reg->descCell->cell.value); - xaccTransSetDescription (trans, reg->descCell->cell.value); - } - - if (MOD_RECN & changed) { - DEBUG ("MOD_RECN: %c\n", reg->recnCell->value[0]); - xaccSplitSetReconcile (split, reg->recnCell->value[0]); - } - - if (MOD_ACTN & changed) { - DEBUG ("MOD_ACTN: %s\n", - reg->actionCell->cell.value); - xaccSplitSetAction (split, reg->actionCell->cell.value); - } - - if (MOD_MEMO & changed) { - DEBUG ("MOD_MEMO: %s\n", - reg->memoCell->cell.value); - xaccSplitSetMemo (split, reg->memoCell->cell.value); - } - - /* -------------------------------------------------------------- */ - /* OK, the handling of transfers gets complicated because it - * depends on what was displayed to the user. For a multi-line - * display, we just reparent the indicated split, its it, - * and that's that. For a two-line display, we want to reparent - * the "other" split, but only if there is one ... - * XFRM is the straight split, MXFRM is the mirrored split. - * XTO is the straight split, too :) Only one of XFRM or XTO - * should be in a given cursor. - */ - if ((MOD_XFRM | MOD_XTO) & changed) { - Account *old_acc=NULL, *new_acc=NULL; - char *new_name; - - if (MOD_XFRM & changed) { - DEBUG ("MOD_XFRM: %s\n", - reg->xfrmCell->cell.value); - } - else { - DEBUG ("MOD_XTO: %s\n", - reg->xtoCell->cell.value); - } - - /* do some reparenting. Insertion into new account will automatically - * delete this split from the old account */ - old_acc = xaccSplitGetAccount (split); - - if (MOD_XFRM & changed) - new_name = reg->xfrmCell->cell.value; - else - new_name = reg->xtoCell->cell.value; - - new_acc = xaccGetAccountByFullName (trans, new_name, account_separator); - - if ((new_acc != NULL) && (old_acc != new_acc)) - { - const char *currency = NULL; - const char *security = NULL; - - currency = xaccAccountGetCurrency(new_acc); - currency = xaccTransIsCommonCurrency(trans, currency); - - if (currency == NULL) { - security = xaccAccountGetSecurity(new_acc); - security = xaccTransIsCommonCurrency(trans, security); - } - - if ((currency != NULL) || (security != NULL)) { - xaccAccountInsertSplit (new_acc, split); - - refresh_accounts = g_list_prepend(refresh_accounts, old_acc); - refresh_accounts = g_list_prepend(refresh_accounts, new_acc); - } - else { - char *message = NULL; - - asprintf(&message, REG_CURR_MSG, xaccAccountGetName(new_acc)); - assert(message != NULL); - - gnc_warning_dialog_parented(xaccSRGetParent(reg), message); - free(message); - } - } - } - - if (MOD_MXFRM & changed) { - Split *other_split = NULL; - - DEBUG ("MOD_MXFRM: %s\n", - reg->mxfrmCell->cell.value); - - other_split = xaccGetOtherSplit(split); - - /* other_split may be null for two very different reasons: - * (1) the parent transaction has three or more splits in it, - * and so the "other" split is ambiguous, and thus null. - * (2) the parent transaction has only this one split as a child. - * and "other" is null because there is no other. - * - * In the case (2), we want to create the other split, so that - * the user's request to transfer actually works out. - */ - - if (!other_split) { - other_split = xaccTransGetSplit (trans, 1); - if (!other_split) { - double amt = xaccSplitGetShareAmount (split); - double prc = xaccSplitGetSharePrice (split); - - other_split = xaccMallocSplit (); - - xaccSplitSetMemo (other_split, xaccSplitGetMemo (split)); - xaccSplitSetAction (other_split, xaccSplitGetAction (split)); - xaccSplitSetSharePriceAndAmount (other_split, prc, -amt); - - xaccTransAppendSplit (trans, other_split); - } - } - - if (other_split) { - Account *old_acc=NULL, *new_acc=NULL; - - /* do some reparenting. Insertion into new account will automatically - * delete from the old account */ - old_acc = xaccSplitGetAccount (other_split); - new_acc = xaccGetAccountByFullName (trans, reg->mxfrmCell->cell.value, - account_separator); - - if ((new_acc != NULL) && (old_acc != new_acc)) - { - const char *currency = NULL; - const char *security = NULL; - - currency = xaccAccountGetCurrency(new_acc); - currency = xaccTransIsCommonCurrency(trans, currency); - - if (currency == NULL) { - security = xaccAccountGetSecurity(new_acc); - security = xaccTransIsCommonCurrency(trans, security); - } - - if ((currency != NULL) || (security != NULL)) { - xaccAccountInsertSplit (new_acc, other_split); - - refresh_accounts = g_list_prepend(refresh_accounts, old_acc); - refresh_accounts = g_list_prepend(refresh_accounts, new_acc); - } - else { - char *message = NULL; - - asprintf(&message, REG_CURR_MSG, xaccAccountGetName(new_acc)); - assert(message != NULL); - - gnc_warning_dialog_parented(xaccSRGetParent(reg), message); - free(message); - } - } - } - } - - if (((MOD_AMNT | MOD_PRIC | MOD_VALU) & changed) && - ((STOCK_REGISTER == (reg->type & REG_TYPE_MASK)) || - (CURRENCY_REGISTER == (reg->type & REG_TYPE_MASK)) || - (PORTFOLIO_LEDGER == (reg->type & REG_TYPE_MASK)))) { - - double value; - double price; - double new_amount; - - if (MOD_VALU & changed) - value = xaccGetPriceCellValue(reg->valueCell); - else - value = xaccSplitGetValue(split); - - if (MOD_PRIC & changed) - price = xaccGetPriceCellValue(reg->priceCell); - else - price = xaccSplitGetSharePrice(split); - - if (MOD_AMNT & changed) { - double credit = xaccGetPriceCellValue(reg->creditCell); - double debit = xaccGetPriceCellValue(reg->debitCell); - new_amount = debit - credit; - } - else - new_amount = xaccSplitGetShareAmount(split); - - if (value != price*new_amount) { - int i; - int choice; - int default_value; - char *radio_list[4] = { NULL, NULL, NULL, NULL }; - - if (MOD_AMNT & changed) - asprintf(&radio_list[0], "%s (%s)", AMT_STR, CHANGED_STR); - else - radio_list[0] = strdup(AMT_STR); - - if (MOD_PRIC & changed) - asprintf(&radio_list[1], "%s (%s)", PRICE_STR, CHANGED_STR); - else - radio_list[1] = strdup(PRICE_STR); - - if (MOD_VALU & changed) - asprintf(&radio_list[2], "%s (%s)", VALUE_STR, CHANGED_STR); - else - radio_list[2] = strdup(VALUE_STR); - - for (i = 0; i < 3; i++) - assert(radio_list[i] != NULL); - - if (!(MOD_AMNT & changed)) - default_value = 0; - else if (!(MOD_PRIC & changed)) - default_value = 1; - else if (!(MOD_VALU & changed)) - default_value = 2; - else - default_value = 0; - - choice = gnc_choose_radio_option_dialog_parented(xaccSRGetParent(reg), - TRANS_RECALC_TITLE, - TRANS_RECALC_MSG, - default_value, - radio_list); - - for (i = 0; i < 3; i++) - free(radio_list[i]); - - switch(choice) - { - case 0: /* Modify number of shares */ - if (price == 0) - break; - - new_amount = value/price; - - xaccSetDebCredCellValue (reg->debitCell, - reg->creditCell, new_amount); - changed |= MOD_AMNT; - break; - case 1: /* Modify the share price */ - if (new_amount == 0) - break; - - price = value/new_amount; - - if (price < 0) { - price = -price; - xaccSetPriceCellValue(reg->valueCell, -value); - changed |= MOD_VALU; - } - xaccSetPriceCellValue(reg->priceCell, price); - changed |= MOD_PRIC; - break; - case 2: /* Modify total value */ - value = price*new_amount; - - xaccSetPriceCellValue(reg->valueCell, value); - changed |= MOD_VALU; - break; - default: - break; - } - } - } - - /* The AMNT and NAMNT updates only differ by sign. Basically, - * the split cursors show minus the quants that the single, - * double and transaction cursors show, and so when updates - * happen, the extra minus sign must also be handled. */ - if ((MOD_AMNT | MOD_NAMNT) & changed) { - double new_amount; - double credit; - double debit; - - if (MOD_AMNT & changed) { - credit = xaccGetPriceCellValue(reg->creditCell); - debit = xaccGetPriceCellValue(reg->debitCell); - new_amount = debit - credit; - } else { - credit = xaccGetPriceCellValue(reg->ncreditCell); - debit = xaccGetPriceCellValue(reg->ndebitCell); - new_amount = -(debit - credit); - } - - DEBUG ("MOD_AMNT: %f\n", new_amount); - - if ((EQUITY_REGISTER == (reg->type & REG_TYPE_MASK)) || - (STOCK_REGISTER == (reg->type & REG_TYPE_MASK)) || - (CURRENCY_REGISTER == (reg->type & REG_TYPE_MASK)) || - (PORTFOLIO_LEDGER == (reg->type & REG_TYPE_MASK))) - xaccSplitSetShareAmount (split, new_amount); - else - xaccSplitSetValue (split, new_amount); - } - - if (MOD_PRIC & changed) { - double price; - - price = xaccGetPriceCellValue(reg->priceCell); - - DEBUG ("MOD_PRIC: %f\n", price); - - xaccSplitSetSharePrice (split, price); - } - - if (MOD_VALU & changed) { - double value = xaccGetPriceCellValue(reg->valueCell); - - DEBUG ("MOD_VALU: %f\n", value); - - xaccSplitSetValue (split, value); - } + refresh_accounts = xaccSRSaveChangedCells (reg, trans, split); PINFO ("finished saving split %s of trans %s \n", xaccSplitGetMemo(split), xaccTransGetDescription(trans)); @@ -2218,17 +2437,28 @@ xaccSRSaveRegEntry (SplitRegister *reg, Transaction *new_trans) * we can be sure of getting a new split. Also, save the date for * the new blank split. */ split = xaccTransGetSplit (trans, 0); - if (split == info->blank_split) + if (split == blank_split) { - info->blank_split = NULL; - info->last_date_entered = xaccTransGetDate(trans); + if (do_commit) + { + info->blank_split_guid = *xaccGUIDNULL(); + blank_split = NULL; + info->last_date_entered = xaccTransGetDate(trans); + } + else + info->blank_split_edited = GNC_T; } - /* If the new transaction is different from the current, - * commit the current and set the pending transaction to NULL. */ - if (trans != new_trans) { + /* If requested, commit the current transaction and set the pending + * transaction to NULL. */ + if (do_commit) + { xaccTransCommitEdit (trans); - info->pending_trans = NULL; + if (pending_trans == trans) + { + pending_trans = NULL; + info->pending_trans_guid = *xaccGUIDNULL(); + } } xaccSplitRegisterClearChangeFlag(reg); @@ -2244,10 +2474,365 @@ xaccSRSaveRegEntry (SplitRegister *reg, Transaction *new_trans) /* ======================================================== */ +static GList * +xaccSRSaveChangedCells (SplitRegister *reg, Transaction *trans, Split *split) +{ + GList *refresh_accounts = NULL; + unsigned int changed; + int style; + + changed = xaccSplitRegisterGetChangeFlag (reg); + style = (reg->type) & REG_STYLE_MASK; + + /* copy the contents from the cursor to the split */ + if (MOD_DATE & changed) { + /* commit any pending changes */ + xaccCommitDateCell (reg->dateCell); + DEBUG ("MOD_DATE DMY= %2d/%2d/%4d \n", + reg->dateCell->date.tm_mday, + reg->dateCell->date.tm_mon+1, + reg->dateCell->date.tm_year+1900); + + xaccTransSetDate (trans, + reg->dateCell->date.tm_mday, + reg->dateCell->date.tm_mon+1, + reg->dateCell->date.tm_year+1900); + } + + if (MOD_NUM & changed) { + DEBUG ("MOD_NUM: %s\n", reg->numCell->cell.value); + xaccTransSetNum (trans, reg->numCell->cell.value); + xaccSetNumCellLastNum(reg->numCell, reg->numCell->cell.value); + } + + if (MOD_DESC & changed) { + DEBUG ("MOD_DESC: %s\n", + reg->descCell->cell.value); + xaccTransSetDescription (trans, reg->descCell->cell.value); + } + + if (MOD_RECN & changed) { + DEBUG ("MOD_RECN: %c\n", reg->recnCell->value[0]); + xaccSplitSetReconcile (split, reg->recnCell->value[0]); + } + + if (MOD_ACTN & changed) { + DEBUG ("MOD_ACTN: %s\n", + reg->actionCell->cell.value); + xaccSplitSetAction (split, reg->actionCell->cell.value); + } + + if (MOD_MEMO & changed) { + DEBUG ("MOD_MEMO: %s\n", + reg->memoCell->cell.value); + xaccSplitSetMemo (split, reg->memoCell->cell.value); + } + + /* -------------------------------------------------------------- */ + /* OK, the handling of transfers gets complicated because it + * depends on what was displayed to the user. For a multi-line + * display, we just reparent the indicated split, its it, + * and that's that. For a two-line display, we want to reparent + * the "other" split, but only if there is one ... + * XFRM is the straight split, MXFRM is the mirrored split. + * XTO is the straight split, too :) Only one of XFRM or XTO + * should be in a given cursor. + */ + if ((MOD_XFRM | MOD_XTO) & changed) { + Account *old_acc=NULL, *new_acc=NULL; + char *new_name; + + if (MOD_XFRM & changed) { + DEBUG ("MOD_XFRM: %s\n", + reg->xfrmCell->cell.value); + } + else { + DEBUG ("MOD_XTO: %s\n", + reg->xtoCell->cell.value); + } + + /* do some reparenting. Insertion into new account will automatically + * delete this split from the old account */ + old_acc = xaccSplitGetAccount (split); + + if (MOD_XFRM & changed) + new_name = reg->xfrmCell->cell.value; + else + new_name = reg->xtoCell->cell.value; + + new_acc = xaccGetAccountByFullName (trans, new_name, account_separator); + + if ((new_acc != NULL) && (old_acc != new_acc)) + { + const char *currency = NULL; + const char *security = NULL; + + currency = xaccAccountGetCurrency(new_acc); + currency = xaccTransIsCommonCurrency(trans, currency); + + if (currency == NULL) { + security = xaccAccountGetSecurity(new_acc); + security = xaccTransIsCommonCurrency(trans, security); + } + + if ((currency != NULL) || (security != NULL)) { + xaccAccountInsertSplit (new_acc, split); + + refresh_accounts = g_list_prepend(refresh_accounts, old_acc); + refresh_accounts = g_list_prepend(refresh_accounts, new_acc); + } + else { + char *message = NULL; + + asprintf(&message, REG_CURR_MSG, xaccAccountGetName(new_acc)); + assert(message != NULL); + + gnc_warning_dialog_parented(xaccSRGetParent(reg), message); + free(message); + } + } + } + + if (MOD_MXFRM & changed) { + Split *other_split = NULL; + + DEBUG ("MOD_MXFRM: %s\n", + reg->mxfrmCell->cell.value); + + other_split = xaccGetOtherSplit(split); + + /* other_split may be null for two very different reasons: + * (1) the parent transaction has three or more splits in it, + * and so the "other" split is ambiguous, and thus null. + * (2) the parent transaction has only this one split as a child. + * and "other" is null because there is no other. + * + * In the case (2), we want to create the other split, so that + * the user's request to transfer actually works out. + */ + + if (!other_split) { + other_split = xaccTransGetSplit (trans, 1); + if (!other_split) { + double amt = xaccSplitGetShareAmount (split); + double prc = xaccSplitGetSharePrice (split); + + other_split = xaccMallocSplit (); + + xaccSplitSetMemo (other_split, xaccSplitGetMemo (split)); + xaccSplitSetAction (other_split, xaccSplitGetAction (split)); + xaccSplitSetSharePriceAndAmount (other_split, prc, -amt); + + xaccTransAppendSplit (trans, other_split); + } + } + + if (other_split) { + Account *old_acc=NULL, *new_acc=NULL; + + /* do some reparenting. Insertion into new account will automatically + * delete from the old account */ + old_acc = xaccSplitGetAccount (other_split); + new_acc = xaccGetAccountByFullName (trans, reg->mxfrmCell->cell.value, + account_separator); + + if ((new_acc != NULL) && (old_acc != new_acc)) + { + const char *currency = NULL; + const char *security = NULL; + + currency = xaccAccountGetCurrency(new_acc); + currency = xaccTransIsCommonCurrency(trans, currency); + + if (currency == NULL) { + security = xaccAccountGetSecurity(new_acc); + security = xaccTransIsCommonCurrency(trans, security); + } + + if ((currency != NULL) || (security != NULL)) { + xaccAccountInsertSplit (new_acc, other_split); + + refresh_accounts = g_list_prepend(refresh_accounts, old_acc); + refresh_accounts = g_list_prepend(refresh_accounts, new_acc); + } + else { + char *message = NULL; + + asprintf(&message, REG_CURR_MSG, xaccAccountGetName(new_acc)); + assert(message != NULL); + + gnc_warning_dialog_parented(xaccSRGetParent(reg), message); + free(message); + } + } + } + } + + if (((MOD_AMNT | MOD_PRIC | MOD_VALU) & changed) && + ((STOCK_REGISTER == (reg->type & REG_TYPE_MASK)) || + (CURRENCY_REGISTER == (reg->type & REG_TYPE_MASK)) || + (PORTFOLIO_LEDGER == (reg->type & REG_TYPE_MASK)))) { + + double value; + double price; + double new_amount; + + if (MOD_VALU & changed) + value = xaccGetPriceCellValue(reg->valueCell); + else + value = xaccSplitGetValue(split); + + if (MOD_PRIC & changed) + price = xaccGetPriceCellValue(reg->priceCell); + else + price = xaccSplitGetSharePrice(split); + + if (MOD_AMNT & changed) { + double credit = xaccGetPriceCellValue(reg->creditCell); + double debit = xaccGetPriceCellValue(reg->debitCell); + new_amount = debit - credit; + } + else + new_amount = xaccSplitGetShareAmount(split); + + if (value != price*new_amount) { + int i; + int choice; + int default_value; + char *radio_list[4] = { NULL, NULL, NULL, NULL }; + + if (MOD_AMNT & changed) + asprintf(&radio_list[0], "%s (%s)", AMT_STR, CHANGED_STR); + else + radio_list[0] = strdup(AMT_STR); + + if (MOD_PRIC & changed) + asprintf(&radio_list[1], "%s (%s)", PRICE_STR, CHANGED_STR); + else + radio_list[1] = strdup(PRICE_STR); + + if (MOD_VALU & changed) + asprintf(&radio_list[2], "%s (%s)", VALUE_STR, CHANGED_STR); + else + radio_list[2] = strdup(VALUE_STR); + + for (i = 0; i < 3; i++) + assert(radio_list[i] != NULL); + + if (!(MOD_AMNT & changed)) + default_value = 0; + else if (!(MOD_PRIC & changed)) + default_value = 1; + else if (!(MOD_VALU & changed)) + default_value = 2; + else + default_value = 0; + + choice = gnc_choose_radio_option_dialog_parented(xaccSRGetParent(reg), + TRANS_RECALC_TITLE, + TRANS_RECALC_MSG, + default_value, + radio_list); + + for (i = 0; i < 3; i++) + free(radio_list[i]); + + switch(choice) + { + case 0: /* Modify number of shares */ + if (price == 0) + break; + + new_amount = value/price; + + xaccSetDebCredCellValue (reg->debitCell, + reg->creditCell, new_amount); + changed |= MOD_AMNT; + break; + case 1: /* Modify the share price */ + if (new_amount == 0) + break; + + price = value/new_amount; + + if (price < 0) { + price = -price; + xaccSetPriceCellValue(reg->valueCell, -value); + changed |= MOD_VALU; + } + xaccSetPriceCellValue(reg->priceCell, price); + changed |= MOD_PRIC; + break; + case 2: /* Modify total value */ + value = price*new_amount; + + xaccSetPriceCellValue(reg->valueCell, value); + changed |= MOD_VALU; + break; + default: + break; + } + } + } + + /* The AMNT and NAMNT updates only differ by sign. Basically, + * the split cursors show minus the quants that the single, + * double and transaction cursors show, and so when updates + * happen, the extra minus sign must also be handled. */ + if ((MOD_AMNT | MOD_NAMNT) & changed) { + double new_amount; + double credit; + double debit; + + if (MOD_AMNT & changed) { + credit = xaccGetPriceCellValue(reg->creditCell); + debit = xaccGetPriceCellValue(reg->debitCell); + new_amount = debit - credit; + } else { + credit = xaccGetPriceCellValue(reg->ncreditCell); + debit = xaccGetPriceCellValue(reg->ndebitCell); + new_amount = -(debit - credit); + } + + DEBUG ("MOD_AMNT: %f\n", new_amount); + + if ((EQUITY_REGISTER == (reg->type & REG_TYPE_MASK)) || + (STOCK_REGISTER == (reg->type & REG_TYPE_MASK)) || + (CURRENCY_REGISTER == (reg->type & REG_TYPE_MASK)) || + (PORTFOLIO_LEDGER == (reg->type & REG_TYPE_MASK))) + xaccSplitSetShareAmount (split, new_amount); + else + xaccSplitSetValue (split, new_amount); + } + + if (MOD_PRIC & changed) { + double price; + + price = xaccGetPriceCellValue(reg->priceCell); + + DEBUG ("MOD_PRIC: %f\n", price); + + xaccSplitSetSharePrice (split, price); + } + + if (MOD_VALU & changed) { + double value = xaccGetPriceCellValue(reg->valueCell); + + DEBUG ("MOD_VALU: %f\n", value); + + xaccSplitSetValue (split, value); + } + + return refresh_accounts; +} + +/* ======================================================== */ + static void xaccSRLoadRegEntry (SplitRegister *reg, Split *split) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); int typo = reg->type & REG_TYPE_MASK; char buff[2]; double baln; @@ -2313,7 +2898,7 @@ xaccSRLoadRegEntry (SplitRegister *reg, Split *split) baln = -baln; } - if (split == info->blank_split) + if (split == blank_split) xaccSetPriceCellBlank (reg->balanceCell); else xaccSetPriceCellValue (reg->balanceCell, baln); @@ -2416,6 +3001,7 @@ xaccSRCountRows (SplitRegister *reg, gncBoolean *ext_on_blank_split) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); CellBlock *lead_cursor; Transaction *trans; Split *split; @@ -2493,7 +3079,7 @@ xaccSRCountRows (SplitRegister *reg, split = slist[i]; } - split = info->blank_split; + split = blank_split; if ((split != NULL) && (split == find_trans_split)) found_trans_split = GNC_T; @@ -2506,7 +3092,7 @@ xaccSRCountRows (SplitRegister *reg, while (split) { /* do not count the blank split */ - if (split != info->blank_split) { + if (split != blank_split) { gncBoolean do_expand; trans = xaccSplitGetParent(split); @@ -2611,7 +3197,7 @@ xaccSRCountRows (SplitRegister *reg, /* ---------------------------------------------------------- */ /* the "blank split", if it exists, is at the end */ - split = info->blank_split; + split = blank_split; trans = xaccSplitGetParent(split); on_trans_split = (find_trans_split == split); @@ -2636,19 +3222,42 @@ xaccSRCountRows (SplitRegister *reg, } } - if (multi_line || dynamic) { - if (!found_split && (find_split == NULL) && (trans == find_trans)) { - save_cursor_phys_row = num_phys_rows + 1; - save_cursor_virt_row = num_virt_rows + 1; - if (on_trans_split || !found_trans_split) - found_split = GNC_T; - found_trans = GNC_T; - on_blank_split = GNC_T; - } + if (multi_line || (dynamic && info->blank_split_edited)) { if (multi_line || (dynamic && on_blank_split)) { - num_virt_rows += 2; - num_phys_rows += reg->trans_cursor->numRows; - num_phys_rows += reg->split_cursor->numRows; + Split *secondary; + int j; + + /* The code below is copied from the main loop above */ + + /* add one row for a transaction */ + num_virt_rows ++; + num_phys_rows += reg->trans_cursor->numRows; + + /* add in the splits */ + trans = xaccSplitGetParent (split); + j = 0; + do { + secondary = xaccTransGetSplit (trans, j); + if (secondary != split) { + /* lets determine where to locate the cursor ... */ + if (!found_split) { + /* Check if we find a perfect match. We have to check + * the transaction in case the split is NULL (blank). */ + if ((secondary == find_split) && + (trans == find_trans)) { + save_cursor_phys_row = num_phys_rows; + save_cursor_virt_row = num_virt_rows; + if (on_trans_split || !found_trans_split) + found_split = GNC_T; + found_trans = GNC_T; + } + } + + num_virt_rows ++; + num_phys_rows += reg->split_cursor->numRows; + } + j++; + } while (secondary); } else { num_virt_rows += 1; @@ -2695,6 +3304,8 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist, Account *default_source_acc) { SRInfo *info = xaccSRGetInfo(reg); + Split *blank_split = xaccSplitLookup(&info->blank_split_guid); + Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid); SplitRegisterBuffer *reg_buffer; CellBlock *lead_cursor; Transaction *find_trans; @@ -2722,6 +3333,22 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist, xaccSplitRegisterConfigColors (reg); + /* make sure we have a blank split */ + if (blank_split == NULL) { + Transaction *trans; + + trans = xaccMallocTransaction (); + + xaccTransBeginEdit (trans, 1); + xaccTransSetDateSecs(trans, info->last_date_entered); + xaccTransCommitEdit (trans); + + blank_split = xaccTransGetSplit (trans, 0); + info->blank_split_guid = *xaccSplitGetGUID (blank_split); + + info->blank_split_edited = GNC_F; + } + info->default_source_account = default_source_acc; table = reg->table; @@ -2797,11 +3424,11 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist, while (split) { - if (info->pending_trans == xaccSplitGetParent (split)) + if (pending_trans == xaccSplitGetParent (split)) found_pending = GNC_T; /* do not load the blank split */ - if (split != info->blank_split) { + if (split != blank_split) { Transaction *trans; gncBoolean do_expand; @@ -2878,31 +3505,12 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist, split = slist[i]; } - /* add the "blank split" at the end. We use either the blank - * split or we create a new one, as needed. */ - if (info->blank_split != NULL) { - split = info->blank_split; - if (info->pending_trans == xaccSplitGetParent(split)) - found_pending = GNC_T; - } else { - Transaction *trans; - - trans = xaccMallocTransaction (); - - xaccTransBeginEdit (trans, 1); - xaccTransSetDateSecs(trans, info->last_date_entered); - xaccTransCommitEdit (trans); - - split = xaccTransGetSplit (trans, 0); - info->blank_split = split; - - reg->destroy = LedgerDestroy; - } - - /* do the split row of the blank split */ - if (multi_line || dynamic) { - Transaction *trans; + /* add the blank split at the end. */ + split = blank_split; + if (pending_trans == xaccSplitGetParent(split)) + found_pending = GNC_T; + if (multi_line || (dynamic && info->blank_split_edited)) { /* do the transaction row of the blank split */ xaccSetCursor (table, reg->trans_cursor, phys_row, 0, vrow, 0); xaccMoveCursor (table, phys_row, 0); @@ -2911,13 +3519,28 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist, phys_row += reg->trans_cursor->numRows; if (multi_line || (dynamic && on_blank_split)) { + Transaction *trans; + Split *secondary; + int j; + trans = xaccSplitGetParent (split); - split = xaccTransGetSplit (trans, 1); - xaccSetCursor (table, reg->split_cursor, phys_row, 0, vrow, 0); - xaccMoveCursor (table, phys_row, 0); - xaccSRLoadRegEntry (reg, split); - vrow ++; - phys_row += reg->split_cursor->numRows; + j = 0; + do { + secondary = xaccTransGetSplit (trans, j); + + if (secondary != split) { + xaccSetCursor (table, reg->split_cursor, + phys_row, 0, vrow, 0); + xaccMoveCursor (table, phys_row, 0); + xaccSRLoadRegEntry (reg, secondary); + PINFO ("load split %d at phys row %d addr=%p \n", + j, phys_row, secondary); + vrow ++; + phys_row += reg->split_cursor->numRows; + } + + j++; + } while (secondary); } } else { xaccSetCursor (table, lead_cursor, phys_row, 0, vrow, 0); @@ -2952,10 +3575,15 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist, } /* If we didn't find the pending transaction, it was removed - * from the account. It might not even exist any more. - * Make sure we don't access it. */ + * from the account. */ if (!found_pending) - info->pending_trans = NULL; + { + if (xaccTransIsOpen(pending_trans)) + xaccTransCommitEdit(pending_trans); + + info->pending_trans_guid = *xaccGUIDNULL(); + pending_trans = NULL; + } /* Set up the hint transaction, split, transaction split, and column. */ info->cursor_hint_trans = xaccSRGetCurrentTrans (reg); @@ -2969,12 +3597,15 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist, /* set the completion character for the xfer cells */ xaccComboCellSetCompleteChar (reg->mxfrmCell, account_separator); xaccComboCellSetCompleteChar (reg->xfrmCell, account_separator); + xaccComboCellSetCompleteChar (reg->xtoCell, account_separator); /* enable callback for cursor user-driven moves */ table->move_cursor = LedgerMoveCursor; table->traverse = LedgerTraverse; table->set_help = LedgerSetHelp; table->client_data = reg; + + reg->destroy = LedgerDestroy; } /* ======================================================== */ @@ -3075,4 +3706,23 @@ xaccSRLoadXferCells (SplitRegister *reg, Account *base_account) xaccLoadXferCell(reg->xtoCell, group, base_account); } +/* ======================================================== */ + +gncBoolean +xaccSRHasPendingChanges (SplitRegister *reg) +{ + SRInfo *info = xaccSRGetInfo(reg); + Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid); + unsigned int changed; + + if (reg == NULL) + return GNC_F; + + changed = xaccSplitRegisterGetChangeFlag (reg); + if (changed) + return GNC_T; + + return xaccTransIsOpen(pending_trans); +} + /* ======================= end of file =================== */ diff --git a/src/SplitLedger.h b/src/SplitLedger.h index 0f6aee3f27..a50c5f9eab 100644 --- a/src/SplitLedger.h +++ b/src/SplitLedger.h @@ -96,11 +96,11 @@ * The xaccSRSaveRegEntry() method will copy the contents * from the cursor to a split. The split/transaction * that is updated is the one associated with the current - * cursor (register entry) position. If the current transaction - * is different from newtrans, the current transaction will be - * comitted. Pass in NULL for newtrans to force a commit. - * The method returns GNC_T if the cursor was really saved, - * i.e., it had been changed. Otherwise, it returns GNC_F. + * cursor (register entry) position. If the do_commit flag + * is set, the transaction will also be committed. If it is + * the blank transaction, and the do_commit flag is set, + * a refresh will result in a new blank transaction. + * The method returns GNC_T if something was changed. * * The xaccSRRedrawRegEntry() method should be called soon * after the xaccSRSaveRegEntry() method. It checks the @@ -161,9 +161,11 @@ void xaccSRCancelCursorTransChanges (SplitRegister *reg); void xaccSRLoadRegister (SplitRegister *reg, Split **slist, Account *default_source_acc); -gncBoolean xaccSRSaveRegEntry (SplitRegister *reg, Transaction *newtrans); +gncBoolean xaccSRSaveRegEntry (SplitRegister *reg, gncBoolean do_commit); void xaccSRRedrawRegEntry (SplitRegister *reg); void xaccSRLoadXferCells (SplitRegister *reg, Account *base_account); +gncBoolean xaccSRHasPendingChanges (SplitRegister *reg); + #endif /* __XACC_SPLIT_LEDGER_H__ */ diff --git a/src/engine/Account.h b/src/engine/Account.h index c2bc0abfbe..ed6bbd610a 100644 --- a/src/engine/Account.h +++ b/src/engine/Account.h @@ -170,12 +170,18 @@ Split * xaccAccountGetSplit (Account *acc, int i); Split ** xaccAccountGetSplitList (Account *acc); int xaccAccountGetNumSplits (Account *acc); -/* WAKE UP! +/* The xaccAccountGetFullName routine returns the fully qualified name + * of the account using the given separator char. The name must be freed + * after use. The fully qualified name of an account is the concatenation + * of the names of the account and all its ancestor accounts starting with + * the topmost account and ending with the given account. Each name is + * separated by the given character. + * + * WAKE UP! * Unlike all other gets, the string returned by xaccAccountGetFullName() - * must be freed by you the user !!! - * hack alert -- can someone document what this routine does, and also, - * since it breaks the rule of string allocation, maybe this routine - * should not be in this library, but some utility library ??? + * must be freed by you the user !!! + * hack alert -- since it breaks the rule of string allocation, maybe this + * routine should not be in this library, but some utility library? */ char * xaccAccountGetFullName (Account *, const char separator); @@ -205,7 +211,7 @@ gncBoolean xaccAccountHasAncestor (Account *, Account * ancestor); * * The xaccClearMark will find the topmost group, and clear the mark in * the entire group tree. - * The xaccClearMarkDown will clear the mark inly in this and in + * The xaccClearMarkDown will clear the mark only in this and in * sub-accounts. */ short xaccAccountGetMark (Account *acc); diff --git a/src/engine/FileIO.c b/src/engine/FileIO.c index 273d7787ae..a9ca174ecc 100644 --- a/src/engine/FileIO.c +++ b/src/engine/FileIO.c @@ -1852,7 +1852,7 @@ static int writeTSDate( int fd, Timespec *ts) { int err=0; - int tmp; + long int tmp; long long longtmp; /* write 64 bits to file format */ @@ -1864,8 +1864,8 @@ writeTSDate( int fd, Timespec *ts) tmp = ts->tv_nsec; XACC_FLIP_INT (tmp); - err = write( fd, &tmp, sizeof(int) ); - if( err != sizeof(int) ) + err = write( fd, &tmp, sizeof(long int) ); + if( err != sizeof(long int) ) return -1; return err; diff --git a/src/engine/Transaction.h b/src/engine/Transaction.h index 3ae101bfdf..9eeff98e46 100644 --- a/src/engine/Transaction.h +++ b/src/engine/Transaction.h @@ -289,10 +289,10 @@ const char * xaccTransFindCommonCurrency (Transaction *trans); * currency and a common security. If the desired match is the * security, a simple string match won't reveal this fact. * - * This routine is useful in dealing - * with currency trading accounts and/or with "stock boxes", where - * transaction have in common. This routine is useful in dealing - * securities of differing types are moved across accounts. + * This routine is useful in dealing with currency trading accounts + * and/or with "stock boxes", where transaction have a security in + * common. This routine is useful in dealing with securities of + * differing types as they are moved across accounts. */ const char * xaccTransIsCommonCurrency (Transaction *trans, const char * currency); diff --git a/src/engine/TransactionP.h b/src/engine/TransactionP.h index e8b3e261c3..4135d853ce 100644 --- a/src/engine/TransactionP.h +++ b/src/engine/TransactionP.h @@ -36,7 +36,7 @@ * routines that perform sub-atomic updates of the accounting * structures. If these routines are not used properly, they * can result in inconsistent, unbalanced accounting structures. - * In other words, thier use is dangerous, and thier use outside + * In other words, their use is dangerous, and their use outside * of the scope of the engine is forbidden. * */ diff --git a/src/engine/guid.c b/src/engine/guid.c index b82aaa6cfb..67f1dbda8b 100644 --- a/src/engine/guid.c +++ b/src/engine/guid.c @@ -335,7 +335,6 @@ guid_init() /* time in secs and clock ticks */ bytes += init_from_time(); - fprintf(stderr, "guid_init got %u bytes.\n", bytes); if (bytes < THRESHOLD) fprintf(stderr, "WARNING: guid_init only got %u bytes.\n" diff --git a/src/engine/guid/guid.c b/src/engine/guid/guid.c new file mode 100644 index 0000000000..67f1dbda8b --- /dev/null +++ b/src/engine/guid/guid.c @@ -0,0 +1,450 @@ +/********************************************************************\ + * guid.c -- globally unique ID implementation * + * Copyright (C) 2000 Dave Peticolas * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation; either version 2 of * + * the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License* + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * + * * +\********************************************************************/ + +#define _GNU_SOURCE + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "guid.h" +#include "md5.h" + +# ifndef P_tmpdir +# define P_tmpdir "/tmp" +# endif + + +/** Constants *******************************************************/ +#define GUID_TRUE (0 == 0) +#define GUID_FALSE (! GUID_TRUE) +#define BLOCKSIZE 4096 +#define THRESHOLD (2 * BLOCKSIZE) + + +/** Static global variables *****************************************/ +static int guid_initialized = GUID_FALSE; +static struct md5_ctx guid_context; + + +/** Function implementations ****************************************/ + +/* This code is based on code in md5.c in GNU textutils. */ +static size_t +init_from_stream(FILE *stream, size_t max_size) +{ + char buffer[BLOCKSIZE + 72]; + size_t sum, block_size, total; + + if (max_size <= 0) + return 0; + + total = 0; + + /* Iterate over file contents. */ + while (1) + { + /* We read the file in blocks of BLOCKSIZE bytes. One call of the + * computation function processes the whole buffer so that with the + * next round of the loop another block can be read. */ + size_t n; + sum = 0; + + if (max_size < BLOCKSIZE) + block_size = max_size; + else + block_size = BLOCKSIZE; + + /* Read block. Take care for partial reads. */ + do + { + n = fread (buffer + sum, 1, block_size - sum, stream); + + sum += n; + } + while (sum < block_size && n != 0); + + max_size -= sum; + + if (n == 0 && ferror (stream)) + return total; + + /* If end of file or max_size is reached, end the loop. */ + if ((n == 0) || (max_size == 0)) + break; + + /* Process buffer with BLOCKSIZE bytes. Note that + * BLOCKSIZE % 64 == 0 */ + md5_process_block (buffer, BLOCKSIZE, &guid_context); + + total += sum; + } + + /* Add the last bytes if necessary. */ + if (sum > 0) + { + md5_process_bytes (buffer, sum, &guid_context); + total += sum; + } + + return total; +} + +static size_t +init_from_file(const char *filename, size_t max_size) +{ + struct stat stats; + size_t total = 0; + FILE *fp; + + if (stat(filename, &stats) == 0) + { + md5_process_bytes(&stats, sizeof(stats), &guid_context); + total += sizeof(stats); + } + + if (max_size <= 0) + return total; + + fp = fopen (filename, "r"); + if (fp == NULL) + return total; + + total += init_from_stream(fp, max_size); + + fclose(fp); + + return total; +} + +static size_t +init_from_dir(const char *dirname, unsigned int max_files) +{ + char filename[1024]; + struct dirent *de; + struct stat stats; + size_t total; + int result; + DIR *dir; + + if (max_files <= 0) + return 0; + + dir = opendir (dirname); + if (dir == NULL) + return 0; + + total = 0; + + do + { + de = readdir(dir); + if (de == NULL) + break; + + md5_process_bytes(de, sizeof(struct dirent), &guid_context); + total += sizeof(struct dirent); + + result = snprintf(filename, sizeof(filename), + "%s/%s", dirname, de->d_name); + if ((result < 0) || (result >= sizeof(filename))) + continue; + + if (stat(filename, &stats) != 0) + continue; + md5_process_bytes(&stats, sizeof(stats), &guid_context); + total += sizeof(stats); + + max_files--; + } while (max_files > 0); + + closedir(dir); + + return total; +} + +static size_t +init_from_time() +{ + size_t total; + time_t t_time; + clock_t clocks; + struct tms tms_buf; + + total = 0; + + t_time = time(NULL); + md5_process_bytes(&t_time, sizeof(t_time), &guid_context); + total += sizeof(t_time); + + clocks = times(&tms_buf); + md5_process_bytes(&clocks, sizeof(clocks), &guid_context); + md5_process_bytes(&tms_buf, sizeof(tms_buf), &guid_context); + total += sizeof(clocks) + sizeof(tms_buf); + + return total; +} + +void +guid_init() +{ + size_t bytes = 0; + + md5_init_ctx(&guid_context); + + /* files */ + { + const char * files[] = + { "/dev/urandom", + "/etc/passwd", + "/proc/loadavg", + "/proc/meminfo", + "/proc/net/dev", + "/proc/rtc", + "/proc/self/environ", + "/proc/self/stat", + "/proc/stat", + "/proc/uptime", + "/dev/urandom", /* once more for good measure :) */ + NULL + }; + int i; + + for (i = 0; files[i] != NULL; i++) + bytes += init_from_file(files[i], BLOCKSIZE); + } + + /* directories */ + { + const char * dirname; + const char * dirs[] = + { + "/proc", + P_tmpdir, + "/var/lock", + "/var/log", + "/var/mail", + "/var/spool/mail", + "/var/run", + NULL + }; + int i; + + for (i = 0; dirs[i] != NULL; i++) + bytes += init_from_dir(dirs[i], 32); + + dirname = getenv("HOME"); + if (dirname != NULL) + bytes += init_from_dir(dirname, 32); + } + + /* process and parent ids */ + { + pid_t pid; + + pid = getpid(); + md5_process_bytes(&pid, sizeof(pid), &guid_context); + bytes += sizeof(pid); + + pid = getppid(); + md5_process_bytes(&pid, sizeof(pid), &guid_context); + bytes += sizeof(pid); + } + + /* user info */ + { + uid_t uid; + gid_t gid; + char *s; + + s = getlogin(); + if (s != NULL) + { + md5_process_bytes(s, strlen(s), &guid_context); + bytes += strlen(s); + } + + uid = getuid(); + md5_process_bytes(&uid, sizeof(uid), &guid_context); + bytes += sizeof(uid); + + gid = getgid(); + md5_process_bytes(&gid, sizeof(gid), &guid_context); + bytes += sizeof(gid); + } + + /* host info */ + { + char string[1024]; + + gethostname(string, sizeof(string)); + md5_process_bytes(string, sizeof(string), &guid_context); + bytes += sizeof(string); + + getdomainname(string, sizeof(string)); + md5_process_bytes(string, sizeof(string), &guid_context); + bytes += sizeof(string); + } + + /* plain old random */ + { + int n, i; + + srand((unsigned int) time(NULL)); + + for (i = 0; i < 32; i++) + { + n = rand(); + + md5_process_bytes(&n, sizeof(n), &guid_context); + bytes += sizeof(n); + } + } + + /* time in secs and clock ticks */ + bytes += init_from_time(); + + if (bytes < THRESHOLD) + fprintf(stderr, + "WARNING: guid_init only got %u bytes.\n" + "The identifiers might not be very random.\n", bytes); + + guid_initialized = GUID_TRUE; +} + +void +guid_init_with_salt(const void *salt, size_t salt_len) +{ + guid_init(); + + md5_process_bytes(salt, salt_len, &guid_context); +} + +void +guid_init_only_salt(const void *salt, size_t salt_len) +{ + md5_init_ctx(&guid_context); + + md5_process_bytes(salt, salt_len, &guid_context); + + guid_initialized = GUID_TRUE; +} + +void +guid_new(GUID *guid) +{ + struct md5_ctx ctx; + + if (guid == NULL) + return; + + if (!guid_initialized) + guid_init(); + + /* make the id */ + ctx = guid_context; + md5_finish_ctx(&ctx, guid->data); + + /* update the global context */ + init_from_time(); +} + +/* needs 32 bytes exactly, doesn't print a null char */ +static void +encode_md5_data(const unsigned char *data, char *buffer) +{ + size_t count; + + for (count = 0; count < 16; count++, buffer += 2) + sprintf(buffer, "%02x", data[count]); +} + +/* returns true if the first 32 bytes of buffer encode + * a hex number. returns false otherwise. Decoded number + * is packed into data in little endian order. */ +static int +decode_md5_string(const char *string, unsigned char *data) +{ + unsigned char n1, n2; + size_t count; + char c1, c2; + + if (string == NULL) + return GUID_FALSE; + + for (count = 0; count < 16; count++) + { + c1 = tolower(string[2 * count]); + if (!isxdigit(c1)) + return GUID_FALSE; + + c2 = tolower(string[2 * count + 1]); + if (!isxdigit(c2)) + return GUID_FALSE; + + if (isdigit(c1)) + n1 = c1 - '0'; + else + n1 = c1 - 'a' + 10; + + if (isdigit(c2)) + n2 = c2 - '0'; + else + n2 = c2 - 'a' + 10; + + if (data != NULL) + data[count] = (n1 << 4) | n2; + } + + return GUID_TRUE; +} + +char * +guid_to_string(const GUID * guid) +{ + char *string = malloc(GUID_ENCODING_LENGTH+1); + if (!string) return NULL; + + encode_md5_data(guid->data, string); + + string[GUID_ENCODING_LENGTH] = '\0'; + + return string; +} + +int +string_to_guid(const char * string, GUID * guid) +{ + return decode_md5_string(string, (guid != NULL) ? guid->data : NULL); +} diff --git a/src/gnome/window-register.c b/src/gnome/window-register.c index 2a3bf52cd6..ab4a576b7f 100644 --- a/src/gnome/window-register.c +++ b/src/gnome/window-register.c @@ -2119,7 +2119,7 @@ recordCB(GtkWidget *w, gpointer data) trans = xaccSRGetCurrentTrans(regData->ledger->ledger); - really_saved = xaccSRSaveRegEntry(regData->ledger->ledger, NULL); + really_saved = xaccSRSaveRegEntry(regData->ledger->ledger, GNC_T); if (!really_saved) return; @@ -2388,10 +2388,10 @@ cancelCB(GtkWidget *w, gpointer data) static void gnc_register_check_close(RegWindow *regData) { - unsigned int changed; + gncBoolean pending_changes; - changed = xaccSplitRegisterGetChangeFlag(regData->ledger->ledger); - if (changed) + pending_changes = xaccSRHasPendingChanges(regData->ledger->ledger); + if (pending_changes) { if (gnc_verify_dialog_parented (GTK_WINDOW(regData->window), TRANS_CHANGED_MSG, GNC_T)) diff --git a/src/optional/swig/Makefile.am b/src/optional/swig/Makefile.am index c356769938..6f7fbcd570 100644 --- a/src/optional/swig/Makefile.am +++ b/src/optional/swig/Makefile.am @@ -46,7 +46,7 @@ SWIG_INPUT_HDRS := \ ## aren't named lib*.so... install-data-local: libgncswig.la cd ${perllibdir} && rm -f gnucash.so - cd ${perllibdir} && ln libgncswig.so gnucash.so + cd ${perllibdir} && ln -s libgncswig.so gnucash.so uninstall-local: rm -f ${perllibdir}/gnucash.so diff --git a/src/optional/swig/Makefile.in b/src/optional/swig/Makefile.in index fafa5aa8b7..3e7009e29d 100644 --- a/src/optional/swig/Makefile.in +++ b/src/optional/swig/Makefile.in @@ -431,7 +431,7 @@ maintainer-clean-generic clean mostlyclean distclean maintainer-clean install-data-local: libgncswig.la cd ${perllibdir} && rm -f gnucash.so - cd ${perllibdir} && ln libgncswig.so gnucash.so + cd ${perllibdir} && ln -s libgncswig.so gnucash.so uninstall-local: rm -f ${perllibdir}/gnucash.so diff --git a/src/register/basiccell.c b/src/register/basiccell.c index 1ede1e4024..113607ed02 100644 --- a/src/register/basiccell.c +++ b/src/register/basiccell.c @@ -162,4 +162,15 @@ xaccBasicCellGetHelp (BasicCell *cell) return cell->get_help_value(cell); } +/* ===================================================== */ + +void +xaccBasicCellSetChanged (BasicCell *cell, gncBoolean changed) +{ + if (cell == NULL) + return; + + cell->changed = changed ? 0xffffffff : 0; +} + /* ================== end of file ====================== */ diff --git a/src/register/basiccell.h b/src/register/basiccell.h index d1031fffc3..a7586ae0b5 100644 --- a/src/register/basiccell.h +++ b/src/register/basiccell.h @@ -268,5 +268,7 @@ void xaccSetBasicCellValue (BasicCell *, const char *); void xaccSetBasicCellBlankHelp (BasicCell *, const char *); char * xaccBasicCellGetHelp (BasicCell *); +void xaccBasicCellSetChanged (BasicCell *, gncBoolean); + #endif /* __XACC_BASIC_CELL_H__ */ /* ------------------ end of file ---------------------- */ diff --git a/src/register/cellblock.h b/src/register/cellblock.h index 82a82b3263..18f02c8cbd 100644 --- a/src/register/cellblock.h +++ b/src/register/cellblock.h @@ -124,7 +124,7 @@ struct _CellBlock { * (exit_r, exit_c) is the last cell of this tab group. */ - /* the last-reneter row and column should contain the very last + /* the last-reenter row and column should contain the very last * cell when the cursor was traversed out of. They determine * the first cell that will be entered (since the first follows * the last). diff --git a/src/register/gnome/gnucash-header.c b/src/register/gnome/gnucash-header.c index ab46d584dc..25a4f2a9ab 100644 --- a/src/register/gnome/gnucash-header.c +++ b/src/register/gnome/gnucash-header.c @@ -227,6 +227,7 @@ gnucash_header_reconfigure (GnucashHeader *header) GnomeCanvas *canvas; GtkWidget *widget; GnucashSheet *sheet; + SheetBlockStyle *old_style; g_return_if_fail (header != NULL); g_return_if_fail (GNUCASH_IS_HEADER (header)); @@ -234,6 +235,7 @@ gnucash_header_reconfigure (GnucashHeader *header) canvas = GNOME_CANVAS_ITEM(header)->canvas; widget = GTK_WIDGET (header->sheet); sheet = GNUCASH_SHEET(header->sheet); + old_style = header->style; header->style = header->sheet->cursor_style[header->type]; @@ -250,7 +252,8 @@ gnucash_header_reconfigure (GnucashHeader *header) w = MAX (widget->allocation.width, header->style->dimensions->width); h = header->style->dimensions->height; - if (header->height != h || header->width != w) { + if (header->height != h || header->width != w || + header->style != old_style) { header->height = h; header->width = w; diff --git a/src/register/left_arrow_small.xpm b/src/register/left_arrow_small.xpm deleted file mode 100644 index 50da82f736..0000000000 --- a/src/register/left_arrow_small.xpm +++ /dev/null @@ -1,103 +0,0 @@ -/* XPM */ -static char * left_arrow_small_xpm[] = { -"13 14 86 1", -" c None", -". c #AC9B8E", -"+ c #8D5C3F", -"@ c #A26A47", -"# c #8F603E", -"$ c #432214", -"% c #8A4629", -"& c #9E5A39", -"* c #B6754F", -"= c #8A5D42", -"- c #974F31", -"; c #A85D3A", -"> c #AC603F", -", c #B36D48", -"' c #BA7A56", -") c #684937", -"! c #975135", -"~ c #B66C48", -"{ c #C57653", -"] c #C27552", -"^ c #C37650", -"/ c #CB805C", -"( c #C58664", -"_ c #8F5036", -": c #BE704D", -"< c #CE825B", -"[ c #D38560", -"} c #D58761", -"| c #D58862", -"1 c #D78A63", -"2 c #DE9471", -"3 c #C98F73", -"4 c #7F5846", -"5 c #9D6F58", -"6 c #C97B56", -"7 c #D88A65", -"8 c #DB8D67", -"9 c #E19069", -"0 c #E3946D", -"a c #EA9B75", -"b c #EBA47F", -"c c #E59A75", -"d c #AD6B4E", -"e c #7D4E3A", -"f c #E3B29A", -"g c #D68963", -"h c #E1916C", -"i c #E79870", -"j c #EA9E79", -"k c #F0A682", -"l c #E7A37F", -"m c #BD7656", -"n c #693924", -"o c #26170F", -"p c #040302", -"q c #000000", -"r c #E7B097", -"s c #E3936A", -"t c #ECA179", -"u c #EFA781", -"v c #EA9F7C", -"w c #C77E5E", -"x c #7E4833", -"y c #3C2118", -"z c #0B0604", -"A c #E9AC90", -"B c #EEA47F", -"C c #EBA27D", -"D c #BF7859", -"E c #844830", -"F c #402318", -"G c #130B07", -"H c #B09488", -"I c #EFA685", -"J c #CE8361", -"K c #87462F", -"L c #3C1F13", -"M c #0F0805", -"N c #E5BAA8", -"O c #9F5E43", -"P c #4F271B", -"Q c #170D09", -"R c #020100", -"S c #684A3D", -"T c #1B0F0A", -"U c #050302", -". ", -"+@# ", -"$%&*= ", -" -;>,') ", -" !~{]^/( ", -" _:<[}|1234 ", -" 567890abcde ", -" fghijklmnopq", -" rstuvwxyzqq ", -" ABCDEFGqq ", -"HIJKLMqq ", -"NOPQRq ", -"STUq ", -" q "}; diff --git a/src/register/splitreg.c b/src/register/splitreg.c index c39ee2b4e4..3e4913884e 100644 --- a/src/register/splitreg.c +++ b/src/register/splitreg.c @@ -101,30 +101,6 @@ static SplitRegisterColors reg_colors = { }; -/* utility defines for cell configuration data */ -#define DATE_CELL 0 -#define NUM_CELL 1 -#define DESC_CELL 2 -#define RECN_CELL 3 -#define SHRS_CELL 4 -#define BALN_CELL 5 -#define ACTN_CELL 6 -#define XFRM_CELL 7 -#define XTO_CELL 8 -#define MEMO_CELL 9 -#define CRED_CELL 10 -#define DEBT_CELL 11 -#define PRIC_CELL 12 -#define VALU_CELL 13 - -/* NCRED & NDEBT handle minus the usual quantities */ -#define NCRED_CELL 14 -#define NDEBT_CELL 15 - -/* MXFRM is the "mirrored" transfer-from account */ -#define MXFRM_CELL 16 - - #define DATE_CELL_WIDTH 11 #define NUM_CELL_WIDTH 7 #define ACTN_CELL_WIDTH 7 @@ -203,9 +179,9 @@ configLabels (SplitRegister *reg) LABEL (SHRS, TOTAL_SHARES_STR); LABEL (BALN, BALN_STR); LABEL (ACTN, ACTION_STR); - LABEL (XFRM, XFRM_STR); - LABEL (MXFRM, XFRM_STR); - LABEL (XTO, XFTO_STR); + LABEL (XFRM, ACCOUNT_STR); + LABEL (MXFRM, TRANSFER_STR); + LABEL (XTO, ACCOUNT_STR); LABEL (MEMO, MEMO_STR); LABEL (CRED, CREDIT_STR); LABEL (DEBT, DEBIT_STR); @@ -1388,6 +1364,198 @@ xaccSplitRegisterGetCursorTypeRowCol (SplitRegister *reg, /* ============================================== */ +CellType +sr_cell_type (SplitRegister *reg, void * cell) +{ + if (cell == reg->dateCell) + return DATE_CELL; + + if (cell == reg->numCell) + return NUM_CELL; + + if (cell == reg->descCell) + return DESC_CELL; + + if (cell == reg->recnCell) + return RECN_CELL; + + if (cell == reg->shrsCell) + return SHRS_CELL; + + if (cell == reg->balanceCell) + return BALN_CELL; + + if (cell == reg->actionCell) + return ACTN_CELL; + + if (cell == reg->xfrmCell) + return XFRM_CELL; + + if (cell == reg->mxfrmCell) + return MXFRM_CELL; + + if (cell == reg->xtoCell) + return XTO_CELL; + + if (cell == reg->memoCell) + return MEMO_CELL; + + if (cell == reg->creditCell) + return CRED_CELL; + + if (cell == reg->debitCell) + return DEBT_CELL; + + if (cell == reg->priceCell) + return PRIC_CELL; + + if (cell == reg->valueCell) + return VALU_CELL; + + if (cell == reg->ncreditCell) + return NCRED_CELL; + + if (cell == reg->ndebitCell) + return NDEBT_CELL; + + return NO_CELL; +} + +/* ============================================== */ + +CellType +xaccSplitRegisterGetCellType (SplitRegister *reg) +{ + Table *table; + + if (reg == NULL) + return NO_CELL; + + table = reg->table; + if (table == NULL) + return NO_CELL; + + return xaccSplitRegisterGetCellTypeRowCol(reg, + table->current_cursor_phys_row, + table->current_cursor_phys_col); +} + +/* ============================================== */ + +static BasicCell * +sr_current_cell (SplitRegister *reg) +{ + Table *table; + Locator *locator; + CellBlock *cellblock; + int phys_row, phys_col; + int virt_row, virt_col; + int cell_row, cell_col; + + if (reg == NULL) + return NULL; + + table = reg->table; + if (table == NULL) + return NULL; + + phys_row = table->current_cursor_phys_row; + phys_col = table->current_cursor_phys_col; + + if ((phys_row < 0) || (phys_row >= table->num_phys_rows) || + (phys_col < 0) || (phys_col >= table->num_phys_cols)) + return NULL; + + locator = table->locators[phys_row][phys_col]; + + virt_row = locator->virt_row; + virt_col = locator->virt_col; + cell_row = locator->phys_row_offset; + cell_col = locator->phys_col_offset; + + cellblock = table->handlers[virt_row][virt_col]; + + return cellblock->cells[cell_row][cell_col]; +} + +/* ============================================== */ + +CellType +xaccSplitRegisterGetCellTypeRowCol (SplitRegister *reg, + int phys_row, int phys_col) +{ + BasicCell *cell; + + cell = sr_current_cell (reg); + if (cell == NULL) + return NO_CELL; + + return sr_cell_type (reg, cell); +} + +/* ============================================== */ + +gncBoolean +xaccSplitRegisterGetCellRowCol (SplitRegister *reg, CellType cell_type, + int *p_phys_row, int *p_phys_col) +{ + Table *table; + Locator *locator; + CellBlock *cellblock; + int phys_row, phys_col; + int virt_row, virt_col; + int cell_row, cell_col; + + if (reg == NULL) + return GNC_F; + + table = reg->table; + if (table == NULL) + return GNC_F; + + phys_row = table->current_cursor_phys_row; + phys_col = table->current_cursor_phys_col; + + if ((phys_row < 0) || (phys_row >= table->num_phys_rows) || + (phys_col < 0) || (phys_col >= table->num_phys_cols)) + return GNC_F; + + locator = table->locators[phys_row][phys_col]; + + virt_row = locator->virt_row; + virt_col = locator->virt_col; + + cellblock = table->handlers[virt_row][virt_col]; + + for (cell_row = 0; cell_row < cellblock->numRows; cell_row++) + for (cell_col = 0; cell_col < cellblock->numCols; cell_col++) + { + BasicCell *cell = cellblock->cells[cell_row][cell_col]; + + if (sr_cell_type (reg, cell) == cell_type) + { + RevLocator *rev_locator; + + rev_locator = table->rev_locators[virt_row][virt_col]; + + phys_row = rev_locator->phys_row + cell_row; + phys_col = rev_locator->phys_col + cell_col; + + if (p_phys_row != NULL) + *p_phys_row = phys_row; + + if (p_phys_col != NULL) + *p_phys_col = phys_col; + + return GNC_T; + } + } + + return GNC_F; +} + +/* ============================================== */ + SplitRegisterBuffer * xaccMallocSplitRegisterBuffer () { diff --git a/src/register/splitreg.h b/src/register/splitreg.h index 38c11c240d..1b269a0214 100644 --- a/src/register/splitreg.h +++ b/src/register/splitreg.h @@ -82,6 +82,33 @@ typedef enum #define REG_TYPE_MASK 0xff +/* These values are used to identify the cells in the register. */ +typedef enum +{ + NO_CELL = -1, + DATE_CELL = 0, + NUM_CELL = 1, + DESC_CELL = 2, + RECN_CELL = 3, + SHRS_CELL = 4, + BALN_CELL = 5, + ACTN_CELL = 6, + XFRM_CELL = 7, + XTO_CELL = 8, + MEMO_CELL = 9, + CRED_CELL = 10, + DEBT_CELL = 11, + PRIC_CELL = 12, + VALU_CELL = 13, + + /* NCRED & NDEBT handle minus the usual quantities */ + NCRED_CELL = 14, + NDEBT_CELL = 15, + + /* MXFRM is the "mirrored" transfer-from account */ + MXFRM_CELL = 16 +} CellType; + /* * enumerated display styles * REG_SINGLE_LINE -- show one line per transaction @@ -236,9 +263,26 @@ void xaccSplitRegisterClearChangeFlag (SplitRegister *reg); /* Returns the type of the current cursor */ CursorType xaccSplitRegisterGetCursorType (SplitRegister *reg); + +/* Returns the type of the cursor at the given virtual row and column. */ CursorType xaccSplitRegisterGetCursorTypeRowCol (SplitRegister *reg, int virt_row, int virt_col); +/* Returns the type of the current cell */ +CellType xaccSplitRegisterGetCellType (SplitRegister *reg); + +/* Returns the type of the cell at the given physical row and column. */ +CellType xaccSplitRegisterGetCellTypeRowCol (SplitRegister *reg, + int phys_row, + int phys_col); + +/* Returns the physical row and column in the current cursor of the + * given cell using the pointer values. The function returns true if + * the given cell type is in the current cursor, false otherwise. */ +gncBoolean xaccSplitRegisterGetCellRowCol (SplitRegister *reg, + CellType cell_type, + int *p_phys_row, + int *p_phys_col); /* Functions for working with split register buffers */ SplitRegisterBuffer * xaccMallocSplitRegisterBuffer (); diff --git a/src/register/table-allgui.c b/src/register/table-allgui.c index 7f30b13065..3fd5c2238d 100644 --- a/src/register/table-allgui.c +++ b/src/register/table-allgui.c @@ -1275,12 +1275,6 @@ gnc_table_traverse_update(Table *table, int row, int col, } } - if (gnc_register_cell_valid(table, *dest_row, *dest_col, GNC_F)) - break; - - if (!gnc_table_find_valid_cell_horiz(table, dest_row, dest_col, GNC_F)) - return GNC_T; - break; case GNC_TABLE_TRAVERSE_UP: diff --git a/src/scm/engine-interface.scm b/src/scm/engine-interface.scm index 36baa9c2ba..278c900f8f 100644 --- a/src/scm/engine-interface.scm +++ b/src/scm/engine-interface.scm @@ -247,13 +247,15 @@ ;; Copy a scheme representation of a transaction onto a C transaction. ;; guid-mapping must be an alist, mapping guids to guids. This list is ;; used to use alternate account guids when creating splits. -(define (gnc:transaction-scm-onto-transaction trans-scm trans guid-mapping) +(define (gnc:transaction-scm-onto-transaction trans-scm trans guid-mapping + commit?) (if (pointer-token-null? trans) #f (begin ;; open the transaction for editing - (gnc:transaction-begin-edit trans 1) + (if (not (gnc:transaction-is-open trans)) + (gnc:transaction-begin-edit trans 1)) ;; copy in the transaction values (let ((description (gnc:transaction-scm-get-description trans-scm)) @@ -285,4 +287,5 @@ (loop (cdr split-scms))))) ;; close the transaction - (gnc:transaction-commit-edit trans)))) + (if commit? + (gnc:transaction-commit-edit trans))))) diff --git a/src/scm/extensions.scm b/src/scm/extensions.scm index 7e331e118f..20f1a23dfe 100644 --- a/src/scm/extensions.scm +++ b/src/scm/extensions.scm @@ -68,13 +68,6 @@ (list "Extensions" "") (lambda () (gnc:main-win-export-data-as-text win)))) - (define qif-item - (gnc:make-menu-item "QIF File Import (Danger: Unfinished)" - "Import QIF File - Scripted in Guile." - (list "Extensions" - "Export data as text (Danger: Unfinished)") - (lambda () (gnc:extensions-qif-import win)))) - (define strings-item (gnc:make-menu-item "Save Translatable Strings" diff --git a/src/scm/prefs.scm b/src/scm/prefs.scm index a2c20f4170..3ee5dcbc93 100644 --- a/src/scm/prefs.scm +++ b/src/scm/prefs.scm @@ -382,6 +382,17 @@ the account instead of opening a register." #f)) "General" "Use accounting labels" "e" "Only use 'debit' and 'credit' instead of informal synonyms" #f)) +;(gnc:register-configuration-option +; (gnc:make-number-range-option +; "General" "Default precision" +; "f" "Default number of decimal places to display" +; 15.0 ;; default +; 1.0 ;; lower bound +; 200.0 ;; upper bound +; 0.0 ;; number of decimals +; 1.0 ;; step size +; )) + ;; Configuation variables diff --git a/src/scm/report/transaction-report-2.scm b/src/scm/report/transaction-report-2.scm index 5d35c11085..7c95a7d5a7 100644 --- a/src/scm/report/transaction-report-2.scm +++ b/src/scm/report/transaction-report-2.scm @@ -518,7 +518,7 @@ 'ascend (list #(ascend "Ascending" "smallest to largest, earliest to latest") - #(descend "Descending" "largest to t, latest to earliest"))))) + #(descend "Descending" "largest to smallest, latest to earliest"))))) (gnc:register-trep-option (gnc:make-simple-boolean-option