This commit will further improve the styling of the table element used for foreign
currencies in any report with foreign currencies or stocks. Adds non-breaking space
between foreign currency/stock and report currency.
Null tip_list after freeing it the first time to prevent double-free,
then don't iterate over it if contents is NULL. Don't even try to open
dialog if tip_count < 1. Protect from dereferencing a NULL tip_list in
gnc_new_tip_number.
The Python API incorectly had GncCommodityTable.get_namespaces() defined
as a list of GncCommodityNamespace over the correct list of String. This
fixes the issue and adds a test for GncCommodityTable.get_namespaces()
and GncCommodityTable.get_namespaces_list().
Note: This is not a direct fix as I could not get SWIG to detect/convert
"GList *" to a "gchar *" to a Python str list.
Bug 776396 - Foreign currency reports, amounts are not aligned correctly
This commit will improve the styling of the table element used
for foreign currencies in the Balance sheet report so they
end up aligned with the other currencies.
Note the operands are const GncDate& because the GncDate has no copy
constructor/assigment operator (any other definition would fail
when used with variables of type boost::optional<GncDate>)
This required a couple of tweaks to the tests because:
- the invalid date returned for impossible conversions is different between the old implementation and the cpp edition
- unhandled glib warnings caused the tests to abort
This double free happened after the introduction of a class variable (static member variable
to GndDate and the test compiling in gnc-datetime.cpp *and* at the same time linking to
gnc-qof. This apparently threw off internal memory management. Removing either of linking to
gnc-qof or compiling in the source file solved it.
Credits go to John Ralls for debugging this.
For some reason gnc-vcs-info.h isn't found properly any more although
the relevant parts of the Makefiles haven't changed compared to the
maint branch. Perhaps a compiler option has changed ? Anyway simply
adding its path explicitly does fix it.
As a GncDate doesn't have any time information, this has to be made up.
GnuCash uses 3 times-of-day quite a lot:
- start-of-day (00:00 local time)
- end-of-day (23:59 local time)
- neutral time (10:59 utc, chosen to minimize
day offsetting when converting to/from localtime)
A second parameter to the new constructor will tell it to use one of these presets.
There were several problems since the conversion to gtk3
* widget wasn't displayed at all - apparently this was because I had overriden the draw function of the gtklayout (sheet)
-> fixed by adding a draw callback instead
* several gtk warnings about allocating sizes to widgets without using *get_preferred_width/height
-> fixed by adding the itemedit dropdowns to the layout only when they are requested
* the arrow button didn't want to resize small enough
-> fixed by adding a custom style to drops the button's internal padding
* there were several sizing issues which ironically got fixed dropping much of the custom sizing code
gtk_statusbar_set_has_resize_grip
gdk_drawable_get_screen
gdk_device_get_core_pointer
There is no replacement for it in gtk3 and it's probably
not needed any more either.
The old code directly accessed a member variable of GtkEntry. This
direct access is no longer possible, but there is no public function
to get/set this variable. There is a private one used by
GtkComboBox internally) but it's not exported so it can't be used either.
As an interim solution I peeked at how hesiod handled it in his earlier
(unmerged) gtk3 branch. He replaced this private access with setting
gtk_widget_set_visible, something I wouldn't have considered in this
situation. The issue is in the register2 code, so for now it's not
too important. We can investigate this more when the register rewrite
is picked up again.