John Ralls
1ff844c195
[options] Fix implementation of gnc_register_owner_option
...
To take an owner-type parameter and to set the UIType accordingly.
2022-08-06 17:17:32 -07:00
John Ralls
da0eff2cac
[options] Implement widget-changed callbacks.
...
Enables full functionality for complex-boolean and multichoice-callback
options.
Note that setter-function callback isn't used in any GnuCash code so it
is not implemented and is not present in the register-callback functions.
2022-08-06 17:17:26 -07:00
John Ralls
552aa438ff
[options] Implement gnc_register_internal_option.
2022-08-06 17:13:28 -07:00
John Ralls
0213787a2f
[options] Enable registering an absolute date option.
2022-08-06 16:25:42 -07:00
John Ralls
f4c27d4494
Move gnc_ui_account_get_tax_info_string to gnc-locale-tax.c
...
To prevent a circular dependency between libgnc-app-utils and
libgnucash-guile.
2022-07-17 10:00:23 -07:00
Robert Fewell
83373563c3
Counter formats stored in wrong place.
...
The Book Options, counter formats were being stored under the 'options'
tree but need to be stored in the 'counter_format' tree similar to the
'counters' tree.
2022-04-07 10:33:11 +01:00
John Ralls
4fe83c3b32
[C++options] Remove GncOptionValue<SCM>.
...
No longer needed.
2022-03-21 14:08:06 -07:00
John Ralls
278aa484d7
[C++options] Implement new GncOptionValue type GncOptionReportPlacement.
...
For multicolumn reports so that we don't have to pass Scheme values.
2022-03-21 13:58:50 -07:00
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
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
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
bed44f404f
Remove the always questionable Scheme generation and parsing code.
...
It's more reasonable to do that in Scheme than in C++.
2021-08-30 11:47:04 -07:00
John Ralls
b361582cf2
Ensure option UI is sorted: Tabs by names, items by keys.
2021-08-18 15:42:29 -07:00
John Ralls
1af97ebb9a
Implement registering/unregistering/calling change callbacks.
...
Drives reloading the report when the Apply or OK button is pressed.
2021-08-13 14:06:47 -07:00
John Ralls
b6622a386b
Pick up option aliases recently added in maint.
2021-08-05 15:52:13 -07:00
John Ralls
a97b3e0c6d
Don't let C code destroy the ODB, it's owned by Guile.
2021-08-05 15:52:13 -07:00
John Ralls
a2e1a3e1b8
Extract the GncOptionDB* from the Scheme dispatch function closure.
...
Scheme code keeps the GncOptionDB in a closure. Extract it for C/C++
use. Ownership remains with the closure, don't free the GncOptionDB*.
2021-08-05 15:46:56 -07:00
John Ralls
18997db720
Separate GncOptionAccountValue into GncOptionAccountListValue and GncOptionAccountSelValue.
...
They have different get_value() return types so can't cohabit comfortably.
2021-07-31 18:22:46 -07:00
John Ralls
05ac056449
Make separate option type for GncOwner.
...
GncOwner is not a QofInstance subclass.
2021-07-31 18:22:45 -07:00
John Ralls
29a2365fdf
Avoid infinite recursion when the alias changes only the section name.
2021-07-31 17:54:30 -07:00
John Ralls
7885353fe3
Bring option aliases up to date.
2021-07-31 17:54:30 -07:00
John Ralls
0f8446a1bb
Remove some no longer needed diagnostics.
2021-07-31 17:54:30 -07:00
John Ralls
0a8f66ee90
Fold GncOptionGncOwnerValue into GncOptionValue<const QofQuery*>.
...
Reflecting the way Scheme options handles it.
2021-07-31 17:54:30 -07:00
John Ralls
534a7c2893
GncOptionMultichoiceValue allow setting a default selection.
...
Instead of arbitrarily using the first allowed value.
Also update tests for the Scheme type addition to
GncMultichoiceOptionChoices, intercept more cases where the value
needs to be transformed, and go back to emitting a string instead of
throwing in GncOptionMultichoiceValue::get_value when m_values has more
than one value.
2021-07-31 17:54:29 -07:00
John Ralls
a21f329b1e
Use 100% instead of 20000 px for default Pixmap size.
2021-07-31 17:54:29 -07:00
John Ralls
8c2a8edbed
Implement gnc_option_db_set_string_value and gnc_optiondb_lookup_string_value.
2021-07-31 17:54:29 -07:00
John Ralls
86102e1be7
Return SCM_BOOL_F instead of nullptr to Scheme optiondb-lookup.
...
Because unlike C, Scheme thinks (if 0) should return true. Besides, Swig
hides pointers so a null check doesn't even work.
2021-07-31 17:54:29 -07:00
John Ralls
08d1eebba2
Use GUID strings instead of QofInstance* for scheme value of QofInstance.
...
Because that's what gets used everywhere else.
2021-07-31 17:54:29 -07:00
John Ralls
43f4bcb610
Make GncOptionUIType an enum class.
...
So that Swig will create properly constrained identifiers for its values.
2021-07-31 17:54:29 -07:00
John Ralls
7fa6778b4b
Add a register_option overload to GncOptionDB
...
For compatibility with existing scheme code.
2021-07-31 17:54:29 -07:00
John Ralls
cb7270cafe
Fix myriad gcc10 complaints.
2021-07-31 17:54:29 -07:00
John Ralls
76b0001cbe
Remove option-util.
2021-07-31 17:54:29 -07:00
John Ralls
ea835b31b7
Provide GncOptionPtr& overloads for register-option functions.
...
Simplifies and makes safer calls from Scheme and C++ by not requiring
a raw pointer.
2021-07-31 17:54:29 -07:00
John Ralls
472814d315
Change the normal internal option ValueType to SCM.
...
Internal options are used as a Scheme hack and don't need to be interpreted
on the C side so there's no point in converting them to C types.
2021-07-31 17:54:29 -07:00
John Ralls
7022f5222d
Revert gnc_option_db_lookup|set_glist_value to ...scm_value.
...
GLists and SCM lists are not interchangeable.
2021-07-31 17:54:29 -07:00
John Ralls
8c77ce967b
Implement and test obsolete option name aliasing.
2021-07-31 17:54:29 -07:00
John Ralls
4f3fd665cf
Fix counter and counter_format storage in KVP.
...
So that they go to their own slots instead of to the options slot.
2021-07-31 17:54:29 -07:00
John Ralls
b19f3d383c
Protect some exceptions from being passed to Swig.
2021-07-31 17:54:29 -07:00
John Ralls
d1cfd62f31
Fix loading text fields from KVP into options.
2021-07-31 17:54:28 -07:00
John Ralls
5f9c66aa61
Save all options to KVP if clear_options is true.
2021-07-31 17:54:28 -07:00
John Ralls
245a8fccc7
Correctly select UI types for GUID output.
2021-07-31 17:54:28 -07:00
John Ralls
c751e56184
Fix fail to load or save number-range values in KVP.
2021-07-31 17:54:28 -07:00
John Ralls
010ab1a965
Fix free of unallocated ptr crash.
2021-07-31 17:54:28 -07:00
John Ralls
4a4e5d36f8
Enable gnc_register_owner_option to handle the three types that GncOwner aliases.
2021-07-31 17:54:28 -07:00
John Ralls
d8f83d6ee6
Boolean simple won't work if its UI type is INTERNAL.
2021-07-31 17:54:28 -07:00
John Ralls
3514725a97
Make gnc_register_number_range_option a template on ValueType.
...
GtkSpinButton works with doubles, but we want to preserve the
ability to use other types.
It really should have enable_if<is_arithmetic(ValueType)>.
2021-07-31 17:54:28 -07:00
John Ralls
e78c012699
Fill in the book options.
2021-07-31 17:54:28 -07:00