Commit Graph

24498 Commits

Author SHA1 Message Date
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
Christopher Lam
bd83c28a51 [gncEntryLedgerModel] don't strdup gnc_print_time64 2021-06-22 18:57:55 +08:00
Christopher Lam
e653c30193 [gnc-xml-backend] g_free char* 2021-06-22 18:57:55 +08:00
Christopher Lam
a8aec07e8a [import-main-matcher] reuse static string for color 2021-06-22 18:57:55 +08:00
Wellington Terumi Uemura
b62772072f
Translation update by Wellington Terumi Uemura <wellingtonuemura@gmail.com> using Weblate
po/pt_BR.po: 99.5% (5337 of 5362 strings; 17 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Portuguese (Brazil))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/pt_BR/

Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
2021-06-21 20:33:40 +02:00
Avi Markovitz
31adcae28e
Translation update by Avi Markovitz <avi.markovitz@gmail.com> using Weblate
po/he.po: 100.0% (5362 of 5362 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Hebrew)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/he/

Co-authored-by: Avi Markovitz <avi.markovitz@gmail.com>
2021-06-21 20:33:40 +02:00
Brian Hsu
ef5603611e
Translation update by Brian Hsu <brianhsu.hsu@gmail.com> using Weblate
po/zh_TW.po: 100.0% (5362 of 5362 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Chinese (Traditional))
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/zh_Hant/

Co-authored-by: Brian Hsu <brianhsu.hsu@gmail.com>
2021-06-21 20:33:39 +02:00
TianXing_Yi
dbdc1a1b7e
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/

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-21 20:33:39 +02:00
Robert Fewell
abcfa6600e Bug 798212 - right-click the register down-arrow
If the toggle buttons on the register sheet, used for date and transfer
cells, is clicked with a right mouse the focus would change to the
first transaction.

To fix add a 'button-press-event' callback to intercept the right mouse
and also prevent the main register sheet menu from showing when an
item_edit pop up is showing.
2021-06-21 11:13:31 +01:00
Robert Fewell
4cff5aa197 Refactor gnc_combo_cell_modify_verify to make it clearer. 2021-06-21 10:03:11 +01:00
Robert Fewell
afd61f7493 Type ahead not working properly on subsequent key strokes
When in the transfer cell and you are searching for the 'fuel' account,
entering the 'f' would bring up all accounts containing an 'f' but when
the next letter 'u' is entered it would show all accounts containing a
'u'. This is down to the transfer cell being updated to early from a
gnc_item_list_select which is being used for the quick fill so test for
quick fill use first.
2021-06-21 10:03:11 +01:00
Robert Fewell
ea2a54bf9e Bug 798162 - Type Ahead Initialization Problem
If navigating by the keyboard and you tab to the transfer cell and then
type a letter, we get to gnc_item_edit_show_popup which starts to
create and hopefully show the pop up list.

But on first use, cell height obtained by gnc_item_list_get_cell_height
can be 1 pixel less than required. This should be corrected by the
check_popup_height_is_true function which calls gnc_item_edit_update
via an idle function. As part of that function, a check is made for
item_edit->show_popup being set but that was only getting set in the
gnc_item_edit_popup_toggled call back so the pop up would not show.

To fix set item_edit->show_popup after setting the toggle button arrow
direction.
2021-06-21 10:03:10 +01:00
TianXing_Yi
a13311bea7
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-20 13:34:14 +02:00
TANIGUCHI Yasuaki
648deefb82
Translation update by TANIGUCHI Yasuaki <yasuakit+weblate@gmail.com> using Weblate
po/ja.po: 90.9% (4877 of 5362 strings; 232 fuzzy)
508 failing checks (9.4%)
Translation: GnuCash/Program (Japanese)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ja/

Co-authored-by: TANIGUCHI Yasuaki <yasuakit+weblate@gmail.com>
2021-06-20 13:34:13 +02:00