r15023 - gnucash/branches/swig-redo - Rebase the swig-redo branch on trunk at r15000.
Chris Shoemaker
chris at cvs.gnucash.org
Sun Oct 15 00:09:23 EDT 2006
Author: chris
Date: 2006-10-15 00:08:48 -0400 (Sun, 15 Oct 2006)
New Revision: 15023
Trac: http://svn.gnucash.org/trac/changeset/15023
Added:
gnucash/branches/swig-redo/art/
gnucash/branches/swig-redo/macros/binreloc.m4
gnucash/branches/swig-redo/packaging/win32/
gnucash/branches/swig-redo/src/engine/binreloc.c
gnucash/branches/swig-redo/src/engine/binreloc.h
gnucash/branches/swig-redo/src/engine/gnc-path.c
gnucash/branches/swig-redo/src/engine/gnc-path.h
gnucash/branches/swig-redo/src/gnome/gnucash.desktop.in.in
gnucash/branches/swig-redo/src/import-export/hbci/gnc-file-aqb-import.c
gnucash/branches/swig-redo/src/import-export/hbci/gnc-file-aqb-import.h
Removed:
gnucash/branches/swig-redo/src/bin/i18n.h.in
gnucash/branches/swig-redo/src/gnome-utils/gnc-dir.h.in
gnucash/branches/swig-redo/src/gnome/gnucash.desktop.in
gnucash/branches/swig-redo/src/import-export/mt940/Makefile.am
gnucash/branches/swig-redo/src/import-export/mt940/gnc-mt940-import.c
gnucash/branches/swig-redo/src/import-export/mt940/gnc-mt940-import.h
gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940-ui.xml
gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940.c
gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940.h
gnucash/branches/swig-redo/src/import-export/mt940/gncmod-mt940-import.c
Modified:
gnucash/branches/swig-redo/ChangeLog
gnucash/branches/swig-redo/Makefile.am
gnucash/branches/swig-redo/configure.in
gnucash/branches/swig-redo/doc/tip_of_the_day.list.in
gnucash/branches/swig-redo/lib/guile-www/Makefile.am
gnucash/branches/swig-redo/lib/libqof/backend/file/Makefile.am
gnucash/branches/swig-redo/lib/libqof/backend/file/qsf-backend.c
gnucash/branches/swig-redo/lib/libqof/backend/file/qsf-xml-map.c
gnucash/branches/swig-redo/lib/libqof/qof/Makefile.am
gnucash/branches/swig-redo/lib/libqof/qof/qof.h
gnucash/branches/swig-redo/lib/libqof/qof/qofbackend-p.h
gnucash/branches/swig-redo/lib/libqof/qof/qofbackend.h
gnucash/branches/swig-redo/lib/libqof/qof/qofbook.c
gnucash/branches/swig-redo/lib/libqof/qof/qofbook.h
gnucash/branches/swig-redo/lib/libqof/qof/qofbookmerge.c
gnucash/branches/swig-redo/lib/libqof/qof/qofchoice.c
gnucash/branches/swig-redo/lib/libqof/qof/qofchoice.h
gnucash/branches/swig-redo/lib/libqof/qof/qofclass.h
gnucash/branches/swig-redo/lib/libqof/qof/qofid-p.h
gnucash/branches/swig-redo/lib/libqof/qof/qofid.c
gnucash/branches/swig-redo/lib/libqof/qof/qofid.h
gnucash/branches/swig-redo/lib/libqof/qof/qofinstance.c
gnucash/branches/swig-redo/lib/libqof/qof/qofinstance.h
gnucash/branches/swig-redo/lib/libqof/qof/qofobject-p.h
gnucash/branches/swig-redo/lib/libqof/qof/qofobject.c
gnucash/branches/swig-redo/lib/libqof/qof/qofobject.h
gnucash/branches/swig-redo/lib/libqof/qof/qofquery.c
gnucash/branches/swig-redo/lib/libqof/qof/qofquery.h
gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore-p.h
gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore.c
gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore.h
gnucash/branches/swig-redo/lib/libqof/qof/qofsession.c
gnucash/branches/swig-redo/lib/libqof/qof/qofutil.h
gnucash/branches/swig-redo/macros/legacy_macros.m4
gnucash/branches/swig-redo/packaging/gnucash.spec.in
gnucash/branches/swig-redo/po/POTFILES.skip
gnucash/branches/swig-redo/src/app-utils/Makefile.am
gnucash/branches/swig-redo/src/app-utils/gnc-account-merge.c
gnucash/branches/swig-redo/src/app-utils/gnc-ui-util.c
gnucash/branches/swig-redo/src/app-utils/test/Makefile.am
gnucash/branches/swig-redo/src/app-utils/test/test-print-parse-amount.c
gnucash/branches/swig-redo/src/app-utils/test/test-print-queries.c
gnucash/branches/swig-redo/src/app-utils/test/test-scm-query-string.c
gnucash/branches/swig-redo/src/backend/file/gnc-account-xml-v2.c
gnucash/branches/swig-redo/src/backend/file/gnc-backend-file.c
gnucash/branches/swig-redo/src/backend/file/gnc-commodity-xml-v2.c
gnucash/branches/swig-redo/src/backend/file/test/Makefile.am
gnucash/branches/swig-redo/src/backend/file/test/test-load-backend.c
gnucash/branches/swig-redo/src/backend/file/test/test-load-example-account.c
gnucash/branches/swig-redo/src/backend/file/test/test-load-xml2.c
gnucash/branches/swig-redo/src/backend/file/test/test-save-in-lang.c
gnucash/branches/swig-redo/src/backend/file/test/test-xml2-is-file.c
gnucash/branches/swig-redo/src/backend/postgres/putil.c
gnucash/branches/swig-redo/src/backend/postgres/test/test-db.c
gnucash/branches/swig-redo/src/backend/postgres/test/test-load-backend.c
gnucash/branches/swig-redo/src/backend/postgres/test/test-period.c
gnucash/branches/swig-redo/src/bin/Makefile.am
gnucash/branches/swig-redo/src/bin/gnucash-bin.c
gnucash/branches/swig-redo/src/bin/gnucash.in
gnucash/branches/swig-redo/src/bin/overrides/Makefile.am
gnucash/branches/swig-redo/src/bin/test/Makefile.am
gnucash/branches/swig-redo/src/business/business-core/Makefile.am
gnucash/branches/swig-redo/src/business/business-core/file/gncmod-business-backend-file.c
gnucash/branches/swig-redo/src/business/business-core/test/Makefile.am
gnucash/branches/swig-redo/src/business/business-core/test/test-address.c
gnucash/branches/swig-redo/src/business/business-core/test/test-business.c
gnucash/branches/swig-redo/src/business/business-core/test/test-customer.c
gnucash/branches/swig-redo/src/business/business-core/test/test-employee.c
gnucash/branches/swig-redo/src/business/business-core/test/test-job.c
gnucash/branches/swig-redo/src/business/business-core/test/test-vendor.c
gnucash/branches/swig-redo/src/business/business-gnome/Makefile.am
gnucash/branches/swig-redo/src/business/business-gnome/schemas/Makefile.am
gnucash/branches/swig-redo/src/business/business-reports/Makefile.am
gnucash/branches/swig-redo/src/business/business-utils/Makefile.am
gnucash/branches/swig-redo/src/business/dialog-tax-table/Makefile.am
gnucash/branches/swig-redo/src/calculation/expression_parser.c
gnucash/branches/swig-redo/src/core-utils/Makefile.am
gnucash/branches/swig-redo/src/core-utils/gnc-gconf-utils.c
gnucash/branches/swig-redo/src/core-utils/gnc-gconf-utils.h
gnucash/branches/swig-redo/src/core-utils/gnc-glib-utils.c
gnucash/branches/swig-redo/src/core-utils/gnc-glib-utils.h
gnucash/branches/swig-redo/src/engine/Account.c
gnucash/branches/swig-redo/src/engine/Account.h
gnucash/branches/swig-redo/src/engine/Group.c
gnucash/branches/swig-redo/src/engine/Group.h
gnucash/branches/swig-redo/src/engine/Makefile.am
gnucash/branches/swig-redo/src/engine/Period.c
gnucash/branches/swig-redo/src/engine/SX-book.c
gnucash/branches/swig-redo/src/engine/SX-book.h
gnucash/branches/swig-redo/src/engine/Transaction.c
gnucash/branches/swig-redo/src/engine/cashobjects.c
gnucash/branches/swig-redo/src/engine/gnc-budget.c
gnucash/branches/swig-redo/src/engine/gnc-engine.c
gnucash/branches/swig-redo/src/engine/gnc-lot.c
gnucash/branches/swig-redo/src/engine/gnc-pricedb.c
gnucash/branches/swig-redo/src/engine/gncla-dir.h.in
gnucash/branches/swig-redo/src/engine/test/Makefile.am
gnucash/branches/swig-redo/src/engine/test/test-commodities.c
gnucash/branches/swig-redo/src/engine/test/test-date.c
gnucash/branches/swig-redo/src/engine/test/test-group-vs-book.c
gnucash/branches/swig-redo/src/engine/test/test-guid.c
gnucash/branches/swig-redo/src/engine/test/test-load-engine.c
gnucash/branches/swig-redo/src/engine/test/test-lots.c
gnucash/branches/swig-redo/src/engine/test/test-numeric.c
gnucash/branches/swig-redo/src/engine/test/test-object.c
gnucash/branches/swig-redo/src/engine/test/test-period.c
gnucash/branches/swig-redo/src/engine/test/test-query.c
gnucash/branches/swig-redo/src/engine/test/test-querynew.c
gnucash/branches/swig-redo/src/engine/test/test-resolve-file-path.c
gnucash/branches/swig-redo/src/engine/test/test-scm-query.c
gnucash/branches/swig-redo/src/engine/test/test-split-vs-account.c
gnucash/branches/swig-redo/src/engine/test/test-transaction-reversal.c
gnucash/branches/swig-redo/src/engine/test/test-transaction-voiding.c
gnucash/branches/swig-redo/src/gnc-module/Makefile.am
gnucash/branches/swig-redo/src/gnc-module/gnc-module.c
gnucash/branches/swig-redo/src/gnc-module/test/test-dynload.c
gnucash/branches/swig-redo/src/gnc-test-env
gnucash/branches/swig-redo/src/gnome-search/Makefile.am
gnucash/branches/swig-redo/src/gnome-search/search.glade
gnucash/branches/swig-redo/src/gnome-utils/Makefile.am
gnucash/branches/swig-redo/src/gnome-utils/dialog-account.c
gnucash/branches/swig-redo/src/gnome-utils/dialog-preferences.c
gnucash/branches/swig-redo/src/gnome-utils/dialog-reset-warnings.c
gnucash/branches/swig-redo/src/gnome-utils/dialog-utils.c
gnucash/branches/swig-redo/src/gnome-utils/druid-gconf-setup.c
gnucash/branches/swig-redo/src/gnome-utils/glade/transfer.glade
gnucash/branches/swig-redo/src/gnome-utils/gnc-date-format.c
gnucash/branches/swig-redo/src/gnome-utils/gnc-dialog.c
gnucash/branches/swig-redo/src/gnome-utils/gnc-druid-provider-file-gnome.c
gnucash/branches/swig-redo/src/gnome-utils/gnc-embedded-window.c
gnucash/branches/swig-redo/src/gnome-utils/gnc-file.c
gnucash/branches/swig-redo/src/gnome-utils/gnc-gnome-utils.c
gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.c
gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin.c
gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin.h
gnucash/branches/swig-redo/src/gnome-utils/gnc-query-list.c
gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-model-account-types.c
gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-model-account-types.h
gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-view.c
gnucash/branches/swig-redo/src/gnome-utils/schemas/Makefile.am
gnucash/branches/swig-redo/src/gnome-utils/search-param.c
gnucash/branches/swig-redo/src/gnome-utils/search-param.h
gnucash/branches/swig-redo/src/gnome-utils/test/test-gnc-recurrence.c
gnucash/branches/swig-redo/src/gnome/
gnucash/branches/swig-redo/src/gnome/Makefile.am
gnucash/branches/swig-redo/src/gnome/dialog-print-check.c
gnucash/branches/swig-redo/src/gnome/druid-acct-period.c
gnucash/branches/swig-redo/src/gnome/druid-hierarchy.c
gnucash/branches/swig-redo/src/gnome/glade/account.glade
gnucash/branches/swig-redo/src/gnome/glade/commodities.glade
gnucash/branches/swig-redo/src/gnome/glade/price.glade
gnucash/branches/swig-redo/src/gnome/glade/stocks.glade
gnucash/branches/swig-redo/src/gnome/gnc-plugin-page-account-tree.c
gnucash/branches/swig-redo/src/gnome/schemas/Makefile.am
gnucash/branches/swig-redo/src/gnome/schemas/apps_gnucash_warnings.schemas.in
gnucash/branches/swig-redo/src/gnome/top-level.c
gnucash/branches/swig-redo/src/gnome/window-reconcile.c
gnucash/branches/swig-redo/src/import-export/Makefile.am
gnucash/branches/swig-redo/src/import-export/hbci/Makefile.am
gnucash/branches/swig-redo/src/import-export/hbci/dialog-hbcitrans.c
gnucash/branches/swig-redo/src/import-export/hbci/dialog-hbcitrans.h
gnucash/branches/swig-redo/src/import-export/hbci/druid-hbci-initial.c
gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-kvp.c
gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-transfer.c
gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-utils.c
gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-utils.h
gnucash/branches/swig-redo/src/import-export/hbci/gnc-plugin-hbci-ui.xml
gnucash/branches/swig-redo/src/import-export/hbci/gnc-plugin-hbci.c
gnucash/branches/swig-redo/src/import-export/hbci/hbci-interaction.c
gnucash/branches/swig-redo/src/import-export/hbci/hbci-interaction.h
gnucash/branches/swig-redo/src/import-export/hbci/schemas/Makefile.am
gnucash/branches/swig-redo/src/import-export/import-account-matcher.c
gnucash/branches/swig-redo/src/import-export/import-match-map.c
gnucash/branches/swig-redo/src/import-export/qif-import/Makefile.am
gnucash/branches/swig-redo/src/import-export/qif-import/test/Makefile.am
gnucash/branches/swig-redo/src/import-export/qif-io-core/Makefile.am
gnucash/branches/swig-redo/src/import-export/qif/Makefile.am
gnucash/branches/swig-redo/src/import-export/schemas/Makefile.am
gnucash/branches/swig-redo/src/import-export/test/Makefile.am
gnucash/branches/swig-redo/src/import-export/test/test-import-parse.c
gnucash/branches/swig-redo/src/network-utils/test/Makefile.am
gnucash/branches/swig-redo/src/register/ledger-core/split-register-control.c
gnucash/branches/swig-redo/src/register/ledger-core/split-register.c
gnucash/branches/swig-redo/src/register/register-core/Makefile.am
gnucash/branches/swig-redo/src/report/locale-specific/us/Makefile.am
gnucash/branches/swig-redo/src/report/locale-specific/us/test/Makefile.am
gnucash/branches/swig-redo/src/report/report-gnome/Makefile.am
gnucash/branches/swig-redo/src/report/report-system/Makefile.am
gnucash/branches/swig-redo/src/report/report-system/test/Makefile.am
gnucash/branches/swig-redo/src/report/standard-reports/Makefile.am
gnucash/branches/swig-redo/src/report/standard-reports/budget.scm
gnucash/branches/swig-redo/src/report/standard-reports/test/Makefile.am
gnucash/branches/swig-redo/src/report/standard-reports/transaction.scm
gnucash/branches/swig-redo/src/report/stylesheets/Makefile.am
gnucash/branches/swig-redo/src/report/stylesheets/test/Makefile.am
gnucash/branches/swig-redo/src/report/utility-reports/Makefile.am
gnucash/branches/swig-redo/src/report/utility-reports/test/Makefile.am
gnucash/branches/swig-redo/src/scm/Makefile.am
gnucash/branches/swig-redo/src/tax/us/Makefile.am
Log:
Rebase the swig-redo branch on trunk at r15000.
Based on the number of merge conflicts (almost every Makefile.am) I'm
rebasing the branch before merging into trunk.
Modified: gnucash/branches/swig-redo/ChangeLog
===================================================================
--- gnucash/branches/swig-redo/ChangeLog 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/ChangeLog 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,3 +1,164 @@
+2006-10-09 Josh Sled <jsled at asynchronous.org>
+
+ * art/: Add, with 2.0 {banner,icon,logo,splash} art.
+
+2006-09-26 Derek Atkins <derek at ihtfp.com>
+
+ * lib/libqof/qof/qofquery.[ch]:
+ Implement SubQuery functionality in QOF: qof_query_run_subquery()
+ Now you can run one query off of the results of another query.
+
+ Add the ability to override the default sort (#150799).
+ Override the Transaction Number to sort numerically.
+ * lib/libqof/qof/qofclass.h:
+ * lib/libqof/qof/qofquery.c:
+ * lib/libqof/qof/qofquerycore-p.h:
+ * lib/libqof/qof/qofquerycore.[ch]:
+ - Publish the QofCompareFunc prototype.
+ - Add a new QofParam param_compfcn parameter
+ - Change QofQuery to use the param_compfcn over the
+ default type compare function.
+ - create (and publish) a qof API to compare strings
+ as numbers: qof_string_number_compare_func()
+ * src/engine/Transaction.c:
+ Assign TRANS_NUM to use qof_string_numer_compare_func()
+
+2006-09-23 Derek Atkins <derek at ihtfp.com>
+
+ * src/ledger-core/split-register*.c:
+ suspend events around the Commit(). Fixes #347089 when combined
+ with r14495.
+
+ * src/gnome/druid-acct-period.c:
+ * src/gnome/gnc-plugin-page-account-tree.c:
+ * src/gnome/window-reconcile.c:
+ disable lot scrubbing during Check & Repair (#357370).
+ Lots are supposed to be disabled in the 2.0 release until we
+ get the cap-gains code working. IMHO the cap-gains code should
+ deal with extra txn splits instead of creating additional txns.
+
+2006-09-19 Christian Stimming <stimming at tuhh.de>
+
+ * configure.in: Remove mt940 module completely from the build and
+ SVN because all of its functionality has been moved into the hbci
+ (aqbanking) module.
+
+2006-09-19 Andreas Köhler <andi5.py at gmx.net>
+
+ * $some.glade: Use some more automatic scrollbars.
+
+ * src/backend/file/gnc-backend-file.c:
+ * src/gnome-utils/gnc-file.c: Do not complain about non-existent
+ files if we save to a new file. In pass one we ignore the error
+ returned by stat and call qof_session_begin with
+ create_if_nonexistent=TRUE for a second run.
+
+2006-09-18 Christian Stimming <stimming at tuhh.de>
+
+ * src/engine/binreloc.[hc], src/engine/gnc-path.c,
+ src/bin/gnucash-bin.c, configure.in: Implement automatic
+ relocation of previously compiled-in paths. With the exception of
+ the env variables in src/bin/gnucash, we're fully relocatable now.
+
+2006-09-13 Christian Stimming <stimming at tuhh.de>
+
+ * src/import-export/hbci/gnc-plugin-hbci.c: Move the MT940
+ importer action from the mt940 into the hbci plugin because in the
+ hbci plugin everything is already there. From now on, MT940
+ importing is available as soon as --enable-hbci is switched
+ on. The mt940 plugin can be removed from SVN now.
+
+2006-09-07 Christian Stimming <stimming at tuhh.de>
+
+ * src/engine/gnc-path.h, gnc-path.c: Add new file with utility
+ functions to retrieve the needed directory paths. All compile-time
+ vs. runtime path lookups will be implemented exactly in this file.
+
+2006-09-07 David Hampton <hampton at employees.org>
+
+ * src/backend/postgres: Include config.h a couple of places.
+
+ * src/engine/gnc-budget.c: Use the glib-compat.h file for backward
+ compatible function names.
+
+2006-09-03 Christian Stimming <stimming at tuhh.de>
+
+ * lib/libqof/qof/qofbackend.h, src/gnome-utils/gnc-file.c,
+ src/backend/file/gnc-backend-file.c: If the file type wasn't
+ recognized, check whether this failed because of no read
+ permission and give appropriate user feedback.
+
+ * src/backend/file/gnc-backend-file.c: Fix error checking for
+ non-existing filenames. Will now always give a "file not found"
+ message on nonexisting paths or filenames. #351351.
+
+2006-08-20 David Hampton <hampton at employees.org>
+
+ * src/backend/file/gnc-account-xml-v2.c:
+ * src/backend/file/gnc-commodity-xml-v2.c:
+ * src/gnome/top-level.c: Remove some conditional code that is no
+ longer compiled, or shouldn't be compiled in 2.2.
+
+ * src/gnome/gnc-plugin-page-account-tree.c: Maintain the account
+ hierarchy when reparenting the descendants of a deleted account.
+
+2006-08-20 Christian Stimming <stimming at tuhh.de>
+
+ * src/import-export/hbci/gnc-dtaus-import.[ch], gnc-plugin-hbci.c:
+ Add new HBCI action to File->Import that imports a DTAUS file and
+ sends all transfers as HBCI online transfers to the bank.
+
+2006-08-19 David Hampton <hampton at employees.org>
+
+ * src/gnome/gnucash-desktop*: Update so that bug-buddy 2.16 will
+ still allow you to file bugs against gnucash.
+
+ * src/engine/Account.c: Add missing call to xaccAccountBeginEdit.
+
+2006-08-18 David Hampton <hampton at employees.org>
+
+ * various: Add some 'const' declarations.
+
+2006-08-17 Christian Stimming <stimming at tuhh.de>
+
+ * lib/libqof/qof/qof.h, qofsession.c: Move #include "qofla-dir.h"
+ into qofsession.c because this is the only place where it is
+ used. Removes an often regenerated dependency from qof.h.
+
+2006-08-15 Christian Stimming <stimming at tuhh.de>
+
+ * src/import-export/hbci/dialog-hbcitrans.c, druid-hbci-initial.c:
+ Double-check really every string from aqbanking for valid utf-8
+ characters.
+
+ * src/core-utils/gnc-glib-utils.[hc]: Add
+ gnc_utf8_strip_invalid_strdup() that returns a stripped copy
+ instead of working in-place.
+
+ * src/import-export/hbci/dialog-hbcitrans.c (blz_changed_cb):
+ Ensure the encoding of the ktoblzcheck library is used
+ correctly. Their encoding is still always ISO-8859-1, but in
+ future versions they might change it to something else. We're
+ prepared now.
+
+2006-08-15 David Hampton <hampton at employees.org>
+
+ * src/core-utils/gnc-gconf-utils.[ch]:
+ * src/gnome-utils/dialog-preferences.c:
+ * src/gnome-utils/gnc-plugin.[ch]:
+ * src/gnome-utils/gnc-main-window.c:
+ * src/gnome-utils/dialog-reset-warnings.c:
+ * src/gnome-utils/gnc-tree-view.c: Remove overloading of an
+ argument passed to the gnc_gconf_add/remove_notification
+ functions.. This will solve a crash on Solaris caused by
+ g_vasprintf being passed a "%s" format string and a NULL as
+ argument.
+
+2006-08-14 David Hampton <hampton at employees.org>
+
+ * doc/tip_of_the_day.list.in: Add a tip for raising the accounts
+ menu in a register page.
+
2006-08-10 David Hampton <hampton at employees.org>
* src/import-export/qif-import/druid-qif-import.c: Fix account
@@ -34,9 +195,6 @@
* various: Unref all new stores.
- * src/gnome-utils/dialog-account.c: Check for account type
- compatibility when creating a new account. Fixes 344966.
-
* src/core-utils/gnc-gtk-utils.c: Unref entry completion, inline
completion only for gtk>=2.6.
Modified: gnucash/branches/swig-redo/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -46,6 +46,7 @@
make-gnucash-potfiles.in \
macros/aqbanking.m4 \
macros/as-scrub-include.m4 \
+ macros/binreloc.m4 \
macros/compiler-flags.m4 \
macros/ac_pkg_swig.m4 \
macros/gnome-guile-checks.m4 \
Copied: gnucash/branches/swig-redo/art (from rev 15000, gnucash/trunk/art)
Modified: gnucash/branches/swig-redo/configure.in
===================================================================
--- gnucash/branches/swig-redo/configure.in 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/configure.in 2006-10-15 04:08:48 UTC (rev 15023)
@@ -24,6 +24,10 @@
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_SRCDIR(src/engine/Transaction.h)
+AC_CONFIG_HEADERS(gsf-config.h)
+AC_CONFIG_HEADERS(goffice-config.h)
+AC_CONFIG_HEADERS(goffice-features.h)
+
# Initialize automake -- make sure we have at least version 1.9
AM_INIT_AUTOMAKE(1.9)
@@ -101,13 +105,44 @@
])
])
+##################################################
+# Check for win32 platform
+##################################################
+AC_MSG_CHECKING([for native Win32])
+case $host in
+ *-*-mingw*)
+ native_win32=yes
+ ;;
+ *)
+ native_win32=no
+ ;;
+esac
+AC_MSG_RESULT([$native_win32])
+AM_CONDITIONAL(OS_WIN32, test "x$native_win32" = "xyes")
+
+AC_MSG_CHECKING([for Win32 platform in general])
+case $host in
+ *-*-mingw*|*-*-cygwin*)
+ platform_win32=yes
+ ;;
+ *)
+ platform_win32=no
+ ;;
+esac
+AC_MSG_RESULT($platform_win32)
+AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes")
+##################################################
+
STRUCT_TM_GMTOFF_CHECK
SCANF_LLD_CHECK
if test x$am_cv_scanf_lld = "xno"; then
SCANF_QD_CHECK
- if test x$am_cv_scanf_qs = "xno"; then
- AC_MSG_ERROR([cannot continue, no long long conversion support in scanf])
+ if test x$am_cv_scanf_qd = "xno"; then
+ SCANF_I64D_CHECK
+ if test x$am_cv_scanf_i64d = "xno"; then
+ AC_MSG_ERROR([Cannot continue, no long long conversion support in scanf.])
+ fi
fi
fi
@@ -134,6 +169,9 @@
AC_CHECK_FUNCS(chown gethostname getppid getuid gettimeofday gmtime_r)
AC_CHECK_FUNCS(gethostid link)
+# Init binreloc
+AM_BINRELOC
+
### --------------------------------------------------------------------------
### See if we have pkg-config
@@ -249,8 +287,24 @@
### --------------------------------------------------------------------------
### Guile version checks (should this be something other than the Gnome check?)
+# If the user has given these values, cache them to override the
+# detected values.
+if test "x$GUILE_LIBS" != x; then
+ saved_GUILE_LIBS="$GUILE_LIBS"
+fi
+if test "x$GUILE_INCS" != x; then
+ saved_GUILE_INCS="$GUILE_INCS"
+fi
GUILE_LIBS=""
GNOME_CHECK_GUILE
+
+if test "x$saved_GUILE_LIBS" != x; then
+ GUILE_LIBS="$saved_GUILE_LIBS"
+fi
+if test "x$saved_GUILE_INCS" != x; then
+ GUILE_INCS="$saved_GUILE_INCS"
+fi
+
AS_SCRUB_INCLUDE(GUILE_INCS)
AC_SUBST(GUILE_LIBS)
@@ -305,6 +359,11 @@
sizeof(gint64)))
],[
AC_MSG_RESULT(no)
+],[
+ AC_MSG_RESULT(assuming yes)
+ AC_CHECK_LIB(guile, scm_long_long2num,
+ AC_DEFINE(GUILE_LONG_LONG_OK,1,is sizeof(long_long) >=
+ sizeof(gint64)))
])
CFLAGS="$GNC_OLDCFLAGS"
@@ -324,6 +383,8 @@
],[
AC_MSG_RESULT(no)
AC_MSG_ERROR(cannot continue, size of unsigned long too small.)
+],[
+ AC_MSG_RESULT(assuming yes)
])
CFLAGS="$GNC_OLDCFLAGS"
@@ -734,33 +795,11 @@
### --------------------------------------------------------------------------
### MT940
AC_ARG_ENABLE( mt940,
- [ --enable-mt940 compile with MT940 support (needs --enable-hbci)],
+ [ --enable-mt940 Obsolete, included in --enable-hbci],
if test "x$enableval" != "xno" ; then
- MT940_DIR=mt940 ;
- HBCI_DIR=hbci ;
+ AC_MSG_ERROR([--enable-mt940 is obsolete -- all functionality is already included in --enable-hbci])
fi)
-if test x${MT940_DIR} = xmt940 ;
-then
- AC_MSG_WARN([MT940 importing support is enabled but is totally experimental!])
- PKG_CHECK_MODULES(HBCI, aqbanking >= "1.3.0", [], [
- # aqbanking-1.3.0 was released on 2005-08-11
- AC_AQBANKING(1,3,0)
- if test x${have_aqbanking} != xyes;
- then
- AC_MSG_ERROR([Could not find aqbanking. If you use --enable-mt940, you *have* to enable aqbanking.])
- fi
- HBCI_LIBS="${aqbanking_libs}"
- HBCI_CFLAGS="${aqbanking_includes}"
- ])
- # Note: HBCI_LIBS is changed again below in the --enable-hbci
- # section. So check for mt940 first and *not* the other way round!
- AS_SCRUB_INCLUDE(HBCI_CFLAGS)
- AC_SUBST(HBCI_LIBS)
- AC_SUBST(HBCI_CFLAGS)
-fi
-AC_SUBST(MT940_DIR)
-
### --------------------------------------------------------------------------
### HBCI
AC_ARG_ENABLE( hbci,
@@ -771,8 +810,9 @@
if test x${HBCI_DIR} = xhbci ;
then
# Check for Aqbanking library
- PKG_CHECK_MODULES(HBCI, aqbanking >= "1.0.0", [], [
- AC_AQBANKING(1,0,0)
+ # aqbanking-1.6.0 was released on 2005-09-22
+ PKG_CHECK_MODULES(HBCI, aqbanking >= "1.6.0", [], [
+ AC_AQBANKING(1,6,0)
if test x${have_aqbanking} != xyes;
then
AC_MSG_ERROR([Could not find aqbanking. If you use --enable-hbci, you *have* to enable aqbanking.])
@@ -1143,21 +1183,39 @@
AC_SUBST(GSF_LIBS)
dnl $4=true => don't die if failure.
- PKG_CHECK_MODULES(GOFFICE, libgoffice-1 >= 0.0.4,,true)
- if $PKG_CONFIG --silence-errors 'libgoffice-1 >= 0.0.4'
+ PKG_CHECK_MODULES(GOFFICE, libgoffice-0.3 >= 0.3.0,,true)
+ if $PKG_CONFIG --silence-errors 'libgoffice-0.3 >= 0.3.0'
then
AC_DEFINE(HAVE_GOFFICE,1,[System has goffice-0.0.4 or better])
HAVE_GOFFICE=yes
else
- AC_MSG_RESULT(using internally-packaged goffice)
- GOFFICE_CFLAGS='-I${top_srcdir}/lib/goffice-0.0.4'
- GOFFICE_LIBS='${top_builddir}/lib/goffice-0.0.4/goffice/libgoffice-1.la'
- HAVE_GOFFICE=no
+ AC_MSG_RESULT(no)
+ PKG_CHECK_MODULES(GOFFICE, libgoffice-1 >= 0.0.4,,true)
+ if $PKG_CONFIG --silence-errors 'libgoffice-1 >= 0.0.4'
+ then
+ AC_DEFINE(HAVE_GOFFICE,1,[System has goffice-0.0.4 or better])
+ HAVE_GOFFICE=yes
+ else
+ AC_MSG_RESULT(using internally-packaged goffice)
+ GOFFICE_CFLAGS='-I${top_srcdir}/lib/goffice-0.0.4'
+ GOFFICE_LIBS='${top_builddir}/lib/goffice-0.0.4/goffice/libgoffice-1.la'
+ HAVE_GOFFICE=no
+ fi
fi
AM_CONDITIONAL(HAVE_GOFFICE, test "x$HAVE_GOFFICE" = "xyes")
AC_SUBST(GOFFICE_CFLAGS)
AC_SUBST(GOFFICE_LIBS)
+ ##################################################
+ # regex needs its own linker flag on win32 platform
+ ##################################################
+ if test "$platform_win32" = yes; then
+ REGEX_LIBS="-lregex"
+ else
+ REGEX_LIBS=""
+ fi
+ AC_SUBST(REGEX_LIBS)
+
### ------------------------------------------------------------------------
### Checks when building internal LIBGSF
### +libgsf-1.12.3
@@ -1183,11 +1241,6 @@
:libgsf_version_micro:libgsf_version_minor)
dnl NOTE: Above line needs no leading whitespace! --warlord
- dnl 2005-11-19,jsled, this doesn't seem to work... :(
- dnl ifelse(x$HAVE_LIBGSF, xyes,,
- AC_CONFIG_HEADERS(gsf-config.h)
- dnl)
-
AC_FUNC_FSEEKO
AC_SYS_LARGEFILE
@@ -1293,30 +1346,6 @@
macro_s_isreg=no])
AC_MSG_RESULT($macro_s_isreg)
- AC_MSG_CHECKING([for native Win32])
- case $host in
- *-*-mingw*)
- native_win32=yes
- ;;
- *)
- native_win32=no
- ;;
- esac
- AC_MSG_RESULT([$native_win32])
- AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)
-
- AC_MSG_CHECKING([for Win32 platform in general])
- case $host in
- *-*-mingw*|*-*-cygwin*)
- platform_win32=yes
- ;;
- *)
- platform_win32=no
- ;;
- esac
- AC_MSG_RESULT($platform_win32)
- AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = yes)
-
##################################################
# Checks for gtk-doc and docbook-tools
##################################################
@@ -1443,8 +1472,6 @@
else
- AM_CONDITIONAL(OS_WIN32, false)
- AM_CONDITIONAL(PLATFORM_WIN32, false)
# dnl AM_CONDITIONAL(GTK_DOC_INSTALLED, false)
# dnl AM_CONDITIONAL(ENABLE_GTK_DOC, false)
# dnl AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, false)
@@ -1477,13 +1504,6 @@
m4_eval(goffice_version_epoch + goffice_version_major)[]dnl
:goffice_version_minor:goffice_version_major)
dnl NOTE: Above line needs no leading whitespace! --warlord
-
- dnl This one is created by autoheader, ...
- AC_CONFIG_HEADERS(goffice-config.h)
-
- dnl ... and this one is a small subset, maintained manually,
- dnl which will be installed.
- AC_CONFIG_HEADERS(goffice-features.h)
dnl
dnl Make sure these two won't clash. Put the following to goffice-config.h:
AH_BOTTOM([/* Don't include goffice-features.h, it's a subset of goffice-config.h. */
@@ -1822,8 +1842,6 @@
AM_CONDITIONAL(HAVE_PANGO18, false )
AM_CONDITIONAL(HAVE_LIBGSF, false)
AM_CONDITIONAL(HAVE_GOFFICE, false)
- AM_CONDITIONAL(OS_WIN32, false)
- AM_CONDITIONAL(PLATFORM_WIN32, false)
AM_CONDITIONAL(WITH_LIBGSF_GNOME, false)
AM_CONDITIONAL(WITH_PYTHON, false)
@@ -2037,6 +2055,9 @@
fi
AC_MSG_RESULT($warnFLAGS)
+# Extend LDFLAGS because libtool on Windows requires this argument
+LDFLAGS="${LDFLAGS} -no-undefined"
+
### --------------------------------------------------------------------------
### Adjustments -- especially executables that aren't generated via
### makefiles, so that we don't have an opportunity to adjust them
@@ -2123,6 +2144,7 @@
lib/libqof/backend/Makefile
lib/libqof/backend/file/Makefile
packaging/Makefile
+ packaging/win32/gnucash.iss
src/Makefile
src/app-utils/Makefile
src/app-utils/test/Makefile
@@ -2152,6 +2174,7 @@
src/gnc-module/test/mod-baz/Makefile
src/gnc-module/test/misc-mods/Makefile
src/gnome/Makefile
+ src/gnome/gnucash.desktop.in
src/gnome/glade/Makefile
src/gnome/schemas/Makefile
src/gnome/ui/Makefile
@@ -2172,7 +2195,6 @@
src/import-export/schemas/Makefile
src/import-export/ofx/Makefile
src/import-export/ofx/test/Makefile
- src/import-export/mt940/Makefile
src/import-export/log-replay/Makefile
src/import-export/hbci/Makefile
src/import-export/hbci/glade/Makefile
@@ -2250,9 +2272,6 @@
if test x${HBCI_DIR} != x; then
components="$components hbci"
fi
-if test x${MT940_DIR} != x; then
-components="$components mt940"
-fi
AC_MSG_RESULT([
Options detected/selected
Modified: gnucash/branches/swig-redo/doc/tip_of_the_day.list.in
===================================================================
--- gnucash/branches/swig-redo/doc/tip_of_the_day.list.in 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/doc/tip_of_the_day.list.in 2006-10-15 04:08:48 UTC (rev 15023)
@@ -78,6 +78,9 @@
a style sheet for your report as a report option, and use \
the Edit -> Style Sheets menu to customize style sheets.")
+ N_( "To raise the accounts menu in the transfer field of a register \
+page, press the Menu key or the Ctrl-Down key combination.")
+
N_( "The GnuCash developers are easy to contact. As well \
as several mailing lists, you can chat to them live on IRC! \
Join them on #gnucash at irc.gnome.org")
Modified: gnucash/branches/swig-redo/lib/guile-www/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/lib/guile-www/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/guile-www/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -15,16 +15,20 @@
endif
.scm-links:
- rm -f www
- $(LN_S) -f . www
+ $(RM) -rf www
+ mkdir -p www
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd www; for A in $(gncscm_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
-CLEANFILES = www .scm-links
+clean-local:
+ $(RM) -rf www
+
+CLEANFILES = .scm-links
DISTCLEANFILES = ${SCM_FILE_LINKS}
endif # GNC_HAVE_GUILE_WWW (else clause)
Modified: gnucash/branches/swig-redo/lib/libqof/backend/file/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/backend/file/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/backend/file/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -7,7 +7,8 @@
-DLOCALE_DIR=\""$(datadir)/locale"\" \
${QOF_CFLAGS} \
${LIBXML2_CFLAGS} \
- ${GLIB_CFLAGS}
+ ${GLIB_CFLAGS} \
+ -I$(top_srcdir)/lib/libc
libgncqof_backend_qsf_la_SOURCES = \
qsf-backend.c \
@@ -18,7 +19,9 @@
libgncqof_backend_qsf_la_LIBADD = \
${QOF_LIBS} \
${GLIB_LIBS} \
- ${LIBXML2_LIBS}
+ ${REGEX_LIBS} \
+ ${LIBXML2_LIBS} \
+ $(top_builddir)/lib/libc/libc-missing.la
qsfschemadir = $(QOF_XML_DIR)
qsfschema_DATA = \
@@ -36,7 +39,7 @@
qsf-dir.h: qsf-dir.h.in Makefile
rm -f $@.tmp
sed < $< > $@.tmp \
- -e 's:@-QSF_SCHEMA_DIR-@:${QOF_XML_DIR}:g'
+ -e 's#@-QSF_SCHEMA_DIR-@#${QOF_XML_DIR}#g'
mv $@.tmp $@
BUILT_SOURCES = qsf-dir.h
Modified: gnucash/branches/swig-redo/lib/libqof/backend/file/qsf-backend.c
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/backend/file/qsf-backend.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/backend/file/qsf-backend.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -35,6 +35,10 @@
#include <errno.h>
#include <sys/stat.h>
+#ifndef HAVE_STRPTIME
+#include "strptime.h"
+#endif
+
#define QSF_TYPE_BINARY "binary"
#define QSF_TYPE_GLIST "glist"
#define QSF_TYPE_FRAME "frame"
Modified: gnucash/branches/swig-redo/lib/libqof/backend/file/qsf-xml-map.c
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/backend/file/qsf-xml-map.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/backend/file/qsf-xml-map.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -33,6 +33,10 @@
#include "qsf-xml.h"
#include "qsf-dir.h"
+#ifndef HAVE_STRPTIME
+#include "strptime.h"
+#endif
+
static QofLogModule log_module = QOF_MOD_QSF;
static void
Modified: gnucash/branches/swig-redo/lib/libqof/qof/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -3,6 +3,7 @@
libgncqof_la_LDFLAGS= -version-info $(LIBQOF_LIBRARY_VERSION)
libgncqof_la_LIBADD= \
$(GLIB_LIBS) \
+ $(REGEX_LIBS) \
$(top_builddir)/lib/libc/libc-missing.la
AM_CFLAGS = \
@@ -90,7 +91,7 @@
qofla-dir.h: $(srcdir)/qofla-dir.h.in Makefile
rm -f $@.tmp
sed < $< > $@.tmp \
- -e 's:@-libdir-@:${QOFLIBdir}:g'
+ -e 's#@-libdir-@#${QOFLIBdir}#g'
mv $@.tmp $@
BUILT_SOURCES = qofla-dir.h
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qof.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qof.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qof.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -100,7 +100,6 @@
#include "qofchoice.h"
#include "qofbookmerge.h"
#include "qofreference.h"
-#include "qofla-dir.h"
#include "deprecated.h"
/** allow easy logging of QSF debug messages */
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofbackend-p.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofbackend-p.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofbackend-p.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -382,7 +382,7 @@
@return 'y' if book is open, otherwise 'n'.
*/
-gchar qof_book_get_open_marker(QofBook *book);
+gchar qof_book_get_open_marker(const QofBook *book);
/** get the book version
@@ -391,13 +391,13 @@
@return -1 if no book exists, 0 if the book is
new, otherwise the book version number.
*/
-gint32 qof_book_get_version (QofBook *book);
+gint32 qof_book_get_version (const QofBook *book);
/** get the book tag number
used for kvp management in sql backends.
*/
-guint32 qof_book_get_idata (QofBook *book);
+guint32 qof_book_get_idata (const QofBook *book);
void qof_book_set_version (QofBook *book, gint32 version);
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofbackend.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofbackend.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofbackend.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -117,6 +117,7 @@
ERR_FILEIO_WRITE_ERROR, /**< couldn't write to the file */
ERR_FILEIO_READ_ERROR, /**< Could not open the file for reading. */
ERR_FILEIO_NO_ENCODING, /**< file does not specify encoding */
+ ERR_FILEIO_FILE_EACCES, /**< No read access permission for the given file */
/* network errors */
ERR_NETIO_SHORT_READ = 2000, /**< not enough bytes received */
@@ -273,7 +274,7 @@
qof_load_backend_library(const gchar *directory, const gchar* module_name);
/** \brief Retrieve the backend used by this book */
-QofBackend* qof_book_get_backend (QofBook *book);
+QofBackend* qof_book_get_backend (const QofBook *book);
void qof_book_set_backend (QofBook *book, QofBackend *);
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofbook.c
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofbook.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofbook.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -135,7 +135,7 @@
/* XXX this should probably be calling is_equal callbacks on gncObject */
gboolean
-qof_book_equal (QofBook *book_1, QofBook *book_2)
+qof_book_equal (const QofBook *book_1, const QofBook *book_2)
{
if (book_1 == book_2) return TRUE;
if (!book_1 || !book_2) return FALSE;
@@ -145,7 +145,7 @@
/* ====================================================================== */
gboolean
-qof_book_not_saved (QofBook *book)
+qof_book_not_saved (const QofBook *book)
{
if (!book) return FALSE;
@@ -185,15 +185,16 @@
}
void
-qof_book_print_dirty (QofBook *book)
+qof_book_print_dirty (const QofBook *book)
{
if (book->inst.dirty)
printf("book is dirty.\n");
- qof_book_foreach_collection(book, qof_collection_print_dirty, NULL);
+ qof_book_foreach_collection
+ (book, (QofCollectionForeachCB)qof_collection_print_dirty, NULL);
}
time_t
-qof_book_get_dirty_time (QofBook *book)
+qof_book_get_dirty_time (const QofBook *book)
{
return book->dirty_time;
}
@@ -209,14 +210,14 @@
/* getters */
QofBackend *
-qof_book_get_backend (QofBook *book)
+qof_book_get_backend (const QofBook *book)
{
if (!book) return NULL;
return book->backend;
}
gboolean
-qof_book_shutting_down (QofBook *book)
+qof_book_shutting_down (const QofBook *book)
{
if (!book) return FALSE;
return book->shutting_down;
@@ -262,7 +263,7 @@
}
gpointer
-qof_book_get_data (QofBook *book, const char *key)
+qof_book_get_data (const QofBook *book, const char *key)
{
if (!book || !key) return NULL;
return g_hash_table_lookup (book->data_tables, (gpointer)key);
@@ -271,7 +272,7 @@
/* ====================================================================== */
QofCollection *
-qof_book_get_collection (QofBook *book, QofIdType entity_type)
+qof_book_get_collection (const QofBook *book, QofIdType entity_type)
{
QofCollection *col;
@@ -302,7 +303,7 @@
}
void
-qof_book_foreach_collection (QofBook *book,
+qof_book_foreach_collection (const QofBook *book,
QofCollectionForeachCB cb, gpointer user_data)
{
struct _iterate iter;
@@ -324,19 +325,19 @@
book->book_open = 'n';
}
-gchar qof_book_get_open_marker(QofBook *book)
+gchar qof_book_get_open_marker(const QofBook *book)
{
if(!book) { return 'n'; }
return book->book_open;
}
-gint32 qof_book_get_version (QofBook *book)
+gint32 qof_book_get_version (const QofBook *book)
{
if(!book) { return -1; }
return book->version;
}
-guint32 qof_book_get_idata (QofBook *book)
+guint32 qof_book_get_idata (const QofBook *book)
{
if(!book) { return 0; }
return book->idata;
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofbook.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofbook.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofbook.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -99,11 +99,11 @@
* a non-NULL value. (Unless the system malloc failed (out of
* memory) in which case what happens??).
*/
-QofCollection * qof_book_get_collection (QofBook *, QofIdType);
+QofCollection * qof_book_get_collection (const QofBook *, QofIdType);
/** Invoke the indicated callback on each collection in the book. */
typedef void (*QofCollectionForeachCB) (QofCollection *, gpointer user_data);
-void qof_book_foreach_collection (QofBook *, QofCollectionForeachCB, gpointer);
+void qof_book_foreach_collection (const QofBook *, QofCollectionForeachCB, gpointer);
/** Return The kvp data for the book.
* Note that the book KVP data is persistent, and is stored/retrieved
@@ -134,10 +134,10 @@
QofBookFinalCB);
/** Retrieves arbitrary pointers to structs stored by qof_book_set_data. */
-gpointer qof_book_get_data (QofBook *book, const gchar *key);
+gpointer qof_book_get_data (const QofBook *book, const gchar *key);
/** Is the book shutting down? */
-gboolean qof_book_shutting_down (QofBook *book);
+gboolean qof_book_shutting_down (const QofBook *book);
/** qof_book_not_saved() will return TRUE if any
* data in the book hasn't been saved to long-term storage.
@@ -147,7 +147,7 @@
* 'dirty' flag. Its up to the backend to periodically reset this
* flag, when it actually does save the data.)
*/
-gboolean qof_book_not_saved (QofBook *book);
+gboolean qof_book_not_saved (const QofBook *book);
/** The qof_book_mark_saved() routine marks the book as having been
* saved (to a file, to a database). Used by backends to mark the
@@ -166,10 +166,10 @@
* and all subsidiary structures, printing out which structures
* have been marked dirty.
*/
-void qof_book_print_dirty (QofBook *book);
+void qof_book_print_dirty (const QofBook *book);
/** Retrieve the earliest modification time on the book. */
-time_t qof_book_get_dirty_time(QofBook *book);
+time_t qof_book_get_dirty_time(const QofBook *book);
/** Set the function to call when a book transitions from clean to
* dirty, or vice versa.
@@ -183,7 +183,7 @@
/** The qof_book_equal() method returns TRUE if books are equal.
* XXX this routine is broken, and does not currently compare data.
*/
-gboolean qof_book_equal (QofBook *book_1, QofBook *book_2);
+gboolean qof_book_equal (const QofBook *book_1, const QofBook *book_2);
/** This will 'get and increment' the named counter for this book.
* The return value is -1 on error or the incremented counter.
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofbookmerge.c
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofbookmerge.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofbookmerge.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -21,6 +21,7 @@
* *
********************************************************************/
+#include "config.h"
#include <glib.h>
#include "qof.h"
@@ -413,7 +414,7 @@
QofBookMergeData *mergeData;
g_return_if_fail(user_data != NULL);
- mergeData = (qof_book_mergeData*)user_data;
+ mergeData = (QofBookMergeData*)user_data;
g_return_if_fail(targetEnt != NULL);
mergeData->targetList = g_slist_prepend(mergeData->targetList,targetEnt);
}
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofchoice.c
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofchoice.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofchoice.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -41,7 +41,7 @@
return TRUE;
}
-gboolean qof_object_is_choice(QofIdType type)
+gboolean qof_object_is_choice(QofIdTypeConst type)
{
gpointer value, check;
@@ -67,7 +67,9 @@
return TRUE;
}
-gboolean qof_choice_add_class(char* select, char* option, char* param_name)
+gboolean qof_choice_add_class(const char* select,
+ char* option,
+ char* param_name)
{
GHashTable *param_table;
GList *option_list;
@@ -97,7 +99,9 @@
return choices;
}
-gboolean qof_choice_check(char* choice_obj, char *param_name, char* choice )
+gboolean qof_choice_check(const char* choice_obj,
+ const char *param_name,
+ const char* choice )
{
GList *choices, *result;
GHashTable *param_table;
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofchoice.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofchoice.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofchoice.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -113,7 +113,7 @@
@return TRUE if one or more choice parameters has been
registered using the object definition, otherwise FALSE.
*/
-gboolean qof_object_is_choice(QofIdType type);
+gboolean qof_object_is_choice(QofIdTypeConst type);
/** \brief Set an object as using QOF_TYPE_CHOICE. */
gboolean qof_choice_create(char* type);
@@ -127,7 +127,7 @@
@return FALSE if object is not a choice object or on error
otherwise TRUE.
*/
-gboolean qof_choice_add_class(char* choice, char* add, char* param_name);
+gboolean qof_choice_add_class(const char* choice, char* add, char* param_name);
/** \brief Return the list of all object types usable with this parameter.
@@ -150,7 +150,9 @@
@return TRUE if choice is found in the list of allowed choices for
this parameter of this object. Otherwise, FALSE
*/
-gboolean qof_choice_check(char* choice_obj, char *param_name, char* choice);
+gboolean qof_choice_check(const char* choice_obj,
+ const char *param_name,
+ const char* choice);
/** @} */
/** @} */
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofclass.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofclass.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofclass.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -151,6 +151,14 @@
*/
typedef void (*QofSetterFunc) (gpointer, gpointer);
+/* A callback for how to compare two (same-type) objects based on a
+ * common getter (parameter member), using the provided comparison
+ * options (which are the type-specific options).
+ */
+typedef gint (*QofCompareFunc) (gpointer a, gpointer b,
+ gint compare_options,
+ QofParam *getter);
+
/** This structure is for each queriable parameter in an object
*
* -- param_name is the name of the parameter.
@@ -174,6 +182,7 @@
QofType param_type;
QofAccessFunc param_getfcn;
QofSetterFunc param_setfcn;
+ QofCompareFunc param_compfcn;
gpointer param_userdata;
};
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofid-p.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofid-p.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofid-p.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -49,7 +49,7 @@
/** reset value of dirty flag */
void qof_collection_mark_clean (QofCollection *);
void qof_collection_mark_dirty (QofCollection *);
-void qof_collection_print_dirty (QofCollection *col, gpointer dummy);
+void qof_collection_print_dirty (const QofCollection *col, gpointer dummy);
/* @} */
/* @} */
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofid.c
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofid.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofid.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -113,7 +113,7 @@
}
const GUID *
-qof_entity_get_guid (QofEntity *ent)
+qof_entity_get_guid (const QofEntity *ent)
{
if (!ent) return guid_null();
return &ent->guid;
@@ -182,7 +182,7 @@
/* getters */
QofIdType
-qof_collection_get_type (QofCollection *col)
+qof_collection_get_type (const QofCollection *col)
{
return col->e_type;
}
@@ -303,7 +303,7 @@
}
QofEntity *
-qof_collection_lookup_entity (QofCollection *col, const GUID * guid)
+qof_collection_lookup_entity (const QofCollection *col, const GUID * guid)
{
QofEntity *ent;
g_return_val_if_fail (col, NULL);
@@ -332,7 +332,7 @@
}
guint
-qof_collection_count (QofCollection *col)
+qof_collection_count (const QofCollection *col)
{
guint c;
@@ -343,7 +343,7 @@
/* =============================================================== */
gboolean
-qof_collection_is_dirty (QofCollection *col)
+qof_collection_is_dirty (const QofCollection *col)
{
return col ? col->is_dirty : FALSE;
}
@@ -361,17 +361,17 @@
}
void
-qof_collection_print_dirty (QofCollection *col, gpointer dummy)
+qof_collection_print_dirty (const QofCollection *col, gpointer dummy)
{
if (col->is_dirty)
printf("%s collection is dirty.\n", col->e_type);
- qof_collection_foreach(col, qof_instance_print_dirty, NULL);
+ qof_collection_foreach(col, (QofEntityForeachCB)qof_instance_print_dirty, NULL);
}
/* =============================================================== */
gpointer
-qof_collection_get_data (QofCollection *col)
+qof_collection_get_data (const QofCollection *col)
{
return col ? col->data : NULL;
}
@@ -398,7 +398,7 @@
}
void
-qof_collection_foreach (QofCollection *col, QofEntityForeachCB cb_func,
+qof_collection_foreach (const QofCollection *col, QofEntityForeachCB cb_func,
gpointer user_data)
{
struct _iterate iter;
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofid.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofid.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofid.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -178,7 +178,7 @@
void qof_set_alt_dirty_mode (gboolean enabled);
/** Return the GUID of this entity */
-const GUID * qof_entity_get_guid (QofEntity *);
+const GUID * qof_entity_get_guid (const QofEntity *);
/** @name Collections of Entities
@{ */
@@ -187,22 +187,22 @@
QofCollection * qof_collection_new (QofIdType type);
/** return the number of entities in the collection. */
-guint qof_collection_count (QofCollection *col);
+guint qof_collection_count (const QofCollection *col);
/** destroy the collection */
void qof_collection_destroy (QofCollection *col);
/** return the type that the collection stores */
-QofIdType qof_collection_get_type (QofCollection *);
+QofIdType qof_collection_get_type (const QofCollection *);
/** Find the entity going only from its guid */
-QofEntity * qof_collection_lookup_entity (QofCollection *, const GUID *);
+QofEntity * qof_collection_lookup_entity (const QofCollection *, const GUID *);
/** Callback type for qof_entity_foreach */
typedef void (*QofEntityForeachCB) (QofEntity *, gpointer user_data);
/** Call the callback for each entity in the collection. */
-void qof_collection_foreach (QofCollection *, QofEntityForeachCB,
+void qof_collection_foreach (const QofCollection *, QofEntityForeachCB,
gpointer user_data);
/** Store and retreive arbitrary object-defined data
@@ -211,11 +211,11 @@
* destroyed, so that the user has a chance to clean up anything
* that was put in the 'data' member here.
*/
-gpointer qof_collection_get_data (QofCollection *col);
+gpointer qof_collection_get_data (const QofCollection *col);
void qof_collection_set_data (QofCollection *col, gpointer user_data);
/** Return value of 'dirty' flag on collection */
-gboolean qof_collection_is_dirty (QofCollection *col);
+gboolean qof_collection_is_dirty (const QofCollection *col);
/** @name QOF_TYPE_COLLECT: Linking one entity to many of one type
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofinstance.c
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofinstance.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofinstance.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -79,28 +79,28 @@
}
const GUID *
-qof_instance_get_guid (QofInstance *inst)
+qof_instance_get_guid (const QofInstance *inst)
{
if (!inst) return NULL;
return &inst->entity.guid;
}
QofBook *
-qof_instance_get_book (QofInstance *inst)
+qof_instance_get_book (const QofInstance *inst)
{
if (!inst) return NULL;
return inst->book;
}
KvpFrame*
-qof_instance_get_slots (QofInstance *inst)
+qof_instance_get_slots (const QofInstance *inst)
{
if (!inst) return NULL;
return inst->kvp_data;
}
Timespec
-qof_instance_get_last_update (QofInstance *inst)
+qof_instance_get_last_update (const QofInstance *inst)
{
if (!inst)
{
@@ -111,7 +111,7 @@
}
int
-qof_instance_version_cmp (QofInstance *left, QofInstance *right)
+qof_instance_version_cmp (const QofInstance *left, const QofInstance *right)
{
if (!left && !right) return 0;
if (!left) return -1;
@@ -124,7 +124,7 @@
}
void
-qof_instance_print_dirty (QofEntity *entity, gpointer dummy)
+qof_instance_print_dirty (const QofEntity *entity, gpointer dummy)
{
QofInstance *inst = QOF_INSTANCE(entity);
@@ -160,14 +160,14 @@
}
gboolean
-qof_instance_check_edit(QofInstance *inst)
+qof_instance_check_edit(const QofInstance *inst)
{
if(inst->editlevel > 0) { return TRUE; }
return FALSE;
}
gboolean
-qof_instance_do_free(QofInstance *inst)
+qof_instance_do_free(const QofInstance *inst)
{
return inst->do_free;
}
@@ -211,7 +211,7 @@
/* ========================================================== */
void
-qof_instance_gemini (QofInstance *to, QofInstance *from)
+qof_instance_gemini (QofInstance *to, const QofInstance *from)
{
time_t now;
@@ -234,7 +234,7 @@
}
QofInstance *
-qof_instance_lookup_twin (QofInstance *src, QofBook *target_book)
+qof_instance_lookup_twin (const QofInstance *src, QofBook *target_book)
{
QofCollection *col;
KvpFrame *fr;
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofinstance.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofinstance.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofinstance.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -57,13 +57,13 @@
void qof_instance_release (QofInstance *inst);
/** Return the book pointer */
-QofBook * qof_instance_get_book (QofInstance *);
+QofBook * qof_instance_get_book (const QofInstance *);
/** Return the GUID of this instance */
-const GUID * qof_instance_get_guid (QofInstance *);
+const GUID * qof_instance_get_guid (const QofInstance *);
/** Return the pointer to the kvp_data */
-KvpFrame* qof_instance_get_slots (QofInstance *);
+KvpFrame* qof_instance_get_slots (const QofInstance *);
/** Return the last time this instance was modified. If QofInstances
* are used with the QofObject storage backends, then the instance
@@ -71,7 +71,7 @@
* multi-user updates. Non-backend code should not set the update
* times.
*/
-Timespec qof_instance_get_last_update (QofInstance *inst);
+Timespec qof_instance_get_last_update (const QofInstance *inst);
/** Compare two instances, based on thier last update times.
* Returns a negative, zero or positive value, respectively,
@@ -79,9 +79,9 @@
* Accepts NULL pointers, NULL's are by definition earlier
* than any value.
*/
-int qof_instance_version_cmp (QofInstance *left, QofInstance *right);
+int qof_instance_version_cmp (const QofInstance *left, const QofInstance *right);
-void qof_instance_print_dirty (QofEntity *entity, gpointer dummy);
+void qof_instance_print_dirty (const QofEntity *entity, gpointer dummy);
/** Return value of is_dirty flag */
gboolean qof_instance_is_dirty (QofInstance *);
@@ -92,9 +92,9 @@
*/
void qof_instance_set_dirty(QofInstance* inst);
-gboolean qof_instance_check_edit(QofInstance *inst);
+gboolean qof_instance_check_edit(const QofInstance *inst);
-gboolean qof_instance_do_free(QofInstance *inst);
+gboolean qof_instance_do_free(const QofInstance *inst);
void qof_instance_mark_free(QofInstance *inst);
@@ -109,7 +109,7 @@
* the gemini kvp includes the book guid as well, so that the right book can
* be found.
*/
-void qof_instance_gemini (QofInstance *to, QofInstance *from);
+void qof_instance_gemini (QofInstance *to, const QofInstance *from);
/** The qof_instance_lookup_twin() routine will find the "twin" of this
* instance 'src' in the given other 'book' (if the twin exists).
@@ -125,7 +125,7 @@
* in 'book', and return it. If not found, it returns NULL. This
* routine uses the 'gemini' kvp values to do its work.
*/
-QofInstance * qof_instance_lookup_twin (QofInstance *src, QofBook *book);
+QofInstance * qof_instance_lookup_twin (const QofInstance *src, QofBook *book);
/* @} */
/* @} */
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofobject-p.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofobject-p.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofobject-p.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -40,7 +40,7 @@
void qof_object_book_begin (QofBook *book);
void qof_object_book_end (QofBook *book);
-gboolean qof_object_is_dirty (QofBook *book);
+gboolean qof_object_is_dirty (const QofBook *book);
void qof_object_mark_clean (QofBook *book);
/** \brief check an object can be created and supports iteration
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofobject.c
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofobject.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofobject.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -89,7 +89,7 @@
}
gboolean
-qof_object_is_dirty (QofBook *book)
+qof_object_is_dirty (const QofBook *book)
{
GList *l;
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofobject.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofobject.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofobject.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -92,7 +92,7 @@
void (*book_end)(QofBook *);
/** Determine if there are any dirty items in this book */
- gboolean (*is_dirty)(QofCollection *);
+ gboolean (*is_dirty)(const QofCollection *);
/** Mark this object's book clean (for after a load) */
void (*mark_clean)(QofCollection *);
@@ -104,7 +104,7 @@
* provide this routine, as without it, little of interest can
* be done.
*/
- void (*foreach)(QofCollection *, QofEntityForeachCB, gpointer);
+ void (*foreach)(const QofCollection *, QofEntityForeachCB, gpointer);
/** Given a particular item of this type, return a printable string.
*/
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofquery.c
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofquery.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofquery.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -473,13 +473,17 @@
*/
if (sort->param_fcns)
{
- sort->comp_fcn = qof_query_core_get_compare (resObj->param_type);
+ /* First, check if this parameter has a sort function override.
+ * if not then check if there's a global compare function for the type
+ */
+ if (resObj->param_compfcn)
+ sort->comp_fcn = resObj->param_compfcn;
+ else
+ sort->comp_fcn = qof_query_core_get_compare (resObj->param_type);
- /* Hrm, perhaps this is an object compare, not a core compare? */
+ /* Next, perhaps this is an object compare, not a core type compare? */
if (sort->comp_fcn == NULL)
- {
sort->obj_cmp = qof_class_get_default_sort (resObj->param_type);
- }
}
else if (!safe_strcmp (sort->param_list->data, QUERY_DEFAULT_SORT))
{
@@ -682,15 +686,17 @@
}
}
-GList * qof_query_run (QofQuery *q)
+static GList * qof_query_run_internal (QofQuery *q,
+ void(*run_cb)(QofQueryCB*,gpointer),
+ gpointer cb_arg)
{
GList *matching_objects = NULL;
- GList *node;
int object_count = 0;
if (!q) return NULL;
g_return_val_if_fail (q->search_for, NULL);
g_return_val_if_fail (q->books, NULL);
+ g_return_val_if_fail (run_cb, NULL);
ENTER (" q=%p", q);
/* XXX: Prioritize the query terms? */
@@ -712,27 +718,9 @@
memset (&qcb, 0, sizeof (qcb));
qcb.query = q;
- /* For each book */
- for (node=q->books; node; node=node->next)
- {
- QofBook *book = node->data;
- QofBackend *be = book->backend;
+ /* Run the query callback */
+ run_cb(&qcb, cb_arg);
- /* run the query in the backend */
- if (be)
- {
- gpointer compiled_query = g_hash_table_lookup (q->be_compiled, book);
-
- if (compiled_query && be->run_query)
- {
- (be->run_query) (be, compiled_query);
- }
- }
-
- /* And then iterate over all the objects */
- qof_object_foreach (q->search_for, book, (QofEntityForeachCB) check_item_cb, &qcb);
- }
-
matching_objects = qcb.list;
object_count = qcb.count;
}
@@ -794,7 +782,68 @@
return matching_objects;
}
+static void qof_query_run_cb(QofQueryCB* qcb, gpointer cb_arg)
+{
+ GList *node;
+
+ (void)cb_arg; /* unused */
+ g_return_if_fail(qcb);
+
+ for (node=qcb->query->books; node; node=node->next)
+ {
+ QofBook *book = node->data;
+ QofBackend *be = book->backend;
+
+ /* run the query in the backend */
+ if (be)
+ {
+ gpointer compiled_query = g_hash_table_lookup (qcb->query->be_compiled,
+ book);
+
+ if (compiled_query && be->run_query)
+ {
+ (be->run_query) (be, compiled_query);
+ }
+ }
+
+ /* And then iterate over all the objects */
+ qof_object_foreach (qcb->query->search_for, book,
+ (QofEntityForeachCB) check_item_cb, qcb);
+ }
+}
+
+GList * qof_query_run (QofQuery *q)
+{
+ /* Just a wrapper */
+ return qof_query_run_internal(q, qof_query_run_cb, NULL);
+}
+
+static void qof_query_run_subq_cb(QofQueryCB* qcb, gpointer cb_arg)
+{
+ QofQuery* pq = cb_arg;
+
+ g_return_if_fail(pq);
+ g_list_foreach(qof_query_last_run(pq), check_item_cb, qcb);
+}
+
GList *
+qof_query_run_subquery (QofQuery *subq, const QofQuery* primaryq)
+{
+ if (!subq) return NULL;
+ if (!primaryq) return NULL;
+
+ /* Make sure we're searching for the same thing */
+ g_return_val_if_fail (subq->search_for, NULL);
+ g_return_val_if_fail (primaryq->search_for, NULL);
+ g_return_val_if_fail(!safe_strcmp(subq->search_for, primaryq->search_for),
+ NULL);
+
+ /* Perform the subquery */
+ return qof_query_run_internal(subq, qof_query_run_subq_cb,
+ (gpointer)primaryq);
+}
+
+GList *
qof_query_last_run (QofQuery *query)
{
if (!query)
@@ -1204,7 +1253,7 @@
}
void qof_query_add_guid_match (QofQuery *q, GSList *param_list,
- const GUID *guid, QofQueryOp op)
+ const GUID *guid, QofQueryOp op)
{
GList *g = NULL;
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofquery.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofquery.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofquery.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -221,6 +221,16 @@
*/
GList * qof_query_last_run (QofQuery *query);
+/** Perform a subquery, return the results.
+ * Instead of running over a book, the subquery runs over the results
+ * of the primary query.
+ *
+ * Do NOT free the resulting list. This list is managed internally
+ * by QofQuery.
+ */
+GList * qof_query_run_subquery (QofQuery *subquery,
+ const QofQuery* primary_query);
+
/** Remove all query terms from query. query matches nothing
* after qof_query_clear().
*/
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore-p.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore-p.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore-p.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -45,14 +45,6 @@
QofParam *getter,
QofQueryPredData *pdata);
-/* A callback for how to compare two (same-type) objects based on a
- * common getter (parameter member), using the provided comparison
- * options (which are the type-specific options).
- */
-typedef gint (*QofCompareFunc) (gpointer a, gpointer b,
- gint compare_options,
- QofParam *getter);
-
/* Lookup functions */
QofQueryPredicateFunc qof_query_core_get_predicate (gchar const *type);
QofCompareFunc qof_query_core_get_compare (gchar const *type);
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore.c
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -24,6 +24,7 @@
#include "config.h"
#include <glib.h>
+#include <stdlib.h>
#include "qof.h"
#include "qofquerycore-p.h"
@@ -182,6 +183,36 @@
return safe_strcmp (s1, s2);
}
+int
+qof_string_number_compare_func (gpointer a, gpointer b, gint options,
+ QofParam *getter)
+{
+ const char *s1, *s2;
+ char *sr1, *sr2;
+ long i1, i2;
+ g_return_val_if_fail (a && b && getter &&getter->param_getfcn, COMPARE_ERROR);
+
+ s1 = ((query_string_getter)getter->param_getfcn) (a, getter);
+ s2 = ((query_string_getter)getter->param_getfcn) (b, getter);
+
+ // Deal with NULL strings
+ if (s1 == s2) return 0;
+ if (!s1 && s2) return -1;
+ if (s1 && !s2) return 1;
+
+ // Convert to integers and test
+ i1 = strtol(s1, &sr1, 0);
+ i2 = strtol(s2, &sr2, 0);
+ if (i1 < i2) return -1;
+ if (i1 > i2) return 1;
+
+ // If the integers match, then test the REST of the string as text.
+ if (options == QOF_STRING_MATCH_CASEINSENSITIVE)
+ return safe_strcasecmp (sr1, sr2);
+
+ return safe_strcmp (sr1, sr2);
+}
+
static void
string_free_pdata (QofQueryPredData *pd)
{
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofquerycore.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -187,6 +187,14 @@
*/
char * qof_query_core_to_string (QofType, gpointer object, QofParam *getter);
+/** Compare two parameter(strings) as if they are numbers!
+ * the two objects, a and b, are the objects being compared
+ * this_param is the QofParam for this parameter in the objects
+ */
+int qof_string_number_compare_func (gpointer a, gpointer b, gint options,
+ QofParam *this_param);
+
+
#endif /* QOF_QUERYCORE_H */
/* @} */
/* @} */
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofsession.c
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofsession.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofsession.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -45,6 +45,7 @@
#include "qofbook-p.h"
#include "qofsession-p.h"
#include "qofobject-p.h"
+#include "qofla-dir.h" /* for QOF_LIB_DIR */
/** \deprecated should not be static */
static QofSession * current_session = NULL;
@@ -1005,6 +1006,18 @@
*p = '\0';
qof_session_load_backend(session, access_method);
g_free (access_method);
+#ifdef G_OS_WIN32
+ if (NULL == session->backend)
+ {
+ /* Clear the error condition of previous errors */
+ qof_session_clear_error (session);
+
+ /* On windows, a colon can be part of a normal filename. So if
+ no backend was found (which means the part before the colon
+ wasn't an access method), fall back to the file backend. */
+ qof_session_load_backend(session, "file");
+ }
+#endif
}
else
{
Modified: gnucash/branches/swig-redo/lib/libqof/qof/qofutil.h
===================================================================
--- gnucash/branches/swig-redo/lib/libqof/qof/qofutil.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/lib/libqof/qof/qofutil.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -45,7 +45,15 @@
#if HAVE_SCANF_LLD
# define QOF_SCANF_LLD "%lld"
#else
-# define QOF_SCANF_LLD "%qd"
+# if HAVE_SCANF_QD
+# define QOF_SCANF_LLD "%qd"
+# else
+# if HAVE_SCANF_I64D
+# define QOF_SCANF_LLD "%I64d"
+# else
+# error "No scanf format string is known for LLD. Fix your ./configure so that the correct one is detected!"
+# endif
+# endif
#endif
#define QOF_MOD_UTIL "qof-utilities"
Copied: gnucash/branches/swig-redo/macros/binreloc.m4 (from rev 15000, gnucash/trunk/macros/binreloc.m4)
Modified: gnucash/branches/swig-redo/macros/legacy_macros.m4
===================================================================
--- gnucash/branches/swig-redo/macros/legacy_macros.m4 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/macros/legacy_macros.m4 2006-10-15 04:08:48 UTC (rev 15023)
@@ -14,13 +14,18 @@
AC_PATH_PROG(GUILE, guile, no)
fi
+dnl We expect the following variables:
+dnl - BUILD_GUILE="yes" if guile-config is available in PATH
+dnl - name_build_guile="guile-config" i.e. the name of guile-config
+dnl - GUILE="/usr/bin/guile" as detected above.
+
version_ok=
min_guile_version=ifelse([$1], , 1.3,$1)
max_guile_version=ifelse([$2], , 99.99.99,$2)
AC_MSG_CHECKING(for guile - ${min_guile_version} <= version < ${max_guile_version})
-if test x${BUILD_GUILE} != x -a ${BUILD_GUILE} != no ; then
+if test "x${BUILD_GUILE}" != x -a "x${BUILD_GUILE}" != xno ; then
guile_version=`${name_build_guile} --version 2>&1`
guile_version="$guile_version.0"
guile_major_version=`echo $guile_version | \
@@ -116,7 +121,18 @@
}
],
am_cv_scanf_lld=yes,
- am_cv_scanf_lld=no))
+ am_cv_scanf_lld=no,[[
+ # When cross-compiling, simply insert known values here
+ case $host in
+ *-*-mingw*)
+ # For mingw we know the result
+ am_cv_scanf_lld=no
+ ;;
+ *)
+ AC_MSG_ERROR([scanf support unknown.])
+ ;;
+ esac
+]]))
if test $am_cv_scanf_lld = yes; then
AC_DEFINE(HAVE_SCANF_LLD, 1,
[Define if scanf supports %lld conversions.])
@@ -146,13 +162,65 @@
}
],
am_cv_scanf_qd=yes,
- am_cv_scanf_qd=no))
+ am_cv_scanf_qd=no,[[
+ # When cross-compiling, simply insert known values here
+ case $host in
+ *-*-mingw*)
+ # For mingw we know the result
+ am_cv_scanf_qd=no
+ ;;
+ *)
+ AC_MSG_ERROR([scanf support unknown.])
+ ;;
+ esac
+]]))
if test $am_cv_scanf_qd = yes; then
AC_DEFINE(HAVE_SCANF_QD, 1,
[Define if scanf supports %qd conversions.])
fi
])
+AC_DEFUN([SCANF_I64D_CHECK],
+[
+ AC_CACHE_CHECK([if scanf supports %I64d conversions],
+ am_cv_scanf_i64d,
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+
+int main ()
+{
+ long long int d;
+ long long int e;
+
+ d = 0;
+ e = 100000;
+ e *= 100000;
+ if ((sscanf ("10000000000", "%I64d", &d) != 1) || (d != e))
+ exit (1);
+
+ exit (0);
+}
+],
+ am_cv_scanf_i64d=yes,
+ am_cv_scanf_i64d=no,[[
+ # When cross-compiling, simply insert known values here
+ case $host in
+ *-*-mingw*)
+ # For mingw we know the result
+ am_cv_scanf_i64d=yes
+ ;;
+ *)
+ AC_MSG_ERROR([scanf support unknown.])
+ ;;
+ esac
+]]))
+ if test $am_cv_scanf_i64d = yes; then
+ AC_DEFINE(HAVE_SCANF_I64D, 1,
+ [Define if scanf supports %I64d conversions.])
+ fi
+])
+
AC_DEFUN([LANGINFO_D_FMT_CHECK],
[
AC_CACHE_CHECK([for nl_langinfo and D_FMT], am_cv_langinfo_dfmt,
Modified: gnucash/branches/swig-redo/packaging/gnucash.spec.in
===================================================================
--- gnucash/branches/swig-redo/packaging/gnucash.spec.in 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/packaging/gnucash.spec.in 2006-10-15 04:08:48 UTC (rev 15023)
@@ -7,7 +7,9 @@
%define _with_ofx 0
%define _with_hbci 0
-%define fc_rel %(rpm -q --queryformat='%{VERSION}' fedora-release)
+# The --whatprovides redhat-release lets us work on RHEL as well as FC
+# Granted, it will look weird, but at least it wont fail outright.
+%define fc_rel %(rpm -q --queryformat='%{VERSION}' --whatprovides redhat-release)
%define version @-VERSION-@
%define __libtoolize /bin/true
@@ -48,6 +50,7 @@
BuildRequires: bzip2-devel, expat-devel, guile-devel
BuildRequires: libglade2-devel, libgsf-devel
BuildRequires: libjpeg-devel, openssl-devel
+BuildRequires: libtool-ltdl-devel
%description
GnuCash is a personal finance manager. A check-book like
@@ -183,8 +186,8 @@
%{_libdir}/*
%{_datadir}/gnucash
%{_datadir}/applications/*
-%{_datadir}/mime-info/gnucash.*
%{_datadir}/xml/gnucash/xsl/*
+%{_datadir}/pixmaps/*
%{_sysconfdir}/gconf/schemas/apps_gnucash*
%if %{_with_ofx}
%exclude %{_libdir}/gnucash/libgncmod-ofx*
Copied: gnucash/branches/swig-redo/packaging/win32 (from rev 15000, gnucash/trunk/packaging/win32)
Property changes on: gnucash/branches/swig-redo/packaging/win32
___________________________________________________________________
Name: svn:ignore
+ gnucash.iss
Modified: gnucash/branches/swig-redo/po/POTFILES.skip
===================================================================
--- gnucash/branches/swig-redo/po/POTFILES.skip 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/po/POTFILES.skip 2006-10-15 04:08:48 UTC (rev 15023)
@@ -4,6 +4,8 @@
src/import-export/csv/gnc-csv2glist.c
src/business/business-core/gncBusPeriod.c
src/backend/dwi/qofmap.c
+src/gnome-utils/gnctreemodelsort.c
+src/gnome-utils/gtktreedatalist.c
src/gnome-utils/gnc-tree-model-selection.c
src/backend/file/gncmod-backend-file.c
src/backend/file/io-gncbin-r.c
Modified: gnucash/branches/swig-redo/src/app-utils/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/app-utils/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -109,13 +109,14 @@
endif
.scm-links:
- rm -f gnucash
- $(LN_S) -f . gnucash
+ $(RM) -rf gnucash
+ mkdir -p gnucash
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
CLEANFILES = ${SCM_FILE_LINKS} gnucash .scm-links
Modified: gnucash/branches/swig-redo/src/app-utils/gnc-account-merge.c
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/gnc-account-merge.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/app-utils/gnc-account-merge.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,4 +1,5 @@
/* Copyright (C) 2006 Joshua Sled <jsled at asynchronous.org> */
+#include "config.h"
#include <glib.h>
#include "gnc-account-merge.h"
#include "Account.h"
Modified: gnucash/branches/swig-redo/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/gnc-ui-util.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/app-utils/gnc-ui-util.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -124,7 +124,7 @@
else
{
if (safe_strcmp (choice, "credit") != 0)
- PERR("bad value '%s'", choice);
+ PERR("bad value '%s'", choice ? choice : "(null)");
reverse_type[ACCT_TYPE_LIABILITY] = TRUE;
reverse_type[ACCT_TYPE_PAYABLE] = TRUE;
reverse_type[ACCT_TYPE_EQUITY] = TRUE;
Modified: gnucash/branches/swig-redo/src/app-utils/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/app-utils/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -24,8 +24,10 @@
--guile-load-dir ${top_srcdir}/src/scm \
--guile-load-dir ${top_builddir}/src/scm \
--guile-load-dir ${top_builddir}/src/gnome-utils \
+ --guile-load-dir ${top_builddir}/src/core-utils \
--guile-load-dir ${top_builddir}/src/gnome \
--library-dir ${top_builddir}/src/gnome-utils \
+ --library-dir ${top_builddir}/lib/libqof/qof \
--library-dir ${top_builddir}/src/gnome
TESTS_ENVIRONMENT := \
Modified: gnucash/branches/swig-redo/src/app-utils/test/test-print-parse-amount.c
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/test/test-print-parse-amount.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/app-utils/test/test-print-parse-amount.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,3 +1,4 @@
+#include "config.h"
#include <glib.h>
#include <stdlib.h>
Modified: gnucash/branches/swig-redo/src/app-utils/test/test-print-queries.c
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/test/test-print-queries.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/app-utils/test/test-print-queries.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,4 +1,5 @@
+#include "config.h"
#include <glib.h>
#include <libguile.h>
#include "guile-mappings.h"
Modified: gnucash/branches/swig-redo/src/app-utils/test/test-scm-query-string.c
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/test/test-scm-query-string.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/app-utils/test/test-scm-query-string.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,4 +1,5 @@
+#include "config.h"
#include <glib.h>
#include <libguile.h>
#include "guile-mappings.h"
Modified: gnucash/branches/swig-redo/src/backend/file/gnc-account-xml-v2.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/file/gnc-account-xml-v2.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/file/gnc-account-xml-v2.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -117,42 +117,6 @@
if(kf)
{
xmlNodePtr kvpnode = kvp_frame_to_dom_tree(act_slots_string, kf);
-#if ((GNUCASH_MAJOR_VERSION == 1) && (GNUCASH_MINOR_VERSION < 10))
- {
- /* Temporary backwards compatability hack. Create kvp slot
- * information for the stock quote data in case the user has
- * to fall back to the production code. */
- xmlNodePtr slot_node, val_node;
- gnc_commodity *com;
- gnc_quote_source *source;
- const gchar *tz;
-
- com = xaccAccountGetCommodity(act);
- if (com &&
- (!gnc_commodity_is_iso(com) ||
- xaccAccountGetType(act) == ACCT_TYPE_CURRENCY) &&
- gnc_commodity_get_quote_flag(com)) {
- if (!kvpnode)
- kvpnode= xmlNewNode(NULL, BAD_CAST act_slots_string);
-
- slot_node = xmlNewChild(kvpnode, NULL, BAD_CAST "slot", NULL);
- xmlNewTextChild(slot_node, NULL, BAD_CAST "slot:key", BAD_CAST "old-price-source");
-
- source = gnc_commodity_get_quote_source(com);
- val_node = xmlNewTextChild(slot_node, NULL, BAD_CAST "slot:value",
- BAD_CAST gnc_quote_source_get_old_internal_name(source));
- xmlSetProp(val_node, BAD_CAST "type", BAD_CAST "string");
-
- tz = gnc_commodity_get_quote_tz(com);
- if (tz) {
- slot_node = xmlNewChild(kvpnode, NULL, BAD_CAST "slot", NULL);
- xmlNewTextChild(slot_node, NULL, BAD_CAST "slot:key", BAD_CAST "old-quote-tz");
- val_node = xmlNewTextChild(slot_node, NULL, BAD_CAST "slot:value", BAD_CAST tz);
- xmlSetProp(val_node, BAD_CAST "type", BAD_CAST "string");
- }
- }
- }
-#endif
if(kvpnode)
{
xmlAddChild(ret, kvpnode);
Modified: gnucash/branches/swig-redo/src/backend/file/gnc-backend-file.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/file/gnc-backend-file.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/file/gnc-backend-file.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -199,37 +199,51 @@
gboolean ignore_lock, gboolean create_if_nonexistent)
{
FileBackend *be = (FileBackend*) be_start;
- char *p;
ENTER (" ");
/* Make sure the directory is there */
- be->dirname = xaccResolveFilePath(book_id);
- if (NULL == be->dirname)
+ be->fullpath = xaccResolveFilePath(book_id);
+ if (NULL == be->fullpath)
{
qof_backend_set_error (be_start, ERR_FILEIO_FILE_NOT_FOUND);
return;
}
- be->fullpath = g_strdup (be->dirname);
be->be.fullpath = be->fullpath;
- p = strrchr (be->dirname, '/');
- if (p && p != be->dirname)
+ be->dirname = g_path_get_dirname (be->fullpath);
+
{
struct stat statbuf;
int rc;
- *p = '\0';
+ /* Again check whether the directory can be accessed */
rc = stat (be->dirname, &statbuf);
if (rc != 0 || !S_ISDIR(statbuf.st_mode))
{
+ /* Error on stat or if it isn't a directory means we
+ cannot find this filename */
qof_backend_set_error (be_start, ERR_FILEIO_FILE_NOT_FOUND);
g_free (be->fullpath); be->fullpath = NULL;
g_free (be->dirname); be->dirname = NULL;
return;
}
+
+ /* Now check whether we can stat(2) the file itself */
rc = stat (be->fullpath, &statbuf);
+ if ((rc != 0) && (!create_if_nonexistent))
+ {
+ /* Error on stat means the file doesn't exist */
+ qof_backend_set_error (be_start, ERR_FILEIO_FILE_NOT_FOUND);
+ g_free (be->fullpath); be->fullpath = NULL;
+ g_free (be->dirname); be->dirname = NULL;
+ return;
+ }
if (rc == 0 && S_ISDIR(statbuf.st_mode))
{
+ /* FIXME: What is actually checked here? Whether the
+ fullpath erroneously points to a directory or what?
+ Then the error message should be changed into something
+ much more clear! */
qof_backend_set_error (be_start, ERR_FILEIO_UNKNOWN_FILE_TYPE);
g_free (be->fullpath); be->fullpath = NULL;
g_free (be->dirname); be->dirname = NULL;
@@ -267,8 +281,23 @@
if (be->lockfd > 0)
close (be->lockfd);
- if (be->lockfile)
- unlink (be->lockfile);
+ if (be->lockfile) {
+ int rv;
+#ifdef G_OS_WIN32
+ /* On windows, we need to allow write-access before
+ unlink() can succeed */
+ rv = chmod (be->lockfile, S_IWRITE | S_IREAD);
+ if (rv) {
+ PWARN("Error on chmod(%s): %d: %s", be->lockfile,
+ errno, strerror(errno) ? strerror(errno) : "");
+ }
+#endif
+ rv = unlink (be->lockfile);
+ if (rv) {
+ PWARN("Error on unlink(%s): %d: %s", be->lockfile,
+ errno, strerror(errno) ? strerror(errno) : "");
+ }
+ }
g_free (be->dirname);
be->dirname = NULL;
@@ -667,7 +696,7 @@
if (gnc_file_be_select_files (dent) == 0)
continue;
- name = g_strconcat(be->dirname, "/", dent->d_name, NULL);
+ name = g_build_filename(be->dirname, dent->d_name, (char*)NULL);
len = strlen(name) - 4;
/* Is this file associated with the current data file */
@@ -758,12 +787,12 @@
/* XXX it would be nice for the user if we made the book
* closing date and/or title part of the file-name. */
- p = strrchr (str, '/');
+ p = strrchr (str, G_DIR_SEPARATOR);
p++;
p = stpcpy (p, "book-");
p = guid_to_string_buff (qof_book_get_guid(book), p);
p = stpcpy (p, "-");
- q = strrchr (fbe->fullpath, '/');
+ q = strrchr (fbe->fullpath, G_DIR_SEPARATOR);
q++;
p = stpcpy (p, q);
p = stpcpy (p, ".gml");
@@ -865,8 +894,24 @@
if (FALSE == rc) error = ERR_FILEIO_PARSE_ERROR;
break;
default:
- PWARN("File not any known type");
- error = ERR_FILEIO_UNKNOWN_FILE_TYPE;
+ /* If file type wasn't known, check errno again to give the
+ user some more useful feedback for some particular error
+ conditions. */
+ switch (errno)
+ {
+ case EACCES: /* No read permission */
+ PWARN("No read permission to file");
+ error = ERR_FILEIO_FILE_EACCES;
+ break;
+ case EISDIR: /* File is a directory - but on this error we don't arrive here */
+ PWARN("Filename is a directory");
+ error = ERR_FILEIO_FILE_NOT_FOUND;
+ break;
+ default:
+ PWARN("File not any known type");
+ error = ERR_FILEIO_UNKNOWN_FILE_TYPE;
+ break;
+ }
break;
}
Modified: gnucash/branches/swig-redo/src/backend/file/gnc-commodity-xml-v2.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/file/gnc-commodity-xml-v2.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/file/gnc-commodity-xml-v2.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -79,13 +79,7 @@
xmlAddChild(ret, text_to_dom_tree(cmdty_id,
gnc_commodity_get_mnemonic(com)));
- /* Enforce backward compatability with 1.8 for the 1.9/2.0 release
- * series. */
- if (
-#if (GNUCASH_MAJOR_VERSION < 2) || ((GNUCASH_MAJOR_VERSION == 2) && (GNUCASH_MINOR_VERSION == 0))
- TRUE ||
-#endif
- !currency) {
+ if (!currency) {
if(gnc_commodity_get_fullname(com))
{
xmlAddChild(ret, text_to_dom_tree(cmdty_name,
Modified: gnucash/branches/swig-redo/src/backend/file/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/backend/file/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/file/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -62,7 +62,7 @@
${top_srcdir}/src/backend/file/sixtp-stack.c \
${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
test-string-converters.c
-
+
test_xml_account_SOURCES = \
${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
@@ -181,6 +181,8 @@
--gnc-module-dir ${top_builddir}/src/gnc-module \
--gnc-module-dir ${top_builddir}/src/engine \
--gnc-module-dir ${top_srcdir}/src/gnc-module \
+ --library-dir ${top_builddir}/src/backend/file \
+ --library-dir ${top_builddir}/lib/libqof/qof \
--gnc-module-dir ${top_srcdir}/src/engine
TESTS_ENVIRONMENT := \
Modified: gnucash/branches/swig-redo/src/backend/file/test/test-load-backend.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/file/test/test-load-backend.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/file/test/test-load-backend.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -25,6 +25,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include "qof.h"
#include "cashobjects.h"
#include "test-stuff.h"
Modified: gnucash/branches/swig-redo/src/backend/file/test/test-load-example-account.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/file/test/test-load-example-account.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/file/test/test-load-example-account.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -21,6 +21,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include <glib.h>
#include <libguile.h>
#include <string.h>
Modified: gnucash/branches/swig-redo/src/backend/file/test/test-load-xml2.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/file/test/test-load-xml2.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/file/test/test-load-xml2.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -26,6 +26,7 @@
* @brief test the loading of a version-2 gnucash XML file
*/
+#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
Modified: gnucash/branches/swig-redo/src/backend/file/test/test-save-in-lang.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/file/test/test-save-in-lang.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/file/test/test-save-in-lang.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,3 +1,4 @@
+#include "config.h"
#include <glib.h>
#include <unistd.h>
#include <sys/types.h>
Modified: gnucash/branches/swig-redo/src/backend/file/test/test-xml2-is-file.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/file/test/test-xml2-is-file.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/file/test/test-xml2-is-file.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,3 +1,4 @@
+#include "config.h"
#include <stdlib.h>
#include <string.h>
Modified: gnucash/branches/swig-redo/src/backend/postgres/putil.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/postgres/putil.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/postgres/putil.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -31,6 +31,7 @@
*
*/
+#include "config.h"
#include <glib.h>
#include <glib/gi18n.h>
#include <libpq-fe.h>
Modified: gnucash/branches/swig-redo/src/backend/postgres/test/test-db.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/postgres/test/test-db.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/postgres/test/test-db.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -15,6 +15,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include <glib.h>
#include <libpq-fe.h>
#include <stdlib.h>
Modified: gnucash/branches/swig-redo/src/backend/postgres/test/test-load-backend.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/postgres/test/test-load-backend.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/postgres/test/test-load-backend.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -25,6 +25,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include "qof.h"
#include "cashobjects.h"
#include "test-stuff.h"
Modified: gnucash/branches/swig-redo/src/backend/postgres/test/test-period.c
===================================================================
--- gnucash/branches/swig-redo/src/backend/postgres/test/test-period.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/backend/postgres/test/test-period.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -22,6 +22,7 @@
* December 2001
*/
+#include "config.h"
#include <ctype.h>
#include <glib.h>
#include <time.h>
Modified: gnucash/branches/swig-redo/src/bin/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/bin/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/bin/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -2,11 +2,10 @@
SUBDIRS = . overrides test
AM_CFLAGS = -I${top_builddir} ${GLIB_CFLAGS} ${GNOME_CFLAGS} ${GTK_CFLAGS} \
+ ${GUILE_INCS} \
${QOF_CFLAGS} \
- -DPREFIX=\"${prefix}\" \
- -DSYSCONFDIR=\"${GNC_CONFIGDIR}\" \
- -DDATADIR=\"${GNC_SHAREDIR}\" \
- -DLIBDIR=\"${GNC_LIBDIR}\" \
+ -DPKGSYSCONFDIR=\"${GNC_CONFIGDIR}\" \
+ -DPKGDATADIR=\"${GNC_SHAREDIR}\" \
-DGNC_HELPDIR=\"${GNC_HELPDIR}\" \
-I${top_srcdir}/src \
-I${top_srcdir}/src/core-utils \
@@ -31,35 +30,26 @@
gnucash: gnucash.in ${top_builddir}/config.status Makefile
rm -f $@.tmp
sed < $< > $@.tmp \
- -e 's:@-BIN_DIR-@:${bindir}:g' \
- -e 's:@-GNC_GUILE_MODULE_DIR-@:${GNC_SHAREDIR}/guile-modules:g' \
- -e 's:@-GNC_SCM_INSTALL_DIR-@:${GNC_SCM_INSTALL_DIR}:g' \
- -e 's:@-GNC_LIB_INSTALLDIR-@:${libdir}:' \
- -e 's:@-GNC_PKGLIB_INSTALLDIR-@:${pkglibdir}:g' \
- -e 's:@-GNC_MODULE_DIR-@:${GNC_MODULE_DIR}:g'
+ -e 's#@-BIN_DIR-@#${bindir}#g' \
+ -e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
+ -e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
+ -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \
+ -e 's#@-GNC_PKGLIB_INSTALLDIR-@#${pkglibdir}#g' \
+ -e 's#@-PATH_SEPARATOR-@#${PATH_SEPARATOR}#g' \
+ -e 's#@-GNC_MODULE_DIR-@#${GNC_MODULE_DIR}#g'
mv $@.tmp $@
chmod u+x $@
-BUILT_SOURCES = i18n.h
-
-i18n.h: i18n.h.in ${top_builddir}/config.status Makefile
- rm -f $@.tmp
- sed < $< > $@.tmp \
- -e 's:@-PACKAGE-@:${PACKAGE}:g' \
- -e 's:@-LOCALE_DIR-@:${LOCALE_DIR}:g'
- mv $@.tmp $@
-
-
gnucash-valgrind: gnucash-valgrind.in ${top_builddir}/config.status Makefile
rm -f $@.tmp
sed < $< > $@.tmp \
- -e 's:@-BIN_DIR-@:${bindir}:g' \
- -e 's:@-GNC_GUILE_MODULE_DIR-@:${GNC_SHAREDIR}/guile-modules:g' \
- -e 's:@-GNC_SCM_INSTALL_DIR-@:${GNC_SCM_INSTALL_DIR}:g' \
- -e 's:@-GNC_LIB_INSTALLDIR-@:${libdir}:' \
- -e 's:@-GNC_PKGLIB_INSTALLDIR-@:${pkglibdir}:g' \
- -e 's:@-GNC_MODULE_DIR-@:${GNC_MODULE_DIR}:g' \
- -e "s:@-TOP_SRC_DIR-@:`pwd`/${top_srcdir}:g"
+ -e 's#@-BIN_DIR-@#${bindir}#g' \
+ -e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
+ -e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
+ -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \
+ -e 's#@-GNC_PKGLIB_INSTALLDIR-@#${pkglibdir}#g' \
+ -e 's#@-GNC_MODULE_DIR-@#${GNC_MODULE_DIR}#g' \
+ -e "s#@-TOP_SRC_DIR-@#`pwd`/${top_srcdir}#g"
mv $@.tmp $@
chmod u+x $@
@@ -87,7 +77,7 @@
# if you change gncoverridedir, make sure you change ./overrides/Makefile.am too.
gncoverridesdir = ${GNC_LIBEXECDIR}/overrides
-EXTRA_DIST = generate-gnc-script update-gnucash-gconf.in i18n.h.in \
+EXTRA_DIST = generate-gnc-script update-gnucash-gconf.in \
gnucash.in gnucash-valgrind.in
## Gnucash scripts -- real code is in overrides, these just get you there.
@@ -104,6 +94,6 @@
${top_builddir}/config.status Makefile
rm -f $@.tmp
sed < $< > $@.tmp \
- -e 's:@-GCONF_SCHEMA_FILE_DIR-@:${GCONF_SCHEMA_FILE_DIR}:g'
+ -e 's#@-GCONF_SCHEMA_FILE_DIR-@#${GCONF_SCHEMA_FILE_DIR}#g'
mv $@.tmp $@
chmod +x $@
Modified: gnucash/branches/swig-redo/src/bin/gnucash-bin.c
===================================================================
--- gnucash/branches/swig-redo/src/bin/gnucash-bin.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/bin/gnucash-bin.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -33,7 +33,8 @@
#include <libgnome/libgnome.h>
#include "glib.h"
#include "gnc-module.h"
-#include "i18n.h"
+#include "gnc-path.h"
+#include "binreloc.h"
#include "gnc-version.h"
#include "gnc-engine.h"
#include "gnc-filepath-utils.h"
@@ -53,6 +54,11 @@
#include "engine-helpers.h"
#include "swig-runtime.h"
+#ifdef HAVE_GETTEXT
+# include <libintl.h>
+# include <locale.h>
+#endif
+
/* GNUCASH_SVN is defined whenever we're building from an SVN tree */
#ifdef GNUCASH_SVN
static int is_development_version = TRUE;
@@ -83,8 +89,8 @@
/* Priority of paths: The default is set at build time. It may be
overridden by environment variables, which may, in turn, be
overridden by command line options. */
-static char *config_path = SYSCONFDIR;
-static char *share_path = DATADIR;
+static char *config_path = PKGSYSCONFDIR;
+static char *share_path = PKGDATADIR;
static char *help_path = GNC_HELPDIR;
static void
@@ -133,6 +139,7 @@
if (is_system_config_loaded) return;
update_message("loading system configuration");
+ /* FIXME: use runtime paths from gnc-path.c here */
system_config = g_build_filename(config_path, "config", NULL);
is_system_config_loaded = gfec_try_load(system_config);
g_free(system_config);
@@ -333,7 +340,6 @@
{ "gnucash/register/register-gnome", 0, FALSE },
{ "gnucash/import-export/qif-import", 0, FALSE },
{ "gnucash/import-export/ofx", 0, TRUE },
- { "gnucash/import-export/mt940", 0, TRUE },
{ "gnucash/import-export/log-replay", 0, TRUE },
{ "gnucash/import-export/hbci", 0, TRUE },
{ "gnucash/report/report-system", 0, FALSE },
@@ -355,8 +361,14 @@
gnc_module_load(modules[i].name, modules[i].version);
}
if (!gnc_engine_is_initialized()) {
+#ifdef G_OS_WIN32
+ g_warning("GnuCash engine indicates it hasn't been initialized correctly. On Windows this mechanism is know not to work. Ignoring for now.\n");
+ /* See more detailed discussion here
+ https://lists.gnucash.org/pipermail/gnucash-devel/2006-September/018529.html */
+#else
g_error("GnuCash engine failed to initialize. Exiting.\n");
exit(0);
+#endif
}
}
@@ -487,14 +499,22 @@
int main(int argc, char ** argv)
{
+ gchar *localedir;
+ GError *binreloc_error = NULL;
+ /* Init binreloc */
+ if (!gbr_init (&binreloc_error) ) {
+ printf("main: Error on gbr_init: %s\n", binreloc_error->message);
+ }
+ localedir = gnc_path_get_localedir ();
#ifdef HAVE_GETTEXT
/* setlocale (LC_ALL, ""); is already called by gtk_set_locale()
via gtk_init(). */
- bindtextdomain (TEXT_DOMAIN, LOCALE_DIR);
- textdomain (TEXT_DOMAIN);
- bind_textdomain_codeset (TEXT_DOMAIN, "UTF-8");
+ bindtextdomain (GETTEXT_PACKAGE, localedir);
+ textdomain (GETTEXT_PACKAGE);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
+ g_free (localedir);
gnc_module_system_init();
envt_override();
@@ -502,12 +522,24 @@
gnc_print_unstable_message();
if (add_quotes_file) {
+ gchar *prefix = gnc_path_get_prefix ();
+ gchar *pkgsysconfdir = gnc_path_get_pkgsysconfdir ();
+ gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
+ gchar *pkglibdir = gnc_path_get_pkglibdir ();
/* This option needs to run without a display, so we can't
initialize any GUI libraries. */
gnome_program_init(
"gnucash", VERSION, LIBGNOME_MODULE,
argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES, GNOME_PARAM_NONE);
+ GNOME_PARAM_APP_PREFIX, prefix,
+ GNOME_PARAM_APP_SYSCONFDIR, pkgsysconfdir,
+ GNOME_PARAM_APP_DATADIR, pkgdatadir,
+ GNOME_PARAM_APP_LIBDIR, pkglibdir,
+ GNOME_PARAM_NONE);
+ g_free (prefix);
+ g_free (pkgsysconfdir);
+ g_free (pkgdatadir);
+ g_free (pkglibdir);
scm_boot_guile(argc, argv, inner_main_add_price_quotes, 0);
exit(0); /* never reached */
}
Modified: gnucash/branches/swig-redo/src/bin/gnucash.in
===================================================================
--- gnucash/branches/swig-redo/src/bin/gnucash.in 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/bin/gnucash.in 2006-10-15 04:08:48 UTC (rev 15023)
@@ -6,18 +6,18 @@
GUILE_WARN_DEPRECATED="no"
export GUILE_WARN_DEPRECATED
-GNC_MODULE_PATH="@-GNC_PKGLIB_INSTALLDIR-@:${GNC_MODULE_PATH}"
+GNC_MODULE_PATH="@-GNC_PKGLIB_INSTALLDIR-@@-PATH_SEPARATOR-@${GNC_MODULE_PATH}"
-EXTRA_PATH="${EXTRA_PATH}:@-GNC_GUILE_MODULE_DIR-@"
-EXTRA_PATH="${EXTRA_PATH}:@-GNC_SCM_INSTALL_DIR-@"
-GUILE_LOAD_PATH="${EXTRA_PATH}:${GUILE_LOAD_PATH}"
+EXTRA_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@@-GNC_GUILE_MODULE_DIR-@"
+EXTRA_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@@-GNC_SCM_INSTALL_DIR-@"
+GUILE_LOAD_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@${GUILE_LOAD_PATH}"
EXTRA_LIBS="${GNC_MODULE_PATH}"
-EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_LIB_INSTALLDIR-@"
-EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_MODULE_DIR-@"
+EXTRA_LIBS="${EXTRA_LIBS}@-PATH_SEPARATOR-@@-GNC_LIB_INSTALLDIR-@"
+EXTRA_LIBS="${EXTRA_LIBS}@-PATH_SEPARATOR-@@-GNC_MODULE_DIR-@"
-LD_LIBRARY_PATH="${EXTRA_LIBS}:${LD_LIBRARY_PATH}"
-LTDL_LIBRARY_PATH="${EXTRA_LIBS}:${LTDL_LIBRARY_PATH}"
+LD_LIBRARY_PATH="${EXTRA_LIBS}@-PATH_SEPARATOR-@${LD_LIBRARY_PATH}"
+LTDL_LIBRARY_PATH="${EXTRA_LIBS}@-PATH_SEPARATOR-@${LTDL_LIBRARY_PATH}"
export GNC_MODULE_PATH
export GUILE_LOAD_PATH
Deleted: gnucash/branches/swig-redo/src/bin/i18n.h.in
===================================================================
--- gnucash/branches/swig-redo/src/bin/i18n.h.in 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/bin/i18n.h.in 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,29 +0,0 @@
-/**-*-c-*-***********************************************************\
- * i18n.h -- internationalization with gettext *
- * Copyright (C) 1999 Laurent Pélecq *
- * Copyright (C) 2000 Dave Peticolas <peticola at cs.ucdavis.edu> *
- * *
- * 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, write to the Free Software *
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
-\********************************************************************/
-
-#include "config.h"
-
-#ifdef HAVE_GETTEXT
-# include <libintl.h>
-# include <locale.h>
-#endif
-
-#define TEXT_DOMAIN "@-PACKAGE-@"
-#define LOCALE_DIR "@-LOCALE_DIR-@"
Modified: gnucash/branches/swig-redo/src/bin/overrides/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/bin/overrides/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/bin/overrides/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -23,7 +23,7 @@
guile: guile.in ${top_builddir}/config.status Makefile
rm -f $@.tmp
sed < $< > $@.tmp \
- -e 's:@-GUILE-@:${GUILE}:'
+ -e 's#@-GUILE-@#${GUILE}#'
mv $@.tmp $@
chmod u+x $@
CLEANFILES = guile
@@ -31,12 +31,12 @@
gnucash-env: gnucash-env.in ${top_builddir}/config.status Makefile
rm -f $@.tmp
sed < $< > $@.tmp \
- -e 's:@-GNC_GUILE_MODULE_DIR-@:${GNC_SHAREDIR}/guile-modules:g' \
- -e 's:@-GNC_SCM_INSTALL_DIR-@:${GNC_SCM_INSTALL_DIR}:g' \
- -e 's:@-GNC_LIB_INSTALLDIR-@:${libdir}:' \
- -e 's:@-GNC_PKGLIB_INSTALLDIR-@:${pkglibdir}:g' \
- -e 's:@-GNC_MODULE_DIR-@:${GNC_MODULE_DIR}:g' \
- -e 's:@-GNC_SCRIPT_OVERRIDE_DIR-@:${gncoverridedir}:g'
+ -e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
+ -e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
+ -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \
+ -e 's#@-GNC_PKGLIB_INSTALLDIR-@#${pkglibdir}#g' \
+ -e 's#@-GNC_MODULE_DIR-@#${GNC_MODULE_DIR}#g' \
+ -e 's#@-GNC_SCRIPT_OVERRIDE_DIR-@#${gncoverridedir}#g'
mv $@.tmp $@
chmod u+x $@
CLEANFILES += gnucash-env
@@ -44,9 +44,9 @@
gnucash-build-env: gnucash-build-env.in ${top_builddir}/config.status Makefile
rm -f $@.tmp
sed < $< > $@.tmp \
- -e 's:@-GNC_TEST_SRFI_LOAD_CMD-@:@GNC_TEST_SRFI_LOAD_CMD@:g' \
- -e 's:@-GNC_BUILDDIR-@:${PWD}/${top_builddir}:g' \
- -e 's:@-GNC_SRCDIR-@:${PWD}/${top_srcdir}:g'
+ -e 's#@-GNC_TEST_SRFI_LOAD_CMD-@#@GNC_TEST_SRFI_LOAD_CMD@#g' \
+ -e 's#@-GNC_BUILDDIR-@#${PWD}/${top_builddir}#g' \
+ -e 's#@-GNC_SRCDIR-@#${PWD}/${top_srcdir}#g'
mv $@.tmp $@
chmod u+x $@
CLEANFILES += gnucash-build-env
Modified: gnucash/branches/swig-redo/src/bin/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/bin/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/bin/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -2,6 +2,6 @@
TESTS = test-version
TESTS_ENVIRONMENT := \
- PATH="..:${PATH}"
+ PATH="..:${PATH}" LD_LIBRARY_PATH="${top_builddir}/lib/libqof/qof/.libs:${LD_LIBRARY_PATH}"
EXTRA_DIST = test-version
Modified: gnucash/branches/swig-redo/src/business/business-core/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-core/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -82,16 +82,16 @@
endif
.scm-links:
- rm -f gnucash
- $(LN_S) -f . gnucash
+ $(RM) -rf gnucash
+ mkdir -p gnucash
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
noinst_DATA = .scm-links
-
CLEANFILES = gnucash .scm-links ${SCM_FILE_LINKS}
MAINTAINERCLEANFILES = swig-business-core.c
Modified: gnucash/branches/swig-redo/src/business/business-core/file/gncmod-business-backend-file.c
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/file/gncmod-business-backend-file.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-core/file/gncmod-business-backend-file.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -23,6 +23,7 @@
*
*********************************************************************/
+#include "config.h"
#include <stdio.h>
#include <glib.h>
Modified: gnucash/branches/swig-redo/src/business/business-core/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-core/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -33,6 +33,7 @@
--gnc-module-dir ${top_builddir}/src/engine \
--gnc-module-dir ${top_builddir}/src/business/business-core \
--gnc-module-dir ${top_srcdir}/src/gnc-module \
+ --library-dir ${top_builddir}/lib/libqof/qof \
--gnc-module-dir ${top_srcdir}/src/engine
TESTS_ENVIRONMENT := \
Modified: gnucash/branches/swig-redo/src/business/business-core/test/test-address.c
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/test/test-address.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-core/test/test-address.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -24,6 +24,7 @@
*
*********************************************************************/
+#include "config.h"
#include <glib.h>
#include "cashobjects.h"
#include "gncAddressP.h"
Modified: gnucash/branches/swig-redo/src/business/business-core/test/test-business.c
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/test/test-business.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-core/test/test-business.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -23,6 +23,7 @@
*
*********************************************************************/
+#include "config.h"
#include <glib.h>
#include <libguile.h>
Modified: gnucash/branches/swig-redo/src/business/business-core/test/test-customer.c
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/test/test-customer.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-core/test/test-customer.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -24,6 +24,7 @@
*
*********************************************************************/
+#include "config.h"
#include <glib.h>
#include "qof.h"
#include "cashobjects.h"
Modified: gnucash/branches/swig-redo/src/business/business-core/test/test-employee.c
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/test/test-employee.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-core/test/test-employee.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -24,6 +24,7 @@
*
*********************************************************************/
+#include "config.h"
#include <glib.h>
#include "qof.h"
#include "gncEmployeeP.h"
Modified: gnucash/branches/swig-redo/src/business/business-core/test/test-job.c
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/test/test-job.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-core/test/test-job.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -24,6 +24,7 @@
*
*********************************************************************/
+#include "config.h"
#include <glib.h>
#include "qof.h"
#include "gncJobP.h"
Modified: gnucash/branches/swig-redo/src/business/business-core/test/test-vendor.c
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/test/test-vendor.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-core/test/test-vendor.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -24,6 +24,7 @@
*
*********************************************************************/
+#include "config.h"
#include <glib.h>
#include "gncInvoiceP.h"
#include "gncCustomerP.h"
Modified: gnucash/branches/swig-redo/src/business/business-gnome/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/business/business-gnome/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-gnome/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -103,15 +103,15 @@
endif
.scm-links:
- rm -f gnucash
- $(LN_S) -f . gnucash
+ $(RM) -rf gnucash
+ mkdir -p gnucash
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
noinst_DATA = .scm-links
-
CLEANFILES = $(BUILT_SOURCES) gnucash .scm-links ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/business/business-gnome/schemas/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/business/business-gnome/schemas/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-gnome/schemas/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -12,10 +12,10 @@
install-data-local:
if GCONF_SCHEMAS_INSTALL
-mkdir -p $(DESTDIR)$(GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY)
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA)
+ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schema_DATA)
endif
uninstall-local:
if GCONF_SCHEMAS_INSTALL
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(srcdir)/$(schema_DATA)
+ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(schema_DATA)
endif
Modified: gnucash/branches/swig-redo/src/business/business-reports/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/business/business-reports/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-reports/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -14,20 +14,24 @@
endif
.scm-links:
- rm -f gnucash report
- $(LN_S) -f . gnucash
- $(LN_S) -f ${srcdir} report
+ $(RM) -rf gnucash
+ mkdir -p gnucash
+ mkdir -p gnucash/report
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash/report; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
touch .scm-links
+clean-local:
+ $(RM) -rf gnucash
+
noinst_DATA = .scm-links
EXTRA_DIST = \
${gncscmmod_DATA}
-CLEANFILES = gnucash report .scm-links
+CLEANFILES = .scm-links
DISTCLEANFILES = ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/business/business-utils/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/business/business-utils/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/business-utils/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -48,14 +48,18 @@
endif
.scm-links:
- rm -f gnucash
- $(LN_S) -f ${srcdir} gnucash
+ $(RM) -rf gnucash
+ mkdir -p gnucash
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
-CLEANFILES = gnucash .scm-links
+clean-local:
+ $(RM) -rf gnucash
+
+CLEANFILES = .scm-links
DISTCLEANFILES = ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/business/dialog-tax-table/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/business/dialog-tax-table/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/business/dialog-tax-table/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -63,13 +63,14 @@
endif
.scm-links:
- rm -f gnucash
- $(LN_S) -f . gnucash
+ $(RM) -rf gnucash
+ mkdir -p gnucash
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
noinst_DATA = .scm-links
Modified: gnucash/branches/swig-redo/src/calculation/expression_parser.c
===================================================================
--- gnucash/branches/swig-redo/src/calculation/expression_parser.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/calculation/expression_parser.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -380,6 +380,7 @@
* stack will probably never be needed.
*/
+#include "config.h"
#include <ctype.h>
#include <stdio.h>
#include <string.h>
Modified: gnucash/branches/swig-redo/src/core-utils/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/core-utils/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/core-utils/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -45,13 +45,14 @@
endif
.scm-links:
- rm -f gnucash
- $(LN_S) -f . gnucash
+ $(RM) -rf gnucash
+ mkdir -p gnucash
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
noinst_DATA = .scm-links
Modified: gnucash/branches/swig-redo/src/core-utils/gnc-gconf-utils.c
===================================================================
--- gnucash/branches/swig-redo/src/core-utils/gnc-gconf-utils.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/core-utils/gnc-gconf-utils.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -29,8 +29,8 @@
#include "gnc-gconf-utils.h"
#define APP_GNUCASH "/apps/gnucash"
-#define CLIENT_TAG "%s-client"
-#define NOTIFY_TAG "%s-notify_id"
+#define CLIENT_TAG "%s-%s-client"
+#define NOTIFY_TAG "%s-%s-notify_id"
static GConfClient *our_client = NULL;
static guint gconf_general_cb_id = 0;
@@ -743,7 +743,8 @@
void
gnc_gconf_add_notification (GObject *object,
const gchar *section,
- GConfClientNotifyFunc callback)
+ GConfClientNotifyFunc callback,
+ const gchar *whoami)
{
GConfClient *client;
GError *error = NULL;
@@ -752,6 +753,7 @@
g_return_if_fail(G_IS_OBJECT(object));
g_return_if_fail(callback != NULL);
+ g_return_if_fail(whoami != NULL);
client = gconf_client_get_default();
path = gnc_gconf_section_name(section);
@@ -785,8 +787,8 @@
/*
* Save the values needed to undo this later.
*/
- client_tag = g_strdup_printf(CLIENT_TAG, section);
- notify_tag = g_strdup_printf(NOTIFY_TAG, section);
+ client_tag = g_strdup_printf(CLIENT_TAG, section, whoami);
+ notify_tag = g_strdup_printf(NOTIFY_TAG, section, whoami);
g_object_set_data(object, client_tag, client);
g_object_set_data(object, notify_tag, GUINT_TO_POINTER(id));
g_free(notify_tag);
@@ -843,22 +845,24 @@
void
gnc_gconf_remove_notification (GObject *object,
- const gchar *section)
+ const gchar *section,
+ const gchar *whoami)
{
GConfClient *client;
gchar *path, *client_tag, *notify_tag;
guint id;
g_return_if_fail(G_IS_OBJECT(object));
+ g_return_if_fail(whoami != NULL);
/*
* Remove any gconf notifications
*/
- client_tag = g_strdup_printf(CLIENT_TAG, section);
+ client_tag = g_strdup_printf(CLIENT_TAG, section, whoami);
client = g_object_get_data(object, client_tag);
path = gnc_gconf_section_name(section);
if (client) {
- notify_tag = g_strdup_printf(NOTIFY_TAG, section);
+ notify_tag = g_strdup_printf(NOTIFY_TAG, section, whoami);
id = GPOINTER_TO_UINT(g_object_get_data(object, notify_tag));
gconf_client_notify_remove(client, id);
gconf_client_remove_dir(client, path, NULL);
Modified: gnucash/branches/swig-redo/src/core-utils/gnc-gconf-utils.h
===================================================================
--- gnucash/branches/swig-redo/src/core-utils/gnc-gconf-utils.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/core-utils/gnc-gconf-utils.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -56,7 +56,7 @@
#define GCONF_WARNINGS_PERM "general/warnings/permanent"
/* Keys used across multiple modules */
-#define DESKTOP_GNOME_INTERFACE "/desktop/gnome/interface"
+#define DESKTOP_GNOME_INTERFACE "desktop/gnome/interface"
#define KEY_TOOLBAR_STYLE "toolbar_style"
#define KEY_SAVE_GEOMETRY "save_window_geometry"
#define KEY_LAST_PATH "last_path"
@@ -765,10 +765,15 @@
* @param callback The function to call when a value changes. This
* function will receive the key/value pair as one argument, and the
* 'object' argument to this function as another of its arguments.
+ *
+ * @param whoami A magic value that must match up this call to the
+ * corresponding call to gnc_gconf_remove_notification(). The pair of
+ * section and whoami should be unique across all callers.
*/
void gnc_gconf_add_notification (GObject *object,
const gchar *section,
- GConfClientNotifyFunc callback);
+ GConfClientNotifyFunc callback,
+ const gchar *whoami);
/** An alternative function for adding a notification callback to
@@ -820,9 +825,14 @@
*
* @param section This string is used to find the correct
* notification function to remove from GConf.
+ *
+ * @param whoami A magic value that must match up this call to the
+ * corresponding call to gnc_gconf_add_notification(). The pair of
+ * section and whoami should be unique across all callers.
*/
void gnc_gconf_remove_notification (GObject *object,
- const gchar *section);
+ const gchar *section,
+ const gchar *whoami);
Modified: gnucash/branches/swig-redo/src/core-utils/gnc-glib-utils.c
===================================================================
--- gnucash/branches/swig-redo/src/core-utils/gnc-glib-utils.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/core-utils/gnc-glib-utils.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -214,3 +214,11 @@
memmove(end, end+1, len); /* shuffle the remainder one byte */
} while (!gnc_utf8_validate(str, -1, (const gchar **)&end));
}
+
+gchar *
+gnc_utf8_strip_invalid_strdup(const gchar* str)
+{
+ gchar *result = g_strdup (str);
+ gnc_utf8_strip_invalid (result);
+ return result;
+}
Modified: gnucash/branches/swig-redo/src/core-utils/gnc-glib-utils.h
===================================================================
--- gnucash/branches/swig-redo/src/core-utils/gnc-glib-utils.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/core-utils/gnc-glib-utils.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -67,7 +67,21 @@
* characters. */
void gnc_utf8_strip_invalid (gchar *str);
+/** Returns a newly allocated copy of the given string but with any
+ * non-utf8 character stripped from it.
+ *
+ * Note that it also removes some subset of invalid XML characters,
+ * too. See http://www.w3.org/TR/REC-xml/#NT-Char linked from bug
+ * #346535
+ *
+ * @param str A pointer to the string to be copied and stripped of
+ * non-utf8 characters.
+ *
+ * @return A newly allocated string that has to be g_free'd by the
+ * caller. */
+gchar *gnc_utf8_strip_invalid_strdup (const gchar* str);
+
/** @} */
#endif /* GNC_GLIB_UTILS_H */
Modified: gnucash/branches/swig-redo/src/engine/Account.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/Account.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/Account.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -2003,6 +2003,7 @@
{
if (!acc) return;
+ xaccAccountBeginEdit (acc);
kvp_frame_set_string (acc->inst.kvp_data, "hidden",
val ? "true" : NULL);
mark_account (acc);
@@ -2178,49 +2179,52 @@
/********************************************************************\
\********************************************************************/
+guint32
+xaccAccountTypesCompatibleWith (GNCAccountType type)
+{
+ switch (type) {
+ case ACCT_TYPE_BANK:
+ case ACCT_TYPE_CASH:
+ case ACCT_TYPE_ASSET:
+ case ACCT_TYPE_STOCK:
+ case ACCT_TYPE_MUTUAL:
+ case ACCT_TYPE_CURRENCY:
+ case ACCT_TYPE_CREDIT:
+ case ACCT_TYPE_LIABILITY:
+ case ACCT_TYPE_RECEIVABLE:
+ case ACCT_TYPE_PAYABLE:
+ return
+ (1 << ACCT_TYPE_BANK) |
+ (1 << ACCT_TYPE_CASH) |
+ (1 << ACCT_TYPE_ASSET) |
+ (1 << ACCT_TYPE_STOCK) |
+ (1 << ACCT_TYPE_MUTUAL) |
+ (1 << ACCT_TYPE_CURRENCY) |
+ (1 << ACCT_TYPE_CREDIT) |
+ (1 << ACCT_TYPE_LIABILITY) |
+ (1 << ACCT_TYPE_RECEIVABLE) |
+ (1 << ACCT_TYPE_PAYABLE);
+ case ACCT_TYPE_INCOME:
+ case ACCT_TYPE_EXPENSE:
+ return
+ (1 << ACCT_TYPE_INCOME) |
+ (1 << ACCT_TYPE_EXPENSE);
+ case ACCT_TYPE_EQUITY:
+ return
+ (1 << ACCT_TYPE_EQUITY);
+ default:
+ PERR("bad account type: %d", type);
+ return 0;
+ }
+}
+
gboolean
xaccAccountTypesCompatible (GNCAccountType parent_type,
GNCAccountType child_type)
{
- gboolean compatible = FALSE;
-
- switch(parent_type)
- {
- case ACCT_TYPE_BANK:
- case ACCT_TYPE_CASH:
- case ACCT_TYPE_ASSET:
- case ACCT_TYPE_STOCK:
- case ACCT_TYPE_MUTUAL:
- case ACCT_TYPE_CURRENCY:
- case ACCT_TYPE_CREDIT:
- case ACCT_TYPE_LIABILITY:
- case ACCT_TYPE_RECEIVABLE:
- case ACCT_TYPE_PAYABLE:
- compatible = ((child_type == ACCT_TYPE_BANK) ||
- (child_type == ACCT_TYPE_CASH) ||
- (child_type == ACCT_TYPE_ASSET) ||
- (child_type == ACCT_TYPE_STOCK) ||
- (child_type == ACCT_TYPE_MUTUAL) ||
- (child_type == ACCT_TYPE_CURRENCY) ||
- (child_type == ACCT_TYPE_CREDIT) ||
- (child_type == ACCT_TYPE_LIABILITY)||
- (child_type == ACCT_TYPE_RECEIVABLE)||
- (child_type == ACCT_TYPE_PAYABLE));
- break;
- case ACCT_TYPE_INCOME:
- case ACCT_TYPE_EXPENSE:
- compatible = ((child_type == ACCT_TYPE_INCOME) ||
- (child_type == ACCT_TYPE_EXPENSE));
- break;
- case ACCT_TYPE_EQUITY:
- compatible = (child_type == ACCT_TYPE_EQUITY);
- break;
- default:
- PERR("bad account type: %d", parent_type);
- break;
- }
-
- return compatible;
+ return ((xaccAccountTypesCompatibleWith (parent_type) &
+ (1 << child_type))
+ != 0);
}
guint32
Modified: gnucash/branches/swig-redo/src/engine/Account.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/Account.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/Account.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -523,6 +523,9 @@
* to the local language. */
GNCAccountType xaccAccountGetTypeFromStr (const gchar *str);
+/** Return the bitmask of account types compatible with a given type. */
+guint32 xaccAccountTypesCompatibleWith (GNCAccountType type);
+
/** Return TRUE if accounts of type parent_type can have accounts
* of type child_type as children. */
gboolean xaccAccountTypesCompatible (GNCAccountType parent_type,
Modified: gnucash/branches/swig-redo/src/engine/Group.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/Group.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/Group.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -77,7 +77,7 @@
\********************************************************************/
AccountGroup *
-xaccCollGetAccountGroup (QofCollection *col)
+xaccCollGetAccountGroup (const QofCollection *col)
{
if (!col) return NULL;
return qof_collection_get_data (col);
@@ -1287,7 +1287,7 @@
}
static gboolean
-group_is_dirty (QofCollection *col)
+group_is_dirty (const QofCollection *col)
{
return xaccGroupNotSaved(xaccCollGetAccountGroup(col));
}
Modified: gnucash/branches/swig-redo/src/engine/Group.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/Group.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/Group.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -60,7 +60,7 @@
* The xaccCollAccountGroup() routine will return the top-most
* account group associated with the indicated collection.
*/
-AccountGroup * xaccCollGetAccountGroup (QofCollection *col);
+AccountGroup * xaccCollGetAccountGroup (const QofCollection *col);
/** The xaccAccountDestroy() routine will destroy and free all
* the data associated with this account group. The group
Modified: gnucash/branches/swig-redo/src/engine/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/engine/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -28,6 +28,7 @@
Split.c \
TransLog.c \
Transaction.c \
+ binreloc.c \
cap-gains.c \
cashobjects.c \
gnc-associate-account.c \
@@ -37,6 +38,7 @@
gnc-filepath-utils.c \
gnc-hooks.c \
gnc-lot.c \
+ gnc-path.c \
gnc-pricedb.c \
gnc-session.c \
gnc-session-scm.c \
@@ -70,6 +72,7 @@
Split.h \
TransLog.h \
Transaction.h \
+ binreloc.h \
cap-gains.h \
cashobjects.h \
engine-helpers.h \
@@ -82,6 +85,7 @@
gnc-event.h \
gnc-filepath-utils.h \
gnc-hooks.h \
+ gnc-path.h \
gnc-pricedb.h \
gnc-session.h \
gnc-session-scm.h \
@@ -113,7 +117,9 @@
../core-utils/libcore-utils.la \
${GUILE_LIBS} \
${QOF_LIBS} \
+ ${REGEX_LIBS} \
${GNUCASH_ENGINE_BASE_LIBS} \
+ ${BINRELOC_LIBS} \
${top_builddir}/lib/libc/libc-missing.la
gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
@@ -149,13 +155,14 @@
endif
.scm-links:
- rm -f gnucash
- $(LN_S) -f . gnucash
+ $(RM) -rf gnucash
+ mkdir -p gnucash
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
noinst_DATA = .scm-links
@@ -170,10 +177,18 @@
-chmod u+x ${srcdir}/iso-currencies-to-c
GUILE_LOAD_PATH=@GNC_SRFI_LOAD_PATH@:${GUILE_LOAD_PATH} srcdir=${srcdir} ${srcdir}/iso-currencies-to-c
-gncla-dir.h: gncla-dir.h.in ${top_builddir}/config.status
+gncla-dir.h: gncla-dir.h.in ${top_builddir}/config.status Makefile
rm -f $@.tmp
sed < $< > $@.tmp \
- -e 's:@-libdir-@:${libdir}:g'
+ -e 's#@-LOCALE_DIR-@#${LOCALE_DIR}#g' \
+ -e 's#@-GNC_ACCOUNTS_DIR-@#${GNC_ACCOUNTS_DIR}#g' \
+ -e 's#@-GNC_GLADE_DIR-@#${GNC_GLADE_DIR}#g' \
+ -e 's#@-GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY-@#${GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY}#g' \
+ -e 's#@-pkglibdir-@#${pkglibdir}#g' \
+ -e 's#@-libdir-@#${libdir}#g' \
+ -e 's#@-sysconfdir-@#${sysconfdir}#g' \
+ -e 's#@-datadir-@#${datadir}#g' \
+ -e 's#@-prefix-@#${prefix}#g'
mv $@.tmp $@
BUILT_SOURCES = iso-4217-currencies.c \
Modified: gnucash/branches/swig-redo/src/engine/Period.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/Period.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/Period.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -33,6 +33,7 @@
* Copyright (c) 2001-2003 Linas Vepstas <linas at linas.org>
*/
+#include "config.h"
#include "AccountP.h"
#include "qof.h"
#include "gnc-lot.h"
Modified: gnucash/branches/swig-redo/src/engine/SX-book.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/SX-book.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/SX-book.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -53,7 +53,7 @@
/* ====================================================================== */
AccountGroup *
-gnc_collection_get_template_group( QofCollection *col )
+gnc_collection_get_template_group( const QofCollection *col )
{
return qof_collection_get_data (col);
}
@@ -118,7 +118,7 @@
static gboolean
-sxtg_is_dirty(QofCollection *col)
+sxtg_is_dirty(const QofCollection *col)
{
return xaccGroupNotSaved(gnc_collection_get_template_group(col));
}
@@ -145,13 +145,13 @@
/* ====================================================================== */
SchedXactions *
-gnc_collection_get_schedxaction_list(QofCollection *col)
+gnc_collection_get_schedxaction_list(const QofCollection *col)
{
return qof_collection_get_data (col);
}
GList *
-gnc_collection_get_schedxactions(QofCollection *col)
+gnc_collection_get_schedxactions(const QofCollection *col)
{
SchedXactions *list;
list = qof_collection_get_data (col);
@@ -236,7 +236,7 @@
}
static gboolean
-book_sxlist_notsaved(QofCollection *col)
+book_sxlist_notsaved(const QofCollection *col)
{
GList *sxlist;
SchedXactions *sxl;
Modified: gnucash/branches/swig-redo/src/engine/SX-book.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/SX-book.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/SX-book.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -43,13 +43,13 @@
typedef struct xaccSchedXactionsDef SchedXactions;
-SchedXactions * gnc_collection_get_schedxaction_list(QofCollection *col);
-GList * gnc_collection_get_schedxactions(QofCollection *col);
+SchedXactions * gnc_collection_get_schedxaction_list(const QofCollection *col);
+GList * gnc_collection_get_schedxactions(const QofCollection *col);
GList * gnc_book_get_schedxactions(QofBook *book);
/** Returns the template group from the book. **/
AccountGroup * gnc_book_get_template_group(QofBook *book);
-AccountGroup * gnc_collection_get_template_group(QofCollection *col);
+AccountGroup * gnc_collection_get_template_group(const QofCollection *col);
/** @return The list of SXes which reference the given Account. Caller should free this list. **/
GList* gnc_sx_get_sxes_referencing_account(QofBook *book, Account *acct);
Modified: gnucash/branches/swig-redo/src/engine/Transaction.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/Transaction.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/Transaction.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1968,7 +1968,8 @@
static QofParam params[] = {
{ TRANS_NUM, QOF_TYPE_STRING,
(QofAccessFunc)xaccTransGetNum,
- (QofSetterFunc)qofTransSetNum },
+ (QofSetterFunc)qofTransSetNum,
+ qof_string_number_compare_func },
{ TRANS_DESCRIPTION, QOF_TYPE_STRING,
(QofAccessFunc)xaccTransGetDescription,
(QofSetterFunc)qofTransSetDescription },
Copied: gnucash/branches/swig-redo/src/engine/binreloc.c (from rev 15000, gnucash/trunk/src/engine/binreloc.c)
Copied: gnucash/branches/swig-redo/src/engine/binreloc.h (from rev 15000, gnucash/trunk/src/engine/binreloc.h)
Modified: gnucash/branches/swig-redo/src/engine/cashobjects.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/cashobjects.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/cashobjects.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -23,6 +23,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include "cashobjects.h"
#include "gnc-engine.h"
#include "AccountP.h"
Modified: gnucash/branches/swig-redo/src/engine/gnc-budget.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/gnc-budget.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/gnc-budget.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -22,12 +22,15 @@
* *
\********************************************************************/
+#include "config.h"
#include <glib.h>
#include <glib/gprintf.h>
#include <glib/gi18n.h>
#include <time.h>
#include "qof.h"
+#include "glib-compat.h"
+
#include "Account.h"
#include "Group.h"
@@ -99,7 +102,7 @@
budget = g_new0(GncBudget, 1);
qof_instance_init (&budget->inst, GNC_ID_BUDGET, book);
- g_date_set_time(&date, time(NULL));
+ g_date_set_time_t(&date, time(NULL));
g_date_subtract_days(&date, g_date_get_day(&date)-1);
recurrenceSet(&budget->recurrence, 1, PERIOD_MONTH, &date);
Modified: gnucash/branches/swig-redo/src/engine/gnc-engine.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/gnc-engine.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/gnc-engine.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -42,7 +42,7 @@
#define GNC_LIB_NAME "gnc-backend-file"
/* gnc-backend-file location */
-#include "gncla-dir.h"
+#include "gnc-path.h"
static GList * engine_init_hooks = NULL;
static int engine_is_initialized = 0;
@@ -76,17 +76,17 @@
gnc_engine_init(int argc, char ** argv)
{
static struct {
- const gchar* dir;
const gchar* lib;
gboolean required;
} libs[] = {
- { GNC_LIBDIR, GNC_LIB_NAME, TRUE },
+ { GNC_LIB_NAME, TRUE },
/* shouldn't the PG gnc-module do this instead of US doing it? */
- { GNC_LIBDIR, "gnc-backend-postgres", FALSE },
- { NULL, NULL, FALSE } }, *lib;
+ { "gnc-backend-postgres", FALSE },
+ { NULL, FALSE } }, *lib;
gnc_engine_init_hook_t hook;
GList * cur;
gchar *tracefilename;
+ gchar *libdir;
if (1 == engine_is_initialized) return;
@@ -107,15 +107,16 @@
/* Now register our core types */
cashobjects_register();
- for (lib = libs; lib->dir && lib->lib ; lib++)
+ libdir = gnc_path_get_libdir ();
+ for (lib = libs; lib->lib ; lib++)
{
- if (qof_load_backend_library(lib->dir, lib->lib))
+ if (qof_load_backend_library(libdir, lib->lib))
{
engine_is_initialized = 1;
}
else
{
- g_message("failed to load %s from %s\n", lib->lib, lib->dir);
+ g_message("failed to load %s from %s\n", lib->lib, libdir);
/* If this is a required library, stop now! */
if (lib->required)
{
@@ -123,6 +124,7 @@
}
}
}
+ g_free (libdir);
/* call any engine hooks */
for (cur = engine_init_hooks; cur; cur = cur->next)
Modified: gnucash/branches/swig-redo/src/engine/gnc-lot.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/gnc-lot.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/gnc-lot.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -39,6 +39,7 @@
* Copyright (c) 2002,2003 Linas Vepstas <linas at linas.org>
*/
+#include "config.h"
#include "Account.h"
#include "gnc-lot.h"
#include "gnc-lot-p.h"
Copied: gnucash/branches/swig-redo/src/engine/gnc-path.c (from rev 15000, gnucash/trunk/src/engine/gnc-path.c)
Copied: gnucash/branches/swig-redo/src/engine/gnc-path.h (from rev 15000, gnucash/trunk/src/engine/gnc-path.h)
Modified: gnucash/branches/swig-redo/src/engine/gnc-pricedb.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/gnc-pricedb.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/gnc-pricedb.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -2376,7 +2376,7 @@
}
static void
-price_foreach(QofCollection *col, QofEntityForeachCB cb, gpointer data)
+price_foreach(const QofCollection *col, QofEntityForeachCB cb, gpointer data)
{
GNCPriceDB *db;
Modified: gnucash/branches/swig-redo/src/engine/gncla-dir.h.in
===================================================================
--- gnucash/branches/swig-redo/src/engine/gncla-dir.h.in 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/gncla-dir.h.in 2006-10-15 04:08:48 UTC (rev 15023)
@@ -23,5 +23,15 @@
* 02110-1301, USA.
*/
-#define GNC_LIBDIR "@-libdir-@"
+#define PREFIX "@-prefix-@"
+#define DATADIR "@-datadir-@"
+#define SYSCONFDIR "@-sysconfdir-@"
+#define LIBDIR "@-libdir-@"
+#define PKGLIBDIR "@-pkglibdir-@"
+
+#define LOCALE_DIR "@-LOCALE_DIR-@"
+
+#define GNC_ACCOUNTS_DIR "@-GNC_ACCOUNTS_DIR-@"
+#define GNC_GLADE_DIR "@-GNC_GLADE_DIR-@"
+#define GNC_GCONF_DIR "@-GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY-@"
Modified: gnucash/branches/swig-redo/src/engine/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -52,6 +52,9 @@
--gnc-module-dir ${top_builddir}/src/engine \
--gnc-module-dir ${top_srcdir}/src/gnc-module \
--gnc-module-dir ${top_srcdir}/src/engine \
+ --library-dir ${top_builddir}/src/core-utils \
+ --library-dir ${top_builddir}/lib/libqof/qof \
+ --library-dir ${top_builddir}/src/backend/file \
--guile-load-dir ${top_srcdir}/src/engine/test
TESTS_ENVIRONMENT := \
Modified: gnucash/branches/swig-redo/src/engine/test/test-commodities.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-commodities.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-commodities.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -23,6 +23,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include <glib.h>
#include "gnc-commodity.h"
Modified: gnucash/branches/swig-redo/src/engine/test/test-date.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-date.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-date.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -2,6 +2,7 @@
* -- fix borken timezone test -- linas May 2004
*/
+#include "config.h"
#include <ctype.h>
#include <glib.h>
#include <time.h>
Modified: gnucash/branches/swig-redo/src/engine/test/test-group-vs-book.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-group-vs-book.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-group-vs-book.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -21,6 +21,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include <glib.h>
#include "qof.h"
#include "cashobjects.h"
Modified: gnucash/branches/swig-redo/src/engine/test/test-guid.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-guid.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-guid.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -26,6 +26,7 @@
*
*/
+#include "config.h"
#include <ctype.h>
#include <glib.h>
#include "cashobjects.h"
Modified: gnucash/branches/swig-redo/src/engine/test/test-load-engine.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-load-engine.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-load-engine.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -21,6 +21,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include "qof.h"
Modified: gnucash/branches/swig-redo/src/engine/test/test-lots.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-lots.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-lots.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -25,6 +25,7 @@
* @author Linas Vepstas <linas at linas.org>
*/
+#include "config.h"
#include <ctype.h>
#include <glib.h>
#include "qof.h"
Modified: gnucash/branches/swig-redo/src/engine/test/test-numeric.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-numeric.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-numeric.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -23,6 +23,7 @@
*/
+#include "config.h"
#include <ctype.h>
#include <glib.h>
#include "cashobjects.h"
Modified: gnucash/branches/swig-redo/src/engine/test/test-object.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-object.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-object.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -23,6 +23,7 @@
/*
* Lightly test the QofObject infrastructure.
*/
+#include "config.h"
#include <glib.h>
#include <glib/gi18n.h>
#include "qof.h"
@@ -32,7 +33,7 @@
#define TEST_MODULE_NAME "object-test"
#define TEST_MODULE_DESC "Test Object"
-static void obj_foreach (QofCollection *, QofEntityForeachCB, gpointer);
+static void obj_foreach (const QofCollection *, QofEntityForeachCB, gpointer);
static const char * printable (gpointer obj);
static void test_printable (const char *name, gpointer obj);
static void test_foreach (QofBook *, const char *);
@@ -78,7 +79,7 @@
}
static void
-obj_foreach (QofCollection *col, QofEntityForeachCB cb, gpointer u_d)
+obj_foreach (const QofCollection *col, QofEntityForeachCB cb, gpointer u_d)
{
int *foo = u_d;
Modified: gnucash/branches/swig-redo/src/engine/test/test-period.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-period.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-period.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -25,6 +25,7 @@
* without crashing.
*/
+#include "config.h"
#include <ctype.h>
#include <glib.h>
#include "qof.h"
Modified: gnucash/branches/swig-redo/src/engine/test/test-query.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-query.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-query.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -21,6 +21,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include <glib.h>
#include "qof.h"
#include "cashobjects.h"
Modified: gnucash/branches/swig-redo/src/engine/test/test-querynew.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-querynew.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-querynew.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -21,6 +21,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include <glib.h>
#include <stdio.h>
#include "qof.h"
Modified: gnucash/branches/swig-redo/src/engine/test/test-resolve-file-path.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-resolve-file-path.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-resolve-file-path.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -21,6 +21,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include <stdlib.h>
#include <string.h>
Modified: gnucash/branches/swig-redo/src/engine/test/test-scm-query.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-scm-query.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-scm-query.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,4 +1,5 @@
+#include "config.h"
#include <glib.h>
#include <libguile.h>
Modified: gnucash/branches/swig-redo/src/engine/test/test-split-vs-account.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-split-vs-account.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-split-vs-account.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -22,6 +22,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include <glib.h>
#include "qof.h"
#include "cashobjects.h"
Modified: gnucash/branches/swig-redo/src/engine/test/test-transaction-reversal.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-transaction-reversal.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-transaction-reversal.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -22,6 +22,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include <glib.h>
#include <string.h>
#include "cashobjects.h"
Modified: gnucash/branches/swig-redo/src/engine/test/test-transaction-voiding.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/test/test-transaction-voiding.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/engine/test/test-transaction-voiding.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -22,6 +22,7 @@
* 02110-1301, USA.
*/
+#include "config.h"
#include <glib.h>
#include <string.h>
#include "cashobjects.h"
Modified: gnucash/branches/swig-redo/src/gnc-module/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnc-module/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -41,13 +41,14 @@
endif
.scm-links:
- rm -f gnucash
- $(LN_S) -f . gnucash
+ $(RM) -rf gnucash
+ mkdir -p gnucash
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
CLEANFILES = .scm-links gnucash ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/gnc-module/gnc-module.c
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/gnc-module.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnc-module/gnc-module.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -9,6 +9,10 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
+#ifdef G_OS_WIN32
+# undef DLL_EXPORT /* Will cause warnings in ltdl.h if defined */
+# define LIBLTDL_DLL_IMPORT
+#endif
#include <ltdl.h>
#include <guile/gh.h>
#include <sys/types.h>
@@ -86,7 +90,8 @@
break;
#endif
- case ':':
+ /* This is ':' on UNIX machines and ';' under Windows. */
+ case G_SEARCHPATH_SEPARATOR:
if(!escchar)
{
list = g_list_append(list, token->str);
@@ -227,9 +232,8 @@
{
/* get the full path name, then dlopen the library and see
* if it has the appropriate symbols to be a gnc_module */
- fullpath = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", (char *)(current->data),
- dent->d_name);
- /* G_DIR_SEPARATOR_S is "/" on unix and "\\" on windows. */
+ fullpath = g_build_filename((const gchar *)(current->data),
+ dent->d_name, (char*)NULL);
info = gnc_module_get_info(fullpath);
if(info)
Modified: gnucash/branches/swig-redo/src/gnc-module/test/test-dynload.c
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/test/test-dynload.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnc-module/test/test-dynload.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -5,6 +5,10 @@
*********************************************************************/
#include <stdio.h>
+#ifdef G_OS_WIN32
+# undef DLL_EXPORT /* Will cause warnings in ltdl.h if defined */
+# define LIBLTDL_DLL_IMPORT
+#endif
#include <ltdl.h>
#include <libguile.h>
Modified: gnucash/branches/swig-redo/src/gnc-test-env
===================================================================
--- gnucash/branches/swig-redo/src/gnc-test-env 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnc-test-env 2006-10-15 04:08:48 UTC (rev 15023)
@@ -6,10 +6,16 @@
;; arguments listing gnc-module-dirs, guile-load-dirs, and
;; library-dirs
+(use-modules (srfi srfi-13) (srfi srfi-14)) ;; for string-tokenize
(debug-enable 'backtrace)
(debug-enable 'debug)
(read-enable 'positions)
+;; Are we on MS Windows here? If yes, make this a #t.
+;; (utsname:sysname (uname)) wasn't available in my guile-1.6.7 on
+;; mingw, so I don't know an automated way to do this so far.
+(define is-windows? #f)
+
(define args (cdr (command-line)))
(define display-exports? #t)
@@ -42,7 +48,32 @@
(set! guile-load-dirs (reverse guile-load-dirs))
(set! library-dirs (reverse library-dirs)))
+;; The character set of everything except a directory separator as
+;; necessary for string-tokenize below
+(define char-set-path
+ (char-set-adjoin
+ (char-set-delete char-set:graphic #\/)
+ #\ ))
+;; The directory separator string.
+(define dir-separator-string
+ (if is-windows?
+ "\\\\" ;; Needs to be quoted twice because of additional shell quoting
+ "/"))
+
+;; The path separator string; only needed for GUILE_LOAD_PATH
+(define path-sep-str
+ (if is-windows?
+ ";"
+ ":"))
+
+;; Adapt the directory separator character in the given PATH and
+;; return the result.
+(define (adapt-dirsep path)
+ (string-join
+ (string-tokenize path char-set-path)
+ dir-separator-string))
+
(if (and (not (null? args))
(string=? "--no-exports" (car args)))
(begin
@@ -53,43 +84,42 @@
(process-args! args)
-(display "GNC_MODULE_PATH=${GNC_MODULE_PATH}")
-(display (apply string-append
- (map (lambda (dir) (string-append ":" dir))
- gnc-module-dirs)))
+(display "GNC_MODULE_PATH=${GNC_MODULE_PATH}:")
+(display (adapt-dirsep
+ (string-join gnc-module-dirs
+ ":")))
-(display " GUILE_LOAD_PATH=${GUILE_LOAD_PATH}")
-(display (apply string-append
- (map (lambda (dir) (string-append ":" dir))
- gnc-module-dirs)))
-(display (apply string-append
- (map (lambda (dir) (string-append ":" dir))
- guile-load-dirs)))
+(display " GUILE_LOAD_PATH=\"${GUILE_LOAD_PATH}")
+(display path-sep-str)
+(display (adapt-dirsep
+ (string-join (append gnc-module-dirs guile-load-dirs)
+ path-sep-str)))
+(display "\"")
(display " LD_LIBRARY_PATH=${LD_LIBRARY_PATH}")
-(display (apply string-append
- (map
- (lambda (dir)
- (string-append ":" dir ":" dir "/.libs"))
- gnc-module-dirs)))
-(display (apply string-append
- (map
- (lambda (dir)
- (string-append ":" dir ":" dir "/.libs"))
- library-dirs)))
+(display (adapt-dirsep
+ (apply string-append
+ (map
+ (lambda (dir)
+ (string-append ":" dir ":" dir "/.libs"))
+ (append gnc-module-dirs library-dirs)))))
(display " LTDL_LIBRARY_PATH=${LTDL_LIBRARY_PATH}")
(display (apply string-append
(map
(lambda (dir)
(string-append ":" dir ":" dir "/.libs"))
- gnc-module-dirs)))
-(display (apply string-append
- (map
- (lambda (dir)
- (string-append ":" dir ":" dir "/.libs"))
- library-dirs)))
+ (append gnc-module-dirs library-dirs))))
+(if is-windows?
+ (begin
+ (display " PATH=${PATH}")
+ (display (apply string-append
+ (map
+ (lambda (dir)
+ (string-append ":" dir ":" dir "/.libs"))
+ (append gnc-module-dirs library-dirs))))))
+
(if display-exports?
(begin
(display "; ")
Property changes on: gnucash/branches/swig-redo/src/gnome
___________________________________________________________________
Name: svn:ignore
- *.diff
*.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
gnc-dir.h
gnucash.desktop
gnucash.keys
gnucash.c
swig-gnome.c
gw-gnc.scm
gw-gnc.h
gw-gnc.c
gw-gnc.html
i18n.h
gnc-version.h
.DS_Store
g-wrapped
gnucash
semantic.cache
TAGS
+ *.diff
*.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
gnc-dir.h
gnucash.desktop
gnucash.desktop.in
gnucash.keys
gnucash.c
swig-gnome.c
gw-gnc.scm
gw-gnc.h
gw-gnc.c
gw-gnc.html
i18n.h
gnc-version.h
.DS_Store
g-wrapped
gnucash
semantic.cache
TAGS
Modified: gnucash/branches/swig-redo/src/gnome/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/gnome/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -128,18 +128,5 @@
# The line below breaks automake 1.5.
##OMIT_DEPENDENCIES = gnc-dir.h
-noinst_DATA = .scm-links
-
-.scm-links:
- rm -f gnucash
- $(LN_S) -f . gnucash
-if GNUCASH_SEPARATE_BUILDDIR
- for X in ${SCM_FILE_LINKS} ; do \
- $(LN_S) -f ${srcdir}/$$X . ; \
- done
-endif
- touch .scm-links
-
-CLEANFILES = gnucash.desktop \
- gnucash .scm-links ${SCM_FILE_LINKS}
+CLEANFILES = gnucash.desktop
MAINTAINERCLEANFILES = swig-gnome.c
Modified: gnucash/branches/swig-redo/src/gnome/dialog-print-check.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome/dialog-print-check.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/dialog-print-check.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -45,7 +45,6 @@
#define GCONF_SECTION "dialogs/print_checks"
#define KEY_CHECK_FORMAT "check_format"
#define KEY_CHECK_POSITION "check_position"
-#define KEY_DATE_FORMAT "date_format"
#define KEY_DATE_FORMAT_USER "date_format_custom"
#define KEY_CUSTOM_PAYEE "custom_payee"
#define KEY_CUSTOM_DATE "custom_date"
Modified: gnucash/branches/swig-redo/src/gnome/druid-acct-period.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome/druid-acct-period.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/druid-acct-period.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -393,7 +393,8 @@
AccountGroup *group = gnc_get_current_group ();
xaccGroupScrubOrphans (group);
xaccGroupScrubImbalance (group);
- xaccGroupScrubLots (group);
+ // XXX: Lots are disabled
+ //xaccGroupScrubLots (group);
}
/* =============================================================== */
Modified: gnucash/branches/swig-redo/src/gnome/druid-hierarchy.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome/druid-hierarchy.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/druid-hierarchy.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -43,7 +43,7 @@
#include "gnc-gconf-utils.h"
#include "gnc-hooks.h"
#include "gnc-component-manager.h"
-#include "../gnome-utils/gnc-dir.h"
+#include "gnc-path.h"
#include "gnc-gui-query.h"
#include "gnc-tree-view-account.h"
#include "gnc-ui-util.h"
@@ -194,7 +194,7 @@
#endif
i = strlen(locale);
- ret = g_strdup_printf("%s/%s", top_dir, locale);
+ ret = g_build_filename(top_dir, locale, (char *)NULL);
while (stat(ret, &buf) != 0)
{
@@ -202,12 +202,12 @@
if (i<1)
{
g_free(ret);
- ret = g_strdup_printf("%s/%s", top_dir, default_locale);
+ ret = g_build_filename(top_dir, default_locale, (char *)NULL);
break;
}
locale[i] = '\0';
g_free(ret);
- ret = g_strdup_printf("%s/%s", top_dir, locale);
+ ret = g_build_filename(top_dir, locale, (char *)NULL);
}
g_free(locale);
@@ -358,6 +358,7 @@
account_categories_tree_view_prepare (hierarchy_data *data)
{
GSList *list;
+ gchar *gnc_accounts_dir;
gchar *locale_dir;
GtkTreeView *tree_view;
GtkListStore *model;
@@ -366,9 +367,11 @@
GtkTreeSelection *selection;
GtkTreePath *path;
- locale_dir = gnc_get_ea_locale_dir (GNC_ACCOUNTS_DIR);
+ gnc_accounts_dir = gnc_path_get_accountsdir ();
+ locale_dir = gnc_get_ea_locale_dir (gnc_accounts_dir);
list = gnc_load_example_account_list (data->temporary,
locale_dir);
+ g_free (gnc_accounts_dir);
g_free (locale_dir);
/* Prepare the account_categories GtkTreeView with a model and with some columns */
@@ -473,9 +476,13 @@
/* Add a new one if something selected */
if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+ gchar *text2;
gtk_tree_model_get (model, &iter, COL_ACCOUNT, &gea, -1);
- text = g_strdup_printf(_("<b>Accounts in '%s'</b>"), gea->title);
+ /* Translators: '%s' is the name of the selected account hierarchy template. */
+ text2 = g_strdup_printf(_("Accounts in '%s'"), gea->title);
+ text = g_strdup_printf("<b>%s</b>", text2);
gtk_label_set_markup(data->category_accounts_label, text);
+ g_free(text2);
g_free(text);
buffer = gtk_text_view_get_buffer(data->category_description);
gtk_text_buffer_set_text(buffer, gea->long_description, -1);
@@ -490,8 +497,10 @@
gtk_container_add(GTK_CONTAINER(data->category_accounts_container), GTK_WIDGET(tree_view));
gtk_widget_show(GTK_WIDGET(tree_view));
} else {
- gtk_label_set_markup(data->category_accounts_label,
- _("<b>Accounts in Category</b>"));
+ gchar *text;
+ text = g_strdup_printf ("<b>%s</b>", _("Accounts in Category"));
+ gtk_label_set_markup(data->category_accounts_label, text);
+ g_free (text);
buffer = gtk_text_view_get_buffer(data->category_description);
gtk_text_buffer_set_text(buffer, "", -1);
}
Modified: gnucash/branches/swig-redo/src/gnome/glade/account.glade
===================================================================
--- gnucash/branches/swig-redo/src/gnome/glade/account.glade 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/glade/account.glade 2006-10-15 04:08:48 UTC (rev 15023)
@@ -887,7 +887,7 @@
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
Modified: gnucash/branches/swig-redo/src/gnome/glade/commodities.glade
===================================================================
--- gnucash/branches/swig-redo/src/gnome/glade/commodities.glade 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/glade/commodities.glade 2006-10-15 04:08:48 UTC (rev 15023)
@@ -220,8 +220,8 @@
<widget class="GtkScrolledWindow" id="commodity_list_window">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
Modified: gnucash/branches/swig-redo/src/gnome/glade/price.glade
===================================================================
--- gnucash/branches/swig-redo/src/gnome/glade/price.glade 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/glade/price.glade 2006-10-15 04:08:48 UTC (rev 15023)
@@ -60,7 +60,7 @@
<property name="border_width">3</property>
<property name="visible">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
Modified: gnucash/branches/swig-redo/src/gnome/glade/stocks.glade
===================================================================
--- gnucash/branches/swig-redo/src/gnome/glade/stocks.glade 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/glade/stocks.glade 2006-10-15 04:08:48 UTC (rev 15023)
@@ -81,8 +81,8 @@
<widget class="GtkScrolledWindow" id="scrolledwindow22">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
Modified: gnucash/branches/swig-redo/src/gnome/gnc-plugin-page-account-tree.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome/gnc-plugin-page-account-tree.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/gnc-plugin-page-account-tree.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1048,7 +1048,7 @@
GList *acct_list, *ptr;
xaccAccountBeginEdit (daa);
- acct_list = xaccGroupGetSubAccounts(children);
+ acct_list = g_list_copy(xaccGroupGetAccountList(children));
for (ptr = acct_list; ptr; ptr = g_list_next(ptr))
xaccAccountInsertSubAccount (daa, ptr->data);
g_list_free(acct_list);
@@ -1168,7 +1168,8 @@
xaccAccountScrubOrphans (account);
xaccAccountScrubImbalance (account);
- xaccAccountScrubLots (account);
+ // XXX: Lots are disabled
+ //xaccAccountScrubLots (account);
gnc_resume_gui_refresh ();
}
@@ -1185,7 +1186,8 @@
xaccAccountTreeScrubOrphans (account);
xaccAccountTreeScrubImbalance (account);
- xaccAccountTreeScrubLots (account);
+ // XXX: Lots are disabled
+ //xaccAccountTreeScrubLots (account);
gnc_resume_gui_refresh ();
}
@@ -1200,7 +1202,8 @@
xaccGroupScrubOrphans (group);
xaccGroupScrubImbalance (group);
- xaccGroupScrubLots (group);
+ // XXX: Lots are disabled
+ //xaccGroupScrubLots (group);
gnc_resume_gui_refresh ();
}
Deleted: gnucash/branches/swig-redo/src/gnome/gnucash.desktop.in
===================================================================
--- gnucash/branches/swig-redo/src/gnome/gnucash.desktop.in 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/gnucash.desktop.in 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,11 +0,0 @@
-[Desktop Entry]
-_Name=GnuCash Finance Management
-_Comment=Manage your finances, accounts, and investments
-Exec=gnucash %f
-Icon=gnucash-icon
-StartupNotify=true
-Terminal=false
-Type=Application
-Categories=Application;GNOME;Office;Finance;
-X-Desktop-File-Install-Version=0.3
-MimeType=application/x-gnucash
Copied: gnucash/branches/swig-redo/src/gnome/gnucash.desktop.in.in (from rev 15000, gnucash/trunk/src/gnome/gnucash.desktop.in.in)
Modified: gnucash/branches/swig-redo/src/gnome/schemas/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/gnome/schemas/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/schemas/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -22,10 +22,10 @@
install-data-local:
if GCONF_SCHEMAS_INSTALL
-mkdir -p $(DESTDIR)$(GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY)
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA)
+ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schema_DATA)
endif
uninstall-local:
if GCONF_SCHEMAS_INSTALL
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(srcdir)/$(schema_DATA)
+ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(schema_DATA)
endif
Modified: gnucash/branches/swig-redo/src/gnome/schemas/apps_gnucash_warnings.schemas.in
===================================================================
--- gnucash/branches/swig-redo/src/gnome/schemas/apps_gnucash_warnings.schemas.in 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/schemas/apps_gnucash_warnings.schemas.in 2006-10-15 04:08:48 UTC (rev 15023)
@@ -16,19 +16,6 @@
</schema>
<schema>
- <key>/schemas/apps/gnucash/general/warnings/close_last_window</key>
- <applyto>/apps/gnucash/general/warnings/permanent/close_last_window</applyto>
- <applyto>/apps/gnucash/general/warnings/temporary/close_last_window</applyto>
- <owner>gnucash</owner>
- <type>int</type>
- <default>0</default>
- <locale name="C">
- <short>Exit GnuCash</short>
- <long>This dialog is presented when you attempt to close the last GnuCash window.</long>
- </locale>
- </schema>
-
- <schema>
<key>/schemas/apps/gnucash/general/warnings/mark_split_unreconciled</key>
<applyto>/apps/gnucash/general/warnings/permanent/mark_split_unreconciled</applyto>
<applyto>/apps/gnucash/general/warnings/temporary/mark_split_unreconciled</applyto>
Modified: gnucash/branches/swig-redo/src/gnome/top-level.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome/top-level.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/top-level.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -258,17 +258,7 @@
if (!keyfile) {
gnc_main_window_restore_default_state();
-
-#if (GNUCASH_MAJOR_VERSION < 2) || ((GNUCASH_MAJOR_VERSION == 2) && (GNUCASH_MINOR_VERSION == 0))
- /* See if there's an old style state file to be found */
- gnc_main_window_book_open_handler(session);
-
- /* At this point the reports have only been loaded into
- memory. Now we create their ui component. */
- gnc_reports_show_all(session);
-#endif
-
- LEAVE("old");
+ LEAVE("no state file");
return;
}
Modified: gnucash/branches/swig-redo/src/gnome/window-reconcile.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome/window-reconcile.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome/window-reconcile.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1228,7 +1228,8 @@
xaccAccountTreeScrubOrphans (account);
xaccAccountTreeScrubImbalance (account);
- xaccAccountTreeScrubLots (account);
+ // XXX: Lots are disabled.
+ //xaccAccountTreeScrubLots (account);
gnc_resume_gui_refresh ();
}
Modified: gnucash/branches/swig-redo/src/gnome-search/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/gnome-search/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-search/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -61,6 +61,7 @@
${GTKHTML_LIBS} \
${GLADE_LIBS} \
${GLIB_LIBS} \
+ ${REGEX_LIBS} \
${QOF_LIBS} \
${GNOME_PRINT_LIBS}
Modified: gnucash/branches/swig-redo/src/gnome-search/search.glade
===================================================================
--- gnucash/branches/swig-redo/src/gnome-search/search.glade 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-search/search.glade 2006-10-15 04:08:48 UTC (rev 15023)
@@ -330,7 +330,7 @@
<widget class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
Modified: gnucash/branches/swig-redo/src/gnome-utils/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -6,10 +6,6 @@
# Note that src/gnome-utils CANNOT depend on src/gnome!
AM_CFLAGS = \
- -DPREFIX=\"${prefix}\" \
- -DSYSCONFDIR=\"${GNC_CONFIGDIR}\" \
- -DDATADIR=\"${GNC_SHAREDIR}\" \
- -DLIBDIR=\"${GNC_LIBDIR}\" \
-I${top_srcdir}/src/core-utils \
-I${top_srcdir}/src/gnc-module \
-I${top_srcdir}/src/engine \
@@ -17,6 +13,7 @@
-I${top_srcdir}/src/network-utils \
-I${top_srcdir}/src/app-utils \
-I${top_srcdir}/src \
+ -I${top_srcdir}/lib/libc \
${GLIB_CFLAGS} \
${GLADE_CFLAGS} \
${GTK_CFLAGS} \
@@ -29,8 +26,6 @@
${GSF_CFLAGS}
libgncmod_gnome_utils_la_SOURCES = \
- gtktreedatalist.c \
- gnctreemodelsort.c \
QuickFill.c \
account-quickfill.c \
cursors.c \
@@ -101,8 +96,6 @@
gncincludedir = ${GNC_INCLUDE_DIR}
gncinclude_HEADERS = \
- gtktreedatalist.h \
- gnctreemodelsort.h \
QuickFill.h \
account-quickfill.h \
dialog-account.h \
@@ -179,6 +172,7 @@
${top_builddir}/src/calculation/libgncmod-calculation.la \
${top_builddir}/src/network-utils/libgncmod-network-utils.la \
${top_builddir}/src/app-utils/libgncmod-app-utils.la \
+ $(top_builddir)/lib/libc/libc-missing.la \
${GNOME_LIBS} \
${GNOME_PRINT_LIBS} \
${GTKHTML_LIBS} \
@@ -191,6 +185,7 @@
${GSF_LIBS} \
${QOF_LIBS} \
${GOFFICE_LIBS} \
+ ${REGEX_LIBS} \
${LIBXML2_LIBS}
if BUILDING_FROM_SVN
@@ -206,7 +201,6 @@
gncscm_DATA = gnc-menu-extensions.scm
EXTRA_DIST = \
- gnc-dir.h.in \
gnc-svninfo.h \
gnome-utils.i \
${gncmod_DATA} \
@@ -216,14 +210,6 @@
## brackets here, instead of the usual @... at . This prevents autoconf
## from substituting the values directly into the left-hand sides of
## the sed substitutions.
-gnc-dir.h: gnc-dir.h.in ${top_builddir}/config.status Makefile
- rm -f $@.tmp
- sed < $< > $@.tmp \
- -e 's:@-GNC_ACCOUNTS_DIR-@:${GNC_ACCOUNTS_DIR}:g' \
- -e 's:@-GNC_GLADE_DIR-@:${GNC_GLADE_DIR}:g' \
- -e 's:@-GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY-@:${GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY}:g'
- mv $@.tmp $@
-
gnc-version.h: _gnc-version.h
-if [ ! -f gnc-version.h ]; then cp _gnc-version.h gnc-version.h; fi
-cmp -s _gnc-version.h gnc-version.h || cp _gnc-version.h gnc-version.h
@@ -267,7 +253,7 @@
fi ; \
fi
-BUILT_SOURCES = gnc-dir.h gnc-version.h
+BUILT_SOURCES = gnc-version.h
if GNUCASH_SEPARATE_BUILDDIR
#For executing test cases
@@ -277,20 +263,22 @@
endif
.scm-links:
- rm -f gnucash
- $(LN_S) -f . gnucash
+ $(RM) -rf gnucash
+ mkdir -p gnucash
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
noinst_DATA = .scm-links
-
CLEANFILES = $(BUILT_SOURCES) gnucash .scm-links ${SCM_FILE_LINKS}
MAINTAINERCLEANFILES = swig-gnome-utils.c
+# FIXME: Symlinking directories only works on non-win32.
+if !PLATFORM_WIN32
#
# I hate inconsistent standards. Autotools puts help files into
# ${datadir}/gnome/help/${program} while the gnome2 libraries expect
@@ -301,3 +289,4 @@
uninstall-hook:
rm -f ${DESTDIR}${pkgdatadir}/gnome
+endif
Modified: gnucash/branches/swig-redo/src/gnome-utils/dialog-account.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/dialog-account.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/dialog-account.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -94,8 +94,9 @@
GtkWidget * commodity_edit;
dialog_commodity_mode commodity_mode;
GtkWidget * account_scu;
-
- GList * valid_types;
+
+ guint32 valid_types;
+ GNCAccountType preferred_account_type;
GtkWidget * type_view;
GtkTreeView * parent_tree;
@@ -129,13 +130,12 @@
/** Static Globals *******************************************************/
static QofLogModule log_module = GNC_MOD_GUI;
-static int last_used_account_type = ACCT_TYPE_BANK;
+static GNCAccountType last_used_account_type = ACCT_TYPE_BANK;
static GList *ac_destroy_cb_list = NULL;
/** Declarations *********************************************************/
static void gnc_account_window_set_name (AccountWindow *aw);
-static void make_account_changes(GHashTable *change_type);
void gnc_account_renumber_prefix_changed_cb (GtkEditable *editable, RenumberDialog *data);
void gnc_account_renumber_interval_changed_cb (GtkSpinButton *spinbutton, RenumberDialog *data);
@@ -241,9 +241,6 @@
flag = xaccAccountGetHidden (account);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (aw->hidden_button),
flag);
-
- gtk_tree_view_collapse_all (aw->parent_tree);
- gnc_tree_view_account_set_selected_account (GNC_TREE_VIEW_ACCOUNT(aw->parent_tree), account);
LEAVE(" ");
}
@@ -321,11 +318,18 @@
return;
}
+ if (aw->type != xaccAccountGetType (account)) {
+ /* Just refreshing won't work. */
+ aw_call_destroy_callbacks (account);
+ }
+
xaccAccountBeginEdit (account);
if (aw->type != xaccAccountGetType (account))
xaccAccountSetType (account, aw->type);
+ last_used_account_type = aw->type;
+
string = gtk_entry_get_text (GTK_ENTRY(aw->name_entry));
old_string = xaccAccountGetName (account);
if (safe_strcmp (string, old_string) != 0)
@@ -436,15 +440,57 @@
}
-static void
-gnc_finish_ok (AccountWindow *aw,
- GHashTable *change_type)
+static void
+set_children_types (Account *account, GNCAccountType type)
{
- ENTER("aw %p, hash table %p", aw, change_type);
+ AccountGroup *children;
+ GList *iter;
+
+ children = xaccAccountGetChildren (account);
+ if (children == NULL)
+ return;
+
+ for (iter=xaccGroupGetAccountList (children); iter; iter=iter->next) {
+ account = iter->data;
+ if (type == xaccAccountGetType(account))
+ continue;
+
+ /* Just refreshing won't work. */
+ aw_call_destroy_callbacks (account);
+
+ xaccAccountBeginEdit (account);
+ xaccAccountSetType (account, type);
+ xaccAccountCommitEdit (account);
+
+ set_children_types (account, type);
+ }
+}
+
+static void
+make_children_compatible (AccountWindow *aw)
+{
+ Account *account;
+
+ g_return_if_fail (aw);
+
+ account = aw_get_account (aw);
+ g_return_if_fail (account);
+
+ if (xaccAccountTypesCompatible (xaccAccountGetType (account), aw->type))
+ return;
+
+ set_children_types (account, aw->type);
+}
+
+
+static void
+gnc_finish_ok (AccountWindow *aw)
+{
+ ENTER("aw %p", aw);
gnc_suspend_gui_refresh ();
/* make the account changes */
- make_account_changes (change_type);
+ make_children_compatible (aw);
gnc_ui_to_account (aw);
gnc_resume_gui_refresh ();
@@ -494,141 +540,43 @@
}
-/* Record all of the children of the given account as needing their
- * type changed to the one specified. */
static void
-gnc_change_account_types(GHashTable *change_type, Account *account,
- Account *except, GNCAccountType type)
+add_children_to_expander (GObject *object, GParamSpec *param_spec, gpointer data)
{
- AccountGroup *children;
- GList *list;
- GList *node;
+ GtkExpander *expander = GTK_EXPANDER (object);
+ Account *account = data;
+ GtkWidget *scrolled_window;
+ GtkTreeView *view;
- if ((change_type == NULL) || (account == NULL))
- return;
+ if (gtk_expander_get_expanded (expander) &&
+ !gtk_bin_get_child (GTK_BIN (expander))) {
- if (account == except)
- return;
+ view = gnc_tree_view_account_new_with_group (
+ xaccAccountGetChildren (account), FALSE);
- g_hash_table_insert(change_type, account, GINT_TO_POINTER(type));
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_SHADOW_IN);
+ gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (view));
- children = xaccAccountGetChildren(account);
- if (children == NULL)
- return;
-
- list = xaccGroupGetAccountList (children);
-
- for (node= list; node; node = node->next)
- {
- account = node->data;
- gnc_change_account_types(change_type, account, except, type);
+ gtk_container_add (GTK_CONTAINER (expander), scrolled_window);
+ gtk_widget_show_all (scrolled_window);
}
}
-
-/* helper function to perform changes to accounts */
-static void
-change_func (gpointer key, gpointer value, gpointer unused)
-{
- Account *account = key;
- int type;
-
- if (account == NULL)
- return;
-
- xaccAccountBeginEdit(account);
-
- type = GPOINTER_TO_INT(value);
-
- if (type == xaccAccountGetType(account))
- return;
-
- /* Just refreshing won't work. */
- aw_call_destroy_callbacks (account);
-
- xaccAccountSetType(account, type);
-
- xaccAccountCommitEdit(account);
-}
-
-
-/* Perform the changes to accounts dictated by the hash tables */
-static void
-make_account_changes(GHashTable *change_type)
-{
- if (change_type != NULL)
- g_hash_table_foreach(change_type, change_func, NULL);
-}
-
-
-typedef struct
-{
- Account *account;
- GtkListStore *list;
- guint count;
-} FillStruct;
-
-static void
-fill_helper(gpointer key, gpointer value, gpointer data)
-{
- Account *account = key;
- FillStruct *fs = data;
- gchar *full_name;
- const gchar *account_field_name;
- const gchar *account_field_value;
- const gchar *value_str;
- GtkTreeIter iter;
-
- if (fs == NULL) return;
- if (fs->account == account) return;
-
- full_name = xaccAccountGetFullName(account);
- account_field_name = _("Type");
- account_field_value = xaccAccountGetTypeStr(xaccAccountGetType(account));
- value_str = xaccAccountGetTypeStr(GPOINTER_TO_INT(value));
-
- gtk_list_store_append(fs->list, &iter);
- gtk_list_store_set(fs->list, &iter,
- ACCOUNT_COL_FULLNAME, full_name,
- ACCOUNT_COL_FIELDNAME, account_field_name,
- ACCOUNT_COL_OLD_VALUE, account_field_value,
- ACCOUNT_COL_NEW_VALUE, value_str,
- -1);
- g_free(full_name);
- fs->count++;
-}
-
-static guint
-fill_list(Account *account, GtkListStore *list,
- GHashTable *change)
-{
- FillStruct fs;
-
- if (change == NULL)
- return 0;
-
- fs.account = account;
- fs.list = list;
- fs.count = 0;
-
- g_hash_table_foreach(change, fill_helper, &fs);
-
- return fs.count;
-}
-
-
-/* Present a dialog of proposed account changes for the user's ok */
+/* Check whether there are children needing a type adjustment because of a
+ a change to an incompatible type (like after some reparenting) and let the
+ user decide whether he wants that */
static gboolean
-extra_change_verify (AccountWindow *aw,
- GHashTable *change_type)
+verify_children_compatible (AccountWindow *aw)
{
Account *account;
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
- GtkTreeView *view;
- GtkListStore *store;
+ AccountGroup *children;
+ GtkWidget *dialog, *vbox, *hbox, *label, *expander;
+ gchar *str;
gboolean result;
- guint size;
if (aw == NULL)
return FALSE;
@@ -637,88 +585,88 @@
if (!account)
return FALSE;
- store = gtk_list_store_new(NUM_ACCOUNT_COLS, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_STRING);
+ if (xaccAccountTypesCompatible (xaccAccountGetType (account), aw->type))
+ return TRUE;
- size = fill_list(account, GTK_LIST_STORE(store), change_type);
-
- if (size == 0)
- {
- g_object_unref(store);
+ children = xaccAccountGetChildren (account);
+ if (!children ||
+ !xaccGroupGetNumAccounts (children))
return TRUE;
- }
- gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store),
- ACCOUNT_COL_FULLNAME,
- GTK_SORT_ASCENDING);
+ dialog = gtk_dialog_new_with_buttons ("",
+ GTK_WINDOW(aw->dialog),
+ GTK_DIALOG_DESTROY_WITH_PARENT |
+ GTK_DIALOG_MODAL,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK,
+ NULL);
- view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)));
- g_object_unref(store);
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes(_("Account"), renderer,
- "text", ACCOUNT_COL_FULLNAME,
- NULL);
- gtk_tree_view_append_column(view, column);
+ gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE);
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes(_("Field"), renderer,
- "text", ACCOUNT_COL_FIELDNAME,
- NULL);
- gtk_tree_view_append_column(view, column);
+ hbox = gtk_hbox_new (FALSE, 12);
+ vbox = gtk_vbox_new (FALSE, 12);
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes(_("Old Value"), renderer,
- "text", ACCOUNT_COL_OLD_VALUE,
- NULL);
- gtk_tree_view_append_column(view, column);
+ gtk_box_pack_start (
+ GTK_BOX (hbox),
+ gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG),
+ FALSE, FALSE, 0);
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes(_("New Value"), renderer,
- "text", ACCOUNT_COL_NEW_VALUE,
- NULL);
- gtk_tree_view_append_column(view, column);
-
+ /* primary label */
+ label = gtk_label_new (_("Give the children the same type?"));
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_label_set_selectable (GTK_LABEL (label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
{
- GtkWidget *dialog;
- GtkWidget *scroll;
- GtkWidget *label;
- GtkWidget *frame;
- GtkWidget *vbox;
+ gint size;
+ PangoFontDescription *font_desc;
- dialog = gtk_dialog_new_with_buttons (_("Verify Changes"),
- GTK_WINDOW(aw->dialog),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- NULL);
+ size = pango_font_description_get_size (label->style->font_desc);
+ font_desc = pango_font_description_new ();
+ pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
+ pango_font_description_set_size (font_desc, size * PANGO_SCALE_LARGE);
+ gtk_widget_modify_font (label, font_desc);
+ pango_font_description_free (font_desc);
+ }
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
- gtk_window_set_default_size (GTK_WINDOW (dialog), 0, 300);
+ /* secondary label */
+ str = g_strdup_printf (_("The children of the edited account have to be "
+ "changed to type \"%s\" to make them compatible."),
+ xaccAccountGetTypeStr (aw->type));
+ label = gtk_label_new (str);
+ g_free (str);
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_label_set_selectable (GTK_LABEL (label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- vbox = GTK_DIALOG (dialog)->vbox;
+ /* children */
+ expander = gtk_expander_new_with_mnemonic (_("_Show children accounts"));
+ gtk_expander_set_spacing (GTK_EXPANDER (expander), 6);
+ g_signal_connect (G_OBJECT (expander), "notify::expanded",
+ G_CALLBACK (add_children_to_expander), account);
+ gtk_box_pack_start (GTK_BOX (vbox), expander, TRUE, TRUE, 0);
- label = gtk_label_new(_("The following changes must be made. Continue?"));
- gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
- frame = gtk_frame_new(NULL);
- gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
+ TRUE, TRUE, 0);
- scroll = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
- GTK_POLICY_NEVER,
- GTK_POLICY_AUTOMATIC);
+ /* spacings */
+ gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
+ gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14);
+ gtk_container_set_border_width (
+ GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
- gtk_container_add(GTK_CONTAINER(frame), scroll);
- gtk_container_set_border_width(GTK_CONTAINER(scroll), 5);
- gtk_container_add(GTK_CONTAINER(scroll), GTK_WIDGET(view));
+ gtk_widget_show_all (hbox);
- gtk_widget_show_all(vbox);
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
- result = (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK);
+ result = (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK);
- gtk_widget_destroy(dialog);
- }
+ gtk_widget_destroy(dialog);
return result;
}
@@ -810,6 +758,16 @@
return FALSE;
}
+ /* check whether the types of child and parent are compatible */
+ if (parent != aw->top_level_account &&
+ !xaccAccountTypesCompatible (aw->type, xaccAccountGetType (parent))) {
+ const char *message = _("The selected account type is incompatible with "
+ "the one of the selected parent.");
+ gnc_error_dialog(aw->dialog, message);
+ LEAVE("incompatible types");
+ return FALSE;
+ }
+
/* check for commodity */
commodity = (gnc_commodity *)
gnc_general_select_get_selected (GNC_GENERAL_SELECT (aw->commodity_edit));
@@ -827,18 +785,8 @@
static void
gnc_edit_account_ok(AccountWindow *aw)
{
- GHashTable *change_type;
-
- gboolean change_children;
- gboolean has_children;
- gboolean change_all;
-
- Account *new_parent;
Account *account;
- AccountGroup *children;
- GNCAccountType current_type;
-
ENTER("aw %p", aw);
account = aw_get_account (aw);
@@ -852,73 +800,12 @@
return;
}
- change_type = g_hash_table_new (NULL, NULL);
-
- children = xaccAccountGetChildren(account);
- if (children == NULL)
- has_children = FALSE;
- else if (xaccGroupGetNumAccounts(children) == 0)
- has_children = FALSE;
- else
- has_children = TRUE;
-
- current_type = xaccAccountGetType(account);
-
- /* If the account has children and the new type isn't compatible
- * with the old type, the children's types must be changed. */
- change_children = (has_children &&
- !xaccAccountTypesCompatible(current_type, aw->type));
-
- /* If the new parent's type is not compatible with the new type,
- * the whole sub-tree containing the account must be re-typed. */
- new_parent = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT (aw->parent_tree));
- if (new_parent != aw->top_level_account)
- {
- int parent_type;
-
- parent_type = xaccAccountGetType(new_parent);
-
- if (!xaccAccountTypesCompatible(parent_type, aw->type))
- change_all = TRUE;
- else
- change_all = FALSE;
- }
- else
- change_all = FALSE;
-
- if (change_children)
- gnc_change_account_types(change_type, account, NULL, aw->type);
-
- if (change_all)
- {
- Account *ancestor;
- Account *temp;
-
- temp = new_parent;
-
- do
- {
- ancestor = temp;
- temp = xaccAccountGetParentAccount(ancestor);
- } while (temp != NULL);
-
- gnc_change_account_types(change_type, ancestor, account, aw->type);
- }
-
- if (!extra_change_verify(aw, change_type))
- {
- g_hash_table_destroy(change_type);
+ if (!verify_children_compatible (aw)) {
LEAVE(" ");
return;
}
- if (current_type != aw->type)
- /* Just refreshing won't work. */
- aw_call_destroy_callbacks (account);
-
- gnc_finish_ok (aw, change_type);
-
- g_hash_table_destroy (change_type);
+ gnc_finish_ok (aw);
LEAVE(" ");
}
@@ -927,8 +814,6 @@
gnc_new_account_ok (AccountWindow *aw)
{
gnc_numeric balance;
- GHashTable *change_type;
- Account *new_parent;
ENTER("aw %p", aw);
@@ -972,41 +857,7 @@
}
}
- /* If the new parent's type is not compatible with the new type,
- * the whole sub-tree containing the account must be re-typed. */
- change_type = g_hash_table_new (NULL, NULL);
-
- new_parent = gnc_tree_view_account_get_selected_account (
- GNC_TREE_VIEW_ACCOUNT (aw->parent_tree));
- if (new_parent != aw->top_level_account)
- {
- if (!xaccAccountTypesCompatible (xaccAccountGetType(new_parent),
- aw->type))
- {
- Account *ancestor;
- Account *temp;
-
- temp = new_parent;
- do
- {
- ancestor = temp;
- temp = xaccAccountGetParentAccount (ancestor);
- } while (temp != NULL);
-
- gnc_change_account_types (change_type, ancestor, NULL, aw->type);
-
- if (!extra_change_verify (aw, change_type))
- {
- g_hash_table_destroy (change_type);
- LEAVE(" ");
- return;
- }
- }
- }
-
- gnc_finish_ok (aw, change_type);
-
- g_hash_table_destroy (change_type);
+ gnc_finish_ok (aw);
LEAVE(" ");
}
@@ -1104,12 +955,64 @@
aw->next_name = NULL;
}
- g_list_free (aw->valid_types);
g_free (aw);
LEAVE(" ");
}
static void
+gnc_account_parent_changed_cb (GtkTreeSelection *selection, gpointer data)
+{
+ AccountWindow *aw = data;
+ Account *parent_account;
+ guint32 types, old_types;
+ GtkTreeModel *type_model;
+ GtkTreeSelection *type_selection;
+ gboolean scroll_to = FALSE;
+
+ g_return_if_fail (aw);
+
+ parent_account = gnc_tree_view_account_get_selected_account (
+ GNC_TREE_VIEW_ACCOUNT (aw->parent_tree));
+ if (!parent_account)
+ return;
+
+ if (parent_account == aw->top_level_account) {
+ types = aw->valid_types;
+ } else {
+ types = aw->valid_types &
+ xaccAccountTypesCompatibleWith (xaccAccountGetType (parent_account));
+ }
+
+ type_model = gtk_tree_view_get_model (GTK_TREE_VIEW (aw->type_view));
+ if (!type_model)
+ return;
+
+ if (aw->type != aw->preferred_account_type &&
+ (types & (1 << aw->preferred_account_type)) != 0) {
+ /* we can change back to the preferred account type */
+ aw->type = aw->preferred_account_type;
+ scroll_to = TRUE;
+ }
+ else if ((types & (1 << aw->type)) == 0) {
+ /* our type is invalid now */
+ aw->type = ACCT_TYPE_INVALID;
+ }
+ else {
+ /* no type change, but maybe list of valid types changed */
+ old_types = gnc_tree_model_account_types_get_mask (type_model);
+ if (old_types != types)
+ scroll_to = TRUE;
+ }
+
+ gnc_tree_model_account_types_set_mask (type_model, types);
+
+ if (scroll_to) {
+ type_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (aw->type_view));
+ gnc_tree_model_account_types_set_selection(type_selection, 1 << aw->type);
+ }
+}
+
+static void
gnc_account_type_changed_cb (GtkTreeSelection *selection, gpointer data)
{
AccountWindow *aw = data;
@@ -1125,7 +1028,7 @@
aw->type = ACCT_TYPE_INVALID;
} else {
aw->type = type_id;
- last_used_account_type = type_id;
+ aw->preferred_account_type = type_id;
gnc_account_commodity_from_type (aw, TRUE);
@@ -1143,18 +1046,6 @@
}
}
-static GNCAccountType
-gnc_account_choose_new_acct_type (AccountWindow *aw)
-{
- if (g_list_index (aw->valid_types, GINT_TO_POINTER(aw->type)) != -1)
- return aw->type;
-
- if (g_list_index (aw->valid_types, GINT_TO_POINTER(last_used_account_type)) != -1)
- return last_used_account_type;
-
- return ((GNCAccountType)(aw->valid_types->data));
-}
-
static void
gnc_account_type_view_create (AccountWindow *aw)
{
@@ -1162,20 +1053,35 @@
GtkTreeSelection *selection;
GtkCellRenderer *renderer;
GtkTreeView *view;
- GList *list;
- guint32 types = 0;
- if ((aw->dialog_type == NEW_ACCOUNT) && aw->valid_types)
- aw->type = gnc_account_choose_new_acct_type (aw);
+ if (aw->valid_types == 0) {
+ /* no type restrictions, choose aw->type */
+ aw->valid_types = xaccAccountTypesValid () | (1 << aw->type);
+ aw->preferred_account_type = aw->type;
+ }
+ else if ((aw->valid_types & (1 << aw->type)) != 0) {
+ /* aw->type is valid */
+ aw->preferred_account_type = aw->type;
+ }
+ else if ((aw->valid_types & (1 << last_used_account_type)) != 0) {
+ /* last used account type is valid */
+ aw->type = last_used_account_type;
+ aw->preferred_account_type = last_used_account_type;
+ }
+ else {
+ /* choose first valid account type */
+ int i;
+ aw->preferred_account_type = aw->type;
+ aw->type = ACCT_TYPE_INVALID;
+ for (i=0; i<32; i++)
+ if ((aw->valid_types & (1 << i)) != 0) {
+ aw->type = i;
+ break;
+ }
+ }
- if (aw->valid_types == NULL)
- types = xaccAccountTypesValid () | (1 << aw->type);
- else
- for (list = aw->valid_types; list; list = list->next)
- types |= (1 << GPOINTER_TO_INT(list->data));
+ model = gnc_tree_model_account_types_filter_using_mask (aw->valid_types);
- model = gnc_tree_model_account_types_filter_using_mask (types);
-
view = GTK_TREE_VIEW (aw->type_view);
gtk_tree_view_set_model (view, model);
g_object_unref (G_OBJECT (model));
@@ -1190,7 +1096,7 @@
selection = gtk_tree_view_get_selection (view);
g_signal_connect (G_OBJECT (selection), "changed",
G_CALLBACK (gnc_account_type_changed_cb), aw);
-
+
gnc_tree_model_account_types_set_selection(selection, 1 << aw->type);
}
@@ -1274,7 +1180,6 @@
static void
gnc_account_window_create(AccountWindow *aw)
{
- GtkDialog *awd;
GtkWidget *amount;
GObject *awo;
GtkWidget *box;
@@ -1287,7 +1192,6 @@
aw->dialog = glade_xml_get_widget (xml, "Account Dialog");
awo = G_OBJECT (aw->dialog);
- awd = GTK_DIALOG (awo);
g_object_set_data (awo, "dialog_info", aw);
@@ -1332,6 +1236,9 @@
aw->parent_tree = gnc_tree_view_account_new(TRUE);
gtk_container_add(GTK_CONTAINER(box), GTK_WIDGET(aw->parent_tree));
gtk_widget_show(GTK_WIDGET(aw->parent_tree));
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (aw->parent_tree));
+ g_signal_connect (G_OBJECT (selection), "changed",
+ G_CALLBACK (gnc_account_parent_changed_cb), aw);
aw->top_level_account =
gnc_tree_view_account_get_top_level (GNC_TREE_VIEW_ACCOUNT(aw->parent_tree));
@@ -1523,13 +1430,17 @@
gnc_commodity *commodity, *parent_commodity;
AccountWindow *aw;
Account *account;
+ GList *list;
aw = g_new0 (AccountWindow, 1);
aw->modal = modal;
aw->dialog_type = NEW_ACCOUNT;
- aw->valid_types = g_list_copy (valid_types);
+ aw->valid_types = 0;
+ for (list = valid_types; list; list = list->next)
+ aw->valid_types |= (1 << GPOINTER_TO_INT (list->data));
+
account = xaccMallocAccount (gnc_get_current_book ());
aw->account = *xaccAccountGetGUID (account);
@@ -1566,16 +1477,15 @@
commodity);
gnc_account_commodity_from_type (aw, FALSE);
- gtk_widget_show (aw->dialog);
+ if (base_account == NULL)
+ base_account = aw->top_level_account;
- if (base_account == NULL) {
- base_account = aw->top_level_account;
- }
-
gtk_tree_view_collapse_all (aw->parent_tree);
- gnc_tree_view_account_set_selected_account (GNC_TREE_VIEW_ACCOUNT (aw->parent_tree),
- base_account);
+ gnc_tree_view_account_set_selected_account (
+ GNC_TREE_VIEW_ACCOUNT (aw->parent_tree), base_account);
+ gtk_widget_show (aw->dialog);
+
gnc_window_adjust_for_screen (GTK_WINDOW(aw->dialog));
gnc_account_window_set_name (aw);
@@ -1583,7 +1493,7 @@
aw->component_id = gnc_register_gui_component (DIALOG_NEW_ACCOUNT_CM_CLASS,
refresh_handler,
modal ? NULL : close_handler,
- aw);
+ aw);
gnc_gui_component_set_session (aw->component_id, gnc_get_current_session());
gnc_gui_component_watch_entity_type (aw->component_id,
@@ -1651,10 +1561,11 @@
return gnc_ui_new_accounts_from_name_with_defaults(name, valid_types, NULL, NULL);
}
-Account * gnc_ui_new_accounts_from_name_with_defaults (const char *name,
- GList *valid_types,
- gnc_commodity * default_commodity,
- Account * parent)
+Account *
+gnc_ui_new_accounts_from_name_with_defaults (const char *name,
+ GList *valid_types,
+ gnc_commodity * default_commodity,
+ Account * parent)
{
AccountWindow *aw;
Account *base_account = NULL;
@@ -1768,7 +1679,9 @@
if (parent == NULL)
parent = aw->top_level_account;
- gnc_tree_view_account_set_selected_account (GNC_TREE_VIEW_ACCOUNT(aw->parent_tree), parent);
+ gtk_tree_view_collapse_all (aw->parent_tree);
+ gnc_tree_view_account_set_selected_account (
+ GNC_TREE_VIEW_ACCOUNT(aw->parent_tree), parent);
gnc_account_window_set_name (aw);
@@ -1816,16 +1729,7 @@
gnc_ui_new_account_with_types( AccountGroup *unused,
GList *valid_types )
{
- GList *validTypesCopy = g_list_copy( valid_types );
- AccountWindow *aw;
-
- aw = gnc_ui_new_account_window_internal( NULL, NULL, validTypesCopy, NULL, FALSE );
- if ( validTypesCopy != NULL ) {
- /* Attach it with "[...]_full" so we can set the appropriate
- * GtkDestroyNotify func. */
- g_object_set_data_full( G_OBJECT(aw->dialog), "validTypesListCopy",
- validTypesCopy, (GDestroyNotify)g_list_free );
- }
+ gnc_ui_new_account_window_internal( NULL, NULL, valid_types, NULL, FALSE );
}
/************************************************************
Modified: gnucash/branches/swig-redo/src/gnome-utils/dialog-preferences.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/dialog-preferences.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/dialog-preferences.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1264,7 +1264,8 @@
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
gnc_unregister_gui_component_by_data(DIALOG_PREFERENCES_CM_CLASS,
dialog);
- gnc_gconf_remove_notification(G_OBJECT(dialog), NULL);
+ gnc_gconf_remove_notification(G_OBJECT(dialog), NULL,
+ DIALOG_PREFERENCES_CM_CLASS);
gtk_widget_destroy(GTK_WIDGET(dialog));
break;
}
@@ -1614,7 +1615,8 @@
gtk_widget_show(dialog);
gnc_gconf_add_notification(G_OBJECT(dialog), NULL,
- gnc_preferences_gconf_changed);
+ gnc_preferences_gconf_changed,
+ DIALOG_PREFERENCES_CM_CLASS);
gnc_gconf_general_register_cb(KEY_ACCOUNT_SEPARATOR,
(GncGconfGeneralCb)gnc_account_separator_prefs_cb,
dialog);
Modified: gnucash/branches/swig-redo/src/gnome-utils/dialog-reset-warnings.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/dialog-reset-warnings.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/dialog-reset-warnings.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -221,7 +221,8 @@
break;
case GTK_RESPONSE_OK:
- gnc_gconf_remove_notification(G_OBJECT(dialog), GCONF_WARNINGS);
+ gnc_gconf_remove_notification(G_OBJECT(dialog), GCONF_WARNINGS,
+ DIALOG_RESET_WARNINGS_CM_CLASS);
gnc_reset_warnings_apply_changes(dialog);
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
gnc_unregister_gui_component_by_data(DIALOG_RESET_WARNINGS_CM_CLASS,
@@ -230,7 +231,8 @@
break;
default:
- gnc_gconf_remove_notification(G_OBJECT(dialog), GCONF_WARNINGS);
+ gnc_gconf_remove_notification(G_OBJECT(dialog), GCONF_WARNINGS,
+ DIALOG_RESET_WARNINGS_CM_CLASS);
gnc_reset_warnings_revert_changes(dialog);
gnc_unregister_gui_component_by_data(DIALOG_RESET_WARNINGS_CM_CLASS,
dialog);
@@ -415,7 +417,8 @@
gnc_reset_warnings_update_widgets(dialog);
gnc_gconf_add_notification(G_OBJECT(dialog), GCONF_WARNINGS,
- gnc_reset_warnings_gconf_changed);
+ gnc_reset_warnings_gconf_changed,
+ DIALOG_RESET_WARNINGS_CM_CLASS);
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
Modified: gnucash/branches/swig-redo/src/gnome-utils/dialog-utils.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/dialog-utils.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/dialog-utils.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -38,7 +38,7 @@
#include "dialog-utils.h"
#include "gnc-commodity.h"
#include "Group.h"
-#include "gnc-dir.h"
+#include "gnc-path.h"
#include "gnc-engine.h"
#include "gnc-euro.h"
#include "gnc-ui-util.h"
@@ -50,9 +50,6 @@
#define WINDOW_POSITION "window_position"
#define WINDOW_GEOMETRY "window_geometry"
-#define DESKTOP_GNOME_INTERFACE "/desktop/gnome/interface"
-#define KEY_TOOLBAR_STYLE "toolbar_style"
-
/* =========================================================== */
static void
@@ -810,6 +807,7 @@
{
GladeXML *xml;
char *fname;
+ gchar *gnc_glade_dir;
g_return_val_if_fail (filename != NULL, NULL);
g_return_val_if_fail (root != NULL, NULL);
@@ -820,7 +818,9 @@
glade_inited = TRUE;
}
- fname = g_strconcat (GNC_GLADE_DIR, "/", filename, (char *)NULL);
+ gnc_glade_dir = gnc_path_get_gladedir ();
+ fname = g_build_filename(gnc_glade_dir, filename, (char *)NULL);
+ g_free (gnc_glade_dir);
xml = glade_xml_new (fname, root, NULL);
Modified: gnucash/branches/swig-redo/src/gnome-utils/druid-gconf-setup.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/druid-gconf-setup.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/druid-gconf-setup.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -41,7 +41,7 @@
#include "dialog-utils.h"
#include "druid-gconf-setup.h"
#include "druid-utils.h"
-#include "gnc-dir.h"
+#include "gnc-path.h"
#include "gnc-gconf-utils.h"
#include "gnc-gui-query.h"
#include "gnc-gnome-utils.h"
@@ -113,6 +113,7 @@
gchar *contents, **lines, *line;
gboolean found_user_dir = FALSE;
FILE *output;
+ gchar *gconfdir;
data_filename = g_build_filename(g_get_home_dir(), ".gconf", (char *)NULL);
path_filename = g_build_filename(g_get_home_dir(), ".gconf.path", (char *)NULL);
@@ -151,7 +152,9 @@
fprintf(output, "\n######## The following lines were added by GnuCash. ########\n");
if (!found_user_dir)
fprintf(output, PATH_STRING1);
- fprintf(output, PATH_STRING2, GNC_GCONF_DIR);
+ gconfdir = gnc_path_get_gconfdir ();
+ fprintf(output, PATH_STRING2, gconfdir);
+ g_free (gconfdir);
fprintf(output, "############## End of lines added by GnuCash. ##############\n");
if (fclose(output) != 0) {
*error = g_error_new (G_FILE_ERROR,
@@ -284,11 +287,13 @@
GtkTextBuffer *textbuffer;
GtkWidget *textview;
gchar *msg;
+ gchar *gconfdir = gnc_path_get_gconfdir ();
textview = gnc_glade_lookup_widget(GTK_WIDGET(druidpage), "update_text");
textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
- msg = g_strdup_printf(PATH_STRING1 PATH_STRING2, GNC_GCONF_DIR);
+ msg = g_strdup_printf(PATH_STRING1 PATH_STRING2, gconfdir);
gtk_text_buffer_set_text(textbuffer, msg, -1);
+ g_free (gconfdir);
}
Modified: gnucash/branches/swig-redo/src/gnome-utils/glade/transfer.glade
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/glade/transfer.glade 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/glade/transfer.glade 2006-10-15 04:08:48 UTC (rev 15023)
@@ -19,7 +19,6 @@
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">False</property>
<signal name="response" handler="gnc_xfer_dialog_response_cb" last_modification_time="Sun, 27 Jul 2003 17:44:58 GMT"/>
- <signal name="close" handler="gnc_xfer_dialog_close_cb" last_modification_time="Sun, 27 Jul 2003 17:45:10 GMT"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="vbox">
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-date-format.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-date-format.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-date-format.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -41,6 +41,10 @@
#include "gnc-date-format.h"
#include "dialog-utils.h"
+#ifndef HAVE_LOCALTIME_R
+# include "localtime_r.h"
+#endif
+
/* Perhaps it's better just to use MAX_DATE_LENGTH defined in gnc-date.h */
#define MAX_DATE_LEN 80
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-dialog.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-dialog.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-dialog.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -18,6 +18,7 @@
* Boston, MA 02110-1301, USA gnu at gnu.org
*/
+#include "config.h"
#include <gtk/gtk.h>
#include <glade/glade.h>
Deleted: gnucash/branches/swig-redo/src/gnome-utils/gnc-dir.h.in
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-dir.h.in 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-dir.h.in 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,30 +0,0 @@
-/**-*- c -*-*********************************************************\
- * gnc-dir.h -- directories for GnuCash *
- * Copyright (C) 2001 Gnumatic, Inc. *
- * *
- * 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 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef GNC_DIR_H
-#define GNC_DIR_H
-
-#define GNC_ACCOUNTS_DIR "@-GNC_ACCOUNTS_DIR-@"
-#define GNC_GLADE_DIR "@-GNC_GLADE_DIR-@"
-#define GNC_GCONF_DIR "@-GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY-@"
-
-#endif
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-druid-provider-file-gnome.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-druid-provider-file-gnome.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-druid-provider-file-gnome.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -122,6 +122,7 @@
return res;
}
+#ifdef HAVE_GLOB_H
static int
gnc_dpfg_file_err(const char *path, int err)
{
@@ -132,6 +133,7 @@
return (res == GTK_RESPONSE_OK ? 0 : 1);
}
+#endif
/* Return TRUE if we have a valid file... */
static gboolean
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-embedded-window.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-embedded-window.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-embedded-window.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -31,7 +31,6 @@
#include "gnc-engine.h"
#include "gnc-gnome-utils.h"
-#include "gnc-dir.h"
#include "gnc-gobject-utils.h"
#include "gnc-gui-query.h"
#include "gnc-plugin.h"
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-file.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-file.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-file.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -415,8 +415,12 @@
break;
case ERR_FILEIO_FILE_NOT_FOUND:
- fmt = _("The file %s could not be found.");
- gnc_error_dialog (parent, fmt, newfile);
+ if (type == GNC_FILE_DIALOG_SAVE) {
+ uh_oh = FALSE;
+ } else {
+ fmt = _("The file %s could not be found.");
+ gnc_error_dialog (parent, fmt, newfile);
+ }
break;
case ERR_FILEIO_FILE_TOO_OLD:
@@ -442,6 +446,11 @@
gnc_error_dialog(parent, fmt, newfile);
break;
+ case ERR_FILEIO_FILE_EACCES:
+ fmt = _("No read permission to read from file %s.");
+ gnc_error_dialog (parent, fmt, newfile);
+ break;
+
case ERR_SQL_DB_TOO_OLD:
fmt = _("This database is from an older version of GnuCash. "
"Do you want to want to upgrade the database "
@@ -1062,7 +1071,8 @@
}
/* if the database doesn't exist, ask the user ... */
- else if ((ERR_BACKEND_NO_SUCH_DB == io_err) ||
+ else if ((ERR_FILEIO_FILE_NOT_FOUND == io_err) ||
+ (ERR_BACKEND_NO_SUCH_DB == io_err) ||
(ERR_SQL_DB_TOO_OLD == io_err))
{
if (FALSE == show_session_error (io_err, newfile, GNC_FILE_DIALOG_SAVE))
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-gnome-utils.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-gnome-utils.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-gnome-utils.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -38,6 +38,7 @@
#include "gnc-gnome-utils.h"
#include "gnc-html.h"
#include "gnc-engine.h"
+#include "gnc-path.h"
#include "gnc-ui.h"
#include "gnc-file.h"
#include "gnc-hooks.h"
@@ -52,7 +53,6 @@
#include "dialog-totd.h"
#include "gnc-ui-util.h"
#include "gnc-session.h"
-#include <gnc-dir.h>
static QofLogModule log_module = GNC_MOD_GUI;
static GnomeProgram *gnucash_program = NULL;
@@ -194,12 +194,24 @@
{
char *fullname;
GError *error = NULL;
+ gchar *prefix = gnc_path_get_prefix ();
+ gchar *pkgsysconfdir = gnc_path_get_pkgsysconfdir ();
+ gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
+ gchar *pkglibdir = gnc_path_get_pkglibdir ();
gnc_gtk_add_rc_file();
gnucash_program = gnome_program_init(
"gnucash", version, LIBGNOMEUI_MODULE,
argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES, GNOME_PARAM_NONE);
+ GNOME_PARAM_APP_PREFIX, prefix,
+ GNOME_PARAM_APP_SYSCONFDIR, pkgsysconfdir,
+ GNOME_PARAM_APP_DATADIR, pkgdatadir,
+ GNOME_PARAM_APP_LIBDIR, pkglibdir,
+ GNOME_PARAM_NONE);
+ g_free (prefix);
+ g_free (pkgsysconfdir);
+ g_free (pkgdatadir);
+ g_free (pkglibdir);
/* initialization required for gtkhtml */
gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1001,13 +1001,6 @@
{
static gboolean already_dead = FALSE;
QofSession *session;
- GtkWidget *dialog;
- gint response;
- const gchar *title = _("Quit GnuCash?");
- const gchar *message =_("You are attempting to close the last "
- "GnuCash window. Doing so will quit the "
- "application. Are you sure that this is "
- "what you want to do?");
if (already_dead)
return TRUE;
@@ -1031,26 +1024,10 @@
return TRUE;
}
- dialog = gtk_message_dialog_new(GTK_WINDOW(window),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- "%s", title);
- gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
- "%s", message);
- gtk_dialog_add_buttons(GTK_DIALOG(dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_QUIT, GTK_RESPONSE_OK,
- NULL);
- gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
- response = gnc_dialog_run (GTK_DIALOG (dialog), "close_last_window");
- gtk_widget_destroy(dialog);
+ /* Tell gnucash to shutdown cleanly */
+ g_timeout_add(250, gnc_main_window_timed_quit, NULL);
+ already_dead = TRUE;
- if (response == GTK_RESPONSE_OK) {
- /* Tell gnucash to shutdown cleanly */
- g_timeout_add(250, gnc_main_window_timed_quit, NULL);
- already_dead = TRUE;
- }
return TRUE;
}
@@ -1831,8 +1808,10 @@
/* Update the "Windows" menu in all other windows */
gnc_main_window_update_all_menu_items();
- gnc_gconf_remove_notification(G_OBJECT(window), DESKTOP_GNOME_INTERFACE);
- gnc_gconf_remove_notification(G_OBJECT(window), GCONF_GENERAL);
+ gnc_gconf_remove_notification(G_OBJECT(window), DESKTOP_GNOME_INTERFACE,
+ GNC_MAIN_WINDOW_NAME);
+ gnc_gconf_remove_notification(G_OBJECT(window), GCONF_GENERAL,
+ GNC_MAIN_WINDOW_NAME);
qof_event_unregister_handler(priv->event_handler_id);
priv->event_handler_id = 0;
@@ -2738,9 +2717,11 @@
g_free(filename);
gnc_gconf_add_notification(G_OBJECT(window), GCONF_GENERAL,
- gnc_main_window_gconf_changed);
+ gnc_main_window_gconf_changed,
+ GNC_MAIN_WINDOW_NAME);
gnc_gconf_add_notification(G_OBJECT(window), DESKTOP_GNOME_INTERFACE,
- gnc_main_window_gconf_changed);
+ gnc_main_window_gconf_changed,
+ GNC_MAIN_WINDOW_NAME);
gnc_main_window_update_toolbar(window);
gnc_main_window_update_tab_position(window);
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -85,7 +85,7 @@
};
gnc_plugin_type = g_type_register_static (G_TYPE_OBJECT,
- "GncPlugin",
+ GNC_PLUGIN_NAME,
&our_info, 0);
}
@@ -195,7 +195,7 @@
if (class->gconf_section && class->gconf_notifications) {
DEBUG ("Requesting notification for section %s", class->gconf_section);
gnc_gconf_add_notification(G_OBJECT(window), class->gconf_section,
- class->gconf_notifications);
+ class->gconf_notifications, GNC_PLUGIN_NAME);
}
/*
@@ -241,7 +241,8 @@
*/
if (class->gconf_section && class->gconf_notifications) {
DEBUG ("Remove notification for section %s", class->gconf_section);
- gnc_gconf_remove_notification (G_OBJECT(window), class->gconf_section);
+ gnc_gconf_remove_notification (G_OBJECT(window), class->gconf_section,
+ GNC_PLUGIN_NAME);
}
/*
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin.h
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -93,6 +93,8 @@
#define GNC_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN))
#define GNC_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_PLUGIN, GncPluginClass))
+#define GNC_PLUGIN_NAME "GncPlugin"
+
/* typedefs & structures */
/** The instance data structure for a menu-only plugin. */
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-query-list.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-query-list.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-query-list.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -138,6 +138,9 @@
/* Initialize the CList */
gnc_query_list_init_clist(list);
+
+ /* Set initial sort order */
+ gnc_query_list_set_query_sort(list, TRUE);
}
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-model-account-types.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-model-account-types.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-model-account-types.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -35,6 +35,8 @@
static QofLogModule log_module = GNC_MOD_GUI;
static GtkTreeModel *account_types_tree_model = NULL;
+#define TYPE_MASK "type-mask"
+
/* Functions for the type system */
static void
gnc_tree_model_account_types_class_init (GncTreeModelAccountTypesClass *klass);
@@ -153,13 +155,15 @@
static gboolean
-gnc_tree_model_account_types_is_valid (GtkTreeModel *model,
+gnc_tree_model_account_types_is_valid (GtkTreeModel *model,
GtkTreeIter *iter, gpointer data)
{
GNCAccountType type;
- guint32 valid_types = GPOINTER_TO_UINT (data);
+ GObject *f_model = G_OBJECT (data);
+ guint32 valid_types = GPOINTER_TO_UINT (g_object_get_data (
+ f_model, TYPE_MASK));
- gtk_tree_model_get (model, iter,
+ gtk_tree_model_get (model, iter,
GNC_TREE_MODEL_ACCOUNT_TYPES_COL_TYPE, &type, -1);
return (valid_types & (1 << type)) ? TRUE : FALSE;
}
@@ -176,16 +180,35 @@
{
GtkTreeModel *f_model;
- f_model = gtk_tree_model_filter_new(gnc_tree_model_account_types_master(),
+ f_model = gtk_tree_model_filter_new (gnc_tree_model_account_types_master (),
NULL);
+ g_object_set_data (G_OBJECT (f_model), TYPE_MASK, GUINT_TO_POINTER (types));
gtk_tree_model_filter_set_visible_func (
GTK_TREE_MODEL_FILTER (f_model), gnc_tree_model_account_types_is_valid,
- GUINT_TO_POINTER (types), NULL);
+ f_model, NULL);
return f_model;
}
+void
+gnc_tree_model_account_types_set_mask (GtkTreeModel *f_model,
+ guint32 types)
+{
+ g_return_if_fail (f_model);
+
+ g_object_set_data (G_OBJECT (f_model), TYPE_MASK, GUINT_TO_POINTER (types));
+ gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (f_model));
+}
+
guint32
+gnc_tree_model_account_types_get_mask (GtkTreeModel *f_model)
+{
+ g_return_val_if_fail (f_model, 0);
+
+ return GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (f_model), TYPE_MASK));
+}
+
+guint32
gnc_tree_model_account_types_get_selected (GncTreeModelAccountTypes * model)
{
GncTreeModelAccountTypesPrivate *priv;
@@ -221,7 +244,12 @@
view = gtk_tree_selection_get_tree_view(sel);
g_return_val_if_fail (view, 0);
+ /* circumvent a bug in gtk+ not always filling f_model */
+ f_model = NULL;
list = gtk_tree_selection_get_selected_rows(sel, &f_model);
+ if (!f_model)
+ f_model = gtk_tree_view_get_model(view);
+
model = gtk_tree_model_filter_get_model(GTK_TREE_MODEL_FILTER(f_model));
if (model != account_types_tree_model)
PERR("TreeSelection's TreeModel is not the account-types Model");
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-model-account-types.h
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-model-account-types.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-model-account-types.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -113,6 +113,13 @@
Caller is responsible for ref/unref. */
GtkTreeModel * gnc_tree_model_account_types_filter_using_mask (guint32 types);
+/* Update the set of the visibible account types in 'f_model' to 'types'. */
+void gnc_tree_model_account_types_set_mask (GtkTreeModel *f_model,
+ guint32 types);
+
+/* Return the current set of the visibible account types. */
+guint32 gnc_tree_model_account_types_get_mask (GtkTreeModel *f_model);
+
/* Return the bitmask of the account type enums reflecting the state
of the tree selection. If your view allows the selection of
multiple account types, use must use this function to get the
Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-view.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-view.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-tree-view.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1191,7 +1191,8 @@
}
DEBUG("removing gconf notification");
- gnc_gconf_remove_notification(G_OBJECT(view), priv->gconf_section);
+ gnc_gconf_remove_notification(G_OBJECT(view), priv->gconf_section,
+ GNC_TREE_VIEW_NAME);
g_free(priv->gconf_section);
priv->gconf_section = NULL;
LEAVE(" ");
@@ -1228,7 +1229,8 @@
priv = GNC_TREE_VIEW_GET_PRIVATE(view);
priv->gconf_section = g_strdup(section);
gnc_gconf_add_notification(G_OBJECT(view), section,
- gnc_tree_view_gconf_changed);
+ gnc_tree_view_gconf_changed,
+ GNC_TREE_VIEW_NAME);
/* Catch changes to the sort column. Propagate to gconf. The key can
* be set before the model, so the code must handle that case. */
Modified: gnucash/branches/swig-redo/src/gnome-utils/schemas/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/schemas/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/schemas/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -12,10 +12,10 @@
install-data-local:
if GCONF_SCHEMAS_INSTALL
-mkdir -p $(DESTDIR)$(GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY)
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA)
+ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schema_DATA)
endif
uninstall-local:
if GCONF_SCHEMAS_INSTALL
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(srcdir)/$(schema_DATA)
+ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(schema_DATA)
endif
Modified: gnucash/branches/swig-redo/src/gnome-utils/search-param.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/search-param.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/search-param.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,6 +1,6 @@
/*
* search-param.c -- a container for a Search Parameter
- * Copyright (C) 2002 Derek Atkins <warlord at MIT.EDU
+ * Copyright (C) 2002 Derek Atkins <warlord at MIT.EDU>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Modified: gnucash/branches/swig-redo/src/gnome-utils/search-param.h
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/search-param.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/search-param.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,6 +1,6 @@
/*
* search-param.h -- a container for a Search Parameter
- * Copyright (C) 2002 Derek Atkins <warlord at MIT.EDU
+ * Copyright (C) 2002 Derek Atkins <warlord at MIT.EDU>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Modified: gnucash/branches/swig-redo/src/gnome-utils/test/test-gnc-recurrence.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/test/test-gnc-recurrence.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/gnome-utils/test/test-gnc-recurrence.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -8,6 +8,7 @@
*
*/
+#include "config.h"
#include <glib.h>
#include <gtk/gtk.h>
#include <stdio.h>
Modified: gnucash/branches/swig-redo/src/import-export/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/import-export/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,7 +1,7 @@
SUBDIRS = . schemas qif qif-import \
- ${OFX_DIR} ${HBCI_DIR} ${MT940_DIR} log-replay test
+ ${OFX_DIR} ${HBCI_DIR} log-replay test
DIST_SUBDIRS = schemas qif qif-import qif-io-core \
- ofx hbci mt940 log-replay test
+ ofx hbci log-replay test
pkglib_LTLIBRARIES=libgncmod-generic-import.la
@@ -48,6 +48,7 @@
${GNOME_LIBS} \
${GLADE_LIBS} \
${QOF_LIBS} \
+ ${REGEX_LIBS} \
${GLIB_LIBS}
gladedir = ${GNC_GLADE_DIR}
@@ -74,27 +75,3 @@
EXTRA_DIST = \
$(glade_DATA) \
generic-import-design.txt
-
-if GNUCASH_SEPARATE_BUILDDIR
-#For compiling
-SCM_FILE_LINKS =
-#For executing test cases
-SCM_FILE_LINKS +=
-endif
-
-noinst_DATA = .scm-links
-
-.scm-links:
- rm -f gnucash generic-import import-export
- $(LN_S) -f . import-export
- $(LN_S) -f . gnucash
- $(LN_S) -f . generic-import
-if GNUCASH_SEPARATE_BUILDDIR
- for X in ${SCM_FILE_LINKS} ; do \
- $(LN_S) -f ${srcdir}/$$X . ; \
- done
-endif
- touch .scm-links
-
-CLEANFILES = gnucash generic-import .scm-links import-export
-DISTCLEANFILES = ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/import-export/hbci/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -6,6 +6,7 @@
dialog-daterange.c \
dialog-hbcitrans.c \
dialog-pass.c \
+ gnc-file-aqb-import.c \
gnc-hbci-getbalance.c \
gnc-hbci-gettrans.c \
gnc-hbci-kvp.c \
@@ -30,6 +31,7 @@
dialog-pass.h \
druid-hbci-initial.h \
druid-hbci-utils.h \
+ gnc-file-aqb-import.h \
gnc-hbci-getbalance.h \
gnc-hbci-gettrans.h \
gnc-hbci-kvp.h \
Modified: gnucash/branches/swig-redo/src/import-export/hbci/dialog-hbcitrans.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/dialog-hbcitrans.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/dialog-hbcitrans.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -45,6 +45,7 @@
#include "gtk-compat.h"
#include "dialog-utils.h"
+#include "gnc-glib-utils.h"
#include "gnc-ui.h"
#include "gnc-amount-edit.h"
#include "dialog-transfer.h"
@@ -246,7 +247,7 @@
GList *templates)
{
GladeXML *xml;
- const char *hbci_bankid, *hbci_bankname;
+ const char *hbci_bankid;
HBCITransDialog *td;
GtkTreeSelection *selection;
GtkTreeViewColumn *column;
@@ -258,7 +259,6 @@
td->trans_type = trans_type;
g_assert (h_acc);
hbci_bankid = AB_Account_GetBankCode(h_acc);
- hbci_bankname = AB_Account_GetBankName(h_acc);
#if HAVE_KTOBLZCHECK_H
td->blzcheck = AccountNumberCheck_new();
#endif
@@ -272,6 +272,7 @@
GTK_WINDOW (parent));
{
+ gchar *hbci_bankname, *hbci_ownername;
GtkWidget *heading_label;
GtkWidget *recp_name_heading;
GtkWidget *recp_account_heading;
@@ -394,9 +395,16 @@
/* Make this button insensitive since it's still unimplemented. */
gtk_widget_destroy (exec_later_button);
+ /* aqbanking up to 2.3.0 did not guarantee the following strings
+ to be correct utf8; mentioned in bug#351371. */
+ hbci_bankname =
+ gnc_utf8_strip_invalid_strdup (AB_Account_GetBankName(h_acc));
+ hbci_ownername =
+ gnc_utf8_strip_invalid_strdup (AB_Account_GetOwnerName(h_acc));
+
/* Fill in the values from the objects */
gtk_label_set_text (GTK_LABEL (orig_name_label),
- AB_Account_GetOwnerName (h_acc));
+ hbci_ownername);
gtk_label_set_text (GTK_LABEL (orig_account_label),
AB_Account_GetAccountNumber (h_acc));
gtk_label_set_text (GTK_LABEL (orig_bankname_label),
@@ -405,6 +413,8 @@
_("(unknown)")));
gtk_label_set_text (GTK_LABEL (orig_bankcode_label),
hbci_bankid);
+ g_free (hbci_ownername);
+ g_free (hbci_bankname);
/* fill list for choosing a transaction template */
gtk_tree_view_set_headers_visible(td->template_gtktreeview, FALSE);
@@ -720,7 +730,7 @@
}
AB_JOB *
-gnc_hbci_trans_dialog_enqueue(HBCITransDialog *td, AB_BANKING *api,
+gnc_hbci_trans_dialog_enqueue(const AB_TRANSACTION *hbci_trans, AB_BANKING *api,
AB_ACCOUNT *h_acc,
GNC_HBCI_Transtype trans_type)
{
@@ -752,7 +762,7 @@
switch (trans_type) {
case SINGLE_DEBITNOTE:
- AB_JobSingleDebitNote_SetTransaction(job, td->hbci_trans);
+ AB_JobSingleDebitNote_SetTransaction(job, hbci_trans);
break;
case SINGLE_INTERNAL_TRANSFER:
#if ((AQBANKING_VERSION_MAJOR > 1) || \
@@ -761,12 +771,12 @@
((AQBANKING_VERSION_MINOR == 6) && \
((AQBANKING_VERSION_PATCHLEVEL > 0) || \
(AQBANKING_VERSION_BUILD > 2))))))
- AB_JobInternalTransfer_SetTransaction(job, td->hbci_trans);
+ AB_JobInternalTransfer_SetTransaction(job, hbci_trans);
break;
#endif
default:
case SINGLE_TRANSFER:
- AB_JobSingleTransfer_SetTransaction(job, td->hbci_trans);
+ AB_JobSingleTransfer_SetTransaction(job, hbci_trans);
};
/* Add job to queue */
@@ -867,13 +877,26 @@
if (record) {
const char *bankname = AccountNumberCheck_Record_bankName (record);
GError *error = NULL;
+ const char *ktoblzcheck_encoding =
+#ifdef KTOBLZCHECK_VERSION_MAJOR
+ /* This version number macro has been added in
+ ktoblzcheck-1.10, but this function exists already since
+ ktoblzcheck-1.7, so we're on the safe side. */
+ AccountNumberCheck_stringEncoding()
+#else
+ /* Every ktoblzcheck release before 1.10 is guaranteed to
+ return strings only in ISO-8859-15. */
+ "ISO-8859-15"
+#endif
+ ;
gchar *utf8_bankname = g_convert (bankname, strlen(bankname),
- "UTF-8", "ISO-8859-15",
+ "UTF-8", ktoblzcheck_encoding,
NULL, NULL, &error);
if (error != NULL) {
- printf ("Error convertion bankname \"%s\" to UTF-8\n", bankname);
+ printf ("Error converting bankname \"%s\" to UTF-8\n", bankname);
g_error_free (error);
- utf8_bankname = g_strdup (bankname);
+ /* Conversion was erroneous, so don't use the string */
+ utf8_bankname = g_strdup (_("(unknown)"));
}
gtk_label_set_text (GTK_LABEL (td->recp_bankname_label),
(strlen(utf8_bankname)>0 ?
Modified: gnucash/branches/swig-redo/src/import-export/hbci/dialog-hbcitrans.h
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/dialog-hbcitrans.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/dialog-hbcitrans.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -86,7 +86,7 @@
int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td,
const AB_ACCOUNT *h_acc);
AB_JOB *
-gnc_hbci_trans_dialog_enqueue(HBCITransDialog *td, AB_BANKING *api,
+gnc_hbci_trans_dialog_enqueue(const AB_TRANSACTION *hbci_trans, AB_BANKING *api,
AB_ACCOUNT *h_acc,
GNC_HBCI_Transtype trans_type);
/** Callback function for gnc_xfer_dialog_set_txn_cb(). The user_data
Modified: gnucash/branches/swig-redo/src/import-export/hbci/druid-hbci-initial.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/druid-hbci-initial.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/druid-hbci-initial.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -37,6 +37,7 @@
#include "import-account-matcher.h"
#include "gnc-hbci-utils.h"
+#include "gnc-glib-utils.h"
#include "dialog-utils.h"
#include "druid-utils.h"
#include "gnc-ui-util.h"
@@ -117,21 +118,25 @@
static gchar *gnc_hbci_account_longname(const AB_ACCOUNT *hacc)
{
- const char *bankname;
+ gchar *bankname;
+ gchar *result;
const char *bankcode;
g_assert(hacc);
- bankname = AB_Account_GetBankName (hacc);
+ bankname =
+ gnc_utf8_strip_invalid_strdup (AB_Account_GetBankName (hacc));
bankcode = AB_Account_GetBankCode (hacc);
/* Translators: Strings are 1. Account code, 2. Bank name, 3. Bank code. */
- if (bankname)
- return g_strdup_printf(_("%s at %s (code %s)"),
+ if (strlen(bankname) > 0)
+ result = g_strdup_printf(_("%s at %s (code %s)"),
AB_Account_GetAccountNumber (hacc),
bankname,
bankcode);
else
- return g_strdup_printf(_("%s at bank code %s"),
+ result = g_strdup_printf(_("%s at bank code %s"),
AB_Account_GetAccountNumber (hacc),
bankcode);
+ g_free (bankname);
+ return result;
}
Copied: gnucash/branches/swig-redo/src/import-export/hbci/gnc-file-aqb-import.c (from rev 15000, gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.c)
Copied: gnucash/branches/swig-redo/src/import-export/hbci/gnc-file-aqb-import.h (from rev 15000, gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.h)
Modified: gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-kvp.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-kvp.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-kvp.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -20,6 +20,7 @@
* Boston, MA 02110-1301, USA gnu at gnu.org *
\********************************************************************/
+#include "config.h"
#include "gnc-hbci-kvp.h"
#include <stdio.h>
Modified: gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-transfer.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-transfer.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-transfer.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -101,6 +101,13 @@
/* Let the user enter the values. If cancel is pressed, -1 is returned. */
result = gnc_hbci_dialog_run_until_ok(td, h_acc);
+ if ((result != GNC_RESPONSE_NOW) && (result != GNC_RESPONSE_LATER)) {
+ /* If cancel has been pressed, the dialog doesn't exist
+ anymore and we cannot query for the template
+ list. Therefore break immediately. */
+ break;
+ }
+
/* Set the template list in case it got modified. */
if (template_list)
g_list_free(template_list);
@@ -111,16 +118,12 @@
maketrans_save_templates(parent, gnc_acc, template_list,
(result == GNC_RESPONSE_NOW));
- if ((result != GNC_RESPONSE_NOW) && (result != GNC_RESPONSE_LATER)) {
- break;
- }
-
/* Make really sure the dialog is hidden now. */
gnc_hbci_dialog_hide(td);
{
AB_JOB *job =
- gnc_hbci_trans_dialog_enqueue(td, api,
+ gnc_hbci_trans_dialog_enqueue(gnc_hbci_dialog_get_htrans(td), api,
(AB_ACCOUNT *)h_acc, trans_type);
/* Check whether we really got a job */
Modified: gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-utils.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-utils.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-utils.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -321,7 +321,7 @@
return FALSE;
#endif
case AB_ERROR_NETWORK:
- GNCInteractor_hide (inter);
+ if (inter) GNCInteractor_hide (inter);
gnc_error_dialog
(parent,
_("The server of your bank refused the HBCI connection. "
@@ -403,8 +403,9 @@
AB_JOB *job, GNCInteractor *inter)
{
int err;
- int resultcode;
+ int resultcode = 3000; /* This code means: Warnings, but not errors */
int be_verbose = FALSE;
+ g_assert (api);
if (inter)
GNCInteractor_show (inter);
@@ -434,7 +435,8 @@
} while (gnc_hbci_Error_retry (parent, err, inter));
- resultcode = gnc_hbci_debug_outboxjob (job, be_verbose);
+ if (job)
+ resultcode = gnc_hbci_debug_outboxjob (job, be_verbose);
if (!hbci_Error_isOk(err)) {
/* char *errstr = */
/* g_strdup_printf("gnc_AB_BANKING_execute: Error at executeQueue: %s", */
@@ -443,8 +445,8 @@
/* HBCI_Interactor_msgStateResponse (HBCI_Hbci_interactor */
/* (AB_BANKING_Hbci (api)), errstr); */
/* g_free (errstr); */
- gnc_hbci_debug_outboxjob (job, TRUE);
- GNCInteractor_show_nodelete (inter);
+ if (job) gnc_hbci_debug_outboxjob (job, TRUE);
+ if (inter) GNCInteractor_show_nodelete (inter);
return FALSE;
}
Modified: gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-utils.h
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-utils.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/gnc-hbci-utils.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -90,7 +90,9 @@
/* Calls AB_BANKING_executeQueue with some supplementary stuff around
* it: set the debugLevel, show the GNCInteractor, and do some error
* checking. Returns TRUE upon success or FALSE if the calling dialog
- * should abort. */
+ * should abort. parent may be NULL, job may be NULL (although in this
+ * case no HBCI result codes can be checked!), inter may be NULL; api
+ * must not be NULL. */
gboolean
gnc_AB_BANKING_execute (GtkWidget *parent, AB_BANKING *api,
AB_JOB *job, GNCInteractor *inter);
Modified: gnucash/branches/swig-redo/src/import-export/hbci/gnc-plugin-hbci-ui.xml
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/gnc-plugin-hbci-ui.xml 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/gnc-plugin-hbci-ui.xml 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,5 +1,17 @@
<ui>
<menubar>
+ <menu name="File" action="FileAction">
+ <menu name="FileImport" action="FileImportAction">
+ <placeholder name="FileImportPlaceholder">
+ <menuitem name="FileMt940Import" action="Mt940ImportAction"/>
+ <menuitem name="FileMt942Import" action="Mt942ImportAction"/>
+ <menuitem name="FileDtausImport" action="DtausImportAction"/>
+ <menuitem name="FileCsvImport" action="CsvImportAction"/>
+ <menuitem name="FileDtausImportsend" action="DtausImportSendAction"/>
+ <menuitem name="FileCsvImportsend" action="CsvImportSendAction"/>
+ </placeholder>
+ </menu>
+ </menu>
<menu name="Actions" action="ActionsAction">
<placeholder name="ActionsPlaceholder">
<menu name="OnlineActions" action="OnlineActionsAction">
Modified: gnucash/branches/swig-redo/src/import-export/hbci/gnc-plugin-hbci.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/gnc-plugin-hbci.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/gnc-plugin-hbci.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -33,6 +33,7 @@
#include "gnc-hbci-getbalance.h"
#include "gnc-hbci-gettrans.h"
#include "gnc-hbci-transfer.h"
+#include "gnc-file-aqb-import.h"
#include "gnc-plugin-hbci.h"
#include "gnc-plugin-manager.h"
#include "gnc-plugin-page-account-tree.h"
@@ -75,6 +76,12 @@
static void gnc_plugin_hbci_cmd_issue_inttransaction (GtkAction *action, GncMainWindowActionData *data);
#endif
static void gnc_plugin_hbci_cmd_issue_direct_debit (GtkAction *action, GncMainWindowActionData *data);
+static void gnc_plugin_hbci_cmd_mt940_import (GtkAction *action, GncMainWindowActionData *data);
+static void gnc_plugin_hbci_cmd_mt942_import (GtkAction *action, GncMainWindowActionData *data);
+static void gnc_plugin_hbci_cmd_dtaus_import (GtkAction *action, GncMainWindowActionData *data);
+static void gnc_plugin_hbci_cmd_csv_import (GtkAction *action, GncMainWindowActionData *data);
+static void gnc_plugin_hbci_cmd_dtaus_importsend (GtkAction *action, GncMainWindowActionData *data);
+static void gnc_plugin_hbci_cmd_csv_importsend (GtkAction *action, GncMainWindowActionData *data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-hbci-actions"
@@ -110,6 +117,27 @@
{ "HbciIssueDirectDebitAction", NULL, N_("_Direct Debit..."), NULL,
N_("Issue a new direct debit note online through HBCI/AqBanking"),
G_CALLBACK (gnc_plugin_hbci_cmd_issue_direct_debit) },
+
+ /* File -> Import menu item */
+ { "Mt940ImportAction", GTK_STOCK_CONVERT, N_("Import _MT940"), NULL,
+ N_("Import a MT940 file into GnuCash"),
+ G_CALLBACK (gnc_plugin_hbci_cmd_mt940_import) },
+ { "Mt942ImportAction", GTK_STOCK_CONVERT, N_("Import MT94_2"), NULL,
+ N_("Import a MT942 file into GnuCash"),
+ G_CALLBACK (gnc_plugin_hbci_cmd_mt942_import) },
+ { "DtausImportAction", GTK_STOCK_CONVERT, N_("Import _DTAUS"), NULL,
+ N_("Import a DTAUS file into GnuCash"),
+ G_CALLBACK (gnc_plugin_hbci_cmd_dtaus_import) },
+ { "CsvImportAction", GTK_STOCK_CONVERT, N_("Import _CSV"), NULL,
+ N_("Import a CSV file into GnuCash"),
+ G_CALLBACK (gnc_plugin_hbci_cmd_csv_import) },
+ { "DtausImportSendAction", GTK_STOCK_CONVERT, N_("Import DTAUS and _send..."), NULL,
+ N_("Import a DTAUS file into GnuCash and send the transfers online through HBCI/AqBanking"),
+ G_CALLBACK (gnc_plugin_hbci_cmd_dtaus_importsend) },
+ { "CsvImportSendAction", GTK_STOCK_CONVERT, N_("Import CSV and s_end..."), NULL,
+ N_("Import a CSV file into GnuCash and send the transfers online through HBCI/AqBanking"),
+ G_CALLBACK (gnc_plugin_hbci_cmd_csv_importsend) },
+
};
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
@@ -511,6 +539,43 @@
LEAVE(" ");
}
+static void
+gnc_plugin_hbci_cmd_dtaus_importsend (GtkAction *action,
+ GncMainWindowActionData *data)
+{
+ gnc_file_aqbanking_import ("dtaus", "default", TRUE);
+}
+static void
+gnc_plugin_hbci_cmd_csv_importsend (GtkAction *action,
+ GncMainWindowActionData *data)
+{
+ gnc_file_aqbanking_import ("csv", "default", TRUE);
+}
+
+static void
+gnc_plugin_hbci_cmd_mt940_import (GtkAction *action,
+ GncMainWindowActionData *data)
+{
+ gnc_file_aqbanking_import ("swift", "swift-mt940", FALSE);
+}
+static void
+gnc_plugin_hbci_cmd_mt942_import (GtkAction *action,
+ GncMainWindowActionData *data)
+{
+ gnc_file_aqbanking_import ("swift", "swift-mt942", FALSE);
+}
+static void
+gnc_plugin_hbci_cmd_dtaus_import (GtkAction *action,
+ GncMainWindowActionData *data)
+{
+ gnc_file_aqbanking_import ("dtaus", "default", FALSE);
+}
+static void
+gnc_plugin_hbci_cmd_csv_import (GtkAction *action,
+ GncMainWindowActionData *data)
+{
+ gnc_file_aqbanking_import ("csv", "default", FALSE);
+}
/************************************************************
* Plugin Bootstrapping *
************************************************************/
Modified: gnucash/branches/swig-redo/src/import-export/hbci/hbci-interaction.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/hbci-interaction.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/hbci-interaction.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -102,12 +102,18 @@
*/
-GtkWidget *GNCInteractor_parent(GNCInteractor *i)
+GtkWidget *GNCInteractor_parent(const GNCInteractor *i)
{
g_assert(i);
return i->parent;
}
+GtkWidget *GNCInteractor_dialog(const GNCInteractor *i)
+{
+ g_assert(i);
+ return i->dialog;
+}
+
static void GNCInteractor_setRunning (GNCInteractor *data)
{
g_assert(data);
Modified: gnucash/branches/swig-redo/src/import-export/hbci/hbci-interaction.h
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/hbci-interaction.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/hbci-interaction.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -44,7 +44,8 @@
void GNCInteractor_reparent (GNCInteractor *i, GtkWidget *new_parent);
gboolean GNCInteractor_get_cache_valid(const GNCInteractor *i);
void GNCInteractor_set_cache_valid(GNCInteractor *i, gboolean value);
-GtkWidget *GNCInteractor_parent(GNCInteractor *i);
+GtkWidget *GNCInteractor_parent(const GNCInteractor *i);
+GtkWidget *GNCInteractor_dialog(const GNCInteractor *i);
void GNCInteractor_add_log_text (GNCInteractor *i, const char *msg);
/** Returns true if aqbanking requested to show a msgBox of type
error. (Note: This happens very seldomly.) */
Modified: gnucash/branches/swig-redo/src/import-export/hbci/schemas/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/import-export/hbci/schemas/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/hbci/schemas/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -12,10 +12,10 @@
install-data-local:
if GCONF_SCHEMAS_INSTALL
-mkdir -p $(DESTDIR)$(GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY)
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA)
+ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schema_DATA)
endif
uninstall-local:
if GCONF_SCHEMAS_INSTALL
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(srcdir)/$(schema_DATA)
+ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(schema_DATA)
endif
Modified: gnucash/branches/swig-redo/src/import-export/import-account-matcher.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/import-account-matcher.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/import-account-matcher.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -98,17 +98,18 @@
Account *selected_account, *new_account;
GList * valid_types = NULL;
/*DEBUG("Begin"); */
-
+
if(picker->new_account_default_type!=ACCT_TYPE_NONE)
{
/*Yes, this is weird, but we really DO want to pass the value instead of the pointer...*/
- valid_types = g_list_prepend(valid_types, (gpointer)picker->new_account_default_type);
+ valid_types = g_list_prepend(valid_types, GINT_TO_POINTER(picker->new_account_default_type));
}
selected_account = gnc_tree_view_account_get_selected_account(picker->account_tree);
new_account = gnc_ui_new_accounts_from_name_with_defaults ( picker->account_human_description,
valid_types,
picker->new_account_default_commodity,
selected_account);
+ g_list_free(valid_types);
gnc_tree_view_account_set_selected_account(picker->account_tree, new_account);
}
Modified: gnucash/branches/swig-redo/src/import-export/import-match-map.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/import-match-map.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/import-match-map.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -27,6 +27,7 @@
"strings" to Gnucash accounts in a generic manner.
@author Copyright (C) 2002,2003 Derek Atkins <derek at ihtfp.com>
*/
+#include "config.h"
#include <string.h>
#include <glib.h>
#include "import-match-map.h"
Deleted: gnucash/branches/swig-redo/src/import-export/mt940/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/import-export/mt940/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/mt940/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,54 +0,0 @@
-SUBDIRS = .
-# test
-
-pkglib_LTLIBRARIES=libgncmod-mt940.la
-
-libgncmod_mt940_la_SOURCES = \
- gnc-mt940-import.c \
- gncmod-mt940-import.c \
- gnc-plugin-mt940.c
-
-noinst_HEADERS = \
- gnc-mt940-import.h \
- gnc-plugin-mt940.h
-
-libgncmod_mt940_la_LIBADD = \
- ${top_builddir}/src/import-export/hbci/libgncmod-hbci.la \
- ${top_builddir}/src/import-export/libgncmod-generic-import.la \
- ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
- ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
- ${top_builddir}/src/core-utils/libcore-utils.la \
- ${top_builddir}/src/gnc-module/libgncmodule.la \
- ${GNOME_LIBS} \
- ${GLADE_LIBS} \
- ${QOF_LIBS} \
- ${GLIB_LIBS} \
- ${HBCI_LIBS}
-
-AM_CFLAGS = \
- -I${top_srcdir}/src \
- -I${top_srcdir}/src/core-utils \
- -I${top_srcdir}/src/engine \
- -I${top_srcdir}/src/gnc-module \
- -I${top_srcdir}/src/app-utils \
- -I${top_srcdir}/src/gnome \
- -I${top_srcdir}/src/gnome-utils \
- -I${top_srcdir}/src/import-export \
- -I$(top_srcdir)/src/import-export/hbci \
- -I${top_srcdir}/src/register \
- -I${top_srcdir}/src/register/register-core \
- -I${top_srcdir}/src/register/register-gnome \
- -I${top_srcdir}/src/register/ledger-core \
- ${GUILE_INCS} \
- ${GNOME_CFLAGS} \
- ${GTKHTML_CFLAGS} \
- ${GLADE_CFLAGS} \
- ${QOF_CFLAGS} \
- ${GLIB_CFLAGS} \
- ${HBCI_CFLAGS}
-
-uidir = $(GNC_UI_DIR)
-ui_DATA = \
- gnc-plugin-mt940-ui.xml
-
-EXTRA_DIST = $(ui_DATA)
Deleted: gnucash/branches/swig-redo/src/import-export/mt940/gnc-mt940-import.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/mt940/gnc-mt940-import.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/mt940/gnc-mt940-import.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,302 +0,0 @@
-/********************************************************************\
- * 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 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-/** @addtogroup Import_Export
- @{ */
-/** @internal
- @file gnc-mt940-import.c
- @brief MT940 import module code
- @author Copyright (c) 2002 Benoit Grégoire <bock at step.polymtl.ca>, Copyright (c) 2003 Jan-Pascal van Best <janpascal at vanbest.org>, Copyright (c) 2006 Florian Steinel, 2006 Christian Stimming.
- */
-#include "config.h"
-
-#include <glib.h>
-#include <glib/gi18n.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/time.h>
-#include <fcntl.h>
-
-#include <aqbanking/version.h>
-#include <aqbanking/banking.h>
-#include <aqbanking/imexporter.h>
-
-#include "gnc-ui.h"
-#include "qof.h"
-#include "Transaction.h"
-#include "Account.h"
-
-#include "gnc-engine.h"
-#include "gnc-file.h"
-#include "gnc-ui-util.h"
-#include "gnc-gconf-utils.h"
-
-#include "gnc-hbci-gettrans.h"
-
-#include "import-main-matcher.h"
-#include "import-account-matcher.h"
-#include "gnc-hbci-gettrans.h"
-
-#include "gnc-mt940-import.h"
-
-#define GCONF_SECTION "dialogs/import/mt940"
-
-static QofLogModule log_module = GNC_MOD_IMPORT;
-
-/* Callback declarations */
-static const AB_TRANSACTION *
-translist_cb (const AB_TRANSACTION *element, void *user_data);
-static AB_IMEXPORTER_ACCOUNTINFO *
-accountinfolist_cb(AB_IMEXPORTER_ACCOUNTINFO *element, void *user_data);
-
-
-/* If aqbanking is older than 1.9.7, use our own copies of these
- foreach functions */
-#if ((AQBANKING_VERSION_MAJOR == 1) && \
- ((AQBANKING_VERSION_MINOR < 9) || \
- ((AQBANKING_VERSION_MINOR == 9) && \
- ((AQBANKING_VERSION_PATCHLEVEL < 7)))))
-static AB_IMEXPORTER_ACCOUNTINFO *
-AB_ImExporterContext_AccountInfoForEach(AB_IMEXPORTER_CONTEXT *iec,
- AB_IMEXPORTER_ACCOUNTINFO *
- (* func)(AB_IMEXPORTER_ACCOUNTINFO *element,
- void *user_data),
- void* user_data)
-{
- AB_IMEXPORTER_ACCOUNTINFO *it;
- AB_IMEXPORTER_ACCOUNTINFO *retval;
- g_assert(iec);
-
- it = AB_ImExporterContext_GetFirstAccountInfo (iec);
- while (it) {
- retval = func(it, user_data);
- if (retval) {
- return retval;
- }
- it = AB_ImExporterContext_GetNextAccountInfo (iec);
- }
- return 0;
-
-}
-static const AB_TRANSACTION *
-AB_ImExporterAccountInfo_TransactionsForEach(AB_IMEXPORTER_ACCOUNTINFO *iea,
- const AB_TRANSACTION *
- (* func)(const AB_TRANSACTION *element,
- void *user_data),
- void* user_data)
-{
- const AB_TRANSACTION *it;
- const AB_TRANSACTION *retval;
- g_assert(iea);
-
- it = AB_ImExporterAccountInfo_GetFirstTransaction (iea);
- while (it) {
- retval = func(it, user_data);
- if (retval) {
- return retval;
- }
- it = AB_ImExporterAccountInfo_GetNextTransaction (iea);
- }
- return 0;
-}
-#endif /* aqbanking < 1.9.7 */
-
-
-/* Note: The importing here is not yet tested with actual files, see
- http://bugzilla.gnome.org/show_bug.cgi?id=325170 . */
-
-/* See aqbanking-1.6.0beta/src/tools/aqbanking-tool/import.c for hints
- on how to program aqbanking. */
-
-/********************************************************************\
- * gnc_file_mt940_import
- * Entry point
-\********************************************************************/
-
-void gnc_file_mt940_import (void)
-{
- char *selected_filename;
- char *default_dir;
- int mt940_fd;
-
- /* qof_log_check(MOD_IMPORT, QOF_LOG_TRACE); */
- DEBUG("gnc_file_mt940_import(): Begin...\n");
-
- default_dir = gnc_gconf_get_string(GCONF_SECTION, KEY_LAST_PATH, NULL);
- if (default_dir == NULL)
- gnc_init_default_directory(&default_dir);
- selected_filename = gnc_file_dialog(_("Select an MT940 file to process"),
- NULL,
- default_dir,
- GNC_FILE_DIALOG_IMPORT);
- g_free(default_dir);
-
- if(selected_filename!=NULL) {
- /* Remember the directory as the default. */
- default_dir = g_path_get_dirname(selected_filename);
- gnc_gconf_set_string(GCONF_SECTION, KEY_LAST_PATH, default_dir, NULL);
- g_free(default_dir);
-
- /*strncpy(file,selected_filename, 255);*/
- DEBUG("Filename found: %s",selected_filename);
-
- DEBUG("Opening selected file");
- mt940_fd = open(selected_filename, O_RDONLY);
- if (mt940_fd == -1) {
- DEBUG("Could not open file %s", selected_filename);
- return;
- }
-
- {
- int result;
- AB_BANKING *ab;
- AB_IMEXPORTER *importer;
- AB_IMEXPORTER_CONTEXT *ctx=0;
- GWEN_BUFFEREDIO *buffio;
- GWEN_DB_NODE *dbProfiles;
- GWEN_DB_NODE *dbProfile;
- const char *importerName = "swift"; /* possible values: csv, swift, dtaus, */
- const char *profileName = "swift-mt940";
- /* Possible values for profile: "swiftmt942", but for other
- importers: "default" */
-
- ab = AB_Banking_new("gnucash", 0);
- AB_Banking_Init(ab);
-
- /* get import module */
- importer=AB_Banking_GetImExporter(ab, importerName);
- if (!importer) {
- DEBUG("Import module %s not found", importerName);
- gnc_error_dialog(NULL, "%s",("Import module for MT940 import not found."));
- return;
- }
- g_assert(importer);
-
- /* load the import profile */
- dbProfiles=AB_Banking_GetImExporterProfiles(ab, importerName);
-
- /* select profile */
- dbProfile=GWEN_DB_GetFirstGroup(dbProfiles);
- while(dbProfile) {
- const char *name;
-
- name=GWEN_DB_GetCharValue(dbProfile, "name", 0, 0);
- g_assert(name);
- if (strcasecmp(name, profileName)==0)
- break;
- dbProfile=GWEN_DB_GetNextGroup(dbProfile);
- }
- if (!dbProfile) {
- DEBUG("Profile \"%s\" for importer \"%s\" not found",
- profileName, importerName);
- printf("Profile \"%s\" for importer \"%s\" not found\n",
- profileName, importerName);
- return;
- }
- g_assert(dbProfile);
-
- /* import new context */
- ctx=AB_ImExporterContext_new();
- g_assert(ctx);
-
- /* Wrap file in gwen_bufferedio */
- buffio = GWEN_BufferedIO_File_new(mt940_fd);
- g_assert(buffio);
- GWEN_BufferedIO_SetReadBuffer(buffio, 0, 1024);
-
- result = AB_ImExporter_Import(importer,
- ctx,
- buffio,
- dbProfile);
-
- DEBUG("Parsing result: %d\n", result);
-
- GWEN_BufferedIO_Close(buffio);
- GWEN_BufferedIO_free(buffio);
- GWEN_DB_Group_free(dbProfiles);
-
- {
- /* Now get all accountinfos */
- struct trans_list_data data;
- GNCImportMainMatcher *importer_generic_gui;
- GtkWidget *parent = NULL;
-
- /* Create importer GUI */
- importer_generic_gui = gnc_gen_trans_list_new(parent, NULL, TRUE, 14);
- data.importer_generic = importer_generic_gui;
-
- /* Iterate through all accounts */
- AB_ImExporterContext_AccountInfoForEach(ctx, accountinfolist_cb, &data);
- /* all accounts finished. */
-
- AB_ImExporterContext_free(ctx);
-
- /* that's it */
- result=AB_Banking_Fini(ab);
- if (result)
- DEBUG("ERROR: Error on deinit (%d)\n",result);
-
- g_free(selected_filename);
- AB_Banking_free(ab);
-
-
- /* and run the gnucash importer. */
- gnc_gen_trans_list_run (importer_generic_gui);
- }
- }
- }
-}
-
-static AB_IMEXPORTER_ACCOUNTINFO *
-accountinfolist_cb(AB_IMEXPORTER_ACCOUNTINFO *accinfo, void *user_data) {
- Account *gnc_acc;
- struct trans_list_data *data = user_data;
- const char *bank_code =
- AB_ImExporterAccountInfo_GetBankCode(accinfo);
- const char *account_number =
- AB_ImExporterAccountInfo_GetAccountNumber(accinfo);
- const char *account_name =
- AB_ImExporterAccountInfo_GetAccountName(accinfo);
- gchar *online_id = g_strconcat (bank_code, account_number, NULL);
-
- gnc_acc = gnc_import_select_account(NULL,
- online_id, 1, account_name, NULL,
- ACCT_TYPE_NONE, NULL, NULL);
- g_free(online_id);
- if (gnc_acc) {
- /* Store chosen gnucash account in callback data */
- data->gnc_acc = gnc_acc;
-
- /* Iterate through all transactions. */
- AB_ImExporterAccountInfo_TransactionsForEach (accinfo, translist_cb, data);
- /* all transactions finished. */
- }
- return NULL;
-}
-
-static const AB_TRANSACTION *
-translist_cb (const AB_TRANSACTION *element, void *user_data) {
- /* This callback in the hbci module will add the imported
- transaction to gnucash's importer. */
- /* The call will use "element" only as const* */
- gnc_hbci_trans_list_cb( (AB_TRANSACTION*) element, user_data);
- return NULL;
-}
-
-
-/** @} */
Deleted: gnucash/branches/swig-redo/src/import-export/mt940/gnc-mt940-import.h
===================================================================
--- gnucash/branches/swig-redo/src/import-export/mt940/gnc-mt940-import.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/mt940/gnc-mt940-import.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,34 +0,0 @@
-/********************************************************************\
- * 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 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
- /** @file
- @brief mt940 import module interface
- *
- gnc-mt940-import.h
- @author Copyright (c) 2002 Benoit Grégoire <bock at step.polymtl.ca>
- */
-#ifndef MT940_IMPORT_H
-#define MT940_IMPORT_H
-
-/** The gnc_file_mt940_import() routine will pop up a standard file
- * selection dialogue asking the user to pick an MT940 file. If one
- * is selected then the MT940 file is opened and read. Its contents
- * are merged into the existing session (if any). The current
- * session continues to remain open for editing. */
-void gnc_file_mt940_import (void);
-#endif
Deleted: gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940-ui.xml
===================================================================
--- gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940-ui.xml 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940-ui.xml 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,11 +0,0 @@
-<ui>
- <menubar>
- <menu name="File" action="FileAction">
- <menu name="FileImport" action="FileImportAction">
- <placeholder name="FileImportPlaceholder">
- <menuitem name="FileMt940Import" action="Mt940ImportAction"/>
- </placeholder>
- </menu>
- </menu>
- </menubar>
-</ui>
Deleted: gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,162 +0,0 @@
-/*
- * gnc-plugin-mt940.c --
- * Copyright (C) 2003 David Hampton <hampton at employees.org>
- *
- * 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
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
- * Boston, MA 02110-1301, USA gnu at gnu.org
- */
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include "gnc-engine.h"
-#include "gnc-plugin-manager.h"
-#include "gnc-plugin-mt940.h"
-#include "gnc-mt940-import.h"
-#include "gnc-plugin-page-account-tree.h"
-#include "gnc-plugin-page-register.h"
-
-static void gnc_plugin_mt940_class_init (GncPluginMt940Class *klass);
-static void gnc_plugin_mt940_init (GncPluginMt940 *plugin);
-static void gnc_plugin_mt940_finalize (GObject *object);
-
-/* Command callbacks */
-static void gnc_plugin_mt940_cmd_import (GtkAction *action, GncMainWindowActionData *data);
-
-
-#define PLUGIN_ACTIONS_NAME "gnc-plugin-mt940-actions"
-#define PLUGIN_UI_FILENAME "gnc-plugin-mt940-ui.xml"
-
-static GtkActionEntry gnc_plugin_actions [] = {
- { "Mt940ImportAction", GTK_STOCK_CONVERT, N_("Import MT940"), NULL,
- N_("Process an MT940 response file"),
- G_CALLBACK (gnc_plugin_mt940_cmd_import) },
-};
-static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
-
-typedef struct GncPluginMt940Private
-{
- gpointer dummy;
-} GncPluginMt940Private;
-
-#define GNC_PLUGIN_MT940_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_MT940, GncPluginMt940Private))
-
-static GObjectClass *parent_class = NULL;
-
-GType
-gnc_plugin_mt940_get_type (void)
-{
- static GType gnc_plugin_mt940_type = 0;
-
- if (gnc_plugin_mt940_type == 0) {
- static const GTypeInfo our_info = {
- sizeof (GncPluginMt940Class),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gnc_plugin_mt940_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GncPluginMt940),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gnc_plugin_mt940_init,
- };
-
- gnc_plugin_mt940_type = g_type_register_static (GNC_TYPE_PLUGIN,
- "GncPluginMt940",
- &our_info, 0);
- }
-
- return gnc_plugin_mt940_type;
-}
-
-GncPlugin *
-gnc_plugin_mt940_new (void)
-{
- return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_MT940, NULL));
-}
-
-static void
-gnc_plugin_mt940_class_init (GncPluginMt940Class *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = gnc_plugin_mt940_finalize;
-
- /* plugin info */
- plugin_class->plugin_name = GNC_PLUGIN_MT940_NAME;
-
- /* widget addition/removal */
- plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
- plugin_class->actions = gnc_plugin_actions;
- plugin_class->n_actions = gnc_plugin_n_actions;
- plugin_class->ui_filename = PLUGIN_UI_FILENAME;
-
- g_type_class_add_private(klass, sizeof(GncPluginMt940Private));
-}
-
-static void
-gnc_plugin_mt940_init (GncPluginMt940 *plugin)
-{
-}
-
-static void
-gnc_plugin_mt940_finalize (GObject *object)
-{
- GncPluginMt940 *plugin;
- GncPluginMt940Private *priv;
-
- g_return_if_fail (GNC_IS_PLUGIN_MT940 (object));
-
- plugin = GNC_PLUGIN_MT940 (object);
- priv = GNC_PLUGIN_MT940_GET_PRIVATE(plugin);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-/************************************************************
- * Plugin Function Implementation *
- ************************************************************/
-
-/************************************************************
- * Command Callbacks *
- ************************************************************/
-
-static void
-gnc_plugin_mt940_cmd_import (GtkAction *action,
- GncMainWindowActionData *data)
-{
- gnc_file_mt940_import ();
-}
-
-
-/************************************************************
- * Plugin Bootstrapping *
- ************************************************************/
-
-void
-gnc_plugin_mt940_create_plugin (void)
-{
- GncPlugin *plugin = gnc_plugin_mt940_new ();
-
- gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
-}
Deleted: gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940.h
===================================================================
--- gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940.h 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/mt940/gnc-plugin-mt940.h 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,60 +0,0 @@
-/*
- * gnc-plugin-mt940.h --
- * Copyright (C) 2003 David Hampton <hampton at employees.org>
- *
- * 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
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
- * Boston, MA 02110-1301, USA gnu at gnu.org
- */
-
-#ifndef __GNC_PLUGIN_MT940_H
-#define __GNC_PLUGIN_MT940_H
-
-#include <gtk/gtkwindow.h>
-
-#include "gnc-plugin.h"
-
-G_BEGIN_DECLS
-
-/* type macros */
-#define GNC_TYPE_PLUGIN_MT940 (gnc_plugin_mt940_get_type ())
-#define GNC_PLUGIN_MT940(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_MT940, GncPluginMt940))
-#define GNC_PLUGIN_MT940_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_MT940, GncPluginMt940Class))
-#define GNC_IS_PLUGIN_MT940(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_MT940))
-#define GNC_IS_PLUGIN_MT940_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_MT940))
-#define GNC_PLUGIN_MT940_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_MT940, GncPluginMt940Class))
-
-#define GNC_PLUGIN_MT940_NAME "gnc-plugin-mt940"
-
-/* typedefs & structures */
-typedef struct {
- GncPlugin gnc_plugin;
-} GncPluginMt940;
-
-typedef struct {
- GncPluginClass gnc_plugin;
-} GncPluginMt940Class;
-
-/* function prototypes */
-GType gnc_plugin_mt940_get_type (void);
-
-GncPlugin *gnc_plugin_mt940_new (void);
-
-void gnc_plugin_mt940_create_plugin (void);
-
-G_END_DECLS
-
-#endif /* __GNC_PLUGIN_MT940_H */
Deleted: gnucash/branches/swig-redo/src/import-export/mt940/gncmod-mt940-import.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/mt940/gncmod-mt940-import.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/mt940/gncmod-mt940-import.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1,96 +0,0 @@
-/********************************************************************\
- * 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 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-/** @addtogroup Import_Export
- @{ */
- /**@internal
- @file gncmod-mt940-import.c
- @brief module definition/initialization for the mt940 importer
- @author Copyright (c) 2002 Benoit Grégoire bock at step.polymtl.ca
- */
-#include "config.h"
-#include <glib.h>
-
-#include <gtk/gtk.h>
-#include <stdio.h>
-#include <libguile.h>
-
-#include "gnc-module.h"
-#include "gnc-module-api.h"
-
-#include "gnc-mt940-import.h"
-#include "gnc-plugin-mt940.h"
-
-/* version of the gnc module system interface we require */
-int libgncmod_mt940_LTX_gnc_module_system_interface = 0;
-
-/* module versioning uses libtool semantics. */
-int libgncmod_mt940_LTX_gnc_module_current = 0;
-int libgncmod_mt940_LTX_gnc_module_revision = 0;
-int libgncmod_mt940_LTX_gnc_module_age = 0;
-
-//static GNCModule bus_core;
-//static GNCModule file;
-
-/* forward references */
-char *libgncmod_mt940_LTX_gnc_module_path(void);
-char *libgncmod_mt940_LTX_gnc_module_description(void);
-int libgncmod_mt940_LTX_gnc_module_init(int refcount);
-int libgncmod_mt940_LTX_gnc_module_end(int refcount);
-
-
-char *
-libgncmod_mt940_LTX_gnc_module_path(void)
-{
- return g_strdup("gnucash/import-export/mt940");
-}
-char *
-libgncmod_mt940_LTX_gnc_module_description(void)
-{
- return g_strdup("Gnome GUI and C code for MT940 importer");
-}
-int
-libgncmod_mt940_LTX_gnc_module_init(int refcount)
-{
- if(!gnc_module_load("gnucash/engine", 0))
- {
- return FALSE;
- }
- if(!gnc_module_load("gnucash/app-utils", 0))
- {
- return FALSE;
- }
- if(!gnc_module_load("gnucash/gnome-utils", 0))
- {
- return FALSE;
- }
- if(!gnc_module_load("gnucash/import-export", 0))
- {
- return FALSE;
- }
-
- gnc_plugin_mt940_create_plugin();
- return TRUE;
-}
-
-int
-libgncmod_mt940_LTX_gnc_module_end(int refcount)
-{
- return TRUE;
-}
-/** @}*/
Modified: gnucash/branches/swig-redo/src/import-export/qif/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/import-export/qif/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/qif/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -23,6 +23,7 @@
${top_builddir}/src/import-export/libgncmod-generic-import.la \
${top_builddir}/src/engine/libgncmod-engine.la \
${QOF_LIBS} \
+ ${REGEX_LIBS} \
${GLIB_LIBS}
AM_CFLAGS = \
Modified: gnucash/branches/swig-redo/src/import-export/qif-import/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/import-export/qif-import/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/qif-import/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -87,16 +87,20 @@
noinst_DATA = .scm-links
.scm-links:
- rm -f gnucash import-export qif-import
- $(LN_S) -f . qif-import # to fix (load "qif-import/foo.scm")
- $(LN_S) -f . import-export
- $(LN_S) -f . gnucash
+ $(RM) -rf gnucash
+ mkdir -p gnucash qif-import
+ mkdir -p gnucash/import-export
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash/import-export; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
+ ( cd qif-import; for A in $(gncscm_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
-CLEANFILES += qif-import import-export gnucash .scm-links
+clean-local:
+ $(RM) -rf gnucash qif-import
+
+CLEANFILES += .scm-links
DISTCLEANFILES = ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/import-export/qif-import/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/import-export/qif-import/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/qif-import/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -6,6 +6,7 @@
test-link.c
test_link_LDADD=../libgncmod-qif-import.la \
+ ${top_builddir}/src/core-utils/libcore-utils.la \
${top_builddir}/src/gnome/libgncgnome.la \
${top_builddir}/src/engine/libgncmod-engine.la \
${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
Modified: gnucash/branches/swig-redo/src/import-export/qif-io-core/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/import-export/qif-io-core/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/qif-io-core/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -25,18 +25,22 @@
endif
.scm-links:
- rm -f gnucash import-export
- $(LN_S) -f . gnucash
- $(LN_S) -f . import-export
+ $(RM) -rf gnucash
+ mkdir -p gnucash
+ mkdir -p gnucash/import-export
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash/import-export; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
touch .scm-links
gncscmmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/import-export/
gncscmmod_DATA = qif-io-core.scm
-CLEANFILES = gnucash import-export .scm-links
+clean-local:
+ $(RM) -rf qif-import
+
+CLEANFILES = .scm-links
DISTCLEANFILES = ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/import-export/schemas/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/import-export/schemas/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/schemas/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -12,10 +12,10 @@
install-data-local:
if GCONF_SCHEMAS_INSTALL
-mkdir -p $(DESTDIR)$(GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY)
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA)
+ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schema_DATA)
endif
uninstall-local:
if GCONF_SCHEMAS_INSTALL
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(srcdir)/$(schema_DATA)
+ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(schema_DATA)
endif
Modified: gnucash/branches/swig-redo/src/import-export/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/import-export/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -35,6 +35,7 @@
--gnc-module-dir ${top_builddir}/src/gnome-utils \
--gnc-module-dir ${top_builddir}/src/network-utils \
--gnc-module-dir ${top_builddir}/src/gnome \
+ --library-dir ${top_builddir}/lib/libqof/qof \
--guile-load-dir ${top_builddir}/src/scm \
--guile-load-dir ${top_srcdir}/src/scm \
--guile-load-dir ${top_srcdir}/src/import-export
Modified: gnucash/branches/swig-redo/src/import-export/test/test-import-parse.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/test/test-import-parse.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/import-export/test/test-import-parse.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -22,6 +22,7 @@
* Boston, MA 02110-1301, USA gnu at gnu.org
*/
+#include "config.h"
#include <glib.h>
#include <libguile.h>
Modified: gnucash/branches/swig-redo/src/network-utils/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/network-utils/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/network-utils/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -8,6 +8,7 @@
GNC_TEST_DEPS := \
--gnc-module-dir ${top_builddir}/src/gnc-module \
+ --library-dir ${top_builddir}/lib/libqof/qof \
--gnc-module-dir ${top_builddir}/src/network-utils
TESTS_ENVIRONMENT := \
Modified: gnucash/branches/swig-redo/src/register/ledger-core/split-register-control.c
===================================================================
--- gnucash/branches/swig-redo/src/register/ledger-core/split-register-control.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/register/ledger-core/split-register-control.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -674,10 +674,15 @@
if (auto_trans == NULL)
return FALSE;
+ gnc_suspend_gui_refresh ();
+
/* now perform the completion */
if ((pending_trans != NULL) && (pending_trans != trans)) {
if (gnc_split_register_begin_edit_or_warn(info, trans))
+ {
+ gnc_resume_gui_refresh ();
return TRUE;
+ }
if (xaccTransIsOpen (pending_trans))
xaccTransCommitEdit (pending_trans);
@@ -685,7 +690,6 @@
}
g_assert(xaccTransIsOpen(trans));
pending_trans = trans;
- gnc_suspend_gui_refresh ();
gnc_copy_trans_onto_trans (auto_trans, trans, FALSE, FALSE);
blank_split = NULL;
Modified: gnucash/branches/swig-redo/src/register/ledger-core/split-register.c
===================================================================
--- gnucash/branches/swig-redo/src/register/ledger-core/split-register.c 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/register/ledger-core/split-register.c 2006-10-15 04:08:48 UTC (rev 15023)
@@ -1366,6 +1366,8 @@
if (gnc_split_register_handle_exchange (reg, FALSE))
return TRUE;
+ gnc_suspend_gui_refresh ();
+
/* determine whether we should commit the pending transaction */
if (pending_trans != trans)
{
@@ -1384,12 +1386,14 @@
} else {
PINFO("beginning edit of trans %p", trans);
if (gnc_split_register_begin_edit_or_warn(info, trans))
+ {
+ gnc_resume_gui_refresh ();
return FALSE;
+ }
}
pending_trans = trans;
}
g_assert(xaccTransIsOpen(trans));
- gnc_suspend_gui_refresh ();
/* If we are committing the blank split, add it to the account now */
if (trans == blank_trans)
Modified: gnucash/branches/swig-redo/src/register/register-core/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/register/register-core/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/register/register-core/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -62,17 +62,4 @@
${QOF_CFLAGS} \
${GLIB_CFLAGS}
-
-.scm-links:
- rm -f gnucash
- $(LN_S) -f . gnucash
- $(LN_S) -f . register
-if GNUCASH_SEPARATE_BUILDDIR
- for X in ${SCM_FILE_LINKS} ; do \
- $(LN_S) -f ${srcdir}/$$X . ; \
- done
-endif
- touch .scm-links
-
-noinst_DATA = .scm-links
-CLEANFILES = $(BUILT_SOURCES) gnucash register .scm-links ${SCM_FILE_LINKS}
+CLEANFILES = $(BUILT_SOURCES)
Modified: gnucash/branches/swig-redo/src/report/locale-specific/us/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/report/locale-specific/us/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/locale-specific/us/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -31,23 +31,27 @@
endif
.scm-links:
- rm -f gnucash report locale-specific us
- $(LN_S) -f . gnucash
- $(LN_S) -f . report
- $(LN_S) -f ${srcdir} locale-specific
- $(LN_S) -f . us
+ $(RM) -rf gnucash
+ mkdir -p gnucash
+ mkdir -p gnucash/report
+ mkdir -p gnucash/report/locale-specific
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash/report/locale-specific; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../../$$A . ; done )
+ ( cd gnucash/report; for A in $(gncscmothermod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
touch .scm-links
+clean-local:
+ $(RM) -rf gnucash
+
noinst_DATA = .scm-links
EXTRA_DIST = \
${gncscmothermod_DATA} \
${gncscmmod_DATA}
-CLEANFILES = gnucash report locale-specific us .scm-links
+CLEANFILES = .scm-links
DISTCLEANFILES = ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/report/locale-specific/us/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/report/locale-specific/us/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/locale-specific/us/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -22,6 +22,7 @@
--guile-load-dir ${top_srcdir}/src/gnome-utils \
--guile-load-dir ${top_srcdir}/src/gnome \
--library-dir ${top_srcdir}/src/gnome-utils \
+ --library-dir ${top_builddir}/lib/libqof/qof \
--library-dir ${top_srcdir}/src/gnome
TESTS_ENVIRONMENT := \
Modified: gnucash/branches/swig-redo/src/report/report-gnome/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/report/report-gnome/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/report-gnome/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -82,14 +82,15 @@
endif
.scm-links:
- rm -f gnucash
- $(LN_S) -f . gnucash
- $(LN_S) -f ${srcdir} report
+ $(RM) -rf gnucash
+ mkdir -p gnucash
+ mkdir -p gnucash/report
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash/report; for A in $(gncmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
touch .scm-links
CLEANFILES = gnucash report .scm-links ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/report/report-system/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/report/report-system/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/report-system/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -59,14 +59,15 @@
endif
.scm-links:
- rm -f gnucash report
- $(LN_S) -f . gnucash
- $(LN_S) -f . report
+ $(RM) -rf gnucash
+ mkdir -p gnucash
+ mkdir -p gnucash/report
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash/report; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
touch .scm-links
noinst_DATA = .scm-links
Modified: gnucash/branches/swig-redo/src/report/report-system/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/report/report-system/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/report-system/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -21,6 +21,7 @@
--guile-load-dir ${top_srcdir}/src/app-utils \
--guile-load-dir ${top_srcdir}/src/report/report-system \
--library-dir ${top_srcdir}/src/gnome-utils \
+ --library-dir ${top_builddir}/lib/libqof/qof \
--library-dir ${top_srcdir}/src/gnome
TESTS_ENVIRONMENT := \
Modified: gnucash/branches/swig-redo/src/report/standard-reports/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/standard-reports/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -43,19 +43,23 @@
endif
.scm-links:
- rm -f gnucash report
- $(LN_S) -f . gnucash
- $(LN_S) -f ${srcdir} report
+ $(RM) -rf gnucash
+ mkdir -p gnucash
+ mkdir -p gnucash/report
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash/report; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
touch .scm-links
+clean-local:
+ $(RM) -rf gnucash
+
noinst_DATA = .scm-links
EXTRA_DIST = ${gncscmmod_DATA}
-CLEANFILES = gnucash report .scm-links
+CLEANFILES = .scm-links
DISTCLEANFILES = ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/report/standard-reports/budget.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/budget.scm 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/standard-reports/budget.scm 2006-10-15 04:08:48 UTC (rev 15023)
@@ -165,11 +165,11 @@
(gnc:html-table-set-cell!
html-table
- 1 bgt-col "Bgt")
+ 1 bgt-col (_ "Bgt")) ;; Translators: Abbreviation for "Budget"
(gnc:html-table-set-cell!
html-table
- 1 act-col "Act")
+ 1 act-col (_ "Act")) ;; Translators: Abbreviation for "Actual"
(set! period (+ period 1))
)
@@ -330,7 +330,7 @@
)
(gnc:html-document-set-title!
- doc (sprintf #f (_ "%s - %s")
+ doc (sprintf #f (_ "%s: %s")
report-name (gnc-budget-get-name budget)))
(set! accounts (sort accounts account-full-name<?))
Modified: gnucash/branches/swig-redo/src/report/standard-reports/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/standard-reports/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -21,6 +21,7 @@
--guile-load-dir ${top_srcdir}/src/gnome \
--guile-load-dir ${top_srcdir}/src/report/report-system \
--library-dir ${top_builddir}/src/gnome-utils \
+ --library-dir ${top_builddir}/lib/libqof/qof \
--library-dir ${top_builddir}/src/gnome
TESTS_ENVIRONMENT := \
Modified: gnucash/branches/swig-redo/src/report/standard-reports/transaction.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/transaction.scm 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/standard-reports/transaction.scm 2006-10-15 04:08:48 UTC (rev 15023)
@@ -594,7 +594,7 @@
(cond ((not (null? current-accounts))
(list (car current-accounts)))
((> num-accounts 0) (list first-account))
- (else ()))))
+ (else '()))))
#f #t))
(gnc:register-trep-option
Modified: gnucash/branches/swig-redo/src/report/stylesheets/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/report/stylesheets/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/stylesheets/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -45,16 +45,20 @@
endif
.scm-links:
- rm -f gnucash report
- $(LN_S) -f . gnucash
- $(LN_S) -f ${srcdir} report
+ $(RM) -rf gnucash
+ mkdir -p gnucash
+ mkdir -p gnucash/report
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash/report; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
touch .scm-links
+clean-local:
+ $(RM) -rf gnucash
+
noinst_DATA = .scm-links
uidir = $(GNC_UI_DIR)
@@ -63,5 +67,5 @@
EXTRA_DIST = ${gncscmmod_DATA}
-CLEANFILES = gnucash report .scm-links
+CLEANFILES = .scm-links
DISTCLEANFILES = ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/report/stylesheets/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/report/stylesheets/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/stylesheets/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -22,6 +22,7 @@
--guile-load-dir ${top_builddir}/src/gnome-utils \
--guile-load-dir ${top_builddir}/src/gnome \
--library-dir ${top_builddir}/src/gnome-utils \
+ --library-dir ${top_builddir}/lib/libqof/qof \
--library-dir ${top_builddir}/src/gnome
TESTS_ENVIRONMENT := \
Modified: gnucash/branches/swig-redo/src/report/utility-reports/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/report/utility-reports/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/utility-reports/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -32,19 +32,23 @@
endif
.scm-links:
- rm -f gnucash report
- $(LN_S) -f . gnucash
- $(LN_S) -f ${srcdir} report
+ $(RM) -rf gnucash
+ mkdir -p gnucash
+ mkdir -p gnucash/report
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash/report; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
touch .scm-links
+clean-local:
+ $(RM) -rf gnucash
+
noinst_DATA = .scm-links
EXTRA_DIST = ${gncscmmod_DATA}
-CLEANFILES = gnucash report .scm-links
+CLEANFILES = .scm-links
DISTCLEANFILES = ${SCM_FILE_LINKS}
Modified: gnucash/branches/swig-redo/src/report/utility-reports/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/report/utility-reports/test/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/report/utility-reports/test/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -21,7 +21,8 @@
--guile-load-dir ${top_srcdir}/src/report/report-system \
--guile-load-dir ${top_srcdir}/src/report/utility-reports \
--library-dir ${top_builddir}/src/gnome-utils \
- --library-dir ${top_builddir}/src/gnome
+ --library-dir ${top_builddir}/src/gnome \
+ --library-dir ${top_builddir}/lib/libqof/qof
TESTS_ENVIRONMENT := \
$(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
Modified: gnucash/branches/swig-redo/src/scm/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/scm/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/scm/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -30,15 +30,19 @@
endif
.scm-links:
- rm -f gnucash
- $(LN_S) -f ${srcdir} gnucash
+ $(RM) -rf gnucash
+ mkdir -p gnucash
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
touch .scm-links
+clean-local:
+ $(RM) -rf gnucash
+
SCM_FILES = ${gncscm_DATA} ${gncscmmod_DATA}
EXTRA_DIST = \
@@ -54,10 +58,10 @@
build-config.scm: ${srcdir}/build-config.scm.in Makefile
rm -f $@.tmp
sed < $< > $@.tmp \
- -e 's:@-VERSION-@:${VERSION}:' \
- -e 's:@-GNC_HELPDIR-@:${GNC_HELPDIR}:'
+ -e 's#@-VERSION-@#${VERSION}#' \
+ -e 's#@-GNC_HELPDIR-@#${GNC_HELPDIR}#'
mv $@.tmp $@
-CLEANFILES = gnucash .scm-links
+CLEANFILES = .scm-links
DISTCLEANFILES = ${SCM_FILE_LINKS}
MAINTAINERCLEANFILES = build-config.scm
Modified: gnucash/branches/swig-redo/src/tax/us/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/tax/us/Makefile.am 2006-10-14 03:15:33 UTC (rev 15022)
+++ gnucash/branches/swig-redo/src/tax/us/Makefile.am 2006-10-15 04:08:48 UTC (rev 15023)
@@ -28,21 +28,25 @@
endif
.scm-links:
- rm -f gnucash tax
- $(LN_S) -f . gnucash
- $(LN_S) -f . tax
+ $(RM) -rf gnucash
+ mkdir -p gnucash
+ mkdir -p gnucash/tax
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
+ ( cd gnucash/tax; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
touch .scm-links
+clean-local:
+ $(RM) -rf gnucash
+
noinst_DATA = .scm-links
EXTRA_DIST = \
${gncscmmod_DATA} \
${gncscm_DATA}
-CLEANFILES = gnucash tax .scm-links
+CLEANFILES = .scm-links
DISTCLEANFILES = ${SCM_FILE_LINKS}
More information about the gnucash-changes
mailing list