Commit Graph

325 Commits

Author SHA1 Message Date
Geert Janssens
8ea52ae212 GSettings - run data model transations while setting up
This makes sure all schema changes are in effect before
the first consumer can query them. For example this will
prevent a one-time re-occurrence of the tip of the day dialog
the first time the new migrations are run.
2021-09-22 15:44:30 +02:00
Geert Janssens
f1802b6fdf GSettings Upgrade - add code to migrate settings
The rules for migration are read from an xml file. This file was
prepared in a previous commit. Future settings 'data model' changes can
reuse this code by simply adding migration rules in the xml file.

This replaces the hardcoded rules that were currently in place to
migrate a few settings from 2.6 and older to 3.0. These rules are no
longer meaningful as we require users to migrate from one major release
series to the immediate next one. So by the time the new migration rules
in this commit are applied by users they should already have run gnucash
3.x at least once. That run should have taken care of the pre-3.0
migration actions.
2021-09-21 17:10:56 +02:00
Geert Janssens
f21c7b6e90 GSettings - define old prefix and check settings for the presence of both prefixes while normalizing 2021-09-21 17:10:56 +02:00
Geert Janssens
a203c5b2d5 GSettings - drop logic to relocate our settings
This was ported from GConf, but GSettings doesn't work that way.
Settings locations are defined at compile time and can't be
relocated at run time (unless you make all of the settings
explicitly relocatable. That however is not how GSettings is meant to be
used.)
2021-09-21 17:10:56 +02:00
Geert Janssens
d1113a4534 GSettings - build as cpp 2021-09-21 17:10:56 +02:00
Geert Janssens
02fbf217f6 GSettings Upgrade - change schema prefix from org.gnucash to org.gnucash.GnuCash
The latter is the prefix format prescribed by gsettings itself. The former never
was an issue until flatpak decided to not accept the shorter prefix when
requesting a settings migration from host system to flatpak sandbox.

In order to allow for migration, keep the old schema around in
org.gnucash.GnuCash.deprecated.gschema.in

While we're at it, make the new prefix an internal implementation detail.
There's no need for it to be visible to the rest of the gnucash code.
2021-09-21 17:10:55 +02:00
Geert Janssens
6674b1bb6b Cleanup - minimal glib=2.56.1 - drop all conditionals on older versions 2021-09-21 17:10:55 +02:00
John Ralls
74d0630867 Bug 798237 - Logging during XML file loading degrades performance...
significantly

Modify the DEBUG and PINFO macros to return unless qof_log_check is
true. Replace almost all direct calls to g_debug and g_message with
DEBUG and PINFO respectively.

Track the highest logging level sent to qof_log_set_level to provide a
short-circuit return in qof_log_check. Remove setting GNC_MOD_TESTS to
QOF_LOG_DEBUG so that the short-circuit threshold isn't defeated by
always being DEBUG.

Net result: 33% improvement in xml load times.
2021-09-14 15:15:11 -07:00
John Ralls
cd0d50aac1 Deprecate date options with a time of day setting.
Removing the only use, an example in hello-world.scm. GnuCash doesn't
use this value in any of its own report options and the feature will
be removed in GnuCash 5.

Related to bug 798297 Pref "Use 24-hour clock" obsolete?.
2021-09-10 12:21:46 -07:00
Christopher Lam
a5edacf0fc [options.scm] Rename option name to "Levels of Subaccounts"
Original name "Show Accounts until level". Add backward compatibility
missed in 08f490ee98
2021-08-04 19:02:30 +08:00
Christopher Lam
f1e35daab3 Rename option name from "Extra notes" to "Extra Notes" 2021-07-23 06:25:01 +08:00
Christopher Lam
251db8c37b Rename option name from "Report title" to "Report Title" 2021-07-23 06:25:01 +08:00
Christopher Lam
2606ddf905 Rename option name from "Invoice number" to "Invoice Number"
This ensures it matches all other invoice reports.
2021-07-23 06:24:55 +08:00
John Ralls
e1c153a516 Bug 798224 - Scheduled transactions are created with date-entered...
copied from the template transaction.
2021-07-10 16:35:20 -07:00
John Ralls
b33d7eb98d Doxygenize some function description comments in gnc-ui-util. 2021-06-18 11:54:14 -07:00
John Ralls
7f62c5395a Bug 743999 - Deleting a digit from an existing number greater than...
four digits in length generates an error message.

Because the grouping is off. Checking grouping on input is pointless so
just ignore the grouping separator when parsing number input.
2021-06-18 11:40:06 -07:00
Robert Fewell
7ee9dac2e9 Add filter for currency symbol for GNCAmountEdit widget
When pasting an amount that includes the currency symbol the validation
will silently fail which may lead to unusual behaviour.
2021-05-31 11:11:01 +01:00
Robert Fewell
748dbf54e0 Change monetary value for gnc_default_share_print_info
Share values are not currencies so set the monetary value to 0 for the
GNCPrintAmountInfo
2021-05-31 11:11:01 +01:00
Robert Fewell
435bb1c76b Parse the register monetary cells for a currency symbol
Add the ability to strip the currency symbol from a registry monetary
cell if it is pasted with one so it can be validated.
2021-05-31 11:11:01 +01:00
Robert Fewell
d55060c0fc Bug 796761 - Control characters can be pasted in register fields
If copied text includes control characters they are inserted when
pasted which can cause alignment issues. This commit filters the
clipboard text for control characters before it is pasted.
2021-05-31 11:11:01 +01:00
John Ralls
f7f35faefe Bug 797928 - Since last run asks for security price when no shares traded
Refactor a bit to ensure that the same price variable names and transaction
currency is used for both extracting the variables and retrieving
any required exchange rates, and that splits with no formula are
ignored in both cases.
2021-04-19 14:25:59 -07:00
Robert Fewell
33b8a19253 Add depreciation warnings for the removal of individual option tool tips 2021-04-18 12:17:51 +01:00
Robert Fewell
02a6a0ae4a Remove the function gnc_option_permissible_value_description
Remove function and scheme using this function which deals with
individual tool tips on multi-choice options.
2021-04-18 12:17:51 +01:00
Christopher Lam
67e65d436c Remove duplicate definitions 2021-04-02 09:37:14 +08:00
Christopher Lam
d316b01da7 [date-utilities] deprecate unused date selectors 2021-03-29 20:14:18 +08:00
Geert Janssens
a4cab54afc i18n - Reuse strings for less translation work 2021-03-28 20:51:19 +02:00
John Ralls
c49b45d8f1 Finish the glib 2.67 fixes for CI tests. 2021-03-22 14:02:37 -07:00
Geert Janssens
e9dfd0d9ea Still more fixes for Arch ci failure 2021-03-22 21:30:41 +01:00
Geert Janssens
cb04365013 More fixes for Arch ci failure 2021-03-22 21:14:34 +01:00
Geert Janssens
fbabcd58e0 Remove dead code 2021-03-17 16:24:22 +01:00
Geert Janssens
b9208eccbf Remove duplicate declaration
The function is also declared and defined in gnc-locale-utils
2021-03-17 16:24:22 +01:00
Geert Janssens
e973a1b60d Drop default locale currency special case for euro
The condition mentioned in the comment no longer applies.
All European locales on Windows (MingW64) properly present EUR
as currency these days
2021-03-17 16:24:22 +01:00
Sumit Bhardwaj
df579c257b Replace g_memdup by memcpy
GLib is deprecating g_memdup. Since older versions of GLib
wouldn't have g_memdup2, this PR replaces occurrences of
g_memdup by memcpy.
2021-03-08 15:14:17 -08:00
Christopher Lam
3739d9121c [date-utilities.scm] typo fix and deprecate unused functions 2021-03-07 13:35:39 +08:00
Frank H. Ellenberger
93e2829ee5 Merge PR #899 into maint 2021-03-02 01:17:26 +01:00
luz paz
16b4976381 Fix typos in libgnucash/
Found via `codespell -q 3 -L ans,ba,parm,parms,numer`
2021-03-02 01:15:32 +01:00
Christopher Lam
b2b8792110 prepend-and-reverse instead of O(N^2) append 2021-02-24 09:08:25 +08:00
Frank H. Ellenberger
6bc8679932 I18N: replace several spourious spaces 2021-02-22 17:56:50 +01:00
John Ralls
7a7c26f87e Move glib and gtk includes out of extern C for tests.
Needed to compile with glib 2.67 and later.
2021-02-16 13:23:48 -08:00
Bill Nottingham
c0f2c3ae25 Fix build with glib2 2.67.x.
glib headers should not be included with 'extern "C"'.
2021-02-16 13:23:16 -08:00
Christopher Lam
779c0521e0 [options.scm API] yank canonically-tabbed parent-subtotal-mode
'canonically-tabbed option is buggy and has never graduated out of
experimental for 17 years. Time to put it to rest.

All previous saved reports with this option will be switched to 't
i.e. parent-subtotal-mode enabled..
2021-02-15 08:59:50 +08:00
Micha Lenk
9386b276e5 Make prototypes static for autoclear unit test
With the explicit prototypes not marked as static unit test builds on Debian
Buster (using buster-backports) fail with

error: testing::internal::ParamGenerator<TestCase*> gtest_InstantiationAutoClearTestAutoClearTest_EvalGenerator_() was declared extern and later static [-fpermissive]

According to the comment preceding the declaration the only intent of the
explicit prototype (in newer versions of googletest implicitly defined by the
GTEST macros) seems to be to silence a warning which would cause a build
failure on Ubuntu 18.04 when using -Werror.

Builds on Debian unstable seem to build just fine without this explicit
declaration, hence I consider it safe to just drop it. However, builds on
Ubuntu 18.04 then fail (see above).

Making the prototypes as static should make both build environments happy.
2021-02-07 13:50:29 -08:00
John Ralls
b66eab2583 Bug 798100 - Equity totals calculating incorrectly
Prevents creation of non-currency opening balance accounts.
2021-01-24 16:53:02 -08:00
Frank H. Ellenberger
84cc64daed I18N: Remove annoying stars from translator comments 2021-01-22 10:19:54 +01:00
Christopher Lam
ca606e7694 [c-interface.scm] deprecate gnc:last-captured-error 2021-01-03 06:28:31 +08:00
John Ralls
c8c58bf349 Add test_autoclear_SOURCES to the dist list for inclusion in the tarball. 2020-12-26 17:23:28 -08:00
Christopher Lam
455ae59a56 [app-utils] fix dependency chain 2020-12-24 22:51:08 +08:00
Christopher Lam
0510ecfe85 [c-interface] internal defines must be declared first
An internal (define) cannot be after a statement such
as (issue-deprecation-warning). This rule was strict in guile-2.2 but
relaxed in guile-3.0, hence, the mixed results in CI.
2020-12-24 22:08:44 +08:00
Christopher Lam
bf671d4fc7 [c-interface] Deprecate gnc:make-string-database
It's only used by date-utilities.scm

This removes the date-utilities -> c-interface dependency.
2020-12-23 23:58:09 +08:00
John Ralls
c2ba88d91d Add MAKE_LINKS to app-utils and qif-import scheme targets.
Needed to successfully build on Windows.
2020-12-13 16:57:48 -08:00