Mercurial > hg > openttd
changeset 18620:3a5946c8e952 draft
(svn r23467) -Feature [FS#4827]: automatically close the online content window after confirming the download with 'ok'
author | yexo <yexo@openttd.org> |
---|---|
date | Fri, 09 Dec 2011 22:44:06 +0000 |
parents | 886ef2ebaf49 |
children | 4389c685b64d |
files | src/network/network_content_gui.cpp |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -197,8 +197,14 @@ virtual void OnClick(Point pt, int widget, int click_count) { if (widget == NCDSWW_CANCELOK) { - if (this->downloaded_bytes != this->total_bytes) _network_content_client.Close(); - delete this; + if (this->downloaded_bytes != this->total_bytes) { + _network_content_client.Close(); + delete this; + } else { + /* If downloading succeeded, close the online content window. This will close + * the current window as well. */ + DeleteWindowById(WC_NETWORK_WINDOW, 1); + } } }