Reopen addon install dialog after installing one.

(patch #1152).
This commit is contained in:
Mark de Wever 2009-04-04 16:29:04 +00:00
parent e919aa2bcb
commit 4265fdbea9
4 changed files with 20 additions and 3 deletions

View file

@ -60,6 +60,8 @@ Version 1.7.0-svn:
special
* Fix missing faction column when waiting that the host start the game,
plus some other unwanted changes there (bug #13243)
* Making the game return to the add-on install dialog just before
installing one, and with its entry selected
* WML Engine:
* Added [show_objectives] tag (part of bug #13042)
* Made moveto events set $x2,$y2 to the source hex. (bug #13140)

View file

@ -863,6 +863,11 @@
[entry]
name = "Miguel Zapico (elricz)"
[/entry]
[entry]
name = "Pablo J. Urbano Santos (Lord Ork)"
wikiuser = "Lord Ork"
email = "asqueados_AT_gmail.com"
[/entry]
[entry]
name = "Paul Smedley (Creeping)"
[/entry]

View file

@ -27,6 +27,9 @@ Version 1.7.0-svn:
* User interface:
* Fix missing faction column when waiting that the host start the game.
* Making the game return to the add-on install dialog just before
installing one, and with its entry selected.
Version 1.6:
* Graphics:

View file

@ -869,7 +869,8 @@ namespace {
msg_dlg.show();
}
void download_addons(game_display& disp, std::string remote_host, bool update_mode, bool* do_refresh)
void download_addons(game_display& disp, std::string remote_host,
bool update_mode, bool* do_refresh, int old_index = 0)
{
const std::vector<std::string> address_components =
utils::split(remote_host, ':');
@ -1034,6 +1035,9 @@ namespace {
gui::filter_textbox* filter = new gui::filter_textbox(disp.video(),
_("Filter: "), options, options_to_filter, 1, addon_dialog, 300);
addon_dialog.set_textbox(filter);
// Scroll the menu to the previous selection
addon_menu->move_selection(old_index);
index = addon_dialog.show();
index = filter->get_index(index);
@ -1057,10 +1061,13 @@ namespace {
return;
}
// Handle download
// Handle download
install_addon(disp, * addons_tree, addons[index], titles[index], types[index],
uploads[index], versions[index], net_manager, sock, do_refresh);
// Show the dialog again, and position it on the same item installed
download_addons(disp, remote_host, update_mode, do_refresh, index);
} catch(config::error& e) {
ERR_CFG << "config::error thrown during transaction with add-on server; \""<< e.message << "\"\n";
gui::show_error_message(disp, _("Network communication error."));
@ -1072,7 +1079,7 @@ namespace {
gui::show_error_message(disp, _("A problem occurred when trying to create the files necessary to install this add-on."));
} catch(twml_exception& e) {
e.show(disp);
}
}
}
void uninstall_local_addons(game_display& disp, bool* should_reload_cfg)