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
John Ralls
a1af86ed40
Implement gnc:generate-restore-forms, gnc-optiondb-save-to-scheme.
2021-07-31 17:54:30 -07:00
John Ralls
c34986dad4
Change gnc:new-options to return a fake dispatch function.
...
To placate test-report.scm
2021-07-31 17:54:30 -07:00
John Ralls
3f89d063eb
Evaluate default function in gnc:make-account-sel-limited-option.
2021-07-31 17:54:30 -07:00
John Ralls
6eb5dfed51
make-internal fail if there is a ui_item, not if there isn't.
2021-07-31 17:54:30 -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
bbe74aa086
Remove tooltips from multichoice option values.
...
This is the c++options equivalent to 02a6a0ae
and e1525721
.
2021-07-31 17:54:30 -07:00
John Ralls
5a2ba091a3
Fix compilation error from latest rebase.
2021-07-31 17:54:30 -07:00
John Ralls
7c6ecafd61
Rewrite options.scm to wrap options.hpp functions where needed.
2021-07-31 17:54:30 -07:00
John Ralls
ce5fe577bf
Fix failure to pass accounts list to gnc:make-account-list-option
...
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.
2021-07-31 17:54:30 -07:00
John Ralls
52ef53a405
Implement multichoice selection options.
2021-07-31 17:54:30 -07:00
John Ralls
7239eb809a
Test more natural way of designating relative dates.
2021-07-31 17:54:30 -07:00
John Ralls
23461f1d6c
The value of a list-option is a list. Duh.
2021-07-31 17:54:30 -07:00
John Ralls
12f8df1eab
Fix test failure: Clear the stream before reusing it.
2021-07-31 17:54:30 -07:00
John Ralls
be322a0d7c
Group GncOptionMultChoiceValue::set_multiple with set_default_multiple.
...
Better readability.
2021-07-31 17:54:30 -07:00
John Ralls
27670a6e98
Make the 'pixel and 'percent SCM symbols C++ constants.
...
Improves efficiency and conciseness.
2021-07-31 17:54:30 -07:00
John Ralls
a94f69d6e0
Pretty up some SFINAE formatting for easier reading.
2021-07-31 17:54:30 -07:00