diff options
author | rubidium <rubidium@openttd.org> | 2009-03-19 17:56:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-03-19 17:56:45 +0000 |
commit | f5cb1873d60f578fda759dfd8e4727b37820d619 (patch) | |
tree | 662d3480797caa08748edd04e6bfdccbf61c3ccb /src/network/network_content_gui.cpp | |
parent | 6dd04a9a7804e0d4cecb74dc88dab1fd8c8382a6 (diff) | |
download | openttd-f5cb1873d60f578fda759dfd8e4727b37820d619.tar.xz |
(svn r15766) -Fix [FS#2744]: Crash when opening the content list window twice; inconsistencies when clicking download twice.
Diffstat (limited to 'src/network/network_content_gui.cpp')
-rw-r--r-- | src/network/network_content_gui.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 1e052fb79..73c1be9b9 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -95,7 +95,7 @@ public: /* Yes... these are the NewGRF windows */ InvalidateWindowClasses(WC_SAVELOAD); InvalidateWindowData(WC_GAME_OPTIONS, 0, 1); - InvalidateWindowData(WC_NETWORK_WINDOW, 0, 2); + InvalidateWindowData(WC_NETWORK_WINDOW, 1, 2); break; case CONTENT_TYPE_SCENARIO: @@ -319,7 +319,7 @@ public: * Create the content list window. * @param desc the window description to pass to Window's constructor. */ - NetworkContentListWindow(const WindowDesc *desc, bool select_all) : QueryStringBaseWindow(EDITBOX_MAX_SIZE, desc), selected(NULL), list_pos(0) + NetworkContentListWindow(const WindowDesc *desc, bool select_all) : QueryStringBaseWindow(EDITBOX_MAX_SIZE, desc, 1), selected(NULL), list_pos(0) { ttd_strlcpy(this->edit_str_buf, "", this->edit_str_size); this->afilter = CS_ALPHANUMERAL; @@ -383,7 +383,7 @@ public: } } - this->SetWidgetDisabledState(NCLWW_DOWNLOAD, filesize == 0); + this->SetWidgetDisabledState(NCLWW_DOWNLOAD, filesize == 0 || FindWindowById(WC_NETWORK_STATUS_WINDOW, 0) != NULL); this->SetWidgetDisabledState(NCLWW_UNSELECT, filesize == 0); this->SetWidgetDisabledState(NCLWW_SELECT_ALL, !show_select_all); this->SetWidgetDisabledState(NCLWW_SELECT_UPDATE, !show_select_upgrade); @@ -594,7 +594,7 @@ public: break; case NCLWW_DOWNLOAD: - new NetworkContentDownloadStatusWindow(); + if (BringWindowToFrontById(WC_NETWORK_STATUS_WINDOW, 0) == NULL) new NetworkContentDownloadStatusWindow(); break; } } @@ -782,6 +782,7 @@ void ShowNetworkContentListWindow(ContentVector *cv, ContentType type) _network_content_client.RequestContentList(cv, true); } + DeleteWindowById(WC_NETWORK_WINDOW, 1); new NetworkContentListWindow(&_network_content_list_desc, cv != NULL); #else ShowErrorMessage(STR_CONTENT_NO_ZLIB_SUB, STR_CONTENT_NO_ZLIB, 0, 0); |