This truncates long Advanced Preferences list entry labels and values
with ellipses using hardcoded character count limits in order to avoid
stretching out the listbox too much over the dialog's width.
Currently, this is notably necessary for the German translation.
The character count limits chosen for this commit (46 for the label, 8
for the value) only really work with the basic ASCII character set. Some
Unicode characters may be rendered wider. Furthermore, the Preferences
page selection list may container longer entries that push this listbox
further to the right, closer to the dialog's right edge.
Also, I really hope most languages have words for 'yes' or 'no' that are
at most 8 characters in length or can at least be read without ambiguity
when truncated to that limit. At least none of the translations we
support which have translated those words hit the limit.
This makes it so the upwards scrolling arrow button is grayed out at
first when the scrollbar starts at the top; otherwise it was only grayed
out after the user scrolled down and then back to the top.
The last commit fixed one issue but introduced yet another. Now both
should work. Need to investigate if parsing the .plain files really is
necessary, would make things much easier if there was no need for it.
I wrote this a long time ago and have been using it to ease testing of
Wesnoth's default configuration under different conditions ever since.
It creates a new configuration and data directory under /tmp that only
exists for the duration of the Wesnoth session, and disables WML cache
functionality.
This is extremely useful for quickly testing and debugging functionality
dependant on user configuration settings.
(thunderstruck, you may want to review this.)
It appears that using a a function or method that returns a temporary as
the second argument of BOOST_FOREACH does something unexpected:
BOOST_FOREACH(const config* faction, engine_->flg().choosable_factions()) {
...
}
mp::flg_manager()::choosable_factions() returns a new object by value
rather than reference. Somehow this may result in invalid memory
accesses with some Boost and gcc versions (e.g. gcc 4.6.3 and Boost
1.46.1 from the bug report crashes, gcc 4.8.2 and Boost 1.54.0 here does
not), apparently.
I don't know the code well enough to determine whether
choosable_factions() returning an object by const value rather than
const reference is a typing mistake, so for now create a temporary const
reference before the BOOST_FOREACH loop.