Commit Graph

24732 Commits

Author SHA1 Message Date
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
John Ralls
00c2e99d2e Convert the Scheme RelativeDatePeriod lookup table to a std::vector.
From a Scheme alist. The vector can be used to find the scheme symbol
as a direct lookup, which isn't possible with an alist, and can be
searched for the Scheme symbol match more quickly than an alist can.
2021-09-02 14:33:35 -07: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
a487ca3f98 Improve template conditional readability with custom traits values. 2021-08-28 16:45:31 -07:00
John Ralls
3935f1a91b Don't put labels on checkboxes, they have their own. 2021-08-19 15:50:55 -07:00
John Ralls
62ab148a3e Output a pair when writing relative date values to scheme file.
So that the can be properly recognized on input.
2021-08-19 09:48:44 -07:00
John Ralls
b3f96701a0 GncOptionAccountListValue: Make setter param cv match template. 2021-08-18 16:14:21 -07:00
John Ralls
7392ac6fcf Prevent running off the end of the GncOptionUI widget's parent tree. 2021-08-18 15:51:19 -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
10381d42e0 Fix color option handling.
Read and write color options the way legacy code does. Pass only values
with no alpha to gdk_rgba_parse because it fails if a hex-string has
alpha.
2021-08-18 13:38:06 -07:00
John Ralls
97a317b50c Ensure that alpha values in colors aren't passed to html.
html color tags don't like them.
2021-08-17 15:47:11 -07:00
John Ralls
3d1812aacd Explicitly cast a value to the decltype of get_value().
Can't always rely on implicit conversion working.
2021-08-17 15:41:26 -07:00
John Ralls
bbe8ebbc15 Reserve space for the accounts in their vector.
Instead of creating an empty vector and then adding the accounts to the
end of it.
2021-08-17 15:38:07 -07:00
John Ralls
42b4755aea Set the initial value on Relative Date combo boxes. 2021-08-17 15:36:51 -07:00
John Ralls
c06924622c Null-value protection for GUID and account values. 2021-08-17 15:34:45 -07:00
John Ralls
53fac914c0 Re-enable connecting the buttons on the Stylesheet Edit select dialog. 2021-08-17 15:30:44 -07:00
John Ralls
e77b5ec03b Fix RelativeDateValue GtkListModel spec: No tooltips anymore. 2021-08-15 14:27:59 -07:00
John Ralls
474bc360f4 Improve converting vectors to SCM lists. 2021-08-15 14:25:52 -07:00
John Ralls
1cd2cf211c Specialize QofInstance* options set_value, catch validation exceptions.
GncOptionValue<const QofInstance*>.get_value() returns a QofInstance* but
reports store them as strings, either commodity mnemonics or GUIDs.
Specialize set_value/set_default_value from scheme to handle those
possibilities.

GncOptionValidatedValue throws an invalid_argument exception if it's
fed an invalid argument. Catch that so that it doesn't crash the program.
2021-08-13 14:06:47 -07:00
John Ralls
852b2ffc2e Handle bare currency mnemonics, catch invalid GUID string exceptions. 2021-08-13 14:06:47 -07:00
John Ralls
e43ff93279 Fix some overly-long lines. 2021-08-13 14:06:47 -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
86da12d844 Use RGB instead of RGBA for color set for color 2021-08-12 14:28:44 -07:00
John Ralls
a7f0476af9 GncMultichoiceUIItem: Cast the selection index to a size_t.
To get correct match with template type.
2021-08-08 15:25:09 -07:00
John Ralls
e8f855e604 Oops, bailed on failure when finding the dialog box buttons. 2021-08-08 15:24:08 -07:00
John Ralls
86d7637160 Handle GncOptionMultichoiceValue::set_value parameters
that don't match the get_value return type.
2021-08-08 15:22:53 -07:00
John Ralls
8acf52a69b Clean up variable declarations in create_list_widget. 2021-08-05 18:22:37 -07:00
John Ralls
e4c9900c9e Avoid infinite recursion in toggle buttons.
Calling activate on a toggle button toggles it again. No need for that.
2021-08-05 18:21:53 -07:00
John Ralls
3c95ad8a00 Create and use renderer for multichoice option widgets. 2021-08-05 18:20:19 -07:00
John Ralls
8079470c8a Fix Color chooser option value setting and getting. 2021-08-05 17:26:04 -07:00
John Ralls
c83a3f44dd Fix paste error. Call get, not set, when we want to get. 2021-08-05 15:52:13 -07:00
John Ralls
f0ecc0e2eb std::string(char*) crashes if it's given a nullptr. 2021-08-05 15:52:13 -07:00
John Ralls
b6622a386b Pick up option aliases recently added in maint. 2021-08-05 15:52:13 -07:00
John Ralls
26946d792c Configure the book options before trying to load them. 2021-08-05 15:52:13 -07:00
John Ralls
914f5f359b Don't unref option UI elements.
They're wrapped in unique_ptr and will take care of themselves.
2021-08-05 15:52:13 -07:00
John Ralls
71955cc326 Correctly terminate gtk_list_store_set(). 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
58d090ff32 Protect strncmp from empty string. It crashes if given one. 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
99eaa81a28 Fix parse of commodity namespace from scheme istream.
Just ignore 2 instead of ignoring 1 twice. No ifdef required.
2021-08-04 10:04:47 -07:00
John Ralls
0bd9033bb3 Move includes of glib and gtk out or extern C in new cpp files. 2021-08-01 11:11:20 -07:00
John Ralls
0f02236ebe Fix gcc warnings. 2021-08-01 10:27:50 -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
dd8e8b4efa Evaluate the getter for making invoice options. 2021-07-31 18:22:45 -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
9d150b1ae7 Always set budget option to default budget. 2021-07-31 18:18:05 -07:00
John Ralls
f5d8d508ee Create the GncOptionVariant's GncOptionValue in place.
Saves a temporary, prevents premature unprotecting of Scheme objects.
2021-07-31 18:18:05 -07:00
John Ralls
c034a26ae7 Protect stored scheme option values from the garbage collector. 2021-07-31 18:18:05 -07:00
John Ralls
67dab6b320 Remove business-options.scm and business-prefs.scm.
Their functions have been reimplemented elsewhere.
2021-07-31 18:18:04 -07:00