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
8eedcb6d6d
Extract all SCM functions to gnc-optiondb.i.
...
So that it can be moved to bindings/ when gnc-module-load-begone is ready.
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
16d1f0655b
Get libswig-gnc-optiondb to install in the right place on Windows.
2021-07-10 17:24:57 -07:00
John Ralls
cee3cdaff9
Instantiate GncOption::set_option for guile, initial types string and int.
...
For proof-of-concept. Guile obviously doesn't know about templates.
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
935ce6db99
Move the SCM option value conversion from the GncOptionValue classes to GncOption.
2021-07-10 17:24:57 -07:00
John Ralls
e51faff3e3
Throw an exception if one tries to set a GncOption with an unsupported type.
2021-07-10 17:24:56 -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
0a13b4c518
Fix up the SWIG wrapper for GncOptionDBPtr.
...
Thanks to Flexo@stackoverflow for
https://stackoverflow.com/questions/27693812/how-to-handle-unique-ptrs-with-swig
5 years later, why isn't this in SWIG 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
6ccb9dbb9e
Use a std::unique_ptr<GncOptionDB> instead of a raw ptr.
...
Passing references to it to the gnc_register_option functions.
Not tested yet with SWIG, might not work.
Includes introducing fixtures to gtest-gnc-optiondb.cpp.
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
6deedd441f
Make the ptr returned by GncOption::get_ui_item() const
...
but not the GtkWidget it points to.
2021-07-10 17:24:56 -07:00
John Ralls
40361ec854
gnc-opption.hpp needs to include <functional>.
2021-07-10 17:24:56 -07:00
John Ralls
41ef2c5d44
Add OptionUIItem composition class to GncOption.
...
Provides a type and a raw pointer member with accessors. The type is one of
enum GncOptionIUType and is either VOID (for internal options that don't
get UI items) or one of the widget types specified in dialog-option.c or
business-options-gnome.c.
2021-07-10 17:24:56 -07:00
John Ralls
083e5b93df
Replace the CRTP class GncOptionBase with direct calls in its former children.
...
Benefit of CRTP too limited to accept the cost of understanding it.
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
2ee0edaa16
Use targets instead of variables for GncOption* tests.
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
ade7fc8b6e
Initial SWIG of GncOptionDB and Scheme tests.
...
This class will be heavily used by reports so we need to ensure SWIG and
Scheme compatibility from the start.
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
John Ralls
16fd632ec8
Make the GncOption member variables private.
...
GncOption is intended to be final, so there's no point in protected members.
2021-07-10 17:24:56 -07:00
John Ralls
13b94d2370
Test integer options, calling get_value with wrong type.
2021-07-10 17:24:56 -07:00
John Ralls
d88ec0dc1b
Replace the gnc_make_foo_option free functions with a template ctor.
...
The free functions will reappear for GncOptionDB. This is to avoid
having to pass naked pointers to Scheme with the attendant object
lifetime issues.
2021-07-10 17:24:56 -07:00
John Ralls
01dc70cc60
Add GncOption accessors for Classifier strings.
2021-07-10 17:24:56 -07:00
John Ralls
01fcae6ac8
Make the OptionClassifier members non-const.
...
Constness deletes the default copy assignment operator, making GncOption
not copy-assignable.
2021-07-10 17:24:56 -07:00
John Ralls
b6fd844774
Wrap GncOptionValue/GncOptionValidatedValue in Boost::Variant.
...
To provide a single type for containers.
2021-07-10 17:24:56 -07:00
John Ralls
c0ba3e2706
[C++ Options] Begin Implementation for basic and validated options.
2021-07-10 17:24:56 -07:00
John Ralls
b495da4e29
[C++ Options] Remove some unused C API from options-utils.
2021-07-10 17:24:56 -07:00
John Ralls
0b77641e9f
Remove gnc_options_dialog bindings from gnome-utils.i.
...
They're unused.
2021-07-10 17:24:56 -07:00
John Ralls
0ea2a8f883
Merge branch 'maint'
2021-06-26 17:39:45 -07:00
John Ralls
228954c408
Release GnuCash 4.6
2021-06-26 14:11:18 -07:00
TianXing_Yi
605d11ac08
Translation update by TianXing_Yi <ytx.cash@gmail.com> using Weblate
...
po/zh_CN.po: 98.4% (5278 of 5362 strings; 70 fuzzy)
30 failing checks (0.5%)
Translation: GnuCash/Program (Chinese (Simplified))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/zh_Hans/
Co-authored-by: TianXing_Yi <ytx.cash@gmail.com>
2021-06-26 19:32:23 +02:00
Christopher Lam
2afb88b006
[gnc-plugin-page-report] export_thunk takes two arguments
2021-06-26 20:03:04 +08:00
Geert Janssens
dbed047ac7
Translation update by Geert Janssens <geert@kobaltwit.be> using Weblate
...
po/nl.po: 100.0% (5362 of 5362 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Dutch)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nl/
Co-authored-by: Geert Janssens <geert@kobaltwit.be>
2021-06-26 12:32:25 +02:00
Geert Janssens
86f53f474a
Translation update by Geert Janssens <geert@kobaltwit.be> using Weblate
...
po/nl.po: 99.1% (5315 of 5362 strings; 46 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Dutch)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nl/
Co-authored-by: Geert Janssens <geert@kobaltwit.be>
2021-06-26 00:32:37 +02:00
Thomas Kriegel
39f036dd6c
Translation update by Thomas Kriegel <warrel040@gmx.de> using Weblate
...
po/de.po: 99.8% (5353 of 5362 strings; 8 fuzzy)
251 failing checks (4.6%)
Translation: GnuCash/Program (German)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/de/
Co-authored-by: Thomas Kriegel <warrel040@gmx.de>
2021-06-25 01:32:09 +02:00
TianXing_Yi
c80bc56b19
Translation update by TianXing_Yi <duguqiubailee@gmail.com> using Weblate
...
po/zh_CN.po: 98.4% (5278 of 5362 strings; 70 fuzzy)
30 failing checks (0.5%)
Translation: GnuCash/Program (Chinese (Simplified))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/zh_Hans/
Translation update by TianXing_Yi <duguqiubailee@gmail.com> using Weblate
po/zh_CN.po: 98.4% (5278 of 5362 strings; 70 fuzzy)
30 failing checks (0.5%)
Translation: GnuCash/Program (Chinese (Simplified))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/zh_Hans/
Co-authored-by: TianXing_Yi <duguqiubailee@gmail.com>
2021-06-25 01:32:08 +02:00
TianXing_Yi
2ee86d93da
Translation update by TianXing_Yi <duguqiubailee@gmail.com> using Weblate
...
po/zh_CN.po: 98.4% (5278 of 5362 strings; 70 fuzzy)
30 failing checks (0.5%)
Translation: GnuCash/Program (Chinese (Simplified))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/zh_Hans/
Translation update by TianXing_Yi <duguqiubailee@gmail.com> using Weblate
po/zh_CN.po: 98.4% (5278 of 5362 strings; 70 fuzzy)
30 failing checks (0.5%)
Translation: GnuCash/Program (Chinese (Simplified))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/zh_Hans/
Co-authored-by: TianXing_Yi <duguqiubailee@gmail.com>
2021-06-23 12:33:23 +02:00
Christopher Lam
13332b15d9
Remove obsolete files from POTFILES.in
2021-06-23 08:46:58 +08:00
Thomas
2229c13a6f
Translation update by Thomas <warrel040@gmx.de> using Weblate
...
po/de.po: 98.8% (5302 of 5362 strings; 54 fuzzy)
268 failing checks (4.9%)
Translation: GnuCash/Program (German)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/de/
Translation update by Thomas <warrel040@gmx.de> using Weblate
po/de.po: 98.3% (5272 of 5362 strings; 72 fuzzy)
308 failing checks (5.7%)
Translation: GnuCash/Program (German)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/de/
Co-authored-by: Thomas <warrel040@gmx.de>
2021-06-23 00:33:39 +02:00
Giuseppe Foti
7be952b7d1
Translation update by Giuseppe Foti <foti.giuseppe@gmail.com> using Weblate
...
po/glossary/it.po: 100.0% (208 of 208 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Italian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/it/
Translation update by Giuseppe Foti <foti.giuseppe@gmail.com> using Weblate
po/it.po: 100.0% (5362 of 5362 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Italian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/it/
Co-authored-by: Giuseppe Foti <foti.giuseppe@gmail.com>
2021-06-23 00:33:38 +02:00
Christopher Lam
1b4d30b3b1
Merge branch 'maint'
2021-06-22 23:30:20 +08:00
Christopher Lam
00983576f4
[split-register-model] don't strdup gnc_print_time64
2021-06-22 18:57:55 +08:00