Commit Graph

25214 Commits

Author SHA1 Message Date
John Ralls
572cb6b1d1 Banish gnc_get_optiondb_from_dispatcher to gnc-report.cpp.
Puts it closer to its points of use and removes it with its Scheme
dependency from libgnucash.
2022-03-14 10:32:08 -07:00
John Ralls
d4c3c30b1a Use GUIDs to represent QofInstances instead of pointers.
Converting them to pointers for Scheme to use. Prevents
dangling pointers when the user deletes a QofInstance as long as the
Scheme report code re-fetches its pointers from the options when it's
regenerated.
2022-03-12 17:58:23 -08:00
John Ralls
a7a643f7f2 Store option commodities and namespace and mnemonic instead of pointer.
Protects against crashes caused by the user deleting the commodity and
allows the option to work if a deleted commodity is recreated.
2022-01-03 14:47:18 -08:00
John Ralls
65bd860249 Fix relative_date_to_time64 calculations.
Where the date requested extends beyond the start or end of the year.
2022-01-01 16:05:06 -08:00
John Ralls
6841e5b5c8 Replace GncOptionValue<const QofInstance*> with GncOptionQofInstanceValue.
That stores its values as a pair of <QofIdType, gncGUID> so that it
won't have dangling ptrs if the instance gets deleted.
2021-12-30 12:21:56 -08:00
John Ralls
11225d9741 c++options: Remove gnc:options-data 2021-12-15 14:54:41 -08:00
John Ralls
16dc15964c c++options: Remove the callback registration functions. 2021-12-15 14:32:39 -08:00
John Ralls
759376eb13 c++options: Fix multicolumn report 2021-12-15 14:13:47 -08:00
John Ralls
18edc17541 c++options remove stray debugging comment. 2021-12-14 14:20:20 -08:00
John Ralls
b5d0c42505 c++options: Put copyright and FSF header comment on gnc-optiondb.i. 2021-12-14 12:06:39 -08:00
John Ralls
a700701cd3 c++options: Remove three unused test functions.
Scheme serialization is now tested in test-option-gnc-scheme-output.scm.
2021-12-14 11:52:15 -08:00
John Ralls
eb0bd4f998 c++options: Remove unneeded C++20 header and resolve ambiguous call. 2021-12-14 11:51:37 -08:00
John Ralls
a3f50586df c++options: More thorough testing of scheme serialization. 2021-12-14 11:03:37 -08:00
John Ralls
6cd88c230c c++options: Create bool or string internal options when possible.
There's no need to save internal options as SCM when we support the
underlying type in C++.
2021-12-14 11:03:01 -08:00
John Ralls
e9b850cca5 c++options: Correct Scheme serialization of type bool. 2021-12-14 10:58:48 -08:00
John Ralls
66f9fc81c7 c++options: Implement serialization for GncOwner. 2021-12-14 10:57:41 -08:00
John Ralls
0ce841d4ce c++options Fix Scheme bindings for QofQuery options. 2021-12-14 10:55:59 -08:00
John Ralls
216b483e26 c++options SCM bindings Rewrite save_scm_value to branch on type.
Instead of GncOptionUIType, mostly. We still need to do that to tell apart
commodities and currencies from other QofInstances.
Allows compile-time dispatch for most types.
2021-12-13 11:05:15 -08:00
John Ralls
947c061989 C++options: Create QofQueryValue trait. 2021-12-11 15:12:22 -08:00
John Ralls
f26014a04e c++options: QofInstanceValue: Protect against crashes when m_value is nullptr. 2021-12-11 15:11:26 -08:00
John Ralls
24d2999aec c++options: Set the dialog entries only once at dialog creation. 2021-12-04 15:29:01 -08:00
John Ralls
51cc2668a1 c++options Ensure signals are inactive for initial setting of option entries.
Ensures that the initial setting of the entries doesn't trigger
gnc_option_changed_widget_cb. The entry widget hasn't been parented yet
and besides we don't want to activate the apply and ok buttons yet.
2021-12-04 14:39:19 -08:00
John Ralls
269249378f c++options fix setting account-selection widget from option. 2021-12-02 16:05:14 -08:00
John Ralls
6f93a68bad c++options: Serialize and deserialize to strings instead of streams.
And use serialize to create values for gnc:generate-restore-forms and both
of them for the meat of the stream functions.

This fixes in particular QofInstance serialization where passing the
option value directly to scheme format resulted in a notation about
a swig pointer instead of the desired GUID string or commodity namespace
and mnemonic strings.
2021-12-02 15:04:49 -08:00
John Ralls
c3b8b6cc49 Make a proper class of GncOptionsDialog.
Removes the C functions, allocates with new and delete and cleans itself
up.
2021-11-21 17:03:03 -08:00
John Ralls
5e84f118dd Move gnc_options_dialog functions from gnc-gnome-utils to dialog-options. 2021-11-19 16:10:47 -08:00
John Ralls
8eddb63ef1 Remove unused global variables global_help_cb_data and global_help_cb. 2021-11-19 16:10:47 -08:00
John Ralls
19a2dd4952 dialog-options: Store the main buttons in GNCOptionWin.
Instead of searching for them every time the dialog updates.
2021-11-19 16:10:47 -08:00
John Ralls
9804928006 Don't call gnc_option_db_clean after setting up the options dialog.
The widgets have already been loaded and loading them again just sensitizes
the buttons as if something had changed.
2021-11-19 11:58:22 -08:00
John Ralls
e17ee38c80 dialog-options.cpp: Replace hand-rolled loop to find toplevel with gtk_widget_get_toplevel. 2021-11-19 11:56:25 -08:00
John Ralls
a3a381cfd0 dialog-options.cpp: Fix passing bad widget ptr to dialog_changed_internal.
GtkTreeSelection is not a widget.
2021-11-19 11:52:44 -08:00
John Ralls
dd7feb9988 options.scm: Remove second license comment. 2021-11-19 11:45:54 -08:00
John Ralls
d1fe359e47 gnc_numeric_to_decimal: Change can't round warning to a debug.
Routinely used as a check so a warning isn't appropriate.
2021-11-19 11:44:57 -08:00
John Ralls
74fd716afb Clarify gnc_relative_date_to_time64 helper functions. 2021-11-19 11:43:04 -08:00
John Ralls
f6c9e63e3d Fix PR comments so far.
Except for gnc-option-date's normalize_tm and set_day_and_time.
2021-11-14 15:28:22 -08:00
John Ralls
4c43dac1b6 Restore setting swig engine initialization flag. 2021-11-13 11:10:17 -08:00
John Ralls
cf5da9fffd Resolve merge conflicts. 2021-11-12 19:56:29 -08:00
John Ralls
96b09ded9f Doxygen documentation for new options classes. 2021-11-12 15:27:36 -08:00
John Ralls
00a982d97d Use Scheme to generate and parse saved option files.
The saved option files being Scheme executables.
2021-11-12 15:27:36 -08:00
Christopher Lam
984d816a58 Merge branch 'maint' 2021-11-06 21:41:17 +08:00
Christopher Lam
4f2d6c7c1b Merge branch 'maint-progress2' into maint #1175 2021-11-06 21:35:02 +08:00
Christopher Lam
16f5be80f9 [test-transaction] "Report Currency" renamed to "Report's currency" 2021-11-06 16:25:48 +08:00
Maxime Leroy
aa450cb00e
Translation update by Maxime Leroy <lisacintosh@gmail.com> using Weblate
po/fr.po: 76.9% (4125 of 5362 strings; 891 fuzzy)
377 failing checks (7.0%)
Translation: GnuCash/Program (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/fr/

Co-authored-by: Maxime Leroy <lisacintosh@gmail.com>
2021-11-05 08:35:59 +01:00
Frank H. Ellenberger
bfe2a1635b Revert "Translation update by Hugo Carvalho <hugokarvalho@hotmail.com>
using Weblate"

This reverts commit 78fac0307c.

Reason: https://github.com/Gnucash/gnucash/pull/1182#discussion_r739675453
2021-11-04 23:28:56 +01:00
Avi Markovitz
e094de7c7a
Translation update by Avi Markovitz <avi.markovitz@gmail.com> using Weblate
po/he.po: 100.0% (5362 of 5362 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Hebrew)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/he/

Co-authored-by: Avi Markovitz <avi.markovitz@gmail.com>
2021-11-04 16:35:00 +01:00
Allan Nordhøy
ebde97ce56
Translation update by Allan Nordhøy <epost@anotheragency.no> using Weblate
po/nb.po: 53.3% (2862 of 5362 strings; 1633 fuzzy)
423 failing checks (7.8%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Co-authored-by: Allan Nordhøy <epost@anotheragency.no>
2021-11-04 16:35:00 +01:00
Maxime Leroy
8d2f059071
Translation update by Maxime Leroy <lisacintosh@gmail.com> using Weblate
po/fr.po: 75.9% (4075 of 5362 strings; 909 fuzzy)
382 failing checks (7.1%)
Translation: GnuCash/Program (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/fr/

Translation update  by Maxime Leroy <lisacintosh@gmail.com> using Weblate

po/fr.po: 75.9% (4073 of 5362 strings; 909 fuzzy)
383 failing checks (7.1%)
Translation: GnuCash/Program (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/fr/

Co-authored-by: Maxime Leroy <lisacintosh@gmail.com>
2021-11-04 16:34:59 +01:00
Hugo Carvalho
78fac0307c
Translation update by Hugo Carvalho <hugokarvalho@hotmail.com> using Weblate
po/glossary/pt.po: 100.0% (208 of 208 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Portuguese)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/pt/

Co-authored-by: Hugo Carvalho <hugokarvalho@hotmail.com>
2021-11-04 16:34:59 +01:00
John Ralls
0660da074f Merge Simon Arlott's 'cut-txn-warning' into maint. 2021-11-03 14:16:10 -07:00
Christopher Lam
970e9af342 Merge branch 'glist-functions' into maint #1183 2021-11-02 23:35:07 +08:00