summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-12-10 00:01:28 +0000
committeryexo <yexo@openttd.org>2011-12-10 00:01:28 +0000
commite2a9dd1b0a0bb89e6121fbd860f1a7cdf023b8f4 (patch)
treea2bbe91f475997f5e1b61a90bb6068f0bb9349ef
parente31ed7db25dee59cb6df2bacab36a6d77ce400e1 (diff)
downloadopenttd-e2a9dd1b0a0bb89e6121fbd860f1a7cdf023b8f4.tar.xz
(svn r23468) -Feature [FS#4827]: when looking for missing content, automatically select it so you can easily start the download
-rw-r--r--src/network/network_content_gui.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 740b4bada..c91a66900 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -258,6 +258,7 @@ class NetworkContentListWindow : public QueryStringBaseWindow, ContentCallback {
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 @@ public:
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 @@ public:
virtual void OnReceiveContentInfo(const ContentInfo *rci)
{
+ if (this->auto_select && !rci->IsSelected()) _network_content_client.ToggleSelectedState(rci);
this->content.ForceRebuild();
this->InvalidateData();
}