The Scheme way of generating options is somehow able to obtain the
account-list even when running the generator before creating the account
tree. The C++ options object doesn't have that ability so one must make
sure to run the account creation first in a let* statement.
Allows reports to derive from other reports and then change the option
default values to suit. If they change only the values and not the defaults
then it's possible to create saved report configs that don't include the
options whose values are changed to the base report's default value. See
https://bugs.gnucash.org/show_bug.cgi?id=642292.
A static has to be initialized at library load and Guile
isn't necessarily running then. The singleton gets evaluated at
runtime only if the getter is called from Guile.
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.
This is a bit of a hack to handle PlotSize options. They're the only
RangeValues that use ints; the rest use doubles because the control is a
GtkSpinButton and that uses doubles. The chart code expects a pair with
either 'pixel or 'percent saying what to put in front of the number. We
hack that too: if value <= 100 then it's percent because 100px is about
3cm on modern monitors and 15mm on HiDPI ones. Bigger numbers are pixels.
This effectively reverts b7dd7f.
Note that two cases aren't handled because the types aren't GObjects and
so don't have type macros to decipher them: GncOwner and QofQuery. Since
they're not GObjects they're obviously not QofInstances either and we
need to rethink this value type a bit.
Create an alist mapping the Scheme symbols to the corresponding Swig
functions that alias the enumerations. When a symbol is received look
up the corresponding function and evaluate it, retrieving the enumeration.
Scheme can use strings, symbols, or ints as keys in multichoice options,
but C++ can handle only strings. Add conversion and tracking so that the
right key type gets sent back to Scheme.