Commit Graph

14 Commits

Author SHA1 Message Date
John Ralls
3dc4bc2377 Implement GncOptionDateValue. 2021-07-10 17:24:57 -07:00
John Ralls
435667e8fe Implement GncOptionMultichoiceValue
Replaces GncOptionValue<GncMultiChoiceOptionChoices> because having the
vector as the value obviously wouldn't work and besides it needs
additional functions.
2021-07-10 17:24:57 -07:00
John Ralls
d544f85256 Replace boost::variant and boost::optional with the C++17 std equivs. 2021-07-10 17:24:57 -07:00
John Ralls
694a15ed21 Extract SCM GncOptionDB::lookup_option to gnc-optiondb.i. 2021-07-10 17:24:57 -07:00
John Ralls
9cdcaf0da8 Remove GncOptionDB::set_selectable and convert set_option to a template. 2021-07-10 17:24:57 -07:00
John Ralls
c5fac51a8b Change the type of OptionUIItem's m_ui_item from void* to GncOptionUIItem.
A locally-opaque class wrapping whatever sort of widget ptr one needs.
Thanks, warlord!
2021-07-10 17:24:56 -07:00
John Ralls
3296212aef Sketch out the rest of the option types.
Minimal implentation to get it to compile and pass tests, not functional yet.
2021-07-10 17:24:56 -07:00
John Ralls
4146251cc7 Add GncOptionUIItem manipulation to GncOptionDB. 2021-07-10 17:24:56 -07:00
John Ralls
94628097e4 Use GncOptionUIType parameters in gnc_register_option functions. 2021-07-10 17:24:56 -07:00
John Ralls
3769a356d5 Extract functions find_section and find_option using boost::optional
to handle not-found condition.
2021-07-10 17:24:56 -07:00
John Ralls
cf0b1da4fa Remove GncOptionWrapper.
Move the GncOptions into the GncOptionDB. This works with tests but
might not with real reports.
2021-07-10 17:24:56 -07:00
John Ralls
d2655d3fb0 Remove gnc-option-db business convenience functions.
gnc_option_db_lookup_invoice_option used only once, so moved its
guts there. The others weren't used at all.
2021-07-10 17:24:56 -07:00
John Ralls
f3eee511e8 Add free functions to create a new GncOptionDB and to register options.
The objective of the free functions is to hide the GncOption from language
bindings so that the GncOptions can be moved into the GncOptionDB instead
of having shared ptrs splattered around the heap. Nearly all access to
the options can then be mediated through the GncOptionDB container.

Note that gnc_option_db_new creates the GncOptionDB on the heap and
returns a raw ptr, so it's up to the creator of the GncOptionDB to
call delete on it when it's no longer needed.
2021-07-10 17:24:56 -07:00
John Ralls
455d3c2d60 Add GncOptionDB class. 2021-07-10 17:24:56 -07:00