(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
This commit is contained in:
@@ -91,20 +91,20 @@ static const NWidgetPart _nested_network_content_download_status_window_widgets[
|
||||
};
|
||||
|
||||
/** Window description for the download window */
|
||||
static const WindowDesc _network_content_download_status_window_desc(
|
||||
static WindowDesc _network_content_download_status_window_desc(
|
||||
WDP_CENTER, 0, 0,
|
||||
WC_NETWORK_STATUS_WINDOW, WC_NONE,
|
||||
WDF_MODAL,
|
||||
_nested_network_content_download_status_window_widgets, lengthof(_nested_network_content_download_status_window_widgets)
|
||||
);
|
||||
|
||||
BaseNetworkContentDownloadStatusWindow::BaseNetworkContentDownloadStatusWindow(const WindowDesc *desc) :
|
||||
cur_id(UINT32_MAX)
|
||||
BaseNetworkContentDownloadStatusWindow::BaseNetworkContentDownloadStatusWindow(WindowDesc *desc) :
|
||||
Window(desc), cur_id(UINT32_MAX)
|
||||
{
|
||||
_network_content_client.AddCallback(this);
|
||||
_network_content_client.DownloadSelectedContent(this->total_files, this->total_bytes);
|
||||
|
||||
this->InitNested(desc, WN_NETWORK_STATUS_WINDOW_CONTENT_DOWNLOAD);
|
||||
this->InitNested(WN_NETWORK_STATUS_WINDOW_CONTENT_DOWNLOAD);
|
||||
}
|
||||
|
||||
BaseNetworkContentDownloadStatusWindow::~BaseNetworkContentDownloadStatusWindow()
|
||||
@@ -472,15 +472,16 @@ public:
|
||||
* @param desc the window description to pass to Window's constructor.
|
||||
* @param select_all Whether the select all button is allowed or not.
|
||||
*/
|
||||
NetworkContentListWindow(const WindowDesc *desc, bool select_all) :
|
||||
NetworkContentListWindow(WindowDesc *desc, bool select_all) :
|
||||
Window(desc),
|
||||
auto_select(select_all),
|
||||
filter_editbox(EDITBOX_MAX_SIZE),
|
||||
selected(NULL),
|
||||
list_pos(0)
|
||||
{
|
||||
this->CreateNestedTree(desc);
|
||||
this->CreateNestedTree();
|
||||
this->vscroll = this->GetScrollbar(WID_NCL_SCROLLBAR);
|
||||
this->FinishInitNested(desc, WN_NETWORK_WINDOW_CONTENT_LIST);
|
||||
this->FinishInitNested(WN_NETWORK_WINDOW_CONTENT_LIST);
|
||||
|
||||
this->GetWidget<NWidgetStacked>(WID_NCL_SEL_ALL_UPDATE)->SetDisplayedPlane(select_all);
|
||||
|
||||
@@ -1031,7 +1032,7 @@ static const NWidgetPart _nested_network_content_list_widgets[] = {
|
||||
};
|
||||
|
||||
/** Window description of the content list */
|
||||
static const WindowDesc _network_content_list_desc(
|
||||
static WindowDesc _network_content_list_desc(
|
||||
WDP_CENTER, 630, 460,
|
||||
WC_NETWORK_WINDOW, WC_NONE,
|
||||
0,
|
||||
|
Reference in New Issue
Block a user