Commit Graph
100 Commits
Author SHA1 Message Date
Chris Shoemaker 97062a3b81 Merge 'misc-backend' -r 14160:14184 into trunk.
This includes the now semi-functional postgres backend.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14198 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-26 00:10:35 +00:00
Chris Shoemaker a98cfaf58d Sync ChangeLog with 'svn log -v'
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14183 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-24 23:49:16 +00:00
Chris Shoemaker 882d453105 Consistently pad date formats with zeros instead of spaces.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14180 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-24 22:54:03 +00:00
Chris Shoemaker 22ce233d1b Fix Bug#342736 by replacing "make-shared-substring" with "substring".
Guile 1.8 automatically shares strings as copy-on-write and no longer
   provides the "make-shared-substring" procedure.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14159 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-24 01:25:30 +00:00
Chris Shoemaker 998edefcc8 Fix Bug#342546 by using the pref date format instead of locale.
Also prefix-pad fixed-width date formats with '0'.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14158 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-24 00:49:10 +00:00
Chris Shoemaker ab152556ed sync ChangeLog with 'svn log -v'
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14070 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-15 00:13:49 +00:00
Chris Shoemaker 9b64ae68a7 Disable Lots scrubbing, which is causing test-suite failures.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14050 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-14 21:30:22 +00:00
Chris Shoemaker 9c714d3e12 Undo accidental revert of part of r13713 by r14026.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14038 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-14 11:59:39 +00:00
Chris Shoemaker 4c941fbefb Change the method for specifying and recording the default visibility of
tree-view columns.  There is now a per-column setting, "DEFAULT_VISIBLE",
   similar to "ALWAYS_VISIBLE", that controls the visibility of a column in 
   the absence of, or prior to, gconf management.

   It is no longer necessary for the tree view to store a list of column names
   for default visible columns.

   To faciliate the adaptation of pre-existing tree-views, the 
   view_column_find_by_name() has been publicized as 
   gnc_tree_view_find_column_by_name().

   All callers of gnc_tree_view_configure_columns() have been converted to use
   the DEFAULT_VISIBLE column property.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14037 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-14 02:07:52 +00:00
Chris Shoemaker 3dd0f96c60 Fixing bug #341589: Apparently, guile 1.8 will actually enforce the rule
that all datum portions of case-statement clauses be unique.  The syntax:
   'foo expands to a list of two symbols: (quote foo) 
   If both 'foo and 'bar are used, then the "quote" symbol won't be unique.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14034 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-13 04:52:09 +00:00
Chris Shoemaker 4ccc09c1c7 Fix Bug #341375.
When handling the focus-out event for a GtkCellEditable, it's important
   not to keep the editable alive for too long, because the cursor-blink
   timeout expects that the editable still has the focus.  The easiest way to 
   do this is to stop the editing immediately by calling 
   gtk_cell_editable_editing_done() and then handle all the real work from 
   the "editing-done" signal handler.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14027 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-12 01:47:12 +00:00
Chris Shoemaker e4092bb349 Minor cleanups to gnc_counter_end_handler().
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14026 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-12 00:28:34 +00:00
Chris Shoemaker eff827a63b Cause gncla-dir.h to be re-made after a 'make clean'.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14025 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-12 00:25:15 +00:00
Chris Shoemaker c67a8fb82f Look for g-wrap's (g-wrap gw standard) or (g-wrap gw-standard) since
g-wrap 1.9.6 doesn't have (g-wrap runtime).


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14024 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-11 22:25:55 +00:00
Chris Shoemaker d4bd374c9d When searching for the g-wrap runtime module, look in the G_WRAP_MODULE_DIR.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14023 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-11 21:21:42 +00:00
Chris Shoemaker a8f8c51858 Warn if no g-wrap runtime module is available during configure.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14022 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-11 05:04:56 +00:00
Chris Shoemaker b49877472e Factor out #define _GNU_SOURCE from various .c files into an AC_GNU_SOURCE
check in configure.in.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14002 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-11 01:14:12 +00:00
Chris Shoemaker 3ed9be95ba Fix fancy invoice report. Bug #341046.
Also, liberalize gnc:html-table-append-row! to accept a non-list argument.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13985 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-10 03:54:45 +00:00
Chris Shoemaker 227f13e913 Silence guile warnings about duplicate binding introduced in guile-1.8.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13984 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-10 01:53:24 +00:00
Chris Shoemaker b175702b45 Use g_get_current_time() instead of gettimeofday(). Fixes #341044.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13966 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-09 03:17:04 +00:00
Chris Shoemaker aeda15cb74 Limit memo length to 27 chars on Quicken wallet checks with side stub
Patch by David Reiser, bug #340977


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13965 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-09 00:42:32 +00:00
Chris Shoemaker 7bb7a5536c Remove some unnecessary calls to xaccGroupMarkNotSaved() which were
dirtying the book implicitly without setting any time of first change.
   Instead, make sure that committed Splits dirty their parent Transaction.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13958 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-08 04:56:17 +00:00
Chris Shoemaker de0c1edcb5 Add a flag, 'infant', to QofInstance to note that the instance has been
committed at least once in its lifecycle.  Then, we can mark the collection
   dirty whenever an object is committed, except for the special case of an 
   QofInstance that has never been committed before and is now being deleted.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13957 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-08 04:47:04 +00:00
Chris Shoemaker 6b925724e7 Fix off-by-one error when checking editlevel in qof_commit_edit() (and
macro version), in case we ever want qof_commit_edit() to actually do 
   something with a backend.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13956 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-08 03:04:49 +00:00
Chris Shoemaker 57636f50e4 Make qof_commit_edit() (and macro version) call qof_backend_run_commit()
instead of qof_backend_run_begin().
   Minor cleanups of qof_commit_edit() and qof_begin_edit().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13955 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-08 03:02:15 +00:00
Chris Shoemaker 681577f889 Add begin/commit edit blocks to budget setters. Change to using the
"destroy" method for budget deletion.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13954 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-08 02:54:03 +00:00
Chris Shoemaker 3555d0f101 More consistent Lot<->Split handling. Try to use the right API for adding
a cloned Split to the Lot.  Make sure to remove the Split from the Lot when
   deleting a Split.  (This prevents use-after-free by test-lots.)  Add some 
   comments to some strange code that's possibly wrong.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13922 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-05 00:58:17 +00:00
Chris Shoemaker 40a9ed1925 Move some gains-related transaction-scrubbing operations to from
cap-gains.c to Transaction.c.
   Fix a logic error where "split->gains |= ~GAINS_STATUS_ADIRTY" was supposed
   to be "split->gains &= ~GAINS_STATUS_ADIRTY".

   Disable the loop-restart code in xaccTransScrubGainsDate() because I think
   the state changes inside the loop will never cause a previously-skipped 
   Split to be not skipped during another pass.

   Incidental:
      make both xaccTransFindSplitByAccount() arguments 'const'
      Internalize Begin/Commit edit block into xaccTransScrubSplits()


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13921 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-05 00:40:15 +00:00
Chris Shoemaker e6f9e20679 Some testing bits that got left out of r13916.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13920 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-05 00:18:59 +00:00
Chris Shoemaker 90864dcb27 Correctly ensure that the amount and value of test Splits have the same sign
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13919 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-05 00:17:04 +00:00
Chris Shoemaker 2324301a45 Fix bug #340168 by ignoring Splits that have been destroyed since the
last call to xaccTransBeginEdit().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13917 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-04 03:59:15 +00:00
Chris Shoemaker 0589407c66 Hide the Transaction's management of the "reverse-by" KVP inside the engine.
Add new function xaccTransGetReversedBy() to find the reversing transaction
   if there is one.
   This also ensures that the KVP changes are inside a Begin/Commit block.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13916 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-04 00:06:58 +00:00
Chris Shoemaker 29ce19ddfc Take care of any pending changes to a Transaction before voiding it.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13885 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-30 02:38:11 +00:00
Chris Shoemaker cc413fa58c When deleting the current Transaction in the register, let the action take
effect immediately by commiting the transaction if it's open.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13883 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-30 00:43:45 +00:00
Chris Shoemaker 14e364dfc0 Return the GtkTreeViewColumn from gnc_tree_view_account_add_kvp_column().
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13880 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-29 15:08:12 +00:00
Chris Shoemaker 4bc2e2e86d When deleting an Account, also delete any Splits that are set to be
added to the Account if their open Transaction is commited.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13874 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-29 02:17:14 +00:00
Chris Shoemaker 8807890d26 For budget data entry interpret an empty string as valid input meaning "0".
Closes #339946


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13870 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-28 13:01:30 +00:00
Chris Shoemaker 6069098e7e Remove an assertion w/ explanation of why it doesn't hold. Fixes #339781.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13869 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-27 21:02:30 +00:00
Chris Shoemaker 1a94c52db0 Address bug #339288: When deleting a split, ensure the transaction is open
for editing, an redraw the display afterward.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13865 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-27 03:27:46 +00:00
Chris Shoemaker a15b9f01d2 Remove some unnecessary BeginEdit/CommitEdit calls.
Early exit the budget keynav function on no-op case.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13864 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-27 02:52:31 +00:00
Chris Shoemaker 34316633af More register fixes related to recent changes:
For the autofill in basic-ledger mode, avoid an extra BeginCommit.

   For "remove all splits from the transaction" case, also avoid a potential
   extra BeginCommit.  Also, fix a bug where one split might have not been 
   removed if this operation was performed in a register other than the one
   where the transaction was created.

   Make sure that whenever we actually do commit the pending transaction, we
   clear the stored GUID *before* the commit, since it may be checked again
   from the register's refresh event handler.

   In other news, I haven't seen the orphan splits recently...


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13863 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-27 02:18:37 +00:00
Chris Shoemaker ccd29a0c12 Publicize the ALWAYS_VISIBLE column attribute for GncTreeView.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13858 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-26 03:30:42 +00:00
Chris Shoemaker a6644b75fc Implement a keynav policy for the budget page. Addresses bug #339515.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13847 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-25 04:18:45 +00:00
Chris Shoemaker c07435ed36 Another crack at fixing bug #327780.
Simplify the control flow around the code in gnc_split_register_save() that
   decides what transactions to commit and when.  Be sure to commit the 
   blank transaction even when it's not the pending transaction.  Refresh the
   register after transaction rollback.

   Add more assertions that will either fail in some case I haven't tested or
   prove that more register code is unreachable.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13844 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-24 22:35:33 +00:00
Chris Shoemaker 2b9956ae42 Use 'pending_trans' variable name for clearer code.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13843 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-24 22:27:37 +00:00
Chris Shoemaker caec68484d Fix uninitialized use in gnc_split_register_empty_current_trans_except_split
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13841 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-24 13:58:04 +00:00
Chris Shoemaker c892fdc474 Default the budget page's show_hidden flag to FALSE. Closes #339413.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13836 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-24 00:58:43 +00:00
Chris Shoemaker 3ca300ec3b sync ChangeLog from 'svn log -v'
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13835 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-24 00:12:18 +00:00
Chris Shoemaker 752096c439 Don't immediately commit the blank transaction after creating it.
When saving the register state, don't commit an open transaction unless
   we think it was opened from this register.

   These changes are intended to fix bug #327780.  I've also added several 
   related assertions.  If any of these assertions fail, it may indicate that
   I don't really understand what's going on, and that this may not be the 
   correct fix for #327780.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13834 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-23 23:01:46 +00:00
Chris Shoemaker 78f8adc645 Remove some unnecessary Begin/Commit blocks around code that is already
transactional.  
   Convert some Split function calls to the xaccSplit... form.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13833 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-23 21:07:55 +00:00
Chris Shoemaker cf8d35eb04 Internalize the transactional semantics for all Transaction setters.
This is what I actually intended in r13130, but we want the stuff that
   xaccTransCommitEdit provides over-and-above what qof_commit_edit provides.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13830 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-22 05:14:48 +00:00
Chris Shoemaker 39d4d945b8 Replace calls to QOF_COMMIT_EDIT_PART1 macro with calls to qof_commit_edit()
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13827 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-22 04:42:29 +00:00
Chris Shoemaker 76f16c91d2 Avoid buffer overrun in qoflog.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13825 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-22 01:25:35 +00:00
Chris Shoemaker 227f515afc Revert r13797 so that it can be recommited as logical, documented changes.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13811 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-20 01:37:50 +00:00
Chris Shoemaker e048e7e7f7 Avoid trying to represent "forever-ago" with a timepair.
Instead, call gnc:accountlist-get-comm-balance-at-date when we really just
   want the balance at one date.
   This fixes the retained-earnings calculation on the balance sheet report.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13790 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-15 21:37:00 +00:00
Chris Shoemaker a83d0c0502 Test for support of the tree-model-sort interface instead of one particular
implementation.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13770 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-12 02:31:23 +00:00
Chris Shoemaker 5cb26b7614 Implement Split events for Split destruction, Split rollback, (including
Split un-destruction) and Split re-parenting.
   All these actions now generate ITEM-REMOVED or ITEM-ADDED events for
   related Transactions (as appropriate).

   Minor: allow xaccSplitSetParent() to accept a NULL argument in order to use
   it in the rollback-newly-created-split case.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13767 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-11 03:12:09 +00:00
Chris Shoemaker 7b489a6943 Avoid generating Transaction modified events for Transaction roll-back.
Enable emission of some new Split events.
   Use xaccSplitRollbackEdit() in implementation of xaccTransRollbackEdit().
   Avoid rollback of Splits not owned by the Transaction.  This was actually
   impossible to encounter, but the algorithm is now correct even for some
   cases that aren't permitted by other code. 


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13766 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-11 02:55:57 +00:00
Chris Shoemaker 720f543e25 Make the tests for growing commodity tables more accurate -
silences incorrect failures.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13738 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-05 22:30:00 +00:00
Chris Shoemaker 0609d99045 When destroying a commodity, remove it from the commodity table.
Fixes random crashes demonstrated by test-xml-commodities.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13737 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-05 17:59:14 +00:00
Chris Shoemaker ec1bcb86df Return the actual number of test failures with get_rv().
Use shorter strings for commodity mnemonics.
   Ensure that test splits amount and value have the same sign.
   Avoid numerical overflow in rate calculation when generating test splits.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13718 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-31 01:43:16 +00:00
Chris Shoemaker 58609204d9 More translator-friendly string placement.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13698 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-25 02:53:51 +00:00
Chris Shoemaker 171d26339c When opening GnuCash for the first time since 1.8.x, allow the user to
choose which reports (if any) to open.  If the user cancels the dialog,
   no reports are opened, otherwise, for each report, they are asked whether
   or not they want to open it.  However, if there are less than 4 reports
   the dialog is skipped and the reports are just opened.  Closes bug#335188.

   Note: if someone implements a solution that opened only precisely the
   reports that were left open in 1.8.x, it's fine to remove this extra code.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13694 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-24 02:01:18 +00:00
Chris Shoemaker e274670ddc Add a label to the budget selection combobox. Bug#334501
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13686 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-23 05:41:29 +00:00
Chris Shoemaker cac5d0dbdc Avoid infinite loop in gnc_find_split_in_trans_by_memo(). Bug #335465
Reported by Mike Alexander.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13683 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-23 00:33:11 +00:00
Chris Shoemaker 37d086196d Restore some widget names that were lost in r9938 but still used by
dialog-transfer.c.   Added a warning to find more bugs like this one.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13607 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-12 03:38:27 +00:00
Chris Shoemaker d1d79562b8 Change the account removal event back to using the parent account instead of
the group, but delay the nulling of the account's group pointer until after
   the generation of the remove event.  That way, the tree model can verify
   that the removed account's root is the same as the root for the model.
   Also, in the model's event handler, check that accounts are in the same book
   as the model is for.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13601 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-11 19:39:16 +00:00
Chris Shoemaker 5fd25c0154 Invert sense of conditions involving g_setenv() since its return value
is different than that of setenv().  Also, convert last remaining uses of 
   setenv() to g_setenv().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13594 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-11 01:23:43 +00:00
Chris Shoemaker bb93d652e2 Factor out and create new function: gnc_xfer_dialog_run_exchange_dialog()
This isolates the amount-to-value conversion algorithm from the register.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13576 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-10 04:23:48 +00:00
Chris Shoemaker 3b3075dc8b More register line wraps, clean-ups, etc., plus some minor re-ordering
to prepare for some factoring.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13575 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-10 02:28:28 +00:00
Chris Shoemaker a1b27bc933 More line-wraps, cleanups, factoring new function: xaccTransGetSplitIndex().
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13538 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-08 05:47:36 +00:00
Chris Shoemaker 7f9bb0da7f More line-wraps, cleanups and factoring.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13535 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-08 04:48:32 +00:00
Chris Shoemaker a054fdf202 Minor line wraps and factoring.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13529 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-08 02:20:57 +00:00
Chris Shoemaker c2ae90cc94 Factor out and create new function: xaccAccountIsPriced() that does the
common STOCK, MUTUAL or CURRENCY check.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13513 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 05:31:54 +00:00
Chris Shoemaker 5badb824e6 When periodically checking for ui events, avoid creating a QofSession
if we don't already have one.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13512 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 04:45:46 +00:00
Chris Shoemaker 15e375ad1c Minor code factoring, line-wraps, control-flow simplifications, etc.
centered around split-register-load.c.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13510 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 03:41:39 +00:00
Chris Shoemaker 2f97e55f9f Factor out one small piece of the huge gnc_split_register_load() into
new static function add_quickfill_completions().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13508 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 03:07:41 +00:00
Chris Shoemaker a914a4da55 Factor out and create new function: gnc_commodity_is_currency().
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13507 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 02:42:12 +00:00
Chris Shoemaker 113daf6340 Move both old an new-style Account MODIFY events into the "on_done" case
of qof_commit_edit_part2().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13505 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 00:27:38 +00:00
Chris Shoemaker a34235d810 Don't force a resort of Account's split lists during xaccTransCommitEdit().
This happens already in xaccAccountCommitEdit() and if the Account isn't
   being edited, then we inserted the Split in sorted order anyway.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13498 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-05 23:46:39 +00:00
Chris Shoemaker 3e662fcbf0 ChangeLog updates from 'svn log -v'
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13494 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-05 19:47:21 +00:00
Chris Shoemaker 84bcf5685b Convert xaccTransGetSplit() and xaccTransCountSplits() to return the
index and count reflective of any in-progress edit.
   Convert some split iterators from directly using the GList of Splits to 
   using xaccTransGetSplit().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13487 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-05 04:14:38 +00:00
Chris Shoemaker 4a63eb5c65 Use for-each, lambda expressions for iterating over split lists.
In contrast to the previous looping construct, this will work even if 
   the split operations don't have side-effects on the split lists.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13476 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 18:12:34 +00:00
Chris Shoemaker 9a65cc1cc6 When the book is shutting down, don't be so eager to destroy the whole
transaction.  This makes it easier to safely iterate over a split list.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13471 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 06:56:27 +00:00
Chris Shoemaker 803e157ed6 Destroy Transactions without rebalancing when shutting down the book.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13469 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 05:10:15 +00:00
Chris Shoemaker d0f3042d8f Generate REMOVE events when a Split is removed from a Transaction.
Pass the *old* parent transaction (since the Split may be moving into 
   a new transaction) and the old index of the Split in the old Transaction's
   list of Splits.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13468 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 03:21:34 +00:00
Chris Shoemaker 7921695276 Look for orphan Splits even when there is no Transaction imbalance.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13466 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 02:42:49 +00:00
Chris Shoemaker 10138bb1d3 Delete unused dialog-exchange.h
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13465 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:27:38 +00:00
Chris Shoemaker cfe743fd8e Remove an unnecessary Account edit-block.
Minor control-flow simplification.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13464 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:23:07 +00:00
Chris Shoemaker 5382b075cd Bits to let the register see the in-progress Transaction edit.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13463 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:13:15 +00:00
Chris Shoemaker 8eadc7cd23 Remove xaccAccountRemoveSplit, and xaccAccountInsertSplit.
(Actually, xaccAccountInsertSplit is #def'd to xaccSplitSetAccount().)
   Accounts no longer manage their Split lists.  The Account split lists
   should only ever be modified from within xaccTransCommitEdit().  This
   simplifies some of the operations on Accounts, since they can now be 
   expressed in terms of operations on Splits.

   Also, the consolidation of two operations (RemoveSplit and InsertSplit) 
   into one operation (xaccSplitSetAccount) means that it's no longer 
   possible to orphan a Split.

   Incidental:
      Fix a leak of a KVP frame.
      Don't recompute the account balance if we're shutting down.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13462 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:11:44 +00:00
Chris Shoemaker 6782a2b49d The xaccTransRollbackEdit() part of the Begin/Commit edit-block rewrite.
Broken out just for clarity.

   Note: There's one piece that I didn't change that I think is conceptually
   awkward.  It has to do with how/when we would discover that another
   user has deleted the transaction we're currently editing.  I think it makes
   more sense to detect and handle this case in xaccTransCommitEdit() instead
   of xaccTransRollbackEdit(), because (a) we don't actually have to do the 
   rollback if we just destroy the trans, (b) some rollbacks are not backend-
   induced, but rather voluntary, (c) we need a generalized mechanism
   anyway for detecting and handling deleted transactions even when
   we're not editing them.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13461 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:11:16 +00:00
Chris Shoemaker dd80eaa743 Move one data-validation function from Scrub.c into Transaction.c
One simplification in xaccTransScrubImbalance() to always find the root
   AccountGroup from the Transaction's book.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13460 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:10:44 +00:00
Chris Shoemaker 7bad37599c A good bit of notes about how the Transaction Begin/Commit
edit-blocks should work, and why. 

   Converts the very important xaccTransCommitEdit function to use the 
   qof_commit_edit_part2() function instead of something that is 90%
   similar.

   Transactions have a Split list that keeps track of Splits during the edit.
   During edits, this list only grows and never shrinks.  Splits that
   have been destroyed or reparented to other transactions remain in
   the list, along with pre-edit Splits and newly added Splits.  Only after a 
   successful commit does the Split list drop reparented or destroyed
   Splits.  A couple out-of-engine users (mainly the register) call
   xaccTransGetSplitList() an work from the Transaction's split list,
   but they expect to be working with only the Splits that would still be in 
   the Transaction if the in-progress edit would be committed.  So, we
   provide the function xaccTransStillHasSplit(t, s) to allow users to query 
   the in-edit state of the Transaction's Split list.

   xaccTransRemoveSplit() and xaccTransInsertSplit() have been replaced by
   xaccSplitSetParent().

   The new xaccTransCommitEdit tries to take a more conservative approach
   to event generation, too.  Instead of generating every possible event for 
   any commit, it should generate only events that indicate a change to an 
   engine object or relation.

   Move some of the financial-constraint-enforcing functions closer to the 
   relevant data-structures. (from Scrub.c)



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13459 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:10:12 +00:00
Chris Shoemaker 241f37379a Remove some testing of an engine API that has been removed.
The engine used to have functions that made it possible to orphan a Split.
   As this is no longer possible, we can't test anymore.

   Incidental:
      Fix three or four small leaks in the test functions.
      Allow test-period to be randomized based on optional command-line arg.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13458 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:09:31 +00:00
Chris Shoemaker ed94e594b2 Splits can now keep track of their own rollback state.
The Split <-> Account and Split <-> Transaction relationships are now
   treated as properties of the Split.  In terms of the BeginEdit/CommitEdit 
   block, Splits are subordinate to Transactions.  There is no public 
   BeginEdit/CommitEdit block for Splits; changes to Splits should be wrapped
   in their Transaction's Edit-block.

   In the case of the Split <-> Account relationship, the call to
   xaccSplitSetAccount() will be immediately visible from
   xaccSplitGetAccount(), but the Account does not learn about the
   Split until and if the edit is committed.

   In the case of the Split <-> Transaction relationship, calling
   xaccSplitSetParent() will immediately add the Split to the
   Transactions split list.  This is because the Split's Transaction
   owns the reference to the Split.  However, see the Transaction.c 
   patch for how to distinguish pre-edit state from in-edit state.

   In both cases, events are not generated until the edits are committed.
   Most of this new logic is in an engine-private helper xaccSplitCommitEdit(),
   which is called from xaccTransCommitEdit().

   Incidental:
      Increased error-checking in xaccSplitSetValue().
      Internalize a Transaction Begin/Commit edit-block in every setter func.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13457 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:09:03 +00:00
Chris Shoemaker 9b63e08746 Remove two slightly different definitions of
gnc:transaction-map-splits, both unused.
   Remove g-wrapped versions of functions being removed:
      gnc:account-fix-split-date-order,
      gnc:trans-fix-split-date-order



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13456 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:08:16 +00:00
Chris Shoemaker f32bc537d1 Make register use engine-provided xaccTransGetAccountConvRate() instead of
writing its own.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13426 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-28 19:57:24 +00:00
Chris Shoemaker c0962037f6 Make register use engine-provided xaccTransGetAccountBalance() instead
of writing its own.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13425 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-28 19:46:19 +00:00
Chris Shoemaker 3dd5ea248e Make register use engine-provided xaccTransGetAccountAmount() instead of
writing its own.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13424 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-28 19:38:29 +00:00