Commit Graph

21193 Commits

Author SHA1 Message Date
Mike Evans
29416292a9 Remove FIX ME
Since it works fine and I can't remember why I put it in.
2019-05-01 11:46:42 +01:00
Mike Evans
c28196fb06 Fix indents, 2019-05-01 11:45:43 +01:00
Mike Evans
126dc3a790 Bug-797168 Proposed fix. 2019-05-01 11:45:43 +01:00
John Ralls
bfbb89f6e2 Rewire and corrected Doxygen comment for gnc_get_locale() c++ function.
There's no point in going through the cache dance on MinGW, that will
just throw.
2019-04-30 15:00:06 -07:00
John Ralls
529a6cb067 Call setlocale(LC_ALL, "") exactly once.
And in Windows only with the value from the environment if there is one.
Calling it with "" in Windows ignores the environment and sets it to the
system settings.
2019-04-30 14:56:43 -07:00
John Ralls
d30cf25c45 Call setlocale() with the right form of locale code on Windows.
Perversely Windows uses the form xx-YY for its own localization
functions but xx_YY for the posix ones including setlocale().
2019-04-30 14:53:46 -07:00
John Ralls
114efe5936 Transcode non-constant strings before passing them to scm_eval_string.
Instead of using scm_c_eval_string, which transcodes with
scm_from_locale_string. That doesn't work on Windows.
2019-04-29 15:00:54 -07:00
Frank H. Ellenberger
1c1fa36023 de.po: update PO-Revision-Date
Follow up of commit 6b10c2f
2019-04-29 23:16:03 +02:00
pianoslum
6b10c2f284 Fix small typo in German translation 2019-04-29 21:36:25 +02:00
John Ralls
a711497130 Fix Travis failure.
Maybe. Can't reproduce it so trying something that looks reasonable.
2019-04-28 21:53:56 -07:00
John Ralls
e42c811341 Make TreeView toggle-buttons not activatable if no toggle callback.
So that it's clear in the UI that clicking on the box won't do anything.
The case that triggered this is the Get-online-quotes item in the
Securities Editor tree view.
2019-04-28 17:09:02 -07:00
John Ralls
3feb864691 Add an optionally-compiled diagnostic console on Windows. 2019-04-28 16:59:51 -07:00
John Ralls
6c7ccbd9e7 Bug 797134 - Decimal separator: Windows configured as dot,...
Gnucash shows comma.

This was introduced by 8f88b7f2b. It turns out that Windows
implementation of setlocale works only if the POSIX locale environment
variables (i.e. LC_FOO or LANG) are set, otherwise it returns NULL. We
were unknowingly relying on Guile to retrieve the Windows environment
for us and that would do the wrong thing if the user had set the locale
in the environment file, so 8f88b7f2b restored it... unfortunately to
the C locale.

This commit changes the set_win32_thread_locale function to work in
both directions, setting both locales from the environment variables
if any are set and calling setlocale with the result of
GetUserDefaultLocaleName if not.
2019-04-28 16:34:58 -07:00
John Ralls
2c637a9714 Put the version back to 3.900. 2019-04-28 10:53:17 -07:00
John Ralls
94bb28d9ab Bug 797127 - Company name and address in reports not display properly
Ensure that all includes of swig-runtime.h are *followed* by
including guile-mappings.h so that the defines masking
scm_to_utf8_string and scm_from_utf8_string are undone.
2019-04-27 13:39:27 -07:00
Christopher Lam
4d529c02cd [libgnucash-scm-utilities] remove unneeded section in CMakeLists 2019-04-27 17:04:02 +08:00
Christopher Lam
b5fe4e3c64 [guile-json] add files to fix distcheck 2019-04-27 17:03:41 +08:00
Geert Janssens
9885ac4687 .gitignore housekeeping
Remove lots of ignores that were only relevant for our former autotools/intltool based build system.
Note if people still have very old working directories, some of these files may suddenly appear
as untracked files after pulling in this commit. A good time to clean them up...
2019-04-26 19:27:49 +02:00
Frank H. Ellenberger
b4ae45d556 Drop po/ChangeLog
It is no longer required by make dist.
Probably it was a requirement of IntlTool.
2019-04-26 18:13:27 +02:00
Robert Fewell
d1ee651bbc Modify the qof log format based on max logger name from log.conf
When you have multiple loggers enabled, the log file indentations are
partly based on logger name length and so you can have false
indentations which can cause confusion. This change gets the maximum
name logger length and uses this for all with a minimum default length
of 12 characters.
2019-04-26 12:09:05 +01:00
Robert Fewell
b87ba7ae91 Bug 797051 - Overwrite prices without warning
Currently if you add a price and a price already exists for that
commodity/currency/day combination it will silently replace that price.
The same is also true for editing a prices if you decide to change the
date. To overcome this add a gnc-warning which allows the response to
be saved temporary or permanently.
2019-04-26 12:09:05 +01:00
Robert Fewell
701974b2c0 Change the sensitivity of Add price button
Enable the Add price button based on the number of rows selected as it
does not make sense for it to be enabled with more than one row.
2019-04-26 12:09:05 +01:00
Robert Fewell
4368e18ac5 Bug 797165 - Crash on price deletion.
Caused by the introduction of caching used in gnc_pricedb_nth_price,
when prices were deleted, the cached list was never updated and so the
tree model could reference a deleted price and hence crash. This also
affected adding prices as the new prices would not show due to the
cache not being updated. To fix this a function was added to reset the
cache when prices are updated from the model.
2019-04-26 12:09:05 +01:00
Robert Fewell
9f0558ffb5 Add some missing log Macros for the price model
Add some missing LEAVE macro statements so the log entries do not get
longer and longer.
2019-04-26 12:09:05 +01:00
Robert Fewell
af96c746a1 Improve setting up the price tree views
Before setting up the price tree view filters, disconnect the model
from the tree view and then connect them after the re-filter.
2019-04-26 12:09:05 +01:00
Robert Fewell
ede281e2a8 Change the Prices dialogue to a GtkWindow.
This removes the need for setting the transient parent which allows the
dialogue to be placed behind the main application.
2019-04-26 12:09:05 +01:00
Robert Fewell
93c8535ea9 Improve setting up the commodity tree view filters
Before setting up the commodity tree view filters, disconnect the model
from the tree view and then connect them after the re-filter.
2019-04-26 12:09:05 +01:00
Robert Fewell
397c5d1358 Keep selection on commodity after updates and adding
After a commodity is updated or added, another row will be selected so
add function to select a given commodity and call this after the
changes so the selection can be maintained. For removal the selection
is cleared so it is consistent.
2019-04-26 12:09:05 +01:00
Robert Fewell
2262142b6a Change the Securities dialogue to use GtkWindow
Change the Securities dialogue from a GtkDialog to GtkWindow. This
removes the need for setting the transient parent which allows the
dialogue to be placed behind the main application.
2019-04-26 12:09:05 +01:00
Frank H. Ellenberger
82a2fca27a [I18N] Mask line endings of continuous text in income-gst-statement.scm
While the HTML renderer ignored them, translators got confused.
2019-04-26 02:30:48 +02:00
John Ralls
a20f3368ae Merge Christoph Holtermann's 'fix-deprecated-positional-arguments' into maint. 2019-04-25 13:38:02 -07:00
thetedmunds
483f9a4c83 Bug 797196 - Allow for per-payment rounding in amortization calculations
Provides functions gnc:amort_pmt, gnc:amort_ppmt, and gnc:amort_ipmt in
fin.scm.
2019-04-25 13:28:40 -07:00
John Ralls
5311e5a386 Revert "Merge T Edmunds's 'amortization-rounding' into maint."
This reverts commit aa53c23239, reversing
changes made to 3c946a8449, because
aa53c23 was based on master and so undid other changes made to maint
since the last merge-to-master.
2019-04-25 13:19:28 -07:00
c-holtermann
c48da07824 fix deprecated positional arguments with the GObject constructor (Bug 797205) 2019-04-25 17:35:47 +02:00
Christopher Lam
0cf49f1244 [test-libgnucash-scm-utilities] amend info to explain comment fix 2019-04-25 11:20:34 +08:00
Christopher Lam
7d15e6e4e7 [utilities] create general string-replace-substring
copied function created by Mark Weaver, core guile dev and augmented
to selectively replace substring indices

This is a much more efficient function than the previous
gnc:substring-replace which will constantly split lists using
substring, and create new strings using string-append.

It also does tail call optimization properly, unlike the previous
functions.

https://lists.gnu.org/archive/html/guile-devel/2013-09/msg00029.html -
original

"Here's an implementation that does this benchmark about 80 times
faster on my machine: (20 milliseconds vs 1.69 seconds)

--8<---------------cut here---------------start------------->8---
(define* (string-replace-substring s substr replacement
                                   #:optional
                                   (start 0)
                                   (end (string-length s)))
  (let ((substr-length (string-length substr)))
    (if (zero? substr-length)
        (error "string-replace-substring: empty substr")
        (let loop ((start start)
                   (pieces (list (substring s 0 start))))
          (let ((idx (string-contains s substr start end)))
            (if idx
                (loop (+ idx substr-length)
                      (cons* replacement
                             (substring s start idx)
                             pieces))
                (string-concatenate-reverse (cons (substring s start)
                                                  pieces))))))))
--8<---------------cut here---------------end--------------->8---

The reason this is so much faster is because it avoids needless
generation of intermediate strings."
2019-04-25 10:52:45 +08:00
John Ralls
a12bbaccd3 Create CMakeLists.txt in libgnucash/scm/test.
Amended by chris to add a working scm/test/CMakeLists.txt.
2019-04-25 10:51:20 +08:00
Christopher Lam
92a920c4e0 [test-libgnucash-scm-utilities] renamed from test-utilities.scm 2019-04-25 10:51:20 +08:00
Christopher Lam
84cc7b1bff [guile-json] fix CMakeLists.txt
one file was renamed during the guile-json update.
2019-04-25 10:51:20 +08:00
Frank H. Ellenberger
268dbbe3af Minor iprovement of 2 Strings in de.po 2019-04-25 00:58:29 +02:00
Frank H. Ellenberger
79a21b4201 Fix a typo in de.po
1c9ad3af35 (r33267294)
2019-04-23 21:30:31 +02:00
Christopher Lam
d9623b0ad1 [test-utilities] initial commit
Add tests for libgnucash/scm/utilities.scm functions

- tests for list<->vec
- tests for gnc:substring-replace
- tests for gnc:substring-replace-from-to

  The latter confirms that the comment before the function definition
  is *incorrect* - it describes that substring-replace-from-to will
  start from the 2nd substring for the first substitution, and
  performs 2 substitutions. However the comment illustrates only 1
  substitution. The test suite performs the test according to code
  behaviour, rather than the comment. This issue is moot in practice
  because the end-after is always called with negative in the code
  base.

  original comment:

;;  gnc:substring-replace-from-to
;;  same as gnc:substring-replace extended by:
;;  start: from which occurrence onwards the replacement shall start
;;  end-after: max. number times the replacement should executed
;;
;;  Example: (gnc:substring-replace-from-to "foobarfoobarfoobar" "bar" "xyz" 2 2)
;;           returns "foobarfooxyzfoobar".
2019-04-23 18:52:36 +08:00
Christopher Lam
4d8ef9b9e4 [report] inline args-to-defn 2019-04-23 18:45:07 +08:00
John Ralls
3815e17e9f Replace VERSION_GREATER_EQUAL with VERSION_GREATER OR VERSION_EQUAL.
The former wasn't introduced until Cmake 3.7.
2019-04-22 12:12:03 -07:00
John Ralls
79f4536a0f Fix typo 2019-04-22 11:28:08 -07:00
John Ralls
4f51f17223 Remove unset _GUILE_LD_LIBRARY_PATH from GncAddSchemeTargets. 2019-04-22 11:26:19 -07:00
John Ralls
b1fdf781ec Adjust GncAddSchemeTargets.cmake to build with Guile2.2 on MinGS64. 2019-04-22 11:26:19 -07:00
Robert Fewell
7e9463db1b Change a couple of accelerator keys in CSV Transaction export
There are a couple of items with the same mnemonic accelerator keys so
change them to non conflicting ones.
2019-04-22 12:09:55 +01:00
Robert Fewell
3985541f48 Add a select all Accounts button for CSV Transaction export. 2019-04-22 12:01:25 +01:00
Robert Fewell
91c992d947 Bug 797123 - Export transactions to CSV file.
When exporting transactions to CSV not all were showing up in the CSV
file. This was due to the start and end dates not being set to the
'start of day' and 'end of day' respectively. Also if you had specified
a range and subsequently used the 'Show All' button the dates used
would still be the ones used for the range.
2019-04-22 11:23:47 +01:00