Commit Graph

343 Commits

Author SHA1 Message Date
Kevin M. Buckley
1e22632687 Bug 798382 - Typo corrections in comments 2021-12-12 09:50:48 -08:00
John Ralls
95b973f792 Bug 798352 - Decimal Precision when Entering Mutual Fund Transaction
Let xaccParseAmount parse up to 12 decimal places instead of 8.
2021-12-09 15:55:37 -08:00
Christopher Lam
33b6dfc6ce [options.scm] addendum ca6604c93 gnc:make-budget-option
selection-budget changed from budget object to guid, handle other uses
as appropriate.
2021-12-04 20:35:04 +08:00
Christopher Lam
ca6604c93c [options.scm] Addon previous commit... need to initialize with guid 2021-12-04 08:59:14 +08:00
Christopher Lam
5a812ca1eb [options.scm] gnc:make-budget-option stores guid instead of object
because object may become stale if UI is used to delete it, leading to
stale pointer and segfault. storing guid is safer, and will return
null if budget is deleted.
2021-12-04 01:37:08 +08:00
Christopher Lam
f813f7cd14 [gnc-autoclear] Move autoclear algorithm into gnome-utils 2021-10-28 21:41:46 +08:00
Geert Janssens
bdb06479e8 GSettings - fix GObject warning when old prefs-version is unset
This will happen when current master (future 5.0) has been run
at least once.
2021-10-27 10:35:11 +02:00
Geert Janssens
09b3ce2382 Revert "Add structure to map migrated preferences to old ones"
This reverts commit c6103a5c17.
2021-10-16 19:02:17 +02:00
Geert Janssens
806d0b3157 Revert "GSettings - make most of the api private"
This reverts commit 26b2d7ca78.
2021-10-16 19:02:10 +02:00
Geert Janssens
1d4673ed2a Revert "GSettings - rework internal helper functions to use more C++"
This reverts commit 24fa289952.
2021-10-16 19:02:04 +02:00
Geert Janssens
24fa289952 GSettings - rework internal helper functions to use more C++ 2021-10-16 10:49:05 +02:00
Geert Janssens
26b2d7ca78 GSettings - make most of the api private
All preference calls should happen via the gnc_prefs_... apis.
The gnc_gsettings_... apis are an internal implementation of this.
2021-10-16 10:49:04 +02:00
Geert Janssens
c6103a5c17 Add structure to map migrated preferences to old ones
This can be used to keep both in sync in the period between
initial migration and eventual obsolence.
Note only non-obsoleted, migrated preferences are tracked.
We don't want to resync preferences that have been
obsoleted (reset). That would nullify the whole idea
of making them obsolete for future removal.

This commit only adds the mapping, synching will follow in a future
commit.
2021-10-16 10:49:04 +02:00
Geert Janssens
9a465fc359 GSettings - add 'deprecate' and 'obsolete' conversions for user preferences
'deprecate' is technically a noop. It serves to remind maintainers
the 'deprecated' preference is to be obsoleted in the next major
release.
'obsolete' goes one step further in that it will cause gnucash to reset
the preference, effectively clearing the value stored in the preferences
backend. This is the final phase of a preference. Following this it
will be completely removed from the GSettings schema in the next
major release.

Notes
* 'deprecate' and 'migrate' are related. Both are a reminder the
preference is to be obsoleted in the next major release. 'deprecate'
does only that though while 'migrate' will also trigger a copy of
the old value to a new location in the databse.

* This commit readds a couple of preferences that had been removed
in the past to be able to properly obsolete them (and to test
the obsoleting code)
2021-10-01 14:46:55 +02:00
Geert Janssens
64576f7d27 GSettings - widen scope from 'migration' to 'transformation'
This commit mostly changes descriptions and variable names to
use the more generic terms 'transformations' or 'conversions'.
'migration' is only one possible transform, future commits will
add others.
There are no functional changes in this commit other than
a logic inversion in parse_one_release_node. It now checks
for nodes named 'migrate' rather than for nodes not named
'migrate' (the code is adapted accordingly to match this
logic change).
2021-10-01 13:59:55 +02:00
John Ralls
29e7b07ed3 Remove superflous schema_source left over from pasting. 2021-09-28 17:17:23 -07:00
John Ralls
8bfa5a63f2 [gsettings] Avoid crash from settings schema not being registered. 2021-09-28 11:00:05 -07:00
Geert Janssens
2a7566cc40 Win32 - drop conditional code never reached
We had hardcoded HAVE_HTMLHELPW to always be true so the fallback
code that's only reached when it is false was never reached.
Time to drop this dead code.
2021-09-26 22:58:08 +02:00
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