Report options need to be saved when they're different from the
defaults, book options need to be saved when their value changes
regardless of whether it's the default value. That's dirty. Implement
it.
Make counters explicitly integer type and adjust the kvp load and save functions
to recognize that and behave accordingly so that other range options like day
threshold aren't affected.
Bug 798930 caused some counters to be saved as KVP double. If the
correct int64_t value isn't found when reading, or if a double is
encountered when loading the option dialog, get the double value
and cast it to int64_t.
- Renamed option to "Account Balance" to avoid confusion with running
total.
- Added helper function to ensure running balance and balance forward
are only shown when transaction are grouped by account and sorted as
in register. In that case column heading remains "Running Balance"
and balance forward is shown. Otherwwise column heading is renamed
"Account Balance" and balance forward is not shown.
- Also added missing code for Common Currency conversion.
- spotted by clang-tidy bugprone
- probably no visible effects because of uniqueness, and other checks
libgnucash/engine/gnc-optiondb.cpp:149:5: warning: this call will remove at most one item even when multiple items should be removed [bugprone-inaccurate-erase]
m_options.erase(std::remove_if(m_options.begin(), m_options.end(),
^
libgnucash/engine/gnc-optiondb.cpp:358:5: warning: the value returned by this function should be used [bugprone-unused-return-value]
std::remove_if(m_callbacks.begin(), m_callbacks.end(),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libgnucash/engine/gnc-optiondb.cpp:358:5: note: cast the expression to void to silence this warning
By deleting the function and using GncOptionDbImpl::lookup_string_option
directly. It returns a string that we don't have to worry about
memory-managing.
Also create a new GncOptionDbImpl::set_string_option to replace
gnc_option_db_set_string_value.
Enable and fix the previously untested GtkOptionGtkUIItem::PLOTSIZE.
This has the potentially unfortunate side effect that integer range
options are assumed to be plot sizes. That's correct for now, but
if some report comes along that needs an integer range option for
something else it will have to be differentiated.
This change was inspired by mildred's #PR1247 and uses the new
GncReportCombo to allow selection of 'Saved Invoice reports' when the
invoice print button is used or when printing multiple invoices.
This change presents a dialog with the default for the report combo set
to the properties setting. This dialog has a timeout which is
adjustable under properties and will stop if a key is pressed or combo
popped so that a different report template can be selected and used.
There is also an 'OK' button that stops the time out and prints and a
'Cancel' button which cancels the print.
This commit changes the preference in Business->'Report for Printing'
to be saved as a book property and allow the selection of any Invoice
Report to be used as the default.
The compiler complains that there's no matching
gnc_register_number_range_option for GncOptionDB*, which without this
commit is true because the explicit templates are for GncOptionDBPtr&.
Note that the original template definition is for GncOptionDB* and
that the header-defined inlines that take GncOptionDBPtr& call the
GncOptionDB* version.