In some contexts the compiler may warn since the wml_exception has no
attribute indicating it will never return. The answer is throwing a
dummy exception.
* Long titles now can get word-wrapped up to a limit of two lines (after
which they are truncated). This allows to display "Invasion from the
Unknown" at 800x480 without truncating it at "Un" (20 characters).
The horizontal limit for word-wrapping is 150 pixels.
* Author names are now truncated at 14 characters instead of 16, adding
an ellipsis if necessary to suggest the possibility of reading the
full name elsewhere (in this case, in the Description window).
This is a quick fix and mordante should review it later.
gcc 4.7 doesn't seem to be happy with gui2::tplacer_::build()'s switch
statement and appears to expect more cases despite
gui2::tplacer_::tgrow_direction doesn't have more members. The warning
in question:
src/gui/auxiliary/placer.cpp:43:1: error: control reaches end of non-void function [-Werror=return-type]
Instead of displaying just "Published" for a published add-on regardless
of whether it is installed or not, display "Published, not installed"
when it isn't. This is a rarer situation than a published add-on being
installed, hence we don't need a "Published, installed" status line.
Used for both placement and size. The value is hard-coded at the moment,
but other settings have been tested.
The code is used to experiment with a different approach of the
implementation of a listbox.
The code has been copy-pasted from another project I've been working on, with
some minor adaptions to compile with Wesnoth:
- Removed dependency on C++11 and use the support in boost instead.
- Changed the error reporting to use the Wesnoth code.
These macros allow to throw an wml_exception without any condition. This
can be used when a code path is reached that should be unreachable with
valid WML.
...by clicking on the column headers
Evidence suggests that either this has never been an obvious feature or
people have a strange obsession with downloading the first entries
before trying out the rest. It's not visually obvious, anyway, so we
might as well mention it.
...is naturally sorted by titles rather than case-sensitive ids
This is quite a hack and it's only here in case I don't figure out a
better solution later before 1.11.0 (or get hit by a truck). It works
and that's all that matters here nowadays, anyway.
The problem this solves is basically the following:
* The internal add-ons list is sorted by id (case-sensitively)
* The add-ons list in GUI1 is unsorted by default, following the row
insertion order
* The row insertion order is that of the internal add-ons list iterator order
* Sorting rows by title isn't possible because of the Publish/Delete entries
* Many add-ons have titles that don't reflect their ids at all, not to
mention that users obviously would prefer case-insensitive sorting.
A quite better solution would be to have the add-ons list take care of
all this by itself, but I haven't figured out a way yet short of
implementing a whole custom class for it (which could actually turn out
to be more efficient by getting rid of the id duplication) with
specialized iterators.
Some fields of the tbuilder_control are actually part of the twidget
class. These are now moved to the tbuilder_widget.
Some of these fields were also used in the tbuilder_grid and are moved
likewise. This means the tbuilder_grid now has some extra fields for
debugging. (`Inherited' from the tbuilder_control.)
This constructor sets its state based on the structure send to it
instead of using a second call that sets the fields later.
The code is used to experiment with a different approach of the
implementation of a listbox.