...to better reflect their function
They have been renamed to get_addon_pbl_info() and set_addon_pbl_info(),
respectively. This also makes sense given the existing have_addon_pbl_info()
function.
...to generate _info.cfg
Through addon_info::write() we can get rid of the previous, annoying
variable interpolation hack and generalize more logic. Instead of using
the parser.cpp write() function on a file stream, we use a string stream
whose contents are inserted into the add-on archive before unpacking, as
usual.
* Both functions and their support elements are now in manager_ui.cpp
* We no longer use an exception to signal the need to refresh the WML
cache back to the game controller
* We no longer pass a pseudo-optional pointer to bool around
The point of the at() member call was to throw an exception if the
access was invalid. By using find() without checking, we could end up
dereferencing the end iterator of the addons_list. Thus, a helper
function has been added now to use an assertion to protect against that
hypothetical situation early enough.
compilation error I got: "at() not a member of std::map". std::map::at()
seems to be gcc (Linux and MinGw) - only. At least it's not listed
here for instance: http://www.cplusplus.com/reference/stl/map/
(workaround for compilation errors on windows (MSVC&MinGw))
These were seemingly the same errors/problem as worked around
by me in 2012-02-04T02:59:11Z!anonymissimus@arcor.de. Also, still pretty clueless about it.
This is a very large step and it's most likely not exempt of
regressions, hence I decided to push it as soon as possible so it can
receive more testing before 1.11.0. Please read the full commit message
in SVN to see what changed, instead of just the CIA version.
A changelog entry will be coming eventually, just shortly before 1.11.0
in order to give me time to finalize many other ongoing and pending changes.
Overall changes:
* Moved most of the GUI1-dealing code to manager_ui.?pp, and rewrote
substantial parts of it for better code cohesion.
* The Get Add-ons and Update Add-ons dialog share most of their code, so
they are effectively one and the same now.
* The behavior of the add-ons dependencies resolution code has changed;
broken dependencies (i.e. add-ons not found in the server) are
reported properly, and the base dependant is always downloaded _before_
its dependencies.
* The add-ons menu dialog no longer has the trivial description text
taking up space above the Filter box.
* When only displaying add-ons that can be upgraded, there is now a
Description button as usual, and add-ons with .pbl information or
lacking _info.cfg data are exempt from listing.
* The underpinnings of an add-on status classification (i.e. installed,
installed+outdated, installed+upgradable, broken, not tracked) have
begun to appear, and will be used for improving the add-ons menu and
later implementing more dependency tiers (required, recommended,
conflicts) in both server and client side.
* Some translatable strings were changed along the way.
* Add-ons are now always sorted by their ids (not titles, though)
thanks to the introduction of a parsed add-ons list generated from
the server's WML reply. This should help eliminate upload races
traditionally occuring when an add-ons server instance in wesnoth.org
has been newly started.
* Some codepaths (check_whether_overwrite() and addon_dependencies_met()
in particular) were greatly improved with more proper usage of our
available infrastructure, and the C++ language itself. Furthermore,
checking whether an add-on is already installed is not a costly
operation anymore and it's implemented by a unique function instead
of several algorithms scattered throughout everywhere.
Known problems:
* The GUI2 codepath is entirely orphaned and I'll evaluate later
whether to reconcile it or replace it entirely with a new
experimental GUI2 front-end. This means --new-widgets has no effect
on the Add-ons Manager code anymore, for now.
* The GUI2 Uninstall Add-ons dialog is still in the original code unit
and needs to be moved soon.
* Some code (such as the add-on status tracking code) will be
refactored further later.
* Quite a few TODOs and FIXMEs still exist, or were newly introduced
with this.
* It needs to become about 20% cooler at a minimum before 1.11.0.
* Recursive dependency tree handling may need further testing.
...type representation of add-on type identifiers
This involves a rather C-ish approach I don't really like, using a
constant table of strings with fixed positions that can be translated to
enum members. I'm open to alternatives.
Also introduced a get_addon_type_string() function that will be used by
the new add-ons manager code for a short while.
* It can now store dependency lists that can be recursively resolved
into full trees, fixing circular and self-refering dependencies if
necessary.
* It now stores its own add-on id.
* It now allows for retrieving a "fixed" version of the icon field with
the habitual fix-ups for broken add-on icons (a placeholder image in
debug mode, TC for unit baseframes without image path functions);
this is used by GUI front-ends.