Commit Graph

144 Commits

Author SHA1 Message Date
Christopher Lam
7ef4c00579 [easy-invoice] Display/Charge Type rename back to Display/Action
This report had renamed "Action" to "Charge Type". For consistency,
let's rename it back, and add migration path in options.scm for
saved-options. 2 fewer strings for translation.
2018-08-07 20:59:35 +08:00
Yuri Chornoivan
f9700ba98d Fix minor typos 2018-07-27 14:23:15 +03:00
John Ralls
216528c130 Merge Bob Fewell's 'fixes8' into maint. 2018-07-23 14:51:01 -07:00
John Ralls
773b070345 Don't set transaction properties via scheme in C code. 2018-07-23 12:00:12 -07:00
Robert Fewell
64778fcad5 Fix error when options dialogue is open when app closed
With the options dialogue open when Gnucash is closed this error is
logged in the trace file, gnc_close_gui_component() component not found.

This is fixed by reversing the components list found for session so the
options dialogue is closed before the report window.
2018-07-22 13:07:57 +01:00
John Ralls
ff91056ab1 Resolve ubuntu 14.04 naming conflict. 2018-07-15 16:55:55 -07:00
John Ralls
a51be5157c Add preference for forcing prices to decimal display.
Anticipating that some users might prefer to see exact prices,
add a preference to General>Numbers to configure whether prices
are rounded to decimals or are displayed as exact fractions.
2018-07-15 14:18:01 -07:00
John Ralls
1fffbaf856 Bug 794755 - Commodity Register displays fractional prices
When printing numbers convert them to a new decimal denominator with
rounding if the passed-in print info specifies that they should be
forced and rounded.

Make the default price settings forced and rounded.

Pass the price currency to gnc_default_price_print_info and
use the currency's fraction * 100 to determine the round-to
denominator and the number of decimal places to display.
2018-07-15 13:20:21 -07:00
John Ralls
756f444ac3 Update bug tracker URL
Change all instances of bugzilla.gnome.org to bugs.gnucash.org, reflecting
our migration to a self-hosted bug tracker.

Inform the Translation Project Coordinator at release that this affects
translatable strings and that all message catalogs have been updated.
2018-07-13 09:49:33 -07:00
John Ralls
7e4f9a444f Add some files missing from the diat so distcheck passes. 2018-06-23 22:00:34 -07:00
John Ralls
9e6760f7cb Bug 796527 - invalid currency on scheduled transactions
1. Don't even check for price/exchange rate on template transactions,
there's no point.

2. Extract function get_transaction_currency:
a. Check all split commodities are valid, abort transaction creation if
not.
b. If the template transaction's currency isn't used by any of the
splits set the new transaction's currency to the first-found currency if
there is one, otherwise to the first-found commodity.

3. Fix a minor typo in a comment.
2018-06-11 10:03:16 -07:00
John Ralls
6f0a3c4345 Bug 795362 - Special variable "i" not parsed in function calls
Limit the range of the random value to 1..1000 to prevent overflows,
particularly in number-of-periods or number-of-years variables.

While we're at it, g_random_int and g_random_int_range return ints so
piping the result through gnc_double_to_numeric() doesn't make much
sense. That's removed, we just construct a gnc_numeric.
2018-06-08 16:44:31 -07:00
Christopher Lam
97ab1b19fe test-date-utilities.scm: to SRFI64
Clearer syntax helped find flawed test - while set-tm:mday directly
accepts 1-31, set-tm:mon accepts 0-11 to represent 1-12, therefore
must minus 1. set-tm:year accepts 92 to represent 1992, therefore must
minus 1900.
2018-05-10 22:21:55 +08:00
Christopher Lam
4a27285edd html-utilities.scm: new home (gnc:html-render-options-changed)
We want to sanitize render-options-changed, therefore it must return
an html-object. Unfortunately this is not accessible to
app-utils/options.scm. If we move this function to
report-system/html-utilities.scm, it can access html-objects.

Also rename it to gnc:html-render-options-changed
2018-05-10 13:19:03 +08:00
Geert Janssens
1f3cf845c4 Work around a conflict between gcc 8.0 and swig 3.0
The swig 3.0 generated python wrappers trigger a warning converted into an error issued
by gcc 8.0 for using strncpy as follows:
strncpy(buff, "swig_ptr: ", 10);
The reason is this call will truncate the trailing null byte from the string.
This appears to have been fixed in swig master already but that's not released yet
so let disable the warning when compiling the swig wrappers until it is.
2018-05-09 22:18:29 +02:00
Geert Janssens
a9f35ed7ae Lowercase cmake commands
A huge bikeshed fest but it distracted me enough to do it anyway.
2018-05-03 23:18:15 +02:00
John Ralls
0106a771d0 Bug 795039 - Crash on startup using Technicolor Style sheet in report
Take 3: Catch encoding exceptions from trying to read a string into
Scheme using scm_from_utf8_string and try again using
scm_from_locale_string. If that throws too, give up and log a
warning.
2018-04-26 13:01:00 -07:00
John Ralls
f680823dbf Bug 795039 - Crash on startup using Technicolor Style sheet in report
The mingw-w64 toolchain bizarrely substitutes scm_to_locale_string()
for scm_to_utf8_string(). This results in latin1 (yeah, "locale" is
a lie) instead of utf8 which causes an assertion in
g_utf8_collate_key().

Perhaps equally bizarre, the compiler doesn't make the substitution
with scm_to_utf8_stringn(), so use that instead.
2018-04-14 10:18:01 -07:00
John Ralls
dedb5265f0 Merge branch 'maint' into unstable 2018-03-25 09:36:21 -07:00
Robert Fewell
f1dd8cfaf1 Component not found error when accounts are deleted
When accounts are deleted that have an open register window a component
not found error is triggered. After the account is destroyed, a call to
'gnc_resume_gui_refresh' calls 'gnc_gui_refresh_internal' and this then
calls 'find_component_ids_by_class' which is used in order resulting in
'register-single' being unregistered before 'GncPluginPageRegister' and
hence 'ld' being freed but the register not knowing this. Reversing the
list fixes this.
2018-03-21 13:11:39 +00:00
luc14n0
a893a632e9 Add COMPILE_GSCHEMAS to allow disabling gschemas compilation 2018-03-18 12:30:13 -07:00
John Ralls
4ecd9c2dd4 Fix the Python Console for Python3.
Replacing libgncmod-python, libgncmod-core-utils-python, and
libgncmod-app-utils-python with _sw_core_utils and _sw_app_utils.
The latter two are the modules that init.py wants to load and with
Python3 Swig appears to no longer make them available via libgncmod.

Note that there may still be some problems with actually using the
console, but it at least loads at startup without complaint.
2018-03-18 11:59:13 -07:00
Robert Fewell
28b2e732ab When doing a file save from the a new start we have no key file
Test for Key_file not being NULL before trying to free it.
2018-03-12 06:48:01 +00:00
Christopher Lam
551e98435d remove begindate in qofquery
This was producing a date corresponding to 01-01-1970. make-zdate was
being used in aging.scm as a hack to search all splits prior to
end-date. fix the date query logic to set begin-date match to #f.
2018-03-05 11:12:13 +08:00
Christopher Lam
8fef1adcc4 date-utilities: bugfix weekly render
This was introduced by 48bdab3.
2018-03-01 12:14:53 +08:00
Christopher Lam
d8d552ee8a options.scm: tidy (gnc:render-options-changed)
This small change introduces \n into the HTML render.
2018-03-01 05:30:48 +08:00
John Ralls
d4476d06b4 Block events while creating scheduled transactions.
Events update the UI, which is slow, and if there are a lot of SXes
because it's an old file that can be significant.
2018-02-24 13:02:50 -08:00
Geert Janssens
e186d77a16 Merge branch 'unstable-prepare-SRFI64' of https://github.com/christopherlam/gnucash into unstable 2018-02-23 11:48:42 +01:00
Christopher Lam
f7378e9332 TR & options: upgrade HTML to XHTML
Upgrade <br> tags to <br /> to allow well-formed XML parsing.
2018-02-23 18:19:59 +08:00
Robert Fewell
955696b0e7 Cache a couple of split register preferences
Two preferences were being used heavily in the drawing of the register
so it makes sense for them to be saved in the split_register structure
so they can be easily be referenced.
2018-02-21 00:54:49 +00:00
Geert Janssens
27256357f5 Merge branch 'BUG792809' of https://github.com/Bob-IT/gnucash into unstable 2018-02-19 20:31:33 +01:00
John Ralls
720acddff2 Restore fin.scm, incorrectly removed earlier.
But put it in app-utils where it's used and load it explicitly.
2018-02-19 10:50:38 -08:00
fell
464281644c Merge branch 'maint' into unstable
Should resolve issue mentioned in PR #277
Conflicts:
	libgnucash/app-utils/gnc-sx-instance-model.c: resolved
	po/de.po: changes in maint ignored
2018-02-19 15:25:53 +01:00
John Ralls
a5f46a5e45 More Scheme dependency additions. 2018-02-18 15:59:00 -08:00
Robert Fewell
b2ed250db1 Change gsettings upgrade test so old_maj_min is < 207
With the original value of 208, the use-gnucash-color-theme kept on
being reset to what ever the use-theme-colors was, by default false.
2018-02-18 22:41:39 +00:00
John Ralls
48bdab38d4 Replace sprintf with Guile's built-in format. 2018-02-17 15:24:44 -08:00
Christopher Lam
b261eb18b3 Revert options.scm lookup-options renaming
and use (gnc:error) as advised
2018-02-17 08:17:01 +08:00
Christopher Lam
276a7d24d2 REWRITE income-gst-statement.scm
This commit rewrites income-gst-statement.scm to be a derivation
of transaction.scm, modifying the options database and passing
custom arguments to the trep-renderer.

This should hopefully reduce risk of errors.
2018-02-17 08:17:01 +08:00
Christopher Lam
88b3446299 ADD-API: gnc:option-make-internal!, gnc:unregister-option
This commit adds 2 additional helper calls, primarily useful for
derived reports.

gnc:option-make-internal! will hide an existing option. e.g.
a derived report can set the value for a Display/* option and
hide it from the user.

gnc:unregister-option will unregister option. This is primarily
useful for derived options e.g. another report copies from
transaction.scm and removes some options and recreates them with
different parameters.

For example, unregister existing option from section "Accounts"
name "Accounts", and recreate with different parameters e.g.
limited account types.
2018-02-17 08:16:23 +08:00
Christopher Lam
12f3099f59 (infobox)->(gnc:render-options-changed) in options.scm
This commit will change (infobox) to a general-purpose
renderer for "all options changed by user" in options.scm
and can be inserted into any report. It reduces the
number of strings required.
2018-02-17 08:16:23 +08:00
John Ralls
cd8f2b7c7e Rename libgnucash/scm/main.scm to utilities.scm
Because it hasn't been "main" since GnuCash became a C program.
2018-02-16 15:52:19 -08:00
John Ralls
32f6958ebb We're done modularizing. About 16 years ago. 2018-02-16 15:41:47 -08:00
John Ralls
26e51339a6 Rework the Scheme target dependencies.
Should fix Bug 793122 - 2.7.3: ninja build fails
along with the nagging parallel-build problems.
2018-02-16 14:28:46 -08:00
Geert Janssens
49a936c1fd Rewrite gnc_add_swig_guile_command to work in dist tarball as well
When building from git it will add targets to generate the swig files.
When building from tarball it will just point at the generated source
files from the tarball.
2018-01-29 19:46:44 +01:00
Geert Janssens
36cb167b68 Rewrite gnc_add_swig_python_command to work in dist tarball as well
When building from git it will add targets to generate the swig files.
When building from tarball it will just point at the generated source
files from the tarball.
2018-01-29 19:46:44 +01:00
Geert Janssens
4317d8a8f6 Improve handling of generated distributable files
- the two dist_add_... macros now both take a list of file names
as argument so more files can be added at once to the dist tarball.
- dist_add_generated now creates the right target by itself. There's
  no need to pass one any more
- make the swig generated *.py module files explicit output files
- change a couple of custom_targets into custom_commands. The only
  reason they were defined as targets was to ensure they got built
  before the dist tarball. This is now properly handled by the
  dist_add_... macros.
- correctly handle dependency on swig-runtime.h (using OBJECT_DEPENDS
  was not the way to do it according to that property's help page)
2018-01-29 19:46:44 +01:00
Geert Janssens
85bfbd8e82 Some minor cleanups after the autotools removal
This includes removal of the now unused make-gnucash-potfiles.in,
checking for CMakeLists.txt rather than Makefile.am in gnc-vcs-info,
upating the HACKING file,
and generally updating references to autotools.

I have kept "Makefile.*" exclude patterns in our CMakeLists.txt files
because they may still be lingering in the source directory from
previous autogen.sh runs. At some point these should probably be
removed as well still, together with the gitignore references to them.
2018-01-26 18:22:48 +01:00
John Ralls
74ddb671e4 Merge Chris Lam's and Aaron Laws's branch 'time64-ftw' into unstable. 2018-01-20 12:40:32 -08:00
Rob Gowin
54ac7f23e0 Remove Autotools 2018-01-13 12:52:57 -06:00
Christopher Lam
cc097a3f35 [mod|inc|dec]date64 API rename back to date
This commit mass renames new t64 API back to the original names.
2018-01-11 21:07:02 +11:00
Christopher Lam
ee8f9053e8 REMOVE-TIMEPAIR: libgnucash/app-utils/app-utils.scm & date-utilities.scm
This commit removes timepair API functions defined in date-utilities.scm
2018-01-08 22:56:50 +11:00
Christopher Lam
d41ad85f0a TP->T64 COMPATIBILITY SHIM: gnucash/libgnucash/app-utils/options.scm
This commit adds a compatibiliy shim. Although the rest of gnucash
can be converted to time64, this shim allows a Gnucash session to
load reports saved with timepairs.
2018-01-08 13:01:29 +11:00
Christopher Lam
7550ccf537 date-utilities.scm: optimize leapyear calc 2018-01-08 13:01:29 +11:00
Christopher Lam
33a7bb73db Bugzilla 790526 Correct weeknum calculator
This change will fix 'num-of-weeks-since-1/jan/1970' which formerly used quotient to remove
the fractional part of the division. For negative values of num-of-weeks, the number is truncated
in the wrong direction (i.e. towards 0). This change uses floor instead to ensure the num-of-weeks
found is the nearest integer LESS than the fractional number.
2018-01-08 13:01:29 +11:00
Christopher Lam
335165104b ADD-TIME64-API: libgnucash/app-utils/app-utils.scm & date-utilities.scm 2018-01-08 13:01:29 +11:00
lmat
95e31f982b Date option absolute now takes time64. 2018-01-08 13:01:29 +11:00
lmat
d36742d941 Removing uses of timespec 2018-01-08 13:01:29 +11:00
lmat
e947214960 Removing uses of timespec 2018-01-08 13:01:29 +11:00
lmat
168f6d6740 Removing unused timespec function 2018-01-08 13:01:29 +11:00
John Ralls
3d2682ac04 Merge branch 'maint' into unstable 2017-12-30 13:39:21 -08:00
Christopher Lam
43cbe65282 REFACTOR:Move Void-status filter to filter tab
Also upgrade lookup-value Void Transactions now in Filter tab
2017-12-24 00:13:39 +08:00
Christopher Lam
8990553e2e ENH: Move Account matcher to Filter tab
This commit moves the Account matcher into the Filtering tab in preparation for further options
2017-12-24 00:13:39 +08:00
Christopher Lam
d93d4f68b0 options.scm: upgrade lookup-value to learn section changes 2017-12-24 00:13:39 +08:00
Geert Janssens
2f96b19c77 Merge branch 'fix_bayes' of https://github.com/limitedAtonement/gnucash into unstable 2017-12-23 15:10:48 +01:00
John Ralls
e0300d3a62 Replace the gnc:numeric pair with normal Scheme rationals.
This allows direct conversion between Scheme numbers and gnc_numeric
without the performance or accuracy penalties arising from using doubles
as an intermediary.
2017-12-21 15:33:15 -08:00
lmat
5636afc4a2 Kvp no longer parses entries looking for delimiters 2017-12-21 07:39:32 -05:00
Geert Janssens
723b51a06d Add unit test for rewritten scheme error handlers 2017-12-20 14:55:40 +01:00
Geert Janssens
3d910ad2b1 Drop guile 1.8 support
And with it all quirks we still had in the code to support that version.
2017-12-20 14:55:40 +01:00
Geert Janssens
a784dd5784 Add support for guile 2.2 2017-12-20 14:55:40 +01:00
John Ralls
e1d3385428 Handle mid-pacific timezones in date-sensitive tests. 2017-12-15 10:13:41 -08:00
Geert Janssens
de4d1e9859 Add infrastructure to handle preference schema migrations and use it to replace one preference
The preference schema migration collects all schema mutations that can occur
when upgrading to a newer gnucash version. The old gconf to gsettings conversion is
integrated in this system as well. Newer schema mutations will happen based on version
number upgrades though.

The preference that got replaced is "use-theme-colors". Based on discussion in bug 746163
(https://bugzilla.gnome.org/show_bug.cgi?id=746163) and gnucash-docs PR#105
(https://github.com/Gnucash/gnucash-docs/pull/105) this has been replaced with
"use-gnucash-color-theme" with inverted meaning. The old option is kept around for one or
two major release cycles to allow seamless conversion.
2017-12-11 21:56:23 +01:00
John Ralls
9dc66c0b7d Fix the Mac install_name_dir to point at CMAKE_INSTALL_FULL_LIBDIR.
Instead of CMAKE_INSTALL_LIBDIR; it needs to be an absolute path.
2017-12-10 13:01:32 -08:00
John Ralls
9b0a8723a4 More GNUInstallDirs path fixes. 2017-12-01 13:56:52 -08:00
John Ralls
5ca129d82d Remove unset variable SWIG_ARGS from Makefile.am 2017-11-30 13:31:23 -08:00
Guy Taylor
c9c5876431 Use glib.h over custom typedefs in Python SWIG
Use the native glib.h (mainly gint, gfloat ...) over custom typedefs in
SWIG type files. This is for Python only.
2017-11-28 16:27:50 -08:00
John Ralls
5204100d53 Use GNUInstallDirs in CMake Builds
Provides correct file layout when building distribution tarballs.
Fixes Bugs 790840 and 790841.
2017-11-28 14:25:35 -08:00
John Ralls
d44f6bc9d5 Fix missing/misspelled files for distribution.
Mostly errors from 6c01e54.
2017-11-19 17:32:12 -08:00
John Ralls
6c01e54042 Convert shell-executed scheme tests to run directly from Guile.
I.e., remove the shell invocation and with it the need to set the shebang.

Surprisingly this required some build-system modifications particularly
for cmake in order to correctly set the environment.
2017-11-07 15:04:16 -08:00
John Ralls
f412795ef2 Remove extraneous parameters from GNC_ADD_SCHEME_TARGETS 2017-11-07 15:04:16 -08:00
Geert Janssens
1238b9d8cd Prevent gcc from searching config.h in the current directory
This will avoid a ninja-build from picking up a config.h generated by the autotools build
(in the root build directory). Picking up the wrong config.h may lead to all kinds of
subtle issues if the autotools run was done with different options than the cmake run.
2017-10-26 14:05:17 +02:00
Geert Janssens
444eb1c28e Improve gnc_numeric_boxed_copy_func based on discussion in PR#145
In essence
- guard against nullptr dereferencing
- free returned values
2017-10-23 23:05:49 +02:00
Bob-IT
53ef0c5be9 Save button active on every load
The gnc_numeric numval was being set with a valid numeric and hence was always different to the parsed amount.
2017-10-23 23:05:49 +02:00
Geert Janssens
b83be1b8c6 Remove configure option --enable-locale-specific-tax and make gnucash always behave as if it was set 2017-10-20 20:50:33 +02:00
John Ralls
91a2ee4525 [MacOS] Change CMake installed names to absolute paths from @rpath/...
gtk-mac-bundler can't access the executable's rpath list so it can't
follow dependencies if they're not in $install_dir/lib from @rpath.
Autotools always sets absolute path install names so this should have no
adverse affects on other Mac builds.
2017-10-15 13:22:29 -07:00
Geert Janssens
545b24fe97 Merge branch maint into unstable
Resolved conflicts:
2017-10-05 16:29:36 +02:00
Geert Janssens
75b5a41eee Merge branch 'maint' 2017-09-15 21:51:50 +02:00
John Ralls
465f24af2e Link libgncmod-app-utils-python to libgncmod-app-utils.
Instead of building libgncmod-app-utils-python as a stand-alone library
because gncmod-app-utils.c can be compiled only with guile thanks to
declaring scm_init_sw_app_utils_module. Linux linkers will just mark it
'U' but the MacOS linker errors out.
2017-09-10 18:24:39 -07:00
Geert Janssens
a670783eb6 Merge branch 'prices-out2' of https://github.com/Bob-IT/gnucash 2017-08-29 22:24:43 +02:00
Geert Janssens
ae75bc963f Rewrite several file path routines to use boost::filesystem
This is a basis for moving .gnucash to a more modern location for
application specific user data (following the xdg spec).
2017-08-26 21:38:21 +02:00
Robert Fewell
6ca85450a8 Move gnc-gdate-utils functions to gnc-date and remove files.
Also update related files to reflect move of gnc-gdate-util functions
2017-08-20 14:07:30 +01:00
Robert Fewell
c3466b79ef Move gnc-gdate-utils.c/h from app-utils to engine 2017-08-20 14:05:05 +01:00
Geert Janssens
f943ba61ae Rename directory for code from external projects
'lib' is also being used by the cmake build, so there was a
theoretical risk for file conflicts. The new name is 'borrowed'.
2017-08-17 15:25:49 +02:00
Geert Janssens
1883d8ec31 Fix a number of test mismatches between cmake and autotools
cmake:
- add test-app-utils
- rename test-link-module to test-link-module-app-utils
- add gtest-import-map
autotools:
- move gtest-import-map from TEST_PROGS to TESTS (autotools) so it shows up in the colored results list
2017-08-16 12:40:38 +02:00
Geert Janssens
83d14e1c1c Restructure the src directory
It is split into
- /libgnucash (for the non-gui bits)
- /gnucash (for the gui)
- /common (misc source files used by both)
- /bindings (currently only holds python bindings)

This is the first step in restructuring the code. It will need much
more fine tuning later on.
2017-08-10 18:45:00 +02:00