John Ralls
bed44f404f
Remove the always questionable Scheme generation and parsing code.
...
It's more reasonable to do that in Scheme than in C++.
5 years ago
John Ralls
b361582cf2
Ensure option UI is sorted: Tabs by names, items by keys.
5 years ago
John Ralls
1af97ebb9a
Implement registering/unregistering/calling change callbacks.
...
Drives reloading the report when the Apply or OK button is pressed.
5 years ago
John Ralls
b6622a386b
Pick up option aliases recently added in maint.
5 years ago
John Ralls
a97b3e0c6d
Don't let C code destroy the ODB, it's owned by Guile.
5 years ago
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*.
5 years ago
John Ralls
18997db720
Separate GncOptionAccountValue into GncOptionAccountListValue and GncOptionAccountSelValue.
...
They have different get_value() return types so can't cohabit comfortably.
5 years ago
John Ralls
05ac056449
Make separate option type for GncOwner.
...
GncOwner is not a QofInstance subclass.
5 years ago
John Ralls
29a2365fdf
Avoid infinite recursion when the alias changes only the section name.
5 years ago
John Ralls
7885353fe3
Bring option aliases up to date.
5 years ago
John Ralls
0f8446a1bb
Remove some no longer needed diagnostics.
5 years ago
John Ralls
0a8f66ee90
Fold GncOptionGncOwnerValue into GncOptionValue<const QofQuery*>.
...
Reflecting the way Scheme options handles it.
5 years ago
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.
5 years ago
John Ralls
a21f329b1e
Use 100% instead of 20000 px for default Pixmap size.
5 years ago
John Ralls
8c2a8edbed
Implement gnc_option_db_set_string_value and gnc_optiondb_lookup_string_value.
5 years ago
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.
5 years ago
John Ralls
08d1eebba2
Use GUID strings instead of QofInstance* for scheme value of QofInstance.
...
Because that's what gets used everywhere else.
5 years ago
John Ralls
43f4bcb610
Make GncOptionUIType an enum class.
...
So that Swig will create properly constrained identifiers for its values.
5 years ago
John Ralls
7fa6778b4b
Add a register_option overload to GncOptionDB
...
For compatibility with existing scheme code.
5 years ago
John Ralls
cb7270cafe
Fix myriad gcc10 complaints.
5 years ago
John Ralls
76b0001cbe
Remove option-util.
5 years ago
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.
5 years ago
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.
5 years ago
John Ralls
7022f5222d
Revert gnc_option_db_lookup|set_glist_value to ...scm_value.
...
GLists and SCM lists are not interchangeable.
5 years ago
John Ralls
8c77ce967b
Implement and test obsolete option name aliasing.
5 years ago
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.
5 years ago
John Ralls
b19f3d383c
Protect some exceptions from being passed to Swig.
5 years ago
John Ralls
d1cfd62f31
Fix loading text fields from KVP into options.
5 years ago
John Ralls
5f9c66aa61
Save all options to KVP if clear_options is true.
5 years ago
John Ralls
245a8fccc7
Correctly select UI types for GUID output.
5 years ago
John Ralls
c751e56184
Fix fail to load or save number-range values in KVP.
5 years ago
John Ralls
010ab1a965
Fix free of unallocated ptr crash.
5 years ago
John Ralls
4a4e5d36f8
Enable gnc_register_owner_option to handle the three types that GncOwner aliases.
5 years ago
John Ralls
d8f83d6ee6
Boolean simple won't work if its UI type is INTERNAL.
5 years ago
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)>.
5 years ago
John Ralls
e78c012699
Fill in the book options.
5 years ago
John Ralls
ae79fd016d
More skeletons
5 years ago
John Ralls
28438e3126
Rewire gnome and gnome-utils to use GncOptionDB.
5 years ago
John Ralls
41e59df71f
Remove unused and un-needed function.
5 years ago
John Ralls
1eef796f09
Add some skeleton functions to make the option-using code in gnucash/gnome-utils and gnucash/gnome happy.
5 years ago
John Ralls
99103ffd10
Change gnc-register-option functions to take GncOptionDB*.
...
Instead of std::unique_ptr<GncOptionDB> because there's no way
to get a unique_ptr through a C call.
5 years ago
John Ralls
25b717d47a
Add a rudimentary C API for GncOptionDB.
...
So that most of the gnome-util and gnome consumers don't need to
be converted to C++.
Hide the corresponding functions in options-utils to stop the
compiler whining.
Note that this commit breaks the build but is necessary at
least temporarily to compartmentalize the changes.
5 years ago
John Ralls
f9e136dbac
Get the spelling of GncMultichoiceOptionEntry consistent.
5 years ago
John Ralls
eb6e31f803
dialog-options: Change signature of gnc_option_get_gtk_widget()
...
So that it can be called from C.
5 years ago
John Ralls
3b4785e744
Convert GncOptionSection from a std::pair to a class.
...
Provides find_option(const char*) and foreach_option(func) for easy
iteration. find_option and find_section now return plain const ptrs
instead of std::optionals. Much less cumbersome though the compiler
won't nag if you forget the nullptr check.
5 years ago
John Ralls
c63db36a60
Rename string_equal_charptr to operator==(const std::string&, const char*)
...
Much prettier and more idiomatic as well as being a lot less typing.
5 years ago
John Ralls
6c8e0e23f7
Redesign GncOptionDateValue.
...
After getting a better understanding of how it interacts with dialog-options and
finding some additional scheme API needing implementation (exposed only in
hello-world.scm, but possibly used in user-written reports).
Creates a new file-pair, gnc-options-date.[ch]pp to separate the creation of
the static structs with the type info and strings for the various
RelativeDatePeriod values from the already too large gnc-option-impl.
Although the result is a rather C-ish design the alternative with classes
or template specializations would be more complicated and offer no
benefit.
Implements the permissible_values functions of GncOptionMultichoiceValue
for GncDateValue and provides for absolute, relative, and both
UI values for the three widget configs afforded by dialog-options.
5 years ago
John Ralls
102f36c3be
Provide more than one Date UI type to match options available in dialog-option.c
...
Also differentiates begin-period and end-period controls.
5 years ago
John Ralls
99c2c5e439
GncOptionUIItem from the GncOptionVariant classes to GncOption.
...
Separating the UI from the data model. Note that the GncOptionVariant
classes still have a GncOptionUIType member to ensure that a
GncOptionUIItem of the right type is attached.
5 years ago
John Ralls
1bea809cec
Remove the UI interface from GncOptionDB.
...
UI operations occur only in dialog-option so there's no need to expose
them from GncOptionDB.
5 years ago