addon/mg: Include Update All on all views and enable it when applicable

This makes it so the Update All button appears on all views, disabled by
default unless there is at least one ADDON_INSTALLED_UPGRADABLE add-on.

The rationale for this is that with the Update Add-ons shortcut in the
Connect dialog gone, the possibility of upgrading installed add-ons is
not as visible as it was in versions 1.5.3 through 1.10.x. Making the
button visible at all times should hint at the existence of this
functionality.
This commit is contained in:
Ignacio R. Morelle 2014-07-06 18:31:22 -04:00
parent b0378981f5
commit c895105a70
4 changed files with 24 additions and 7 deletions

View file

@ -14,6 +14,10 @@ The release team should empty this file after each release.
CHANGES
=======
[section="Minor Add-ons Manager improvement"]
Since the Update Add-ons shortcut in the add-ons server connection dialog was removed in version 1.11.0, the Update All (add-ons) functionality became considerably less visible. To address this, the Update All button is now available on all Add-on Manager views, and enabled whenever there is at least one add-on on the list that may be upgraded.
[/section]
[section="Fixed WML load error reporting"]
A change introduced in version 1.11.15 caused WML parser/preprocessor errors found at game/add-on load time to not be reported to the player in the GUI, and the game to carry on with a incomplete and malformed WML tree in most cases. This issue was [url=http://r.wesnoth.org/p571380]reported[/url] on the forums by SkyOne and is fixed in this release.
[/section]

View file

@ -1,4 +1,8 @@
Version 1.11.15+dev:
* Add-ons client:
* The Update All button is now displayed on all Add-on Manager views instead
of just the Upgradable filter view, and enabled only when there is at
least one add-on that may be upgraded.
* Add-ons server:
* Add-on metadata pattern blacklisting implemented.
* Campaigns

View file

@ -3,6 +3,11 @@ changes may be omitted). For a complete list of changes, see the main
changelog: https://github.com/wesnoth/wesnoth/blob/1.12/changelog
Version 1.11.15+dev:
* Add-ons client:
* The Update All button is now displayed on all Add-on Manager views instead
of just the Upgradable filter view, and enabled only when there is at
least one add-on that may be upgraded.
* Campaigns:
* Northern Rebirth:
* Fixed Sister Thera and Father Morvin respawning into the recall list if

View file

@ -602,6 +602,8 @@ void show_addons_manager_dialog(display& disp, addons_client& client, addons_lis
const sorted_addon_pointer_list& sorted_addons = sort_addons_list(addons, filter.sort, filter.direction);
bool have_upgradable_addons = false;
BOOST_FOREACH(const sorted_addon_pointer_list::value_type& sorted_entry, sorted_addons) {
const addons_list::value_type& entry = *sorted_entry;
const addon_info& addon = entry.second;
@ -616,6 +618,10 @@ void show_addons_manager_dialog(display& disp, addons_client& client, addons_lis
)
continue;
if(state == ADDON_INSTALLED_UPGRADABLE) {
have_upgradable_addons = true;
}
option_ids.push_back(addon.id);
if(tracking[addon.id].can_publish) {
@ -774,12 +780,10 @@ void show_addons_manager_dialog(display& disp, addons_client& client, addons_lis
_("Description"), gui::button::TYPE_PRESS, gui::CONTINUE_DIALOG, &description_helper);
dlg.add_button(description_button, gui::dialog::BUTTON_EXTRA);
gui::dialog_button* update_all_button = NULL;
if(updates_only) {
update_all_button = new gui::dialog_button(disp.video(), _("Update All"),
gui::button::TYPE_PRESS, update_all_value);
dlg.add_button(update_all_button, gui::dialog::BUTTON_EXTRA);
}
gui::dialog_button* update_all_button = new gui::dialog_button(disp.video(), _("Update All"),
gui::button::TYPE_PRESS, update_all_value);
update_all_button->enable(have_upgradable_addons);
dlg.add_button(update_all_button, gui::dialog::BUTTON_EXTRA);
filter_options_action filter_opts_helper(disp.video(), filter);
gui::dialog_button* filter_opts_button = new gui::dialog_button(disp.video(),
@ -818,7 +822,7 @@ void show_addons_manager_dialog(display& disp, addons_client& client, addons_lis
filter.keywords = filter_box->text();
}
const bool update_everything = updates_only && result == update_all_value;
const bool update_everything = result == update_all_value;
if(result < 0 && !(update_everything || filter.changed)) {
// User canceled the dialog.