Commit Graph

21916 Commits

Author SHA1 Message Date
Geert Janssens
fbd73c83cf gnc-module - move most of scm tests to bindings/guile
This is a first rudimentary separation of gnc-module tests
based on whether they require guile or not. Needs plenty of refinement
which will be applied in followup commits.
2019-12-06 19:59:12 +01:00
Geert Janssens
6eb0ccfa11 gnc-module - move guile wrappers to bindings/guile 2019-12-06 19:59:12 +01:00
Geert Janssens
096a515154 bindings/guile - fix typos in error messages
These were imported verbatim from libgnucash/app-utils/guile-util.c
2019-12-06 19:59:12 +01:00
Geert Janssens
6a3505d01f app-utils - move price-quotes support functions directly into bindings
- wrappers for glib functions go into glib-guile
- engine convenience functions go into gnc-engine-guile
2019-12-06 19:59:12 +01:00
Geert Janssens
9ed9621363 app-utils - remove unused guile includes 2019-12-06 19:59:12 +01:00
Geert Janssens
d777128e6f app-utils - simplify and move gettext wrappers
1. Instead of creating a C wrapper around gettext to then wrap in
guile, use guile's builtin gettext support directly.

The code still defines the _ and N_ shorthands. However it doesn't
really warant a separate module just for these two shorthands.
Instead define them in core-utils. So all code wanting to use
_ or N_ in guile should now use the (gnucash core-utils) module.

The bulk of this commit is actually deleting the scm-gettext
target and using (gnucash core-utils) instead of (gnucash gettext).

2. As the definition of _ and N_ is removed from app-utils.scm,
the app-utils test for a functional N_ macro has been moved to a
new test file in the guile bindinds tests.

3. The (gnucash gettext) module has been deprecated. Use
(gnucash core-utils) from now on.
2019-12-06 19:59:12 +01:00
Geert Janssens
759bbe1da0 app-utils - move gnc_get_debit/credit_str functions to Account
Eliminates another scm file (prefs.scm).
The old scm functions are declared deprecated.
2019-12-06 19:59:12 +01:00
Geert Janssens
0a635fadee engine - cmake cleanups
- drop no longer used GUILE_LDFLAGS and GUILE_INCLUDE_DIRS
- use generator expressions where it makes sense
2019-12-06 19:59:11 +01:00
Geert Janssens
2e1b9f937b engine - drop guile wrappers for obsolete functions
These were marked deprecated early in the 3.x release cycle.
2019-12-06 19:59:11 +01:00
Geert Janssens
04f10d66fa engine cosmetics - remove a few references to guile that are no longer relevant 2019-12-06 19:59:11 +01:00
Geert Janssens
c46c9682eb engine/test - move guile related tests to bindings 2019-12-06 19:59:11 +01:00
Geert Janssens
02511401b7 bindings/guile cosmetic - rename source files for consistency 2019-12-06 19:59:11 +01:00
Geert Janssens
77f669f123 bindings/guile cosmetic - move price-quotes target lower down
This is just a cosmetic. This way the scm targets in the CMakeLists.txt
file are ordered according to their dependencies (targets later in the
file can depend on targets earlier in the file).
2019-12-06 19:59:11 +01:00
Geert Janssens
48f3195e5c bindings - make business-core scm module part of the engine module
There's no reason to expose it as an individual module as what it exports
are support functions for first class engine objects.
2019-12-06 19:59:11 +01:00
Geert Janssens
e940ce8524 engine.scm - a few minor cosmetics
- drop export of non-existing symbol
- add a couple of comments
2019-12-06 19:59:11 +01:00
Geert Janssens
3d4cc63d73 bindings - ensure engine is initialized before any scm code interfaces with it
This is done by invoking gnc_engine_init in the swig initialization routine
2019-12-06 19:59:11 +01:00
Geert Janssens
1c7f835f47 engine - move guile code to bindings/guile
This commit tries to do the minimum necessary to move the guile bits from engine
to bindings/guile. As engine is a very central piece in the software, this unfortunately
still touches many other source files:

- A few helper objects have been squashed together:
  * engine-helpers-guile.[ch] (of which the c part is extracted from engine-helpers.c)
  * gncBusGuile.[ch]
  * gnc-hooks-scm.[ch]
- The initialization function of gncmod-engine no longer initializes the scm bits.
  Any scm code that wants to interact with the engine code now has to load
  the (gnucash engine) scm module, or sometimes (gnucash business-core).
  The bulk of changes in this commit actually is updating all the scm consumers to do so.
- scm-scm target has been removed. Instead (gnucash utilities) is part
  of scm-engine. A few dependency graphs have been updated for this.

More refinements will be in followup commits.
2019-12-06 19:59:11 +01:00
Geert Janssens
b1ba16c33b gnc-hooks - factor out scm calls into a separate source file
This required the addition of an extra parameter to gnc_hook_add_dangler
to allow the scm hooks to unprotect the scm data on hook destruction.
2019-12-06 19:59:11 +01:00
Geert Janssens
49bf27fad5 core-utils - use one command to export all swig wrapped symbols via the (gnucash core-utils) module 2019-12-06 19:59:11 +01:00
Geert Janssens
a6b7eecd81 core-utils - make the swig generated source file dependent on the core-utils headers
That should trigger a regeneration of these swig sources if
any of the header files change.
This is done via a small macro that can be reused for other wrappers as well.

Note
cmake 3.15 introduces a 'FILTER' generator expression
that might allow us to do something like the following:
$<FILTER:$<TARGET_PROPERTY:baselib,SOURCES>,INCLUDE,"*.h[pp]?$">
I toyed briefly with that idea but it currently has two issues:
1. 3.15 is newer than our current minimum cmake requirement, so we can't
   depend in that feature yet.
2. the sources are relative to *their* source directory, which
   is different from the one in which the wrappers are generated
   So they should still be properly transformed into absolute paths
2019-12-06 19:59:11 +01:00
Geert Janssens
a1898daf6c core-utils - move python wrapper code to bindings/python
This makes libgnucash/core-utils completely guile and python free.
2019-12-06 19:59:11 +01:00
Geert Janssens
ad8c388235 core-utils - rework link_libraries and include_directories propagation
By properly marking certain parameters as private or public
we can have cmake work out most of the link_libraries and
include_directoris for other targets dependent on core-utils
2019-12-06 19:59:11 +01:00
Geert Janssens
36c19b4085 core-utils - regroup build rules per target
- first all rules and variables for libgnc-core-utils
- then the rules to generate additional files (like
  gncla-dir.h or gnc-vcs-info.h)
- next rules for the python bindings
- finally rules for the dist targets

Note this commit also eliminates variable
core_utils_ALL_SOURCES, replacing its two
uses directly with its value.
2019-12-06 19:59:11 +01:00
Geert Janssens
94fc5233ea core-utils - cleanup build rules for target library gnc-core-utils
* Eliminate redundant variables (core_utils_ALL_INCLUDES, core_utils_ALL_LIBRARIES)
  Their values are used directly in target_include_directories and
  target_link_libraries respectively.
  They have been eliminated from the python target because target_include_directories
  and target_link_libraries will correctly propagate these values.
* Use generator expressions for a few conditional compile defines and options
2019-12-06 19:59:11 +01:00
Geert Janssens
28fa4c6465 core-utils - move wrapper code to bindings/guile
Note core-utils.i is used by both the guile and the python bindings so
it is moved up to the common bindings directory, while guile
specific changes are in bindings/guile.
2019-12-06 19:59:11 +01:00
Geert Janssens
18093b5e82 core-utils - move guile utils to bindings/guile 2019-12-06 19:59:11 +01:00
Geert Janssens
33e1ff645c Allow to pass include directories to the add_swig_xyz commands
This will be needed when the wrappers no longer live in
the same directory as the objects they are wrapping.
2019-12-06 19:59:11 +01:00
Geert Janssens
e493d42def Introduce gnucash-guile shared library
This (currently empty) library is intented to become
the standard api library for guile code that wants
to use the libgnucash functionality.
2019-12-06 19:59:11 +01:00
Geert Janssens
a0aa105826 libgnucash/scm - move to bindings/guile
A small step in the direction of making libgnucash guile-free.
2019-12-06 19:59:11 +01:00
Geert Janssens
9b803428ef split register - add tests for copy operations 2019-12-06 19:59:11 +01:00
Geert Janssens
f5e28c3d0f split register - drop scm copy interface 2019-12-06 19:41:50 +01:00
Geert Janssens
cb273b13a1 split register - use C copy interface instead of scm copy interface 2019-12-06 19:29:47 +01:00
Geert Janssens
543fab2513 split-register - port copy operations from scm to c
This is done with minimal interpretation, to be able to easily
compare with the original scheme code.
It will most likely be optimized in future commits
2019-12-06 19:29:11 +01:00
Geert Janssens
9f5cbb3a82 app-utils - move register's copy operations to ledger-core
They are only used by split-register.c in that directory
2019-12-04 19:23:14 +01:00
Geert Janssens
02afa33e54 app-utils - reduce guile-util api-surface
Make internal-use only function static and drop two unused functions.
2019-12-04 19:23:14 +01:00
Geert Janssens
efefac3e1e Dead code removal 2019-12-04 19:23:14 +01:00
Geert Janssens
f039cc80e9 Fix ninja-build check without running ninja-build first
The (gnucash reports) guile module should be built before the reports
depending on it.
2019-11-27 17:28:53 +01:00
Robert Fewell
cbc8cc8d8c Remove file committed by mistake 2019-11-25 20:43:39 +00:00
Robert Fewell
574d1a99f2 Add warning label in Import Account Matcher for Commodity
When an account is selected for matching the incoming source, at the
moment any account can be selected apart from a place holder account.
If the required commodity is passed in, display a warning if the
selected account is a different commodity and disable the OK button.
2019-11-25 16:18:27 +00:00
Robert Fewell
8afbe89772 Change image from a stock to an icon name 2019-11-25 16:18:27 +00:00
Robert Fewell
789339c4b7 Set ellipsis on Memo column of import matcher
On first load the Description and Memo columns are set to the width of
the longest piece of text which can force the Info column out of site
so add the 'ellipsize end' to the memo column which will help keep the
info column in view.
2019-11-25 16:18:27 +00:00
Robert Fewell
3ac440121d Info column in matcher looks odd if other columns are resized
The Info column has a cell_render_pixbuf and a cell_render_text aligned
to the left. If the info column is made larger, the text does not keep
to the left so split them into there own columns.
2019-11-25 16:18:27 +00:00
Robert Fewell
d50d3de8b5 Remove a vertical black line from import matcher
When change a row to skipping it, a pixbuf is created with just a
vertical black line and looks odd. There is no reason to create a
pixbuf so change the value in the store to NULL. Do the same when
the 'match missing' is displayed.
2019-11-25 16:18:27 +00:00
Robert Fewell
161bb5f65d Change import-main-matcher to display matched information
Change the import-main-matcher tree view to use a tree store and add
the matched information as a child row.
2019-11-25 16:18:21 +00:00
Christopher Lam
6c3b24a9b6 [html-style-info] remove font-face/size/color from style-info
These were unused in real code.
2019-11-25 20:38:16 +08:00
Christopher Lam
ea9d5fb197 Merge branch 'maint' 2019-11-25 19:45:26 +08:00
Christopher Lam
0973d54d6c [report-utilities] make gnc:owner-splits->aging-list less noisy
invoice processing messages dumped in debug mode. use gnc:msg
2019-11-25 18:35:26 +08:00
Christopher Lam
9adf8db1a2 [report-utilities] gnc:strify can render vectors too 2019-11-25 18:28:58 +08:00
Christopher Lam
aa451bc89d [balsheet-pnl] compact functions
readability fixes
2019-11-25 18:28:58 +08:00
Christopher Lam
d6a5c8ba54 [balsheet-pnl] accumulate column data report-dates
Previous would call gnc:account-get-balances-at-dates and
gnc:account-accumulate-at-dates to retrieve balances and
last-split. This commit reduces the O(2*N) operation to O(N) which
becomes significant with accounts with large number of splits.

Maybe we can reduce other account splitlist scans in the future; these
will be easier and would only require augmenting the record.
2019-11-25 18:28:58 +08:00