changeset 18621:4389c685b64d draft

(svn r23468) -Feature [FS#4827]: when looking for missing content, automatically select it so you can easily start the download
author yexo <yexo@openttd.org>
date Sat, 10 Dec 2011 00:01:28 +0000
parents 3a5946c8e952
children d2339f4988df
files src/network/network_content_gui.cpp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -258,6 +258,7 @@
 	static GUIContentList::SortFunction * const sorter_funcs[];   ///< Sorter functions
 	static GUIContentList::FilterFunction * const filter_funcs[]; ///< Filter functions.
 	GUIContentList content;      ///< List with content
+	bool auto_select;            ///< Automatically select all content when the meta-data becomes available
 
 	const ContentInfo *selected; ///< The selected content info
 	int list_pos;                ///< Our position in the list
@@ -374,7 +375,8 @@
 	NetworkContentListWindow(const WindowDesc *desc, bool select_all) :
 			QueryStringBaseWindow(EDITBOX_MAX_SIZE),
 			selected(NULL),
-			list_pos(0)
+			list_pos(0),
+			auto_select(select_all)
 	{
 		this->CreateNestedTree(desc);
 		this->vscroll = this->GetScrollbar(NCLWW_SCROLLBAR);
@@ -760,6 +762,7 @@
 
 	virtual void OnReceiveContentInfo(const ContentInfo *rci)
 	{
+		if (this->auto_select && !rci->IsSelected()) _network_content_client.ToggleSelectedState(rci);
 		this->content.ForceRebuild();
 		this->InvalidateData();
 	}