Commit Graph

20004 Commits

Author SHA1 Message Date
John Ralls
d906ac4136 Prevent "quit without saving" dialog at shutdown when there's no session.
Don't create a session if there isn't one.
2018-06-17 14:09:00 -07:00
John Ralls
a9f0fe2f93 Merge Chris Lam's 'maint-test-all-charts' into maint. 2018-06-17 14:06:38 -07:00
Christian Stimming
1e3a445007 Optimize calls to get_path_kvp so that std::strings are not always created and deleted immediately.
Turns out that the on-the-fly conversion from const char* (the KVP_OPTION_PATH
constants) to std::string with their immediate deletion afterwards is
a quite costly operation. Avoiding this is surprisingly easy: Just keep
local std::string objects at hand, and they don't have to be created
and deleted anymore.

The more optimized solution might be to turn the std::vector<std::string>
into a std::vector<GQuark>, but this commit at least improves the picture for now.
2018-06-17 22:51:16 +02:00
John Ralls
4aaa18eafc Bug 796600 - stock split cash-in-lieu income/asset labels backwards. 2018-06-16 16:19:12 -07:00
John Ralls
9b7544a777 Fix build of windows resources file. 2018-06-16 15:30:23 -07:00
John Ralls
c1103a3a52 Bug 796586 - QIF import incorrectly converts unicode characters from...
UTF8 encoded file

Force UTF-8 encoding; the line processing includes checking each
line for legal UTF-8 and transcoding it to the locale encoding.
2018-06-16 10:37:58 -07:00
Christopher Lam
186ac71fcf Merge old tests with their support files.
It bothered me that these old tests have 2 scheme files per test. It
was always confusing.
2018-06-16 22:47:41 +08:00
Christopher Lam
a78e8b1035 [test-balance-sheet] initial commit
Adds basic balance-sheet testing.

This does not yet test foreign-currency conversions, nor calculation
of unrealized gains.
2018-06-16 22:47:41 +08:00
Christopher Lam
6a62b8db8c [balance-sheet] sanitize & in (add-subtotal-line) 2018-06-16 22:47:41 +08:00
Christopher Lam
62b5c8138d [html-acct-table] sanitize &nbsp; in (gnc-commodity-table)
This sanitizes the commodity-table html.
(improves my first commit!)
2018-06-16 22:47:41 +08:00
Robert Fewell
1b4a2acb45 Add the ability to have register cell tooltips
Add the ability to display tooltips on the register sheet based on type
of cell.
2018-06-16 10:31:14 +01:00
Christopher Lam
01a426bf79 [test-transaction] upgrade to test foreign conversion too
Thanks to previous commit, we can now test foreign currency conversions.
2018-06-16 14:19:13 +08:00
Christopher Lam
02bb981daa [test-extras] upgrade env-transfer-foreign to update pricedb 2018-06-16 14:18:30 +08:00
Christopher Lam
f1823c525c [webkit] eradicate css?
Forgot to remove in 5093a8fb14, remove all traces off css?
2018-06-16 13:09:39 +08:00
Christopher Lam
0461eb43c3 [test-charts] will now test presence of *all* standard charts
And will eventually test data for all chart types too.
2018-06-16 07:55:43 +08:00
Christopher Lam
b1a165eb3b [test-charts] rename test-net-charts to test-charts
It is not that much more difficult to test *all* charts in the same
test-file.
2018-06-16 07:55:43 +08:00
John Ralls
1801fed486 Remove emacs spoor from POTFILES.in 2018-06-15 16:42:02 -07:00
John Ralls
7ce8c9d336 Bug 796595 - QIF Import Select Account button to add a new account...
is labled gnc-account-new but should be New.

Made it "New Account".
2018-06-15 15:21:14 -07:00
John Ralls
d6de324b32 Bug 795272 - QIF importer causes application crash if action is invalid.
Fixes the crash and also pauses after loading if there are load errors.
The load "protection" catches exceptions other than bad-date so that it's
real protection.
Check for unbalanced transactions (i.e. with only one account) and don't
try to match if there is; report the error in the error log space in the
assistant.
Don't proceed to finding duplicates if the new account tree hasn't been
created, there aren't any.
2018-06-15 14:59:06 -07:00
John Ralls
1f8f681732 Remove abandoned C-Language QIF implementation. 2018-06-15 11:38:31 -07:00
John Ralls
9f1bfddc27 Revert "Remove abandoned C-language QIF implementation."
Because it included some extraneous changes.
This reverts commit edd439a05e.
2018-06-15 11:30:09 -07:00
John Ralls
edd439a05e Remove abandoned C-language QIF implementation. 2018-06-15 09:30:31 -07:00
John Ralls
554001604a Merge Chris Lam's 'maint-chartjs-part-1' into maint. 2018-06-14 10:52:42 -07:00
John Ralls
0efe32ea73 Merge Chris Lam's 'maint-test-net-charts' into maint. 2018-06-14 09:52:19 -07:00
Christopher Lam
754c047892 [net-charts] styling table for all charts 2018-06-14 12:53:33 +08:00
Christopher Lam
be1ebb9d32 [net-charts] use scheme rationals directly 2018-06-14 12:53:33 +08:00
Christopher Lam
66488bbb1a [net-charts] *reindent/whitespace* 2018-06-14 12:53:33 +08:00
Christopher Lam
ffd20b2e2f [net-charts] combine net-[bar|line]chart.scm into net-charts.scm
This commit combines both charts into one. This can improve ease of
maintenance.
2018-06-14 12:53:33 +08:00
Benjamin Gordon
8cae602e66 Add support for libsecret to cmake
gnucash has historically supported storing passwords for database
backends with libsecret when HAVE_LIBSECRET is defined. The code is
still present, but support for detecting libsecret's availablity was not
ported over when the build system was converted to cmake.  This change
restores the missing detection.
2018-06-13 21:13:21 -06:00
Christopher Lam
2e4e18e21e [test-net-charts] initial commit test-net-charts
This just tests that the report exists. It does not do any checking
for the data generated yet.
2018-06-14 11:11:04 +08:00
Christopher Lam
7de68cef88 [test-extras] split gnc:options->sxml into 2 functions
Creates (gnc:options->render) which outputs report as a string.
2018-06-14 11:11:04 +08:00
Christopher Lam
1fc5634c7a [html-text] [bugfix] img url was mistakenly disabled. 2018-06-13 21:38:26 +08:00
John Ralls
6c03d07e00 Merge Chris Lam's 'maint-test-invoice' into maint. 2018-06-12 16:28:28 -07:00
John Ralls
87f4791fae Merge Chris Lam's 'maint-fix-796537' into maint. 2018-06-12 16:21:26 -07:00
John Ralls
9c7fa77d3b Merge Bob Fewell's 'fixes6' into maint. 2018-06-12 16:12:48 -07:00
John Ralls
5d3ae6c672 Fix test-tokenizer failure due to not nulling the GError*. 2018-06-12 16:12:30 -07:00
John Ralls
ffe6044cd6 Bug 796248 - Editing Scheduled Transaction
An extra XaccTransBeginEdit, never committed, for transactions that
the backend tried to load when they were already there. That made
the register think that something else had it open.
2018-06-12 15:49:28 -07:00
John Ralls
c8861d4666 Bug 795276 - Invalid date on price stops file from being parsed.
Instead of reporting an error and declining to load the file (XML)
or failing to enter a value (SQL) when a bad date is found in the
database, use a 0 time stamp (1970-01-01 00:00:00 UTC). Adds a warning
in SQL backends; there was one already in XML.
2018-06-12 14:56:27 -07:00
John Ralls
9179505208 Bug 796484 - csv import: iostream error
Unfortunately it turns out that we can't use filestreams because
they can't take path arguments containing Unicode on Windows.
Replace the filestream code with g_file_get_contents(),  which
takes care of all of that Windows compatibility noise for us.
2018-06-12 11:48:03 -07:00
Christopher Lam
e4407dee9b [test-invoice] add gncOrder display and testing 2018-06-12 23:40:13 +08:00
Christopher Lam
aa4dfb0ead [test-invoice] also test fancy-invoice 2018-06-12 23:40:13 +08:00
Christopher Lam
bb37adc3ec [test-invoice] also test easy-invoice 2018-06-12 23:40:13 +08:00
Christopher Lam
81303b4193 [test-invoice] last test inv-8 is paid up
Note there is a debugging display which unexpectedly causes test
failure. Calling gncEntryGetDocValue for each entry, with any
combination of booleans, would cause the amounts to change slightly.
2018-06-12 23:40:13 +08:00
Christopher Lam
da1d1b9a47 [test-invoice] initial commit 2018-06-12 23:40:13 +08:00
Christopher Lam
7918c0317e [test-extras.scm] options->sxml to whitespace
Previously whitespace was encoded onto SXML, but it seems to make
travis complain, i.e. on my branch no errors, however, on main Gnucash
branch would occasionally strip whitespace. This change will parse
XHTML and strip whitespace, which means some tests need amending.
2018-06-12 23:40:13 +08:00
Christopher Lam
746219926a [test-extras.scm] upgrade options->sxml to parse &nbsp; entities
The default xml->sxml parser handles only &gt; &lt; &amp; &apos;
&quot; entities. We need to add handler for &nbsp; as well.
2018-06-12 23:40:13 +08:00
Christopher Lam
b30f4d7c90 [easy-invoice.scm] fix html to be parsable by sxml
Without this change the HTML cannot be parsed by sxml.
2018-06-12 23:40:13 +08:00
Christopher Lam
af00712561 Bug 796537 - Transaction Report cannot sort by "num"
This is technically a bug in the TR regarding book split-action
property. The reworked TR did not retrieve book split-action properly
which means it was always assuming split-action was #f for sorting.

This commit redefines sortkey-list to accept split-action? as a
parameter to generate the correct sortkeys. Unfortunately it will make
it more complicated; I'm not sure how to simplify.
2018-06-12 22:44:08 +08: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
goodvibes2
5f53e2926a Use HINTS instead of PATHS to tell cmake where to look for GTEST + GMOCK
files so it selects the paths in GTEST_ROOT + GMOCK_ROOT rather than the
system libraries.
2018-06-11 18:30:04 +10:00