Index: src/settings.cpp
===================================================================
--- src/settings.cpp	(revision 14572)
+++ src/settings.cpp	(working copy)
@@ -1458,7 +1458,16 @@
 	 SDTC_BOOL(gui.show_track_reservation,               S,  0, false,                        STR_CONFIG_PATCHES_SHOW_TRACK_RESERVATION,      RedrawScreen),
 	  SDTC_VAR(gui.default_signal_type,       SLE_UINT8, S, MS,     0,        0,        2, 1, STR_CONFIG_PATCHES_DEFAULT_SIGNAL_TYPE,         NULL),
 	  SDTC_VAR(gui.cycle_signal_types,        SLE_UINT8, S, MS,     0,        0,        2, 1, STR_CONFIG_PATCHES_CYCLE_SIGNAL_TYPES,          NULL),
-
+	SDTC_BOOL(gui.persistant_buildtools,                 S,  0, false,                        STR_CONFIG_PATCHES_PERSISTANT_BUILDTOOLS,       NULL),
+	SDTC_BOOL(gui.auto_screenshot,                      S,  0, false,                        STR_CONFIG_PATCHES_AUTO_GIANT_SCREEN,           NULL),
+	SDTC_VAR(gui.auto_screenshot_interval, SLE_UINT16, S,  0,    15,        1,     1000, 1, STR_CONFIG_PATCHES_AUTO_GIANT_SCREEN_INTERVAL,  NULL),
+	SDTC_VAR(gui.auto_screenshot_zoomlvl,   SLE_UINT8, S, MS,     0,        0,        3, 1, STR_CONFIG_PATCHES_AUTO_GIANT_SCREEN_ZOOMLVL,   NULL),
+	SDTC_BOOL(gui.auto_local_screen,                    S,  0, false,                        STR_CONFIG_PATCHES_AUTO_LOCAL_SCREEN,           NULL),
+	SDTC_VAR(gui.auto_local_screen_interval,SLE_UINT16,S,  0,    15,        1,     1000, 1, STR_CONFIG_PATCHES_AUTO_LOCAL_SCREEN_INTERVAL,  NULL),
+	SDTC_VAR(gui.auto_local_screen_zoomlvl, SLE_UINT8, S, MS,     0,        0,        3, 1, STR_CONFIG_PATCHES_AUTO_LOCAL_SCREEN_ZOOMLVL,   NULL),
+	SDTC_VAR(gui.auto_local_screen_size_x, SLE_UINT16, S,  0,   800,      100,     8000, 1, STR_NULL,                                       NULL),
+	SDTC_VAR(gui.auto_local_screen_size_y, SLE_UINT16, S,  0,   600,      100,     6000, 1, STR_NULL,                                       NULL),
+	
 	  SDTC_VAR(gui.console_backlog_timeout,  SLE_UINT16, S,  0,   100,       10,    65500, 0, STR_NULL,                                       NULL),
 	  SDTC_VAR(gui.console_backlog_length,   SLE_UINT16, S,  0,   100,       10,    65500, 0, STR_NULL,                                       NULL),
 #ifdef ENABLE_NETWORK
Index: src/bridge_gui.cpp
===================================================================
--- src/bridge_gui.cpp	(revision 14572)
+++ src/bridge_gui.cpp	(working copy)
@@ -22,6 +22,8 @@
 
 #include "table/strings.h"
 
+BridgeType _last_bridge_type = 0;
+
 /**
  * Carriage for the data we need if we want to build a bridge
  */
@@ -93,6 +95,7 @@
 
 	void BuildBridge(uint8 i)
 	{
+		_last_bridge_type = this->bridges->Get(i)->index;
 		DoCommandP(this->end_tile, this->start_tile, this->type | this->bridges->Get(i)->index,
 				CcBuildBridge, CMD_BUILD_BRIDGE | CMD_MSG(STR_5015_CAN_T_BUILD_BRIDGE_HERE));
 	}
@@ -286,6 +289,16 @@
 	 *     14..8 = road/rail types,
 	 *      7..0 = type of bridge */
 	uint32 type = (transport_type << 15) | (road_rail_type << 8);
+	
+	/* If Ctrl is being pressed, check wether the last bridge built is available 
+	 * If so, return this bridge type. Otherwise continue normally
+	 */
+	const uint bridge_len = GetTunnelBridgeLength(start, end);
+	if ( (_ctrl_pressed) && (CheckBridge_Stuff(_last_bridge_type, bridge_len))) {
+		DoCommandP(end, start, type | _last_bridge_type, CcBuildBridge,
+					CMD_BUILD_BRIDGE | CMD_MSG(STR_5015_CAN_T_BUILD_BRIDGE_HERE));
+		return;
+	}
 
 	/* only query bridge building possibility once, result is the same for all bridges!
 	 * returns CMD_ERROR on failure, and price on success */
@@ -298,9 +311,9 @@
 	} else {
 		/* check which bridges can be built
 		 * get absolute bridge length
-		 * length of the middle parts of the bridge */
-		const uint bridge_len = GetTunnelBridgeLength(start, end);
-		/* total length of bridge */
+		 * length of the middle parts of the bridge.
+		 *
+		 * total length of bridge */
 		const uint tot_bridgedata_len = CalcBridgeLenCostFactor(bridge_len + 2);
 
 		bl = new GUIBridgeList();
Index: src/console_gui.cpp
===================================================================
--- src/console_gui.cpp	(revision 14572)
+++ src/console_gui.cpp	(working copy)
@@ -153,7 +153,6 @@
 	IConsoleWindow(const WindowDesc *desc) : Window(desc)
 	{
 		_iconsole_mode = ICONSOLE_OPENED;
-		SetBit(_no_scroll, SCROLL_CON); // override cursor arrows; the gamefield will not scroll
 
 		this->height = _screen.height / 3;
 		this->width  = _screen.width;
@@ -162,7 +161,6 @@
 	~IConsoleWindow()
 	{
 		_iconsole_mode = ICONSOLE_CLOSED;
-		ClrBit(_no_scroll, SCROLL_CON);
 	}
 
 	virtual void OnPaint()
@@ -183,7 +181,7 @@
 
 		DoDrawString(_iconsole_cmdline.buf, 10 + delta, this->height - ICON_LINE_HEIGHT, CC_COMMAND);
 
-		if (_iconsole_cmdline.caret) {
+		if (_focused_window == this && _iconsole_cmdline.caret) {
 			DoDrawString("_", 10 + delta + _iconsole_cmdline.caretxoffs, this->height - ICON_LINE_HEIGHT, TC_WHITE);
 		}
 	}
Index: src/toolbar_gui.cpp
===================================================================
--- src/toolbar_gui.cpp	(revision 14572)
+++ src/toolbar_gui.cpp	(working copy)
@@ -1022,7 +1022,7 @@
 	}
 
 	virtual EventState OnKeyPress(uint16 key, uint16 keycode)
-	{
+	{ 
 		switch (keycode) {
 			case WKC_F1: case WKC_PAUSE: ToolbarPauseClick(this); break;
 			case WKC_F2: ShowGameOptions(); break;
@@ -1057,6 +1057,7 @@
 			case WKC_CTRL  | 'S': MenuClickSmallScreenshot(); break;
 			case WKC_CTRL  | 'G': MenuClickWorldScreenshot(); break;
 			case WKC_CTRL | WKC_ALT | 'C': if (!_networking) ShowCheatWindow(); break;
+			case WKC_CTRL | 'L': ShowSignList(); break;
 			case 'A': if (CanBuildVehicleInfrastructure(VEH_TRAIN)) ShowBuildRailToolbar(_last_built_railtype, 4); break; // Invoke Autorail
 			case 'L': ShowTerraformToolbar(); break;
 			case 'M': ShowSmallMap(); break;
Index: src/lang/english.txt
===================================================================
--- src/lang/english.txt	(revision 14572)
+++ src/lang/english.txt	(working copy)
@@ -1142,6 +1142,7 @@
 STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_LAST                       :Last available
 STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MOST_USED                  :Most used
 STR_CONFIG_PATCHES_SHOW_TRACK_RESERVATION                       :{LTBLUE}Show reserved tracks: {ORANGE}{STRING1}
+STR_CONFIG_PATCHES_PERSISTANT_BUILDTOOLS                        :{LTBLUE}Keep build tools active after usage: {ORANGE}{STRING1}
 
 STR_CONFIG_PATCHES_ALWAYS_BUILD_INFRASTRUCTURE                  :{LTBLUE}Show building tools when no suitable vehicles are available: {ORANGE}{STRING1}
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Max trains per player: {ORANGE}{STRING1}
@@ -1211,6 +1212,20 @@
 STR_CONFIG_PATCHES_LARGER_TOWNS_DISABLED                        :{LTBLUE}Proportion of towns that will become cities: {ORANGE}None
 STR_CONFIG_PATCHES_CITY_SIZE_MULTIPLIER                         :{LTBLUE}Initial city size multiplier: {ORANGE}{STRING1}
 STR_CONFIG_MODIFIED_ROAD_REBUILD                                :{LTBLUE}Remove absurd road-elements during the road construction
+STR_CONFIG_PATCHES_AUTO_GIANT_SCREEN                            :{LTBLUE}Automatically take giant screenshots: {ORANGE}{STRING1}
+STR_CONFIG_PATCHES_AUTO_GIANT_SCREEN_INTERVAL                   :{LTBLUE}Interval for automatic giant screenshots: {ORANGE}{STRING1} day(s)
+STR_CONFIG_PATCHES_AUTO_GIANT_SCREEN_ZOOMLVL                    :{LTBLUE}Zoom level for automatic giant screenshots: {ORANGE}{STRING1}
+STR_CONFIG_PATCHES_AUTO_GIANT_SCREEN_ZOOMLVL_NORMAL             :Normal
+STR_CONFIG_PATCHES_AUTO_GIANT_SCREEN_ZOOMLVL_2X                 :2x
+STR_CONFIG_PATCHES_AUTO_GIANT_SCREEN_ZOOMLVL_4X                 :4x
+STR_CONFIG_PATCHES_AUTO_GIANT_SCREEN_ZOOMLVL_8X                 :8x
+STR_CONFIG_PATCHES_AUTO_LOCAL_SCREEN                            :{LTBLUE}Automatically take local screenshots (use signs with #): {ORANGE}{STRING1}
+STR_CONFIG_PATCHES_AUTO_LOCAL_SCREEN_INTERVAL                   :{LTBLUE}Interval for automatic local screenshots: {ORANGE}{STRING1} day(s)
+STR_CONFIG_PATCHES_AUTO_LOCAL_SCREEN_ZOOMLVL                    :{LTBLUE}Zoom level for automatic local screenshots: {ORANGE}{STRING1}
+STR_CONFIG_PATCHES_AUTO_LOCAL_SCREEN_ZOOMLVL_NORMAL             :Normal
+STR_CONFIG_PATCHES_AUTO_LOCAL_SCREEN_ZOOMLVL_2X                 :2x
+STR_CONFIG_PATCHES_AUTO_LOCAL_SCREEN_ZOOMLVL_4X                 :4x
+STR_CONFIG_PATCHES_AUTO_LOCAL_SCREEN_ZOOMLVL_8X                 :8x
 
 STR_CONFIG_PATCHES_GUI                                          :{BLACK}Interface
 STR_CONFIG_PATCHES_CONSTRUCTION                                 :{BLACK}Construction
@@ -2376,8 +2391,12 @@
 STR_7070_BUILD_COMPANY_HEADQUARTERS                             :{BLACK}Build company headquarters / view company headquarters
 STR_RELOCATE_COMPANY_HEADQUARTERS                               :{BLACK}Rebuild company headquarters elsewhere for 1% cost of company value
 STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS                       :{WHITE}Can't build company headquarters...
+STR_COMPANY_CENTER_VIEWPORT                                     :{BLACK}Center viewport to place where company built last time
+STR_COMPANY_OPEN_VIEWPORT                                       :{BLACK}Open new viewport to watch company's actions
 STR_7072_VIEW_HQ                                                :{BLACK}View HQ
 STR_RELOCATE_HQ                                                 :{BLACK}Relocate HQ
+STR_COMPANY_CENTER                                              :{BLACK}Center view
+STR_COMPANY_OPEN                                                :{BLACK}Open window
 STR_COMPANY_PASSWORD                                            :{BLACK}Password
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Password-protect your company to prevent unauthorised users from joining.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Set company password
@@ -3209,6 +3228,7 @@
 STR_NEWGRF_TIP                                                  :{BLACK}A list of all the Newgrf sets that you have installed. Click a set to change the settings
 STR_NEWGRF_NO_FILES_INSTALLED                                   :{BLACK}There are currently no newgrf files installed! Please refer to the manual for instructions on installing new graphics
 STR_NEWGRF_FILENAME                                             :{BLACK}Filename: {SILVER}{RAW_STRING}
+STR_NEWGRF_NAME                                                 :{BLACK}Name: {SILVER}{RAW_STRING}
 STR_NEWGRF_PALETTE                                              :{BLACK}Palette: {SILVER}{RAW_STRING}
 STR_NEWGRF_GRF_ID                                               :{BLACK}GRF ID: {SILVER}{RAW_STRING}
 STR_NEWGRF_MD5SUM                                               :{BLACK}MD5sum: {SILVER}{RAW_STRING}
@@ -3242,19 +3262,23 @@
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Add a NewGRF file to the list
 STR_NEWGRF_REMOVE                                               :{BLACK}Remove
 STR_NEWGRF_REMOVE_TIP                                           :{BLACK}Remove the selected NewGRF file from the list
-STR_NEWGRF_MOVEUP                                               :{BLACK}Move Up
+STR_NEWGRF_JOINT_ADD                                            :{BLACK}>>
+STR_NEWGRF_JOINT_REMOVE                                         :{BLACK}<<
+STR_NEWGRF_TOGGLE_SHOW                                          :{BLACK}Disp. Mode
+STR_NEWGRF_TOGGLE_SHOW_TIP                                      :{BLACK}Toggles filtering of already selected grfs in the left list. Ctrl-click toggles show file names in stead of grf names.
 STR_NEWGRF_MOVEUP_TIP                                           :{BLACK}Move the selected NewGRF file up the list
-STR_NEWGRF_MOVEDOWN                                             :{BLACK}Move Down
+STR_NEWGRF_MOVEUP                                               :{BLACK}Up
+STR_NEWGRF_MOVEDOWN                                             :{BLACK}Down
 STR_NEWGRF_MOVEDOWN_TIP                                         :{BLACK}Move the selected NewGRF file down the list
 STR_NEWGRF_FILE_TIP                                             :{BLACK}A list of the NewGRF files that are installed. Click a file to change its parameters
 STR_NEWGRF_PARAMETER                                            :{BLACK}Parameters: {SILVER}{STRING1}
 STR_NEWGRF_PARAMETER_QUERY                                      :{BLACK}Enter NewGRF parameters
 STR_NEWGRF_NO_INFO                                              :{BLACK}No information available
 
-STR_NEWGRF_ADD_CAPTION                                          :{WHITE}Available NewGRF files
+STR_NEWGRF_ADD_CAPTION                                          :{WHITE}Available NewGRFs
 STR_NEWGRF_ADD_FILE                                             :{BLACK}Add to selection
 STR_NEWGRF_ADD_FILE_TIP                                         :{BLACK}Add the selected NewGRF file to your configuration
-STR_NEWGRF_RESCAN_FILES                                         :{BLACK}Rescan files
+STR_NEWGRF_RESCAN_FILES                                         :{BLACK}Rescan
 STR_NEWGRF_RESCAN_FILES_TIP                                     :{BLACK}Update the list of available NewGRF files
 STR_NEWGRF_DUPLICATE_GRFID                                      :{WHITE}Cannot add file: duplicate GRF ID
 
@@ -3564,6 +3588,12 @@
 
 ########
 
+#### GUI list filter 
+STR_FILTER                                                      :{BLACK}Filter
+STR_FILTER_OSKTITLE                                             :{BLACK}Enter a filter string
+STR_FILTER_CLEAR                                                :{BLACK}Clear filter
+########
+
 STR_FUND_NEW_INDUSTRY                                           :{BLACK}Fund
 STR_PROSPECT_NEW_INDUSTRY                                       :{BLACK}Prospect
 STR_BUILD_NEW_INDUSTRY                                          :{BLACK}Build
Index: src/settings_gui.cpp
===================================================================
--- src/settings_gui.cpp	(revision 14572)
+++ src/settings_gui.cpp	(working copy)
@@ -614,6 +614,13 @@
 	"gui.default_rail_type",
 	"gui.always_build_infrastructure",
 	"gui.show_track_reservation",
+	"gui.persistant_buildtools",
+	"gui.auto_screenshot",
+	"gui.auto_screenshot_interval",
+	"gui.auto_screenshot_zoomlvl",
+	"gui.auto_local_screen",
+	"gui.auto_local_screen_interval",
+	"gui.auto_local_screen_zoomlvl",
 };
 
 static const char *_patches_construction[] = {
Index: src/genworld_gui.cpp
===================================================================
--- src/genworld_gui.cpp	(revision 14572)
+++ src/genworld_gui.cpp	(working copy)
@@ -251,13 +251,14 @@
 	char name[64];
 	glwp_modes mode;
 
-	GenerateLandscapeWindow(const WindowDesc *desc, WindowNumber number = 0) : QueryStringBaseWindow(11, desc, number)
+	GenerateLandscapeWindow(const WindowDesc *desc, WindowNumber number = 0) : QueryStringBaseWindow(11, desc, 0, 0, number)
 	{
 		this->LowerWidget(_settings_newgame.game_creation.landscape + GLAND_TEMPERATE);
 
 		/* snprintf() always outputs trailing '\0', so whole buffer can be used */
 		snprintf(this->edit_str_buf, this->edit_str_size, "%u", _settings_newgame.game_creation.generation_seed);
 		InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, 120);
+		this->SetFocusedWidget(GLAND_RANDOM_EDITBOX);
 		this->caption = STR_NULL;
 		this->afilter = CS_NUMERAL;
 
@@ -373,10 +374,6 @@
 				this->SetDirty();
 				break;
 
-			case GLAND_RANDOM_EDITBOX: // edit box for random seed
-				ShowOnScreenKeyboard(this, GLAND_RANDOM_EDITBOX, 0, 0);
-				break;
-
 			case GLAND_GENERATE_BUTTON: // Generate
 				_settings_game = _settings_newgame;
 
Index: src/misc_gui.cpp
===================================================================
--- src/misc_gui.cpp	(revision 14572)
+++ src/misc_gui.cpp	(working copy)
@@ -960,8 +960,28 @@
 	return false;
 }
 
+bool QueryString::HasEditBoxFocus(Window *w, int wid) const
+{
+	if (w->window_class == WC_OSK) {
+		if (_focused_window == w->parent &&
+				w->parent->focused_widget &&
+				w->parent->focused_widget->type == WWT_EDITBOX) {
+			return true;
+		}
+	}
+	if (w->IsWidgetGlobalyFocused(wid)) {
+		return true;
+	}
+
+	return false;
+}
+
 HandleEditBoxResult QueryString::HandleEditBoxKey(Window *w, int wid, uint16 key, uint16 keycode, Window::EventState &state)
 {
+	if (!QueryString::HasEditBoxFocus(w, wid)) {
+		return HEBR_NOT_FOCUSED;
+	}
+
 	state = Window::ES_HANDLED;
 
 	switch (keycode) {
@@ -999,7 +1019,7 @@
 
 void QueryString::HandleEditBox(Window *w, int wid)
 {
-	if (HandleCaret(&this->text)) w->InvalidateWidget(wid);
+	if (HasEditBoxFocus(w, wid) && HandleCaret(&this->text)) w->InvalidateWidget(wid);
 }
 
 void QueryString::DrawEditBox(Window *w, int wid)
@@ -1035,12 +1055,12 @@
 	if (tb->caretxoffs + delta < 0) delta = -tb->caretxoffs;
 
 	DoDrawString(tb->buf, delta, 0, TC_YELLOW);
-	if (tb->caret) DoDrawString("_", tb->caretxoffs + delta, 0, TC_WHITE);
+	if (HasEditBoxFocus(w, wid) && tb->caret) DoDrawString("_", tb->caretxoffs + delta, 0, TC_WHITE);
 
 	_cur_dpi = old_dpi;
 }
 
-int QueryStringBaseWindow::HandleEditBoxKey(int wid, uint16 key, uint16 keycode, EventState &state)
+HandleEditBoxResult QueryStringBaseWindow::HandleEditBoxKey(int wid, uint16 key, uint16 keycode, EventState &state)
 {
 	return this->QueryString::HandleEditBoxKey(this, wid, key, keycode, state);
 }
@@ -1055,6 +1075,11 @@
 	this->QueryString::DrawEditBox(this, wid);
 }
 
+void QueryStringBaseWindow::OnOpenOSKWindow(int wid)
+{
+	ShowOnScreenKeyboard(this, wid, 0, 0);
+}
+
 enum QueryStringWidgets {
 	QUERY_STR_WIDGET_TEXT = 3,
 	QUERY_STR_WIDGET_DEFAULT,
@@ -1065,10 +1090,10 @@
 
 struct QueryStringWindow : public QueryStringBaseWindow
 {
-	QueryStringWindow(uint16 size, const WindowDesc *desc, Window *parent) : QueryStringBaseWindow(size, desc)
+	QueryStringWindow(uint16 size, const WindowDesc *desc, Window *parent) : QueryStringBaseWindow(size, desc, QUERY_STR_WIDGET_CANCEL, QUERY_STR_WIDGET_OK)
 	{
 		this->parent = parent;
-		SetBit(_no_scroll, SCROLL_EDIT);
+		this->SetFocusedWidget(QUERY_STR_WIDGET_TEXT);
 
 		this->FindWindowPlacementAndResize(desc);
 	}
@@ -1098,10 +1123,6 @@
 	virtual void OnClick(Point pt, int widget)
 	{
 		switch (widget) {
-			case QUERY_STR_WIDGET_TEXT:
-				ShowOnScreenKeyboard(this, QUERY_STR_WIDGET_TEXT, QUERY_STR_WIDGET_CANCEL, QUERY_STR_WIDGET_OK);
-				break;
-
 			case QUERY_STR_WIDGET_DEFAULT:
 				this->text.buf[0] = '\0';
 				/* Fallthrough */
@@ -1131,10 +1152,16 @@
 			case HEBR_CONFIRM: this->OnOk();
 			/* FALL THROUGH */
 			case HEBR_CANCEL: delete this; break; // close window, abandon changes
+			case HEBR_NOT_FOCUSED: break;
 		}
 		return state;
 	}
 
+	virtual void OnOpenOSKWindow(int wid)
+	{
+		ShowOnScreenKeyboard(this, wid, QUERY_STR_WIDGET_CANCEL, QUERY_STR_WIDGET_OK);
+	}
+
 	~QueryStringWindow()
 	{
 		if (!this->handled && this->parent != NULL) {
@@ -1142,7 +1169,6 @@
 			this->parent = NULL; // so parent doesn't try to delete us again
 			parent->OnQueryTextFinished(NULL);
 		}
-		ClrBit(_no_scroll, SCROLL_EDIT);
 	}
 };
 
@@ -1177,7 +1203,6 @@
 void ShowQueryString(StringID str, StringID caption, uint maxsize, uint maxwidth, Window *parent, CharSetFilter afilter, QueryStringFlags flags)
 {
 	DeleteWindowById(WC_QUERY_STRING, 0);
-	DeleteWindowById(WC_SAVELOAD, 0);
 
 	QueryStringWindow *w = new QueryStringWindow(maxsize, &_query_string_desc, parent);
 
@@ -1432,7 +1457,7 @@
 		SanitizeFilename(this->edit_str_buf);
 	}
 
-	SaveLoadWindow(const WindowDesc *desc, SaveLoadDialogMode mode) : QueryStringBaseWindow(64, desc)
+	SaveLoadWindow(const WindowDesc *desc, SaveLoadDialogMode mode) : QueryStringBaseWindow(64, desc, 0, 0)
 	{
 		static const StringID saveload_captions[] = {
 			STR_4001_LOAD_GAME,
@@ -1443,7 +1468,6 @@
 		};
 
 		SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, VHM_NONE, WC_MAIN_WINDOW, 0);
-		SetBit(_no_scroll, SCROLL_SAVE);
 
 		/* Use an array to define what will be the current file type being handled
 		 * by current file mode */
@@ -1491,6 +1515,11 @@
 				strecpy(o_dir.name, _personal_dir, lastof(o_dir.name));
 		}
 
+		/* Focus the edit box by default in the save windows */
+		if (_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO) {
+			this->SetFocusedWidget(10);
+		}
+
 		this->vscroll.cap = 10;
 		this->resize.step_width = 2;
 		this->resize.step_height = 10;
@@ -1505,7 +1534,6 @@
 			if (_pause_game >= 0) DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
 		}
 		FiosFreeSavegameList();
-		ClrBit(_no_scroll, SCROLL_SAVE);
 	}
 
 	virtual void OnPaint()
@@ -1599,10 +1627,6 @@
 				break;
 			}
 
-			case 10: // edit box
-				ShowOnScreenKeyboard(this, widget, 0, 0);
-				break;
-
 			case 11: case 12: // Delete, Save game
 				break;
 		}
@@ -1703,7 +1727,6 @@
 
 void ShowSaveLoadDialog(SaveLoadDialogMode mode)
 {
-	DeleteWindowById(WC_QUERY_STRING, 0);
 	DeleteWindowById(WC_SAVELOAD, 0);
 
 	const WindowDesc *sld;
Index: src/smallmap_gui.cpp
===================================================================
--- src/smallmap_gui.cpp	(revision 14572)
+++ src/smallmap_gui.cpp	(working copy)
@@ -1214,7 +1214,7 @@
 	_extra_view_port_widgets,
 };
 
-void ShowExtraViewPortWindow(TileIndex tile)
+int ShowExtraViewPortWindow(TileIndex tile)
 {
 	int i = 0;
 
@@ -1222,6 +1222,8 @@
 	while (FindWindowById(WC_EXTRA_VIEW_PORT, i) != NULL) i++;
 
 	new ExtraViewportWindow(&_extra_view_port_desc, i, tile);
+
+	return i;
 }
 
 bool ScrollMainWindowTo(int x, int y, bool instant)
Index: src/date.cpp
===================================================================
--- src/date.cpp	(revision 14572)
+++ src/date.cpp	(working copy)
@@ -15,6 +15,9 @@
 #include "vehicle_base.h"
 #include "debug.h"
 #include "rail_gui.h"
+#include "screenshot.h"
+#include "transparency.h"
+#include "signs_base.h"
 #ifdef DEBUG_DUMP_COMMANDS
 #include "saveload.h"
 #endif
@@ -234,6 +237,33 @@
 	if (_game_mode != GM_MENU) {
 		InvalidateWindowWidget(WC_STATUS_BAR, 0, 0);
 		EnginesDailyLoop();
+		if (_settings_client.gui.auto_local_screen && (_date % _settings_client.gui.auto_local_screen_interval == 0)) {
+			/* save the current transparency setting */
+			uint8 transparency_backup = _transparency_opt;
+			/* disable transparency for all unlocked transparency settings */
+			_transparency_opt &= _transparency_lock;
+			/* iterate through signs and take local screenshots if appropriate */
+			const Sign *si;
+			FOR_ALL_SIGNS(si) {
+				if (si->name != NULL && *si->name == '#') {
+					SetScreenshotType(SC_TIMELAPSE_LOCAL);
+					MakeScreenshot(si);
+				}
+			}
+			/* reset transparency to the former state */
+			_transparency_opt = transparency_backup;
+		}
+		if (_settings_client.gui.auto_screenshot && (_date % _settings_client.gui.auto_screenshot_interval == 0)) {
+			/* save the current transparency setting */
+			uint8 transparency_backup = _transparency_opt;
+			/* disable transparency for all unlocked transparency settings */
+			_transparency_opt &= _transparency_lock;
+			/* take a giant screenshot */
+			SetScreenshotType(SC_TIMELAPSE);
+			MakeScreenshot();
+			/* reset transparency to the former state */
+			_transparency_opt = transparency_backup;
+		}
 	}
 
 	/* check if we entered a new month? */
Index: src/airport_gui.cpp
===================================================================
--- src/airport_gui.cpp	(revision 14572)
+++ src/airport_gui.cpp	(working copy)
@@ -34,7 +34,7 @@
 {
 	if (success) {
 		SndPlayTileFx(SND_1F_SPLAT, tile);
-		ResetObjectToPlace();
+		if (! _settings_client.gui.persistant_buildtools) ResetObjectToPlace();
 	}
 }
 
Index: src/newgrf_gui.cpp
===================================================================
--- src/newgrf_gui.cpp	(revision 14572)
+++ src/newgrf_gui.cpp	(working copy)
@@ -15,6 +15,7 @@
 #include "core/alloc_func.hpp"
 #include "string_func.h"
 #include "gfx_func.h"
+#include "tilehighlight_func.h"
 #include "gamelog.h"
 #include "settings_func.h"
 #include "widgets/dropdown_type.h"
@@ -47,7 +48,7 @@
 }
 
 
-static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, uint bottom, bool show_params)
+static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, uint bottom, bool show_params, bool show_filenames)
 {
 	char buff[256];
 
@@ -74,8 +75,8 @@
 
 	/* Draw filename or not if it is not known (GRF sent over internet) */
 	if (c->filename != NULL) {
-		SetDParamStr(0, c->filename);
-		y += DrawStringMultiLine(x, y, STR_NEWGRF_FILENAME, w, bottom - y);
+		SetDParamStr(0, (show_filenames) ? c->name : c->filename);
+		y += DrawStringMultiLine(x, y,  (show_filenames) ? STR_NEWGRF_NAME : STR_NEWGRF_FILENAME, w, bottom - y);
 	}
 
 	/* Prepare and draw GRF ID */
@@ -119,150 +120,6 @@
 	}
 }
 
-
-/**
- * Window for adding NewGRF files
- */
-struct NewGRFAddWindow : public Window {
-	/* Names of the add a newgrf window widgets */
-	enum AddNewGRFWindowWidgets {
-		ANGRFW_CLOSEBOX = 0,
-		ANGRFW_CAPTION,
-		ANGRFW_BACKGROUND,
-		ANGRFW_GRF_LIST,
-		ANGRFW_SCROLLBAR,
-		ANGRFW_GRF_INFO,
-		ANGRFW_ADD,
-		ANGRFW_RESCAN,
-		ANGRFW_RESIZE,
-	};
-
-	GRFConfig **list;
-	const GRFConfig *sel;
-
-	NewGRFAddWindow(const WindowDesc *desc, GRFConfig **list) : Window(desc, 0)
-	{
-		this->list = list;
-		this->resize.step_height = 10;
-
-		this->FindWindowPlacementAndResize(desc);
-	}
-
-	virtual void OnPaint()
-	{
-		const GRFConfig *c;
-		const Widget *wl = &this->widget[ANGRFW_GRF_LIST];
-		int n = 0;
-
-		/* Count the number of GRFs */
-		for (c = _all_grfs; c != NULL; c = c->next) n++;
-
-		this->vscroll.cap = (wl->bottom - wl->top) / 10;
-		SetVScrollCount(this, n);
-
-		this->SetWidgetDisabledState(ANGRFW_ADD, this->sel == NULL || this->sel->IsOpenTTDBaseGRF());
-		this->DrawWidgets();
-
-		GfxFillRect(wl->left + 1, wl->top + 1, wl->right, wl->bottom, 0xD7);
-
-		uint y = wl->top + 1;
-		for (c = _all_grfs, n = 0; c != NULL && n < (this->vscroll.pos + this->vscroll.cap); c = c->next, n++) {
-			if (n >= this->vscroll.pos) {
-				bool h = c == this->sel;
-				const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename;
-
-				/* Draw selection background */
-				if (h) GfxFillRect(3, y, this->width - 15, y + 9, 156);
-				DoDrawStringTruncated(text, 4, y, h ? TC_WHITE : TC_ORANGE, this->width - 18);
-				y += 10;
-			}
-		}
-
-		if (this->sel != NULL) {
-			const Widget *wi = &this->widget[ANGRFW_GRF_INFO];
-			ShowNewGRFInfo(this->sel, wi->left + 2, wi->top + 2, wi->right - wi->left - 2, wi->bottom, false);
-		}
-	}
-
-	virtual void OnDoubleClick(Point pt, int widget)
-	{
-		if (widget == ANGRFW_GRF_LIST) this->OnClick(pt, ANGRFW_ADD);
-	}
-
-	virtual void OnClick(Point pt, int widget)
-	{
-		switch (widget) {
-			case ANGRFW_GRF_LIST: {
-				/* Get row... */
-				const GRFConfig *c;
-				uint i = (pt.y - this->widget[ANGRFW_GRF_LIST].top) / 10 + this->vscroll.pos;
-
-				for (c = _all_grfs; c != NULL && i > 0; c = c->next, i--) {}
-				this->sel = c;
-				this->SetDirty();
-				break;
-			}
-
-			case ANGRFW_ADD: // Add selection to list
-				if (this->sel != NULL) {
-					const GRFConfig *src = this->sel;
-					GRFConfig **list;
-
-					/* Find last entry in the list, checking for duplicate grfid on the way */
-					for (list = this->list; *list != NULL; list = &(*list)->next) {
-						if ((*list)->grfid == src->grfid) {
-							ShowErrorMessage(INVALID_STRING_ID, STR_NEWGRF_DUPLICATE_GRFID, 0, 0);
-							return;
-						}
-					}
-
-					/* Copy GRF details from scanned list */
-					GRFConfig *c = CallocT<GRFConfig>(1);
-					*c = *src;
-					c->filename = strdup(src->filename);
-					if (src->name      != NULL) c->name      = strdup(src->name);
-					if (src->info      != NULL) c->info      = strdup(src->info);
-					c->next = NULL;
-
-					/* Append GRF config to configuration list */
-					*list = c;
-
-					DeleteWindowByClass(WC_SAVELOAD);
-					InvalidateWindowData(WC_GAME_OPTIONS, 0);
-				}
-				break;
-
-			case ANGRFW_RESCAN: // Rescan list
-				this->sel = NULL;
-				ScanNewGRFFiles();
-				this->SetDirty();
-				break;
-		}
-	}
-};
-
-/* Widget definition for the add a newgrf window */
-static const Widget _newgrf_add_dlg_widgets[] = {
-{   WWT_CLOSEBOX,    RESIZE_NONE,  COLOUR_GREY,   0,  10,   0,  13, STR_00C5,                STR_018B_CLOSE_WINDOW },           // ANGRFW_CLOSEBOX
-{    WWT_CAPTION,   RESIZE_RIGHT,  COLOUR_GREY,  11, 306,   0,  13, STR_NEWGRF_ADD_CAPTION,  STR_018C_WINDOW_TITLE_DRAG_THIS }, // ANGRFW_CAPTION
-{      WWT_PANEL,      RESIZE_RB,  COLOUR_GREY,   0, 294,  14, 121, 0x0,                     STR_NULL },                        // ANGRFW_BACKGROUND
-{      WWT_INSET,      RESIZE_RB,  COLOUR_GREY,   2, 292,  16, 119, 0x0,                     STR_NULL },                        // ANGRFW_GRF_LIST
-{  WWT_SCROLLBAR,     RESIZE_LRB,  COLOUR_GREY, 295, 306,  14, 121, 0x0,                     STR_NULL },                        // ANGRFW_SCROLLBAR
-{      WWT_PANEL,     RESIZE_RTB,  COLOUR_GREY,   0, 306, 122, 224, 0x0,                     STR_NULL },                        // ANGRFW_GRF_INFO
-{ WWT_PUSHTXTBTN,     RESIZE_RTB,  COLOUR_GREY,   0, 146, 225, 236, STR_NEWGRF_ADD_FILE,     STR_NEWGRF_ADD_FILE_TIP },         // ANGRFW_ADD
-{ WWT_PUSHTXTBTN,    RESIZE_LRTB,  COLOUR_GREY, 147, 294, 225, 236, STR_NEWGRF_RESCAN_FILES, STR_NEWGRF_RESCAN_FILES_TIP },     // ANGRFW_RESCAN
-{  WWT_RESIZEBOX,    RESIZE_LRTB,  COLOUR_GREY, 295, 306, 225, 236, 0x0,                     STR_RESIZE_BUTTON },               // ANGRFW_RESIZE
-{   WIDGETS_END },
-};
-
-/* Window definition for the add a newgrf window */
-static const WindowDesc _newgrf_add_dlg_desc = {
-	WDP_CENTER, WDP_CENTER, 307, 237, 307, 337,
-	WC_SAVELOAD, WC_NONE,
-	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
-	_newgrf_add_dlg_widgets,
-};
-
 static GRFPresetList _grf_preset_list;
 
 class DropDownListPresetItem : public DropDownListItem {
@@ -285,44 +142,60 @@
 static void NewGRFConfirmationCallback(Window *w, bool confirmed);
 
 /**
- * Window for showing NewGRF files
+ * Combined NewGrf Window 
  */
 struct NewGRFWindow : public Window {
-	/* Names of the manage newgrfs window widgets */
-	enum ShowNewGRFStateWidgets {
-		SNGRFS_CLOSEBOX = 0,
+
+	/* Names of the window widgets */
+	enum NewGRFListWindowWidgets {
+		SNGRFS_CLOSE = 0,
 		SNGRFS_CAPTION,
-		SNGRFS_BACKGROUND1,
+		SNGRFS_EMPTY_PRESET,
 		SNGRFS_PRESET_LIST,
 		SNGRFS_PRESET_SAVE,
 		SNGRFS_PRESET_DELETE,
-		SNGRFS_BACKGROUND2,
-		SNGRFS_ADD,
+		SNGRFS_AVAILABLE_GRF_CAPTION,
+		SNGRFS_EMPTY_GRF_LIST,
+		SNGRFS_AVAILABLE_GRF_LIST,
+		SNGRFS_AVAILABLE_GRF_LIST_SCROLLBAR,
+		SNGRFS_NEWGRF_INFO_LEFT,
+		SNGRFS_RESCAN_FILES,
+		SNGRFS_TOGGLE_SHOW_MODE,
+		SNGRFS_EMPTY_MIDDLE,
+		SNGRFS_EMPTY_BOTTOM_MIDDLE,
+		SNGRFS_EMPTY_TOP_RIGHT,
+		SNGRFS_ADD_FILE,
 		SNGRFS_REMOVE,
 		SNGRFS_MOVE_UP,
 		SNGRFS_MOVE_DOWN,
 		SNGRFS_FILE_LIST,
-		SNGRFS_SCROLLBAR,
-		SNGRFS_NEWGRF_INFO,
+		SNGRFS_FILE_LIST_SCROLLBAR,
+		SNGRFS_NEWGRF_INFO_RIGHT,
+		SNGRFS_TOGGLE_PALETTE,
 		SNGRFS_SET_PARAMETERS,
-		SNGRFS_TOGGLE_PALETTE,
 		SNGRFS_APPLY_CHANGES,
-		SNGRFS_RESIZE,
 	};
+	
+	const GRFConfig *sel_l;
+	GRFConfig **orig_list;   ///< grf list the window is shown with
+	GRFConfig *list;         ///< temporary grf list to which changes are made
+	GRFConfig *sel_r;        ///< selected grf item
+	bool editable;           ///< is the window editable
+	bool show_params;        ///< are the grf-parameters shown in the info-panel
+	bool execute;            ///< on pressing 'apply changes' are grf changes applied immediately, or only list is updated
+	bool show_all;
+	bool show_file_names;
+	int query_widget;        ///< widget that opened a query
+	int preset;              ///< selected preset
 
-	GRFConfig **orig_list; ///< grf list the window is shown with
-	GRFConfig *list;       ///< temporary grf list to which changes are made
-	GRFConfig *sel;        ///< selected grf item
-	bool editable;         ///< is the window editable
-	bool show_params;      ///< are the grf-parameters shown in the info-panel
-	bool execute;          ///< on pressing 'apply changes' are grf changes applied immediately, or only list is updated
-	int query_widget;      ///< widget that opened a query
-	int preset;            ///< selected preset
-
 	NewGRFWindow(const WindowDesc *desc, bool editable, bool show_params, bool exec_changes, GRFConfig **config) : Window(desc, 0)
 	{
-		this->resize.step_height = 14;
-		this->sel         = NULL;
+		this->resize.step_height = 13;
+		this->resize.step_width = 8;
+		this->resize.height = this->height - 78;
+		this->resize.width  = this->width / 2 - 64;
+
+		this->sel_r       = NULL;
 		this->list        = NULL;
 		this->orig_list   = config;
 		this->editable    = editable;
@@ -337,6 +210,7 @@
 		this->SetupNewGRFWindow();
 	}
 
+
 	~NewGRFWindow()
 	{
 		if (!this->execute) {
@@ -350,43 +224,39 @@
 		_grf_preset_list.Clear();
 	}
 
-	void SetupNewGRFWindow()
+	virtual void OnPaint()
 	{
 		const GRFConfig *c;
-		int i;
 
-		for (c = this->list, i = 0; c != NULL; c = c->next, i++) {}
+		int i, y;
+		int n = 0;
 
-		this->vscroll.cap = (this->widget[SNGRFS_FILE_LIST].bottom - this->widget[SNGRFS_FILE_LIST].top) / 14 + 1;
-		SetVScrollCount(this, i);
+		bool disable_all = this->sel_r == NULL || !this->editable;
 
-		this->SetWidgetsDisabledState(!this->editable,
-			SNGRFS_PRESET_LIST,
-			SNGRFS_ADD,
-			SNGRFS_APPLY_CHANGES,
-			SNGRFS_TOGGLE_PALETTE,
-			WIDGET_LIST_END
-		);
-	}
-
-	virtual void OnPaint()
-	{
-		bool disable_all = this->sel == NULL || !this->editable;
-
 		this->SetWidgetsDisabledState(disable_all,
 			SNGRFS_REMOVE,
 			SNGRFS_MOVE_UP,
 			SNGRFS_MOVE_DOWN,
 			WIDGET_LIST_END
 		);
+
+		this->SetWidgetsDisabledState(!this->editable,
+			SNGRFS_RESCAN_FILES,
+			SNGRFS_NEWGRF_INFO_LEFT,
+			SNGRFS_AVAILABLE_GRF_LIST,
+			SNGRFS_APPLY_CHANGES,
+			WIDGET_LIST_END
+		);
+
+		this->SetWidgetDisabledState(SNGRFS_ADD_FILE, !this->editable || this->sel_l == NULL || this->sel_l->IsOpenTTDBaseGRF());
 		this->SetWidgetDisabledState(SNGRFS_SET_PARAMETERS, !this->show_params || disable_all);
 		this->SetWidgetDisabledState(SNGRFS_TOGGLE_PALETTE, disable_all);
 
 		if (!disable_all) {
 			/* All widgets are now enabled, so disable widgets we can't use */
-			if (this->sel == this->list)       this->DisableWidget(SNGRFS_MOVE_UP);
-			if (this->sel->next == NULL)       this->DisableWidget(SNGRFS_MOVE_DOWN);
-			if (this->sel->IsOpenTTDBaseGRF()) this->DisableWidget(SNGRFS_REMOVE);
+			if (this->sel_r == this->list) this->DisableWidget(SNGRFS_MOVE_UP);
+			if (this->sel_r->next == NULL) this->DisableWidget(SNGRFS_MOVE_DOWN);
+			if (this->sel_r->IsOpenTTDBaseGRF()) this->DisableWidget(SNGRFS_REMOVE);
 		}
 
 		if (this->preset == -1) {
@@ -398,12 +268,32 @@
 
 		this->DrawWidgets();
 
+		DrawStringCentered((this->widget[SNGRFS_AVAILABLE_GRF_CAPTION].right - this->widget[SNGRFS_AVAILABLE_GRF_CAPTION].left) / 2, 34, STR_NEWGRF_ADD_CAPTION, TC_WHITE);
+		GfxFillRect(this->widget[SNGRFS_AVAILABLE_GRF_LIST].left + 1, this->widget[SNGRFS_AVAILABLE_GRF_LIST].top + 1, this->widget[SNGRFS_AVAILABLE_GRF_LIST].right, this->widget[SNGRFS_AVAILABLE_GRF_LIST].bottom, 0xD7);
+
+		n = 0;
+		y = this->widget[SNGRFS_AVAILABLE_GRF_LIST].top + 2;
+		for (c = _all_grfs; c != NULL; c = c->next) {
+
+			if (IsInSelectedList(c->grfid)) continue;	
+			
+			if (n >= this->vscroll.pos && n < this->vscroll.pos + this->vscroll.cap) {
+				bool h = (c == this->sel_l);
+				const char *text = (c->name != NULL && !StrEmpty(c->name) && !this->show_file_names) ? c->name : c->filename;
+
+				/* Draw selection background */
+				if (h) GfxFillRect(3, y, this->widget[SNGRFS_AVAILABLE_GRF_LIST].right - 4, y + 9, 156);
+				DoDrawStringTruncated(text, 4, y, h ? TC_WHITE : TC_ORANGE, this->widget[SNGRFS_AVAILABLE_GRF_LIST].right - 7);
+				y += 10;
+			}
+			n++;
+		}
+
 		/* Draw NewGRF list */
-		int y = this->widget[SNGRFS_FILE_LIST].top;
-		int i = 0;
-		for (const GRFConfig *c = this->list; c != NULL; c = c->next, i++) {
-			if (i >= this->vscroll.pos && i < this->vscroll.pos + this->vscroll.cap) {
-				const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename;
+		y = this->widget[SNGRFS_FILE_LIST].top;
+		for (c = this->list, i = 0; c != NULL; c = c->next, i++) {
+			if (i >= this->vscroll2.pos && i < this->vscroll2.pos + this->vscroll2.cap) {
+				const char *text = (c->name != NULL && !StrEmpty(c->name) && !this->show_file_names) ? c->name : c->filename;
 				SpriteID pal;
 				byte txtoffset;
 
@@ -430,21 +320,81 @@
 					}
 				}
 
-				DrawSprite(SPR_SQUARE, pal, 5, y + 2);
-				if (c->error != NULL) DrawSprite(SPR_WARNING_SIGN, 0, 20, y + 2);
+				DrawSprite(SPR_SQUARE, pal, this->widget[SNGRFS_FILE_LIST].left + 9, y + 1);
+				if (c->error != NULL) DrawSprite(SPR_WARNING_SIGN, 0, this->widget[SNGRFS_FILE_LIST].left + 21, y + 1);
 				txtoffset = c->error != NULL ? 35 : 25;
-				DoDrawStringTruncated(text, txtoffset, y + 3, this->sel == c ? TC_WHITE : TC_BLACK, this->width - txtoffset - 10);
-				y += 14;
+				DoDrawStringTruncated(text,
+						this->widget[SNGRFS_FILE_LIST].left + txtoffset, y + 2,
+						this->sel_r == c ? TC_WHITE : TC_BLACK,
+						this->widget[SNGRFS_FILE_LIST].right - this->widget[SNGRFS_FILE_LIST].left - txtoffset);
+				y += 13;
 			}
 		}
 
-		if (this->sel != NULL) {
+		if (this->sel_r != NULL) {
 			/* Draw NewGRF file info */
-			const Widget *wi = &this->widget[SNGRFS_NEWGRF_INFO];
-			ShowNewGRFInfo(this->sel, wi->left + 2, wi->top + 2, wi->right - wi->left - 2, wi->bottom, this->show_params);
+			const Widget *wi = &this->widget[SNGRFS_NEWGRF_INFO_RIGHT];
+			ShowNewGRFInfo(this->sel_r, wi->left + 2, wi->top + 2, wi->right - wi->left - 2, wi->bottom, this->show_params, this->show_file_names);
 		}
+
+		if (this->sel_l != NULL) {
+			const Widget *wi = &this->widget[SNGRFS_NEWGRF_INFO_LEFT];
+			ShowNewGRFInfo(this->sel_l, wi->left + 2, wi->top + 2, wi->right - wi->left - 2, wi->bottom, false, this->show_file_names);
+		}
+
 	}
 
+	virtual void OnInvalidateData(int data = 0)
+	{
+		this->preset = -1;
+		this->SetupNewGRFWindow();
+	}
+
+	virtual void OnDragMove(Point pt, int widget)
+	{
+		if (widget != SNGRFS_FILE_LIST) return;
+
+		GRFConfig **pc, *c, *source, *target;
+
+		if ((source = this->sel_r) == NULL) return;
+
+		uint i = (pt.y - this->widget[SNGRFS_FILE_LIST].top) / 13 + this->vscroll2.pos;
+		for (c = this->list; c != NULL && i > 0; c = c->next, i--)
+			if (c == source) i += 1;
+		target = c;
+		
+		if (target == source) return;
+
+		for (pc = &this->list; (c = *pc) != NULL; pc = &c->next) {
+			if (c == source)
+				*pc = c->next;
+			else if (c->next == source) {
+				c->next = c->next->next;
+			}
+		}
+
+		for (pc = &this->list; (c = *pc) != NULL; pc = &c->next) {
+			if (c == target) {
+				*pc = source;
+				source->next = target;
+			}
+			else if (c->next == target) {
+				c->next = source;
+				source->next = target;
+			}
+		}
+
+		this->SetDirty();
+	}
+
+	virtual void OnDoubleClick(Point pt, int widget)
+	{
+		if (widget == SNGRFS_AVAILABLE_GRF_LIST)
+			this->OnClick(pt, SNGRFS_ADD_FILE);
+		if (widget == SNGRFS_FILE_LIST && this->sel_r) 
+			this->OnClick(pt, SNGRFS_REMOVE);
+	}
+
 	virtual void OnClick(Point pt, int widget)
 	{
 		switch (widget) {
@@ -478,30 +428,96 @@
 				this->SetDirty();
 				break;
 
-			case SNGRFS_ADD: // Add GRF
-				DeleteWindowByClass(WC_SAVELOAD);
-				new NewGRFAddWindow(&_newgrf_add_dlg_desc, &this->list);
+			case SNGRFS_AVAILABLE_GRF_LIST: {
+				/* Get row... */
+				const GRFConfig *c;
+				uint i = ((pt.y) - this->widget[SNGRFS_AVAILABLE_GRF_LIST].top) / 10 + this->vscroll.pos;
+				
+				c = _all_grfs;
+				while (c && IsInSelectedList(c->grfid) && c->next) {
+					c = c->next;
+				}
+				while (c != NULL && i > 0)
+				{
+					c = c->next;
+					while (c != NULL && IsInSelectedList(c->grfid) && c->next) {
+						c = c->next;
+					}
+					--i;
+				}
+				if (c && IsInSelectedList(c->grfid)) c = NULL;
+				this->sel_l = c;
+				this->SetDirty();
 				break;
+			}
 
+			case SNGRFS_ADD_FILE: // Add selection to list
+				if (this->sel_l != NULL && this->editable) {
+					const GRFConfig *src = this->sel_l;
+					GRFConfig **list;
+
+					/* Find last entry in the list, checking for duplicate grfid on the way */
+					for (list = &this->list; *list != NULL; list = &(*list)->next) {
+						if ((*list)->grfid == src->grfid) {
+							ShowErrorMessage(INVALID_STRING_ID, STR_NEWGRF_DUPLICATE_GRFID, 0, 0);
+							return;
+						}
+					}
+
+					/* Copy GRF details from scanned list */
+					GRFConfig *c = CallocT<GRFConfig>(1);
+					*c = *src;
+					c->filename = strdup(src->filename);
+					if (src->name      != NULL) c->name      = strdup(src->name);
+					if (src->info      != NULL) c->info      = strdup(src->info);
+					c->next = NULL;
+
+					/* Append GRF config to configuration list */
+					*list = c;
+					this->sel_l = NULL;
+					this->preset = -1;
+					this->SetupNewGRFWindow();
+					this->SetDirty();
+				}
+				break;
+
+			case SNGRFS_RESCAN_FILES: // Rescan list
+				this->sel_l = NULL;
+				ScanNewGRFFiles();
+				this->SetDirty();
+				break;
+				
+			case SNGRFS_TOGGLE_SHOW_MODE: // Toggle show mode
+				if (_ctrl_pressed) {
+					this->show_file_names = !this->show_file_names;
+				}
+				else {
+					this->show_all = !this->show_all;
+				}
+
+				this->SetupNewGRFWindow(); // Adjust scroll bars
+				this->SetDirty();
+				break;
+
 			case SNGRFS_REMOVE: { // Remove GRF
 				GRFConfig **pc, *c, *newsel;
 
 				/* Choose the next GRF file to be the selected file */
-				newsel = this->sel->next;
+				newsel = this->sel_r->next;
 
 				for (pc = &this->list; (c = *pc) != NULL; pc = &c->next) {
 					/* If the new selection is empty (i.e. we're deleting the last item
 					 * in the list, pick the file just before the selected file */
-					if (newsel == NULL && c->next == this->sel) newsel = c;
+					if (newsel == NULL && c->next == this->sel_r) newsel = c;
 
-					if (c == this->sel) {
+					if (c == this->sel_r) {
 						*pc = c->next;
 						free(c);
 						break;
 					}
 				}
 
-				this->sel = newsel;
+				this->sel_r = newsel;
 				this->preset = -1;
 				this->SetupNewGRFWindow();
 				this->SetDirty();
@@ -510,13 +526,13 @@
 
 			case SNGRFS_MOVE_UP: { // Move GRF up
 				GRFConfig **pc, *c;
-				if (this->sel == NULL) break;
+				if (this->sel_r == NULL) break;
 
 				for (pc = &this->list; (c = *pc) != NULL; pc = &c->next) {
-					if (c->next == this->sel) {
-						c->next = this->sel->next;
-						this->sel->next = c;
-						*pc = this->sel;
+					if (c->next == this->sel_r) {
+						c->next = this->sel_r->next;
+						this->sel_r->next = c;
+						*pc = this->sel_r;
 						break;
 					}
 				}
@@ -527,10 +543,10 @@
 
 			case SNGRFS_MOVE_DOWN: { // Move GRF down
 				GRFConfig **pc, *c;
-				if (this->sel == NULL) break;
+				if (this->sel_r == NULL) break;
 
 				for (pc = &this->list; (c = *pc) != NULL; pc = &c->next) {
-					if (c == this->sel) {
+					if (c == this->sel_r) {
 						*pc = c->next;
 						c->next = c->next->next;
 						(*pc)->next = c;
@@ -544,11 +560,14 @@
 
 			case SNGRFS_FILE_LIST: { // Select a GRF
 				GRFConfig *c;
-				uint i = (pt.y - this->widget[SNGRFS_FILE_LIST].top) / 14 + this->vscroll.pos;
+				uint i = (pt.y - this->widget[SNGRFS_FILE_LIST].top) / 13 + this->vscroll2.pos;
 
-				for (c = this->list; c != NULL && i > 0; c = c->next, i--) {}
-				this->sel = c;
+				for (c = this->list; c != NULL && i > 0; c = c->next, i--);
+				this->sel_r = c;
 
+				/* Activate drag and drop */
+				SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, VHM_DRAG, this);
+				
 				this->SetDirty();
 				break;
 			}
@@ -569,19 +588,19 @@
 				break;
 
 			case SNGRFS_SET_PARAMETERS: { // Edit parameters
-				if (this->sel == NULL) break;
+				if (this->sel_r == NULL) break;
 
 				this->query_widget = widget;
 				static char buff[512];
-				GRFBuildParamList(buff, this->sel, lastof(buff));
+				GRFBuildParamList(buff, this->sel_r, lastof(buff));
 				SetDParamStr(0, buff);
 				ShowQueryString(STR_JUST_RAW_STRING, STR_NEWGRF_PARAMETER_QUERY, 63, 250, this, CS_ALPHANUMERAL, QSF_NONE);
 				break;
 			}
 
 			case SNGRFS_TOGGLE_PALETTE: {
-				if (this->sel != NULL) {
-					this->sel->windows_paletted ^= true;
+				if (this->sel_r != NULL) {
+					this->sel_r->windows_paletted ^= true;
 					this->SetDirty();
 				}
 				break;
@@ -598,14 +617,14 @@
 			GRFConfig *c = LoadGRFPresetFromConfig(_grf_preset_list[index]);
 
 			if (c != NULL) {
-				this->sel = NULL;
+				this->sel_r = NULL;
 				ClearGRFConfigList(&this->list);
 				this->list = c;
 				this->preset = index;
 			}
 		}
 
-		this->sel = NULL;
+		this->sel_r = NULL;
 		this->SetupNewGRFWindow();
 		this->SetDirty();
 	}
@@ -632,7 +651,7 @@
 
 			case SNGRFS_SET_PARAMETERS: {
 				/* Parse our new "int list" */
-				GRFConfig *c = this->sel;
+				GRFConfig *c = this->sel_r;
 				c->num_params = parse_intlist(str, (int*)c->param, lengthof(c->param));
 
 				/* parse_intlist returns -1 on error */
@@ -647,53 +666,120 @@
 
 	virtual void OnResize(Point new_size, Point delta)
 	{
-		if (delta.x != 0) {
-			ResizeButtons(this, SNGRFS_ADD, SNGRFS_MOVE_DOWN);
-			ResizeButtons(this, SNGRFS_SET_PARAMETERS, SNGRFS_APPLY_CHANGES);
+		/* ASSUME: this->width, this->height already contains the new window size */
+
+		int left_column_width  = (this->width - 31) / 2 + 4;
+		int right_column_width = left_column_width - 7;
+
+		Widget *w = this->widget;
+		
+		w[SNGRFS_RESCAN_FILES].right =
+				(left_column_width / 2) - 1;
+
+		w[SNGRFS_TOGGLE_SHOW_MODE].left =
+				(left_column_width / 2);
+
+		w[SNGRFS_AVAILABLE_GRF_LIST].right = 
+				left_column_width - 14;
+
+		w[SNGRFS_AVAILABLE_GRF_LIST_SCROLLBAR].left =
+				left_column_width - 12;
+
+		w[SNGRFS_AVAILABLE_GRF_CAPTION].right =
+		w[SNGRFS_EMPTY_GRF_LIST].right =
+		w[SNGRFS_AVAILABLE_GRF_LIST_SCROLLBAR].right =
+		w[SNGRFS_TOGGLE_SHOW_MODE].right =
+		w[SNGRFS_NEWGRF_INFO_LEFT].right =
+				left_column_width - 1;
+
+		w[SNGRFS_EMPTY_MIDDLE].left =
+		w[SNGRFS_EMPTY_BOTTOM_MIDDLE].left =
+				left_column_width;
+
+		w[SNGRFS_ADD_FILE].left =
+		w[SNGRFS_REMOVE].left =
+				left_column_width + 5;
+
+		w[SNGRFS_ADD_FILE].right =
+		w[SNGRFS_REMOVE].right =
+				left_column_width + 25;
+
+		w[SNGRFS_EMPTY_MIDDLE].right =
+		w[SNGRFS_EMPTY_BOTTOM_MIDDLE].right =
+				left_column_width + 29;
+
+		w[SNGRFS_EMPTY_TOP_RIGHT].left =
+		w[SNGRFS_FILE_LIST].left =
+		w[SNGRFS_NEWGRF_INFO_RIGHT].left =
+		w[SNGRFS_TOGGLE_PALETTE].left = 
+		w[SNGRFS_SET_PARAMETERS].left =
+				left_column_width + 30;
+		
+		int spacing = (right_column_width - 72) / 3;
+		int pos     = left_column_width + 30 + spacing;
+
+		w[SNGRFS_MOVE_UP].left    = pos; pos += 36;
+		w[SNGRFS_MOVE_UP].right   = pos; pos += spacing;
+		w[SNGRFS_MOVE_DOWN].left  = pos; pos += 36;
+		w[SNGRFS_MOVE_DOWN].right = pos;
+
+		spacing = left_column_width + 30 + (right_column_width - 12) / 2;
+		w[SNGRFS_SET_PARAMETERS].right = spacing - 1;
+		w[SNGRFS_APPLY_CHANGES].left   = spacing;
+
+		int list_bottom;
+
+		if (this->height < 224) {
+			list_bottom = 111;
+		} else {
+			list_bottom = this->height - 113;
 		}
 
-		this->vscroll.cap += delta.y / 14;
-		this->widget[SNGRFS_FILE_LIST].data = (this->vscroll.cap << 8) + 1;
+		w[SNGRFS_EMPTY_GRF_LIST].bottom =
+		w[SNGRFS_AVAILABLE_GRF_LIST].bottom =
+		w[SNGRFS_AVAILABLE_GRF_LIST_SCROLLBAR].bottom =
+		w[SNGRFS_FILE_LIST].bottom =
+		w[SNGRFS_FILE_LIST_SCROLLBAR].bottom =
+			list_bottom;
 
+		w[SNGRFS_NEWGRF_INFO_LEFT].top =
+		w[SNGRFS_NEWGRF_INFO_RIGHT].top = 
+			list_bottom + 1;
+
 		this->SetupNewGRFWindow();
 	}
+	
+	bool IsInSelectedList(uint32 grfid) {
+		if (this->show_all) return false;
+		const GRFConfig *ctemp;
+		for (ctemp = this->list; ctemp != NULL; ctemp = ctemp->next) {
+			if (grfid == ctemp->grfid) return true;
+		}
+		return false;
+	}
 
-	virtual void OnInvalidateData(int data = 0)
+	void SetupNewGRFWindow()
 	{
-		this->preset = -1;
-		this->SetupNewGRFWindow();
-	}
-};
+		const GRFConfig *c;
+		uint8 n;
 
-/* Widget definition of the manage newgrfs window */
-static const Widget _newgrf_widgets[] = {
-{   WWT_CLOSEBOX,  RESIZE_NONE,  COLOUR_MAUVE,    0,  10,   0,  13, STR_00C5,                    STR_018B_CLOSE_WINDOW },            // SNGRFS_CLOSEBOX
-{    WWT_CAPTION, RESIZE_RIGHT,  COLOUR_MAUVE,   11, 299,   0,  13, STR_NEWGRF_SETTINGS_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS },  // SNGRFS_CAPTION
-{      WWT_PANEL, RESIZE_RIGHT,  COLOUR_MAUVE,    0, 299,  14,  41, STR_NULL,                    STR_NULL },                         // SNGRFS_BACKGROUND1
-{   WWT_DROPDOWN, RESIZE_RIGHT,  COLOUR_YELLOW,  10, 103,  16,  27, STR_EMPTY,                   STR_NEWGRF_PRESET_LIST_TIP },       // SNGRFS_PRESET_LIST
-{ WWT_PUSHTXTBTN,    RESIZE_LR,  COLOUR_YELLOW, 104, 196,  16,  27, STR_NEWGRF_PRESET_SAVE,      STR_NEWGRF_PRESET_SAVE_TIP },       // SNGRFS_PRESET_SAVE
-{ WWT_PUSHTXTBTN,    RESIZE_LR,  COLOUR_YELLOW, 197, 289,  16,  27, STR_NEWGRF_PRESET_DELETE,    STR_NEWGRF_PRESET_DELETE_TIP },     // SNGRFS_PRESET_DELETE
-{      WWT_PANEL, RESIZE_RIGHT,  COLOUR_MAUVE,    0, 299,  30,  45, STR_NULL,                    STR_NULL },                         // SNGRFS_BACKGROUND
-{ WWT_PUSHTXTBTN,  RESIZE_NONE,  COLOUR_YELLOW,  10,  79,  32,  43, STR_NEWGRF_ADD,              STR_NEWGRF_ADD_TIP },               // SNGRFS_ADD
-{ WWT_PUSHTXTBTN,  RESIZE_NONE,  COLOUR_YELLOW,  80, 149,  32,  43, STR_NEWGRF_REMOVE,           STR_NEWGRF_REMOVE_TIP },            // SNGRFS_REMOVE
-{ WWT_PUSHTXTBTN,  RESIZE_NONE,  COLOUR_YELLOW, 150, 219,  32,  43, STR_NEWGRF_MOVEUP,           STR_NEWGRF_MOVEUP_TIP },            // SNGRFS_MOVE_UP
-{ WWT_PUSHTXTBTN, RESIZE_RIGHT,  COLOUR_YELLOW, 220, 289,  32,  43, STR_NEWGRF_MOVEDOWN,         STR_NEWGRF_MOVEDOWN_TIP },          // SNGRFS_MOVE_DOWN
-{     WWT_MATRIX,    RESIZE_RB,  COLOUR_MAUVE,    0, 287,  46, 115, 0x501,                       STR_NEWGRF_FILE_TIP },              // SNGRFS_FILE_LIST
-{  WWT_SCROLLBAR,   RESIZE_LRB,  COLOUR_MAUVE,  288, 299,  46, 115, 0x0,                         STR_0190_SCROLL_BAR_SCROLLS_LIST }, // SNGRFS_SCROLLBAR
-{      WWT_PANEL,   RESIZE_RTB,  COLOUR_MAUVE,    0, 299, 116, 238, STR_NULL,                    STR_NULL },                         // SNGRFS_NEWGRF_INFO
-{ WWT_PUSHTXTBTN,    RESIZE_TB,  COLOUR_MAUVE,    0,  95, 239, 250, STR_NEWGRF_SET_PARAMETERS,   STR_NULL },                         // SNGRFS_SET_PARAMETERS
-{ WWT_PUSHTXTBTN,   RESIZE_RTB,  COLOUR_MAUVE,   96, 191, 239, 250, STR_NEWGRF_TOGGLE_PALETTE,   STR_NEWGRF_TOGGLE_PALETTE_TIP },    // SNGRFS_TOGGLE_PALETTE
-{ WWT_PUSHTXTBTN,   RESIZE_RTB,  COLOUR_MAUVE,  192, 287, 239, 250, STR_NEWGRF_APPLY_CHANGES,    STR_NULL },                         // SNGRFS_APPLY_CHANGES
-{  WWT_RESIZEBOX,  RESIZE_LRTB,  COLOUR_MAUVE,  288, 299, 239, 250, 0x0,                         STR_RESIZE_BUTTON },                // SNGRFS_RESIZE
-{ WIDGETS_END },
-};
+		for (c = this->list, n = 0; c != NULL; c = c->next, n++);
 
-/* Window definition of the manage newgrfs window */
-static const WindowDesc _newgrf_desc = {
-	WDP_CENTER, WDP_CENTER, 300, 251, 300, 251,
-	WC_GAME_OPTIONS, WC_NONE,
-	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
-	_newgrf_widgets,
+		this->vscroll2.cap = (this->widget[SNGRFS_FILE_LIST].bottom - this->widget[SNGRFS_FILE_LIST].top) / 13;
+
+		this->widget[SNGRFS_FILE_LIST].data = (this->vscroll2.cap << 8) + 1;
+		SetVScroll2Count(this, n);
+		this->SetWidgetDisabledState(SNGRFS_APPLY_CHANGES, !this->editable);
+
+		/* Count the number of GRFs */
+		for (c = _all_grfs, n = 0; c != NULL; c = c->next)
+		{
+			if (this->show_all || !IsInSelectedList(c->grfid)) n++;
+		}
+
+		this->vscroll.cap = (this->widget[SNGRFS_AVAILABLE_GRF_LIST].bottom - this->widget[SNGRFS_AVAILABLE_GRF_LIST].top) / 10;
+		SetVScrollCount(this, n);
+	}
 };
 
 /** Callback function for the newgrf 'apply changes' confirmation window
@@ -707,23 +793,64 @@
 		GRFConfig *c;
 		int i = 0;
 
-		GamelogStartAction(GLAT_GRF);
-		GamelogGRFUpdate(_grfconfig, nw->list); // log GRF changes
 		CopyGRFConfigList(nw->orig_list, nw->list, false);
 		ReloadNewGRFData();
-		GamelogStopAction();
 
 		/* Show new, updated list */
-		for (c = nw->list; c != NULL && c != nw->sel; c = c->next, i++) {}
+		for (c = nw->list; c != NULL && c != nw->sel_r; c = c->next, i++);
 		CopyGRFConfigList(&nw->list, *nw->orig_list, false);
-		for (c = nw->list; c != NULL && i > 0; c = c->next, i--) {}
-		nw->sel = c;
+		for (c = nw->list; c != NULL && i > 0; c = c->next, i--);
+		nw->sel_r = c;
 
 		w->SetDirty();
 	}
 }
 
+static const Widget _newgrf_widgets[] = {
+{   WWT_CLOSEBOX,  RESIZE_NONE,  COLOUR_MAUVE,   0,  10,   0,  13, STR_00C5,                    STR_018B_CLOSE_WINDOW },           // SNGRFS_CLOSE
+{    WWT_CAPTION, RESIZE_RIGHT,  COLOUR_MAUVE,  11, 600,   0,  13, STR_NEWGRF_SETTINGS_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS }, // SNGRFS_CAPTION
+/* NewGRF Presets */
+{      WWT_PANEL, RESIZE_RIGHT,  COLOUR_MAUVE,   0, 600,  14,  29, STR_NULL,                    STR_NULL },                        // SNGRFS_EMPTY_PRESET
+{   WWT_DROPDOWN, RESIZE_RIGHT, COLOUR_YELLOW,  10, 403,  16,  27, STR_EMPTY,                   STR_NEWGRF_PRESET_LIST_TIP },      // SNGRFS_PRESET_LIST
+{ WWT_PUSHTXTBTN,    RESIZE_LR, COLOUR_YELLOW, 404, 496,  16,  27, STR_NEWGRF_PRESET_SAVE,      STR_NEWGRF_PRESET_SAVE_TIP },      // SNGRFS_PRESET_SAVE
+{ WWT_PUSHTXTBTN,    RESIZE_LR, COLOUR_YELLOW, 497, 589,  16,  27, STR_NEWGRF_PRESET_DELETE,    STR_NEWGRF_PRESET_DELETE_TIP },    // SNGRFS_PRESET_DELETE
+/* List of files */
+{      WWT_PANEL, RESIZE_RIGHT,  COLOUR_MAUVE,   0, 291,  30,  45, STR_NULL,                    STR_NULL },                        // SNGRFS_AVAILABLE_GRF_CAPTION
+{      WWT_PANEL,    RESIZE_RB,  COLOUR_MAUVE,   0, 279,  46, 137, STR_NULL,                    STR_NULL },                        // SNGRFS_EMPTY_GRF_LIST
+{      WWT_INSET,    RESIZE_RB,  COLOUR_MAUVE,   2, 277,  46, 137, STR_NULL,                    STR_NULL },                        // SNGRFS_AVAILABLE_GRF_LIST
+{  WWT_SCROLLBAR,   RESIZE_LRB,  COLOUR_MAUVE, 280, 291,  46, 137, STR_NULL,                    STR_NULL },                        // SNGRFS_AVAILABLE_GRF_LIST_SCROLLBAR
+/* NewGRF file info */
+{      WWT_PANEL,   RESIZE_RTB,  COLOUR_MAUVE,   0, 291, 138, 237, STR_NULL,                    STR_NULL },                        // SNGRFS_NEWGRF_INFO_LEFT
+{ WWT_PUSHTXTBTN,   RESIZE_RTB,  COLOUR_MAUVE,   0, 136, 238, 249, STR_NEWGRF_RESCAN_FILES,     STR_NEWGRF_RESCAN_FILES_TIP },     // SNGRFS_RESCAN_FILES
+{ WWT_PUSHTXTBTN,  RESIZE_LRTB,  COLOUR_MAUVE, 137, 291, 238, 249, STR_NEWGRF_TOGGLE_SHOW,      STR_NEWGRF_TOGGLE_SHOW_TIP },      // SNGRFS_TOGGLE_SHOW_MODE
+/* Middle Panel */
+{      WWT_PANEL,   RESIZE_LRB,  COLOUR_MAUVE, 292, 321,  30, 237, STR_NULL,                    STR_NULL },                        // SNGRFS_EMPTY_MIDDLE
+{      WWT_PANEL,  RESIZE_LRTB,  COLOUR_MAUVE, 292, 321, 238, 249, STR_NULL,                    STR_NULL },                        // SNGRFS_EMPTY_BOTTOM_MIDDLE
+/* NewGRF file Add, Remove, Move up, Move down */
+{      WWT_PANEL,    RESIZE_LR,  COLOUR_MAUVE, 322, 600,  30,  45, STR_NULL,                    STR_NULL },                        // SNGRFS_EMPTY_TOP_RIGHT
+{ WWT_PUSHTXTBTN,    RESIZE_LR, COLOUR_YELLOW, 297, 316,  36,  58, STR_NEWGRF_JOINT_ADD,        STR_NEWGRF_ADD_TIP },              // SNGRFS_ADD_FILE
+{ WWT_PUSHTXTBTN,    RESIZE_LR, COLOUR_YELLOW, 297, 316,  66,  88, STR_NEWGRF_JOINT_REMOVE,     STR_NEWGRF_REMOVE_TIP },           // SNGRFS_REMOVE
+{ WWT_PUSHTXTBTN,    RESIZE_LR, COLOUR_YELLOW, 394, 430,  32,  43, STR_NEWGRF_MOVEUP,           STR_NEWGRF_MOVEUP_TIP },           // SNGRFS_MOVE_UP
+{ WWT_PUSHTXTBTN,    RESIZE_LR, COLOUR_YELLOW, 499, 535,  32,  43, STR_NEWGRF_MOVEDOWN,         STR_NEWGRF_MOVEDOWN_TIP },         // SNGRFS_MOVE_DOWN
+/* NewGRF file list */
+{     WWT_MATRIX,   RESIZE_LRB,  COLOUR_MAUVE, 322, 588,  46, 137, 0x501,                       STR_NEWGRF_FILE_TIP },             // SNGRFS_FILE_LIST
+{ WWT_SCROLL2BAR,   RESIZE_LRB,  COLOUR_MAUVE, 589, 600,  46, 137, STR_NULL,                    STR_0190_SCROLL_BAR_SCROLLS_LIST },// SNGRFS_FILE_LIST_SCROLLBAR
+/* NewGRF file info */
+{      WWT_PANEL,  RESIZE_LRTB,  COLOUR_MAUVE, 322, 600, 138, 225, STR_NULL,                    STR_NULL },                        // SNGRFS_NEWGRF_INFO_RIGHT
+/* Edit parameter and apply changes button... */
+{ WWT_PUSHTXTBTN,  RESIZE_LRTB,  COLOUR_MAUVE, 322, 600, 226, 237, STR_NEWGRF_TOGGLE_PALETTE,   STR_NEWGRF_TOGGLE_PALETTE_TIP },   // SNGRFS_TOGGLE_PALETTE
+{ WWT_PUSHTXTBTN,  RESIZE_LRTB,  COLOUR_MAUVE, 322, 458, 238, 249, STR_NEWGRF_SET_PARAMETERS,   STR_NULL },                        // SNGRFS_SET_PARAMETERS
+{ WWT_PUSHTXTBTN,  RESIZE_LRTB,  COLOUR_MAUVE, 459, 588, 238, 249, STR_NEWGRF_APPLY_CHANGES,    STR_NULL },                        // SNGRFS_APPLY_CHANGES
+{  WWT_RESIZEBOX,  RESIZE_LRTB,  COLOUR_MAUVE, 589, 600, 238, 249, STR_NULL,                    STR_RESIZE_BUTTON },
+{   WIDGETS_END },
+};
 
+static const WindowDesc _newgrf_desc = {
+	WDP_CENTER, WDP_CENTER, 600, 250, 600, 250,
+	WC_GAME_OPTIONS, WC_NONE,
+	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
+	_newgrf_widgets,
+};
 
 /** Setup the NewGRF gui
  * @param editable allow the user to make changes to the grfconfig in the window
@@ -734,5 +861,7 @@
 void ShowNewGRFSettings(bool editable, bool show_params, bool exec_changes, GRFConfig **config)
 {
 	DeleteWindowByClass(WC_GAME_OPTIONS);
+
 	new NewGRFWindow(&_newgrf_desc, editable, show_params, exec_changes, config);
 }
+
Index: src/querystring_gui.h
===================================================================
--- src/querystring_gui.h	(revision 14572)
+++ src/querystring_gui.h	(working copy)
@@ -16,6 +16,7 @@
 	HEBR_EDITING = 0, // Other key pressed.
 	HEBR_CONFIRM,     // Return or enter key pressed.
 	HEBR_CANCEL,      // Escape key pressed.
+	HEBR_NOT_FOCUSED, // Edit box widget not focused.
 };
 
 /**
@@ -43,6 +44,7 @@
 		free((void*)this->orig);
 	}
 
+	bool HasEditBoxFocus(Window *w, int wid) const;
 	void DrawEditBox(Window *w, int wid);
 	void HandleEditBox(Window *w, int wid);
 	HandleEditBoxResult HandleEditBoxKey(Window *w, int wid, uint16 key, uint16 keycode, Window::EventState &state);
@@ -52,11 +54,14 @@
 	char *edit_str_buf;
 	char *orig_str_buf;
 	const uint16 edit_str_size; ///< maximum length of string (in bytes), including terminating '\0'
+	int osk_ok, osk_cancel;
 
-	QueryStringBaseWindow(uint16 size, const WindowDesc *desc, WindowNumber window_number = 0) : Window(desc, window_number), edit_str_size(size)
+	QueryStringBaseWindow(uint16 size, const WindowDesc *desc, int osk_ok, int osk_cancel, WindowNumber window_number = 0) : Window(desc, window_number), edit_str_size(size)
 	{
 		assert(size != 0);
 		this->edit_str_buf = CallocT<char>(size);
+		this->osk_ok = osk_ok;
+		this->osk_cancel = osk_cancel;
 	}
 
 	~QueryStringBaseWindow()
@@ -66,7 +71,8 @@
 
 	void DrawEditBox(int wid);
 	void HandleEditBox(int wid);
-	int HandleEditBoxKey(int wid, uint16 key, uint16 keycode, EventState &state);
+	HandleEditBoxResult HandleEditBoxKey(int wid, uint16 key, uint16 keycode, EventState &state);
+	virtual void OnOpenOSKWindow(int wid);
 };
 
 void ShowOnScreenKeyboard(QueryStringBaseWindow *parent, int button, int cancel, int ok);
Index: src/window_gui.h
===================================================================
--- src/window_gui.h	(revision 14572)
+++ src/window_gui.h	(working copy)
@@ -224,6 +224,7 @@
 	Widget *widget;        ///< Widgets of the window
 	uint widget_count;     ///< Number of widgets of the window
 	uint32 desc_flags;     ///< Window/widgets default flags setting, @see WindowDefaultFlag
+	const Widget *focused_widget; ///< Currently focused widget or 0, if no widget have focus
 
 	Window *parent;        ///< Parent window
 
@@ -237,6 +238,9 @@
 	void HideWidget(byte widget_index);
 	void ShowWidget(byte widget_index);
 	bool IsWidgetHidden(byte widget_index) const;
+	void SetFocusedWidget(byte widget_index);
+	bool IsWidgetGlobalyFocused(byte widget_index) const;
+	bool IsWidgetFocused(byte widget_index) const;
 	void SetWidgetLoweredState(byte widget_index, bool lowered_stat);
 	void ToggleWidgetLoweredState(byte widget_index);
 	void LowerWidget(byte widget_index);
@@ -266,6 +270,8 @@
 	 */
 	virtual void OnPaint() {}
 
+	virtual void OnFocus() {}
+	virtual void OnFocusLost() {}
 
 	/**
 	 * A key has been pressed.
@@ -286,8 +292,8 @@
 
 	/**
 	 * A click with the left mouse button has been made on the window.
-	 * @param pt     the point inside the window that has been clicked.
-	 * @param widget the clicked widget.
+	 * @param pt                     the point inside the window that has been clicked.
+	 * @param widget                 the clicked widget.
 	 */
 	virtual void OnClick(Point pt, int widget) {}
 
@@ -313,6 +319,13 @@
 	virtual void OnDragDrop(Point pt, int widget) {}
 
 	/**
+	 * An 'object' is being dragged.
+	 * @param pt     the point inside the window where the cursor points to.
+	 * @param widget the widget where the cursor points to.
+	 */
+	virtual void OnDragMove(Point pt, int widget) {}
+
+	/**
 	 * Handle the request for (viewport) scrolling.
 	 * @param delta the amount the viewport must be scrolled.
 	 */
@@ -477,7 +490,7 @@
 	WWT_CLOSEBOX,   ///< Close box (at top-left of a window)
 	WWT_DROPDOWN,   ///< Raised drop down list (regular)
 	WWT_DROPDOWNIN, ///< Inset drop down list (used on game options only)
-	WWT_EDITBOX,    ///< a textbox for typing (don't forget to call ShowOnScreenKeyboard() when clicked)
+	WWT_EDITBOX,    ///< a textbox for typing
 	WWT_LAST,       ///< Last Item. use WIDGETS_END to fill up padding!!
 
 	WWT_MASK = 0x1F,
@@ -539,6 +552,7 @@
 /* window.cpp */
 extern Window *_z_windows[];
 extern Window **_last_z_window;
+extern Window *_focused_window;
 
 /** Iterate over all windows */
 #define FOR_ALL_WINDOWS(wz) for (wz = _z_windows; wz != _last_z_window; wz++)
@@ -555,9 +569,6 @@
 	SCROLL_CHAT = 4,
 };
 
-/** Disable scrolling of the main viewport when an input-window is active. */
-extern byte _no_scroll;
-
 extern Point _cursorpos_drag_start;
 
 extern int _scrollbar_start_pos;
@@ -578,6 +589,10 @@
 Window *GetCallbackWnd();
 Window **FindWindowZPosition(const Window *w);
 
+void SetFocusedWindow(Window* w);
+const Widget *GetGlobalyFocusedWidget();
+bool EditBoxInGlobalFocus();
+
 void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y);
 
 void ResizeButtons(Window *w, byte left, byte right);
@@ -674,6 +689,39 @@
 }
 
 /**
+ * Set focus within this window to given widget. The function however don't
+ * change which window that has focus.
+ * @param widget_index : index of the widget in the window to set focus to
+ */
+inline void Window::SetFocusedWidget(byte widget_index)
+{
+	if (widget_index < this->widget_count) {
+		this->focused_widget = &this->widget[widget_index];
+	}
+}
+
+/**
+ * Check if given widget has user input focus. This means that both the window
+ * has focus and that the given widget has focus within the window.
+ * @param widget_index : index of the widget in the window to check
+ * @return true if given widget is the focused window in this window and this window has focus
+ */
+inline bool Window::IsWidgetGlobalyFocused(byte widget_index) const
+{
+	return _focused_window == this && IsWidgetFocused(widget_index);
+}
+
+/**
+ * Check if given widget is focused within this window
+ * @param widget_index : index of the widget in the window to check
+ * @return true if given widget is the focused window in this window
+ */
+inline bool Window::IsWidgetFocused(byte widget_index) const
+{
+	return this->focused_widget == &this->widget[widget_index];
+}
+
+/**
  * Sets the lowered/raised status of a widget.
  * @param widget_index index of this widget in the window
  * @param lowered_stat status to use ie: lowered = true, raised = false
Index: src/company_cmd.cpp
===================================================================
--- src/company_cmd.cpp	(revision 14572)
+++ src/company_cmd.cpp	(working copy)
@@ -55,6 +55,7 @@
 Company::Company(uint16 name_1, bool is_ai) : name_1(name_1), is_ai(is_ai)
 {
 	for (uint j = 0; j < 4; j++) this->share_owners[j] = COMPANY_SPECTATOR;
+	this->window = -1;
 }
 
 Company::~Company()
Index: src/command.cpp
===================================================================
--- src/command.cpp	(revision 14572)
+++ src/command.cpp	(working copy)
@@ -18,6 +18,9 @@
 #include "town.h"
 #include "date_func.h"
 #include "debug.h"
+#include "window_func.h"
+#include "viewport_type.h"
+#include "viewport_func.h"
 #include "company_func.h"
 #include "company_base.h"
 #include "signal_func.h"
@@ -442,7 +445,17 @@
 		SubtractMoneyFromCompany(res);
 		/* XXX - Old AI hack which doesn't use DoCommandDP; update last build coord of company */
 		if (tile != 0 && IsValidCompanyID(_current_company)) {
-			GetCompany(_current_company)->last_build_coordinate = tile;
+			Company *c = GetCompany(_current_company);
+			if (c->last_build_coordinate != tile) {
+				c->last_build_coordinate = tile;
+				if (c->window != -1) {
+					Window *w = FindWindowById(WC_EXTRA_VIEW_PORT, c->window);
+					if (w != NULL)
+						ScrollWindowTo(TileX(tile) * TILE_SIZE + TILE_SIZE / 2, TileY(tile) * TILE_SIZE + TILE_SIZE / 2, w, true);
+					else
+						c->window = -1;
+				}
+			}
 		}
 	}
 
@@ -602,7 +615,17 @@
 
 	/* update last build coordinate of company. */
 	if (tile != 0 && IsValidCompanyID(_current_company)) {
-		GetCompany(_current_company)->last_build_coordinate = tile;
+		Company *c = GetCompany(_current_company);
+		if (c->last_build_coordinate != tile) {
+			c->last_build_coordinate = tile;
+			if (c->window != -1) {
+				Window *w = FindWindowById(WC_EXTRA_VIEW_PORT, c->window);
+				if (w != NULL)
+					ScrollWindowTo(TileX(tile) * TILE_SIZE + TILE_SIZE / 2, TileY(tile) * TILE_SIZE + TILE_SIZE / 2, w, true);
+				else
+					c->window = -1;
+			}
+		}
 	}
 
 	/* Actually try and execute the command. If no cost-type is given
Index: src/rail_gui.cpp
===================================================================
--- src/rail_gui.cpp	(revision 14572)
+++ src/rail_gui.cpp	(working copy)
@@ -144,7 +144,7 @@
 		DiagDirection dir = (DiagDirection)p2;
 
 		SndPlayTileFx(SND_20_SPLAT_2, tile);
-		ResetObjectToPlace();
+		if (! _settings_client.gui.persistant_buildtools) ResetObjectToPlace();
 
 		tile += TileOffsByDiagDir(dir);
 
@@ -175,8 +175,8 @@
 {
 	if (success) {
 		SndPlayTileFx(SND_20_SPLAT_2, tile);
-		/* Only close the station builder window if the default station is chosen. */
-		if (_railstation.station_class == STAT_CLASS_DFLT && _railstation.station_type == 0) ResetObjectToPlace();
+		/* Only close the station builder window if the default station and non persistant building is chosen. */
+		if (_railstation.station_class == STAT_CLASS_DFLT && _railstation.station_type == 0 && (! _settings_client.gui.persistant_buildtools)) ResetObjectToPlace();
 	}
 }
 
@@ -257,7 +257,7 @@
 {
 	if (success) {
 		SndPlayTileFx(SND_20_SPLAT_2, tile);
-		ResetObjectToPlace();
+		if (! _settings_client.gui.persistant_buildtools) ResetObjectToPlace(); 
 	} else {
 		SetRedErrorSquare(_build_tunnel_endtile);
 	}
@@ -710,7 +710,7 @@
 			switch (select_proc) {
 				default: NOT_REACHED();
 				case DDSP_BUILD_BRIDGE:
-					ResetObjectToPlace();
+					if (! _settings_client.gui.persistant_buildtools) ResetObjectToPlace();
 					ShowBuildBridgeWindow(start_tile, end_tile, TRANSPORT_RAIL, _cur_railtype);
 					break;
 
Index: src/company_base.h
===================================================================
--- src/company_base.h	(revision 14572)
+++ src/company_base.h	(working copy)
@@ -71,6 +71,8 @@
 
 	bool is_ai;
 
+	int window;
+
 	Money yearly_expenses[3][EXPENSES_END];
 	CompanyEconomyEntry cur_economy;
 	CompanyEconomyEntry old_economy[24];
Index: src/settings_type.h
===================================================================
--- src/settings_type.h	(revision 14572)
+++ src/settings_type.h	(working copy)
@@ -82,6 +82,15 @@
 	bool   show_track_reservation;           ///< highlight reserved tracks.
 	uint8  default_signal_type;              ///< the signal type to build by default.
 	uint8  cycle_signal_types;               ///< what signal types to cycle with the build signal tool.
+	bool   persistant_buildtools;            ///< keep the build tools active after usage
+	bool   auto_screenshot;                  ///< automatically takes a giant screenshot (whole map) in a set interval.
+	uint16 auto_screenshot_interval;         ///< the interval for automatic giant screenshots.
+	uint8  auto_screenshot_zoomlvl;          ///< the zoom level used for automatic giant screenshots (zoomed out means smaller filesize but less quality).
+	bool   auto_local_screen;                ///< automatically takes local screenshots (at signs starting with #) in a set interval.
+	uint16 auto_local_screen_interval;       ///< the interval for automatic local screenshots.
+	uint16 auto_local_screen_zoomlvl;        ///< the zoom level used for automatic local screenshots.
+	uint16 auto_local_screen_size_x;         ///< width of automatic local screenshots.
+	uint16 auto_local_screen_size_y;         ///< heigth of automatic local screenshots.
 
 	uint16 console_backlog_timeout;          ///< the minimum amount of time items should be in the console backlog before they will be removed in ~3 seconds granularity.
 	uint16 console_backlog_length;           ///< the minimum amount of items in the console backlog before items will be removed.
Index: src/window.cpp
===================================================================
--- src/window.cpp	(revision 14572)
+++ src/window.cpp	(working copy)
@@ -24,6 +24,7 @@
 #include "window_func.h"
 #include "tilehighlight_func.h"
 #include "network/network.h"
+#include "querystring_gui.h"
 
 #include "table/sprites.h"
 
@@ -38,7 +39,13 @@
 Window *_z_windows[MAX_NUMBER_OF_WINDOWS];
 Window **_last_z_window; ///< always points to the next free space in the z-array
 
-byte _no_scroll;
+/*
+ * Window that currently have focus. - The main purpose is to generate
+ * FocusLost events, not to give next window in z-order focus when a
+ * window is closed.
+ */
+Window *_focused_window;
+
 Point _cursorpos_drag_start;
 
 int _scrollbar_start_pos;
@@ -50,7 +57,39 @@
 
 byte _special_mouse_mode;
 
+void SetFocusedWindow(Window* w)
+{
+	if (_focused_window == w) {
+		return;
+	}
 
+	/* Invalidate focused widget */
+	if (_focused_window && _focused_window->focused_widget) {
+		uint focused_widget_id = _focused_window->focused_widget - _focused_window->widget;
+		_focused_window->InvalidateWidget(focused_widget_id);
+	}
+
+	/* Remember which window was previously focused */
+	Window* old_focused = _focused_window;
+	_focused_window = w;
+
+	/* So we can inform it that it lost focus */
+	if (old_focused) old_focused->OnFocusLost();
+	if (_focused_window) _focused_window->OnFocus();
+}
+
+const Widget *GetGlobalyFocusedWidget()
+{
+	return _focused_window != NULL ? _focused_window->focused_widget : NULL;
+}
+
+bool EditBoxInGlobalFocus()
+{
+	const Widget *wi = GetGlobalyFocusedWidget();
+
+	return wi != NULL && wi->type == WWT_EDITBOX;
+}
+
 /**
  * Sets the enabled/disabled status of a list of widgets.
  * By default, widgets are enabled.
@@ -163,9 +202,27 @@
  */
 static void DispatchLeftClickEvent(Window *w, int x, int y, bool double_click)
 {
+	bool focused_widget_changed = false;
 	int widget = 0;
 	if (w->desc_flags & WDF_DEF_WIDGET) {
 		widget = GetWidgetFromPos(w, x, y);
+
+		/* If clicked on a window that previously did dot have focus */
+		if (_focused_window != w) {
+			focused_widget_changed = true;
+			if (_focused_window) {
+				_focused_window->OnFocusLost();
+
+				/* The window that lost focus may have had opened a OSK, window so close it, unless the user has clicked on the OSK window. */
+				if (w->window_class != WC_OSK) {
+					Window *osk_window = FindWindowById(WC_OSK, 0);
+					delete osk_window;
+				}
+			}
+			SetFocusedWindow(w);
+			w->OnFocus();
+		}
+
 		if (widget < 0) return; // exit if clicked outside of widgets
 
 		/* don't allow any interaction if the button has been disabled */
@@ -173,6 +230,21 @@
 
 		const Widget *wi = &w->widget[widget];
 
+		/* Clicked on a widget that is not disabled.
+		 * So unless the clicked widget is the caption bar, change focus to this widget */
+		if (wi->type != WWT_CAPTION) {
+			/* Close the OSK window if a edit box loses focus */
+			if (w->focused_widget && w->focused_widget->type == WWT_EDITBOX && // An edit box was previously selected
+					w->focused_widget != wi &&                                 // and focus is going to change
+					w->window_class != WC_OSK) {                               // and it is not the OSK window
+				Window *osk_window = FindWindowById(WC_OSK, 0);
+				delete osk_window;
+			}
+
+			if (w->focused_widget != wi) focused_widget_changed = true;
+			w->focused_widget = wi;
+		}
+
 		if (wi->type & WWB_MASK) {
 			/* special widget handling for buttons*/
 			switch (wi->type) {
@@ -184,6 +256,12 @@
 			}
 		} else if (wi->type == WWT_SCROLLBAR || wi->type == WWT_SCROLL2BAR || wi->type == WWT_HSCROLLBAR) {
 			ScrollbarClickHandler(w, wi, x, y);
+		} else if (wi->type == WWT_EDITBOX && !focused_widget_changed)	{ // Only open the OSK window if clicking on an allready focused edit box
+			QueryStringBaseWindow *qs = dynamic_cast<QueryStringBaseWindow*>(w);
+			if (qs != NULL) {
+				const uint widget_index = wi - w->widget;
+				qs->OnOpenOSKWindow(widget_index);
+			}
 		}
 
 		if (w->desc_flags & WDF_STD_BTN) {
@@ -447,6 +525,9 @@
 	/* Prevent Mouseover() from resetting mouse-over coordinates on a non-existing window */
 	if (_mouseover_last_w == this) _mouseover_last_w = NULL;
 
+	/* Make sure we don't try to access this window as the focused window when it don't exist anymore. */
+	if (_focused_window == this) _focused_window = NULL;
+
 	/* Find the window in the z-array, and effectively remove it
 	 * by moving all windows after it one to the left. This must be
 	 * done before removing the child so we cannot cause recursion
@@ -729,12 +810,17 @@
 	this->width = min_width;
 	this->height = min_height;
 	AssignWidgetToWindow(this, widget);
+	this->focused_widget = 0;
 	this->resize.width = min_width;
 	this->resize.height = min_height;
 	this->resize.step_width = 1;
 	this->resize.step_height = 1;
 	this->window_number = window_number;
 
+	/* Give focus to the opened winodw unless it is the OSK window or a text box
+	 * of focused window has focus (so we don't interupt typing). */
+	if (this->window_class != WC_OSK && !EditBoxInGlobalFocus()) SetFocusedWindow(this);
+
 	/* Hacky way of specifying always-on-top windows. These windows are
 		* always above other windows because they are moved below them.
 		* status-bar is above news-window because it has been created earlier.
@@ -1110,8 +1196,8 @@
 	IConsoleClose();
 
 	_last_z_window = _z_windows;
+	_focused_window = 0;
 	_mouseover_last_w = NULL;
-	_no_scroll = 0;
 	_scrolling_viewport = 0;
 }
 
@@ -1184,7 +1270,6 @@
 static bool HandleDragDrop()
 {
 	if (_special_mouse_mode != WSM_DRAGDROP) return true;
-	if (_left_button_down) return false;
 
 	Window *w = GetCallbackWnd();
 
@@ -1193,7 +1278,13 @@
 		Point pt;
 		pt.x = _cursor.pos.x - w->left;
 		pt.y = _cursor.pos.y - w->top;
-		w->OnDragDrop(pt, GetWidgetFromPos(w, pt.x, pt.y));
+
+		if (_left_button_down) {
+			w->OnDragMove(pt, GetWidgetFromPos(w, pt.x, pt.y));
+			return false;
+		} else {
+			w->OnDragDrop(pt, GetWidgetFromPos(w, pt.x, pt.y));
+		}
 	}
 
 	ResetObjectToPlace();
@@ -1660,11 +1751,6 @@
  */
 void HandleKeypress(uint32 raw_key)
 {
-	/* Stores if a window with a textfield for typing is open
-	 * If this is the case, keypress events are only passed to windows with text fields and
-	 * to thein this main toolbar. */
-	bool query_open = false;
-
 	/*
 	* During the generation of the world, there might be
 	* another thread that is currently building for example
@@ -1694,30 +1780,20 @@
 	 */
 	if (key == 0 && keycode == 0) return;
 
-	/* check if we have a query string window open before allowing hotkeys */
-	if (FindWindowById(WC_QUERY_STRING,            0) != NULL ||
-			FindWindowById(WC_SEND_NETWORK_MSG,        0) != NULL ||
-			FindWindowById(WC_GENERATE_LANDSCAPE,      0) != NULL ||
-			FindWindowById(WC_CONSOLE,                 0) != NULL ||
-			FindWindowById(WC_SAVELOAD,                0) != NULL ||
-			FindWindowById(WC_COMPANY_PASSWORD_WINDOW, 0) != NULL) {
-		query_open = true;
+	/* Check if the focused window has a focused editbox */
+	if (_focused_window != NULL &&
+			(_focused_window->window_class == WC_CONSOLE || // The console does not have an edit box so a special case is needed
+			_focused_window->focused_widget != NULL &&
+			_focused_window->focused_widget->type == WWT_EDITBOX))
+	{
+		/* All input will in this case go to the focused window */
+		_focused_window->OnKeyPress(key, keycode);
+		return;
 	}
 
 	/* Call the event, start with the uppermost window. */
 	for (Window* const *wz = _last_z_window; wz != _z_windows;) {
 		Window *w = *--wz;
-
-		/* if a query window is open, only call the event for certain window types */
-		if (query_open &&
-				w->window_class != WC_QUERY_STRING &&
-				w->window_class != WC_SEND_NETWORK_MSG &&
-				w->window_class != WC_GENERATE_LANDSCAPE &&
-				w->window_class != WC_CONSOLE &&
-				w->window_class != WC_SAVELOAD &&
-				w->window_class != WC_COMPANY_PASSWORD_WINDOW) {
-			continue;
-		}
 		if (w->OnKeyPress(key, keycode) == Window::ES_HANDLED) return;
 	}
 
@@ -1840,7 +1916,11 @@
 
 static void HandleKeyScrolling()
 {
-	if (_dirkeys && !_no_scroll) {
+	/*
+	 * Check that any of the dirkeys is pressed and that the focused window
+	 * dont has an edit-box as focused widget.
+	 */
+	if (_dirkeys && !(_focused_window != NULL && _focused_window->focused_widget != NULL && _focused_window->focused_widget->type == WWT_EDITBOX)) {
 		int factor = _shift_pressed ? 50 : 10;
 		ScrollMainViewport(scrollamt[_dirkeys][0] * factor, scrollamt[_dirkeys][1] * factor);
 	}
Index: src/screenshot.h
===================================================================
--- src/screenshot.h	(revision 14572)
+++ src/screenshot.h	(working copy)
@@ -13,10 +13,12 @@
 enum ScreenshotType {
 	SC_NONE,
 	SC_VIEWPORT,
-	SC_WORLD
+	SC_WORLD,
+	SC_TIMELAPSE,
+	SC_TIMELAPSE_LOCAL
 };
 
-bool MakeScreenshot();
+bool MakeScreenshot(const void *si = NULL);
 void SetScreenshotType(ScreenshotType t);
 bool IsScreenshotRequested();
 
Index: src/company_gui.cpp
===================================================================
--- src/company_gui.cpp	(revision 14572)
+++ src/company_gui.cpp	(working copy)
@@ -1054,6 +1054,8 @@
 	CW_WIDGET_BUY_SHARE,
 	CW_WIDGET_SELL_SHARE,
 	CW_WIDGET_COMPANY_PASSWORD,
+	CW_WIDGET_CENTER,
+	CW_WIDGET_OPEN,
 };
 
 static const Widget _company_widgets[] = {
@@ -1069,6 +1071,8 @@
 { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,     0,   179,   158,   169, STR_7077_BUY_25_SHARE_IN_COMPANY,  STR_7079_BUY_25_SHARE_IN_THIS_COMPANY},
 { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   180,   359,   158,   169, STR_7078_SELL_25_SHARE_IN_COMPANY, STR_707A_SELL_25_SHARE_IN_THIS_COMPANY},
 { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   266,   355,   138,   149, STR_COMPANY_PASSWORD,              STR_COMPANY_PASSWORD_TOOLTIP},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   266,   355,    46,    57, STR_COMPANY_CENTER,                STR_COMPANY_CENTER_VIEWPORT},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   266,   355,    60,    71, STR_COMPANY_OPEN,                  STR_COMPANY_OPEN_VIEWPORT},
 {   WIDGETS_END},
 };
 
@@ -1290,6 +1294,21 @@
 				DoCommandP(0, this->window_number, 0, NULL, CMD_BUY_SHARE_IN_COMPANY | CMD_MSG(STR_707B_CAN_T_BUY_25_SHARE_IN_THIS));
 				break;
 
+			case CW_WIDGET_CENTER:
+				ScrollMainWindowToTile(GetCompany((CompanyID)this->window_number)->last_build_coordinate);
+				break;
+
+			case CW_WIDGET_OPEN: {
+				int window = ShowExtraViewPortWindow();
+				Company *c = GetCompany((CompanyID)this->window_number);
+				TileIndex tile = c->last_build_coordinate;
+
+				c->window = window;
+				ScrollWindowTo(TileX(tile) * TILE_SIZE + TILE_SIZE / 2, TileY(tile) * TILE_SIZE + TILE_SIZE / 2, FindWindowById(WC_EXTRA_VIEW_PORT, window), true);
+				break;
+			}
+
+
 			case CW_WIDGET_SELL_SHARE:
 				DoCommandP(0, this->window_number, 0, NULL, CMD_SELL_SHARE_IN_COMPANY | CMD_MSG(STR_707C_CAN_T_SELL_25_SHARE_IN));
 				break;
Index: src/gui.h
===================================================================
--- src/gui.h	(revision 14572)
+++ src/gui.h	(working copy)
@@ -61,7 +61,7 @@
 void ShowErrorMessage(StringID msg_1, StringID msg_2, int x, int y);
 
 void ShowSmallMap();
-void ShowExtraViewPortWindow(TileIndex tile = INVALID_TILE);
+int ShowExtraViewPortWindow(TileIndex tile = INVALID_TILE);
 
 void BuildFileList();
 void SetFiosType(const byte fiostype);
Index: src/network/network_client.cpp
===================================================================
--- src/network/network_client.cpp	(revision 14572)
+++ src/network/network_client.cpp	(working copy)
@@ -519,9 +519,14 @@
 			_password_game_seed = p->Recv_uint32();
 			p->Recv_string(_password_server_unique_id, sizeof(_password_server_unique_id));
 			if (MY_CLIENT->has_quit) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
-
+			if (_company_pw != NULL) _login_pw = _company_pw;
 		case NETWORK_GAME_PASSWORD:
-			ShowNetworkNeedPassword(type);
+			if (_login_pw == NULL) {
+			    ShowNetworkNeedPassword(type);
+			} else {
+			    SEND_COMMAND(PACKET_CLIENT_PASSWORD)(type, _login_pw);
+			    _login_pw = NULL;
+			}
 			return NETWORK_RECV_STATUS_OKAY;
 
 		default: return NETWORK_RECV_STATUS_MALFORMED_PACKET;
Index: src/network/network_internal.h
===================================================================
--- src/network/network_internal.h	(revision 14572)
+++ src/network/network_internal.h	(working copy)
@@ -127,6 +127,9 @@
 //  (and the client uses [0] for his own communication)
 extern NetworkTCPSocketHandler _clients[MAX_CLIENTS];
 
+extern char *_login_pw;                      // login password from -p argument
+extern char *_company_pw;                    // company password from -P argument
+
 void NetworkTCPQueryServer(const char* host, unsigned short port);
 
 void NetworkAddServer(const char *b);
Index: src/network/network_chat_gui.cpp
===================================================================
--- src/network/network_chat_gui.cpp	(revision 14572)
+++ src/network/network_chat_gui.cpp	(working copy)
@@ -268,16 +268,16 @@
 	DestType dtype;
 	int dest;
 
-	NetworkChatWindow (const WindowDesc *desc, DestType type, int dest) : QueryStringBaseWindow(NETWORK_CHAT_LENGTH, desc)
+	NetworkChatWindow (const WindowDesc *desc, DestType type, int dest) : QueryStringBaseWindow(NETWORK_CHAT_LENGTH, desc, 0, 3)
 	{
 		this->LowerWidget(2);
 		this->dtype   = type;
 		this->dest    = dest;
 		this->afilter = CS_ALPHANUMERAL;
 		InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, 0);
+		this->SetFocusedWidget(2);
 
 		InvalidateWindowData(WC_NEWS_WINDOW, 0, this->height);
-		SetBit(_no_scroll, SCROLL_CHAT); // do not scroll the game with the arrow-keys
 
 		_chat_tab_completion_active = false;
 
@@ -287,7 +287,6 @@
 	~NetworkChatWindow ()
 	{
 		InvalidateWindowData(WC_NEWS_WINDOW, 0, 0);
-		ClrBit(_no_scroll, SCROLL_CHAT);
 	}
 
 	/**
@@ -443,10 +442,6 @@
 	virtual void OnClick(Point pt, int widget)
 	{
 		switch (widget) {
-			case 2:
-				ShowOnScreenKeyboard(this, 2, 0, 3);
-				break;
-
 			case 3: /* Send */
 				SendChat(this->text.buf, this->dtype, this->dest);
 			/* FALLTHROUGH */
@@ -476,10 +471,16 @@
 					SendChat(this->text.buf, this->dtype, this->dest);
 				/* FALLTHROUGH */
 				case HEBR_CANCEL: delete this; break;
+				case HEBR_NOT_FOCUSED: break;
 			}
 		}
 		return state;
 	}
+
+	virtual void OnOpenOSKWindow(int wid)
+	{
+		ShowOnScreenKeyboard(this, wid, 0, 3);
+	}
 };
 
 static const Widget _chat_window_widgets[] = {
Index: src/network/network_gui.cpp
===================================================================
--- src/network/network_gui.cpp	(revision 14572)
+++ src/network/network_gui.cpp	(working copy)
@@ -310,11 +310,12 @@
 	}
 
 public:
-	NetworkGameWindow(const WindowDesc *desc) : QueryStringBaseWindow(NETWORK_NAME_LENGTH, desc)
+	NetworkGameWindow(const WindowDesc *desc) : QueryStringBaseWindow(NETWORK_NAME_LENGTH, desc, 0, 0)
 	{
 		ttd_strlcpy(this->edit_str_buf, _settings_client.network.client_name, this->edit_str_size);
 		this->afilter = CS_ALPHANUMERAL;
 		InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, 120);
+		this->SetFocusedWidget(NGWW_CLIENT);
 
 		UpdateNetworkGameWindow(true);
 
@@ -473,10 +474,6 @@
 	{
 		this->field = widget;
 		switch (widget) {
-			case NGWW_CLIENT:
-				ShowOnScreenKeyboard(this, NGWW_CLIENT, 0, 0);
-				break;
-
 			case NGWW_CANCEL: // Cancel button
 				DeleteWindowById(WC_NETWORK_WINDOW, 0);
 				break;
@@ -852,7 +849,7 @@
 	FiosItem *map;               ///< Selected map
 	byte widget_id;              ///< The widget that has the pop-up input menu
 
-	NetworkStartServerWindow(const WindowDesc *desc) : QueryStringBaseWindow(NETWORK_NAME_LENGTH, desc)
+	NetworkStartServerWindow(const WindowDesc *desc) : QueryStringBaseWindow(NETWORK_NAME_LENGTH, desc, 0, 0)
 	{
 		ttd_strlcpy(this->edit_str_buf, _settings_client.network.server_name, this->edit_str_size);
 
@@ -863,6 +860,7 @@
 
 		this->afilter = CS_ALPHANUMERAL;
 		InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, 160);
+		this->SetFocusedWidget(NSSW_GAMENAME);
 
 		this->field = NSSW_GAMENAME;
 
@@ -917,10 +915,6 @@
 				ShowNetworkGameWindow();
 				break;
 
-			case NSSW_GAMENAME:
-				ShowOnScreenKeyboard(this, NSSW_GAMENAME, 0, 0);
-				break;
-
 			case NSSW_SETPWD: // Set password button
 				this->widget_id = NSSW_SETPWD;
 				SetDParamStr(0, _settings_client.network.server_password);
@@ -1848,11 +1842,12 @@
 };
 
 struct NetworkCompanyPasswordWindow : public QueryStringBaseWindow {
-	NetworkCompanyPasswordWindow(const WindowDesc *desc, Window *parent) : QueryStringBaseWindow(lengthof(_settings_client.network.default_company_pass), desc)
+	NetworkCompanyPasswordWindow(const WindowDesc *desc, Window *parent) : QueryStringBaseWindow(lengthof(_settings_client.network.default_company_pass), desc, 2, 1)
 	{
 		this->parent = parent;
 		this->afilter = CS_ALPHANUMERAL;
 		InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, 0);
+		this->SetFocusedWidget(4);
 
 		this->FindWindowPlacementAndResize(desc);
 	}
@@ -1890,10 +1885,6 @@
 				this->ToggleWidgetLoweredState(NCPWW_SAVE_AS_DEFAULT_PASSWORD);
 				this->SetDirty();
 				break;
-
-			case NCPWW_PASSWORD:
-				ShowOnScreenKeyboard(this, NCPWW_PASSWORD, NCPWW_CANCEL, NCPWW_OK);
-				break;
 		}
 	}
 
@@ -1918,6 +1909,11 @@
 		}
 		return state;
 	}
+
+	virtual void OnOpenOSKWindow(int wid)
+	{
+		ShowOnScreenKeyboard(this, wid, NCPWW_CANCEL, NCPWW_OK);
+	}
 };
 
 static const Widget _ncp_window_widgets[] = {
Index: src/dock_gui.cpp
===================================================================
--- src/dock_gui.cpp	(revision 14572)
+++ src/dock_gui.cpp	(working copy)
@@ -35,7 +35,7 @@
 {
 	if (success) {
 		SndPlayTileFx(SND_02_SPLAT, tile);
-		ResetObjectToPlace();
+		if (! _settings_client.gui.persistant_buildtools) ResetObjectToPlace();
 	}
 }
 
@@ -215,7 +215,7 @@
 		if (pt.x != -1) {
 			switch (select_proc) {
 				case DDSP_BUILD_BRIDGE:
-					ResetObjectToPlace();
+					if (! _settings_client.gui.persistant_buildtools) ResetObjectToPlace();
 					extern void CcBuildBridge(bool success, TileIndex tile, uint32 p1, uint32 p2);
 					DoCommandP(end_tile, start_tile, TRANSPORT_WATER << 15, CcBuildBridge, CMD_BUILD_BRIDGE | CMD_MSG(STR_CAN_T_BUILD_AQUEDUCT_HERE));
 
Index: src/road_gui.cpp
===================================================================
--- src/road_gui.cpp	(revision 14572)
+++ src/road_gui.cpp	(working copy)
@@ -118,7 +118,7 @@
 {
 	if (success) {
 		SndPlayTileFx(SND_20_SPLAT_2, tile);
-		ResetObjectToPlace();
+		if (! _settings_client.gui.persistant_buildtools) ResetObjectToPlace();
 	} else {
 		SetRedErrorSquare(_build_tunnel_endtile);
 	}
@@ -191,7 +191,7 @@
 	if (success) {
 		DiagDirection dir = (DiagDirection)GB(p1, 0, 2);
 		SndPlayTileFx(SND_1F_SPLAT, tile);
-		ResetObjectToPlace();
+		if (! _settings_client.gui.persistant_buildtools) ResetObjectToPlace();
 		BuildRoadOutsideStation(tile, dir);
 		/* For a drive-through road stop build connecting road for other entrance */
 		if (HasBit(p2, 1)) BuildRoadOutsideStation(tile, ReverseDiagDir(dir));
@@ -579,7 +579,7 @@
 			switch (select_proc) {
 				default: NOT_REACHED();
 				case DDSP_BUILD_BRIDGE:
-					ResetObjectToPlace();
+					if (! _settings_client.gui.persistant_buildtools) ResetObjectToPlace();
 					ShowBuildBridgeWindow(start_tile, end_tile, TRANSPORT_ROAD, RoadTypeToRoadTypes(_cur_roadtype));
 					break;
 
Index: src/tree_gui.cpp
===================================================================
--- src/tree_gui.cpp	(revision 14572)
+++ src/tree_gui.cpp	(working copy)
@@ -5,6 +5,7 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "window_gui.h"
+#include "window_func.h"
 #include "gfx_func.h"
 #include "tilehighlight_func.h"
 #include "company_func.h"
@@ -58,6 +59,13 @@
 		this->FindWindowPlacementAndResize(desc);
 	}
 
+	void ActivateRandomTrees() {
+		// make "random trees" being pushed
+		ResetObjectToPlace();
+		if (HandlePlacePushButton(this, BTW_TYPE_RANDOM, SPR_CURSOR_TREE, VHM_RECT, NULL)) {
+			this->tree_to_plant = -1;
+		}
+	}
 	virtual void OnPaint()
 	{
 		static const PalSpriteID tree_sprites[] = {
@@ -104,9 +112,7 @@
 				break;
 
 			case BTW_TYPE_RANDOM: // tree of random type.
-				if (HandlePlacePushButton(this, BTW_TYPE_RANDOM, SPR_CURSOR_TREE, VHM_RECT, NULL)) {
-					this->tree_to_plant = -1;
-				}
+				ActivateRandomTrees();
 				break;
 
 			case BTW_MANY_RANDOM: // place trees randomly over the landscape
@@ -181,5 +187,7 @@
 void ShowBuildTreesToolbar()
 {
 	if (_game_mode != GM_EDITOR && !IsValidCompanyID(_current_company)) return;
-	AllocateWindowDescFront<BuildTreesWindow>(&_build_trees_desc, 0);
+	BuildTreesWindow *w = AllocateWindowDescFront<BuildTreesWindow>(&_build_trees_desc, 0);
+	if(w==NULL)	w = dynamic_cast<BuildTreesWindow*>(FindWindowById(WC_BUILD_TREES,0));
+	w->ActivateRandomTrees();
 }
Index: src/osk_gui.cpp
===================================================================
--- src/osk_gui.cpp	(revision 14572)
+++ src/osk_gui.cpp	(working copy)
@@ -66,7 +66,6 @@
 		/* make a copy in case we need to reset later */
 		this->orig_str_buf = strdup(this->qs->text.buf);
 
-		SetBit(_no_scroll, SCROLL_EDIT);
 		/* Not needed by default. */
 		this->DisableWidget(OSK_WIDGET_SPECIAL);
 
@@ -138,6 +137,21 @@
 		bool delete_this = false;
 
 		switch (widget) {
+			case OSK_WIDGET_TEXT:
+				/* Find the edit box of the parent window and give focus to that */
+				for (uint i = 0; i < this->parent->widget_count; i++) {
+					Widget &wi = this->parent->widget[i];
+					if (wi.type == WWT_EDITBOX) {
+						this->parent->focused_widget = &wi;
+						break;
+					}
+				}
+
+				/* Give focus to parent window */
+				SetFocusedWindow(this->parent);
+
+				break;
+
 			case OSK_WIDGET_BACKSPACE:
 				if (DeleteTextBufferChar(&this->qs->text, WKC_BACKSPACE)) this->InvalidateWidget(OSK_WIDGET_TEXT);
 				break;
Index: src/signs_gui.cpp
===================================================================
--- src/signs_gui.cpp	(revision 14572)
+++ src/signs_gui.cpp	(working copy)
@@ -33,6 +33,12 @@
 	static const Sign *last_sign;
 	GUISignList signs;
 
+	char filter_text[MAX_LENGTH_SIGN_NAME_BYTES];
+
+	SignList(){
+		memset(filter_text, '\0', sizeof(this->filter_text));
+	}
+
 	void BuildSignsList()
 	{
 		if (!this->signs.NeedRebuild()) return;
@@ -41,9 +47,21 @@
 
 		this->signs.Clear();
 
+		bool filter = strlen(this->filter_text) != 0; // Check if there is a filter
 		const Sign *si;
-		FOR_ALL_SIGNS(si) *this->signs.Append() = si;
+		FOR_ALL_SIGNS(si) {
+			/* Get sign string */
+			char buf1[64];
+			SetDParam(0, si->index);
+			GetString(buf1, STR_SIGN_NAME, lastof(buf1));
 
+			/* If there is a filter, check that the sign string matches the 
+			 * filter before adding the sign to sign list. 
+			 */
+			if (!filter || strstr(buf1, this->filter_text)) 
+				*this->signs.Append() = si;
+		}
+
 		this->signs.Compact();
 		this->signs.RebuildDone();
 	}
@@ -51,7 +69,7 @@
 	/** Sort signs by their name */
 	static int CDECL SignNameSorter(const Sign* const *a, const Sign* const *b)
 	{
-		static char buf_cache[64];
+ 		static char buf_cache[64];
 		char buf[64];
 
 		SetDParam(0, (*a)->index);
@@ -77,19 +95,68 @@
 
 const Sign *SignList::last_sign = NULL;
 
-struct SignListWindow : Window, SignList {
-	SignListWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
+/** Enum referring to the widgets of the sign list window */
+enum SignListWidgets {
+	SIGN_LIST_WIDGET_CAPTION = 1,
+	SIGN_LIST_WIDGET_LIST = 3,
+	SIGN_LIST_WIDGET_SCROLLBAR,
+	SIGN_LIST_WIDGET_FILTER_TEXT,
+	SIGN_LIST_WIDGET_FILTER_CLEAR_BTN,
+};
+
+struct SignListWindow : QueryStringBaseWindow, SignList {
+
+	SignListWindow(const WindowDesc *desc, WindowNumber window_number) : QueryStringBaseWindow(MAX_LENGTH_SIGN_NAME_BYTES, desc, SIGN_LIST_WIDGET_FILTER_CLEAR_BTN, 0x0)
 	{
-		this->vscroll.cap = 12;
+		this->vscroll.cap = 11;
 		this->resize.step_height = 10;
 		this->resize.height = this->height - 10 * 7; // minimum if 5 in the list
 
+		this->InitializeFilterTextWidget();
+		this->SetFilterText("");
+
 		this->signs.ForceRebuild();
 		this->signs.NeedResort();
 
 		this->FindWindowPlacementAndResize(desc);
 	}
 
+	void InitializeFilterTextWidget()
+	{
+		this->afilter = CS_ALPHANUMERAL;
+		this->LowerWidget(SIGN_LIST_WIDGET_FILTER_TEXT);
+
+		/* Display an empty string in the edit box */
+		GetString(this->edit_str_buf, STR_EMPTY, lastof(this->edit_str_buf));
+
+		this->edit_str_buf[lengthof(this->edit_str_buf) - 1] = '\0';
+
+		InitializeTextBuffer(&this->text, this->edit_str_buf, MAX_LENGTH_SIGN_NAME_BYTES, 255); // Allow MAX_LENGTH_SIGN_NAME_BYTES characters (including \0)
+
+		this->InvalidateWidget(SIGN_LIST_WIDGET_FILTER_TEXT);
+	}
+
+	void SetFilterText(const char* new_filter_text)
+	{
+		/* clear this->filter_text */
+		memset(this->filter_text, '\0', sizeof(this->filter_text));
+
+		/* check if there is a new filter text */ 
+		if (new_filter_text != 0 && strlen(new_filter_text) != 0) {
+			/* Copy new filter text */
+			strncpy(this->filter_text, new_filter_text, strlen(new_filter_text));
+			this->filter_text[strlen(new_filter_text)] = '\0';
+		}
+
+		/* Rebuild the list of signs that are displayed */
+		this->signs.ForceRebuild();
+
+		/* Re-paint widgets that need to be repainted */
+		this->InvalidateWidget(SIGN_LIST_WIDGET_LIST);
+		this->InvalidateWidget(SIGN_LIST_WIDGET_SCROLLBAR);
+		this->InvalidateWidget(SIGN_LIST_WIDGET_CAPTION);
+	}
+
 	virtual void OnPaint()
 	{
 		BuildSignsList();
@@ -99,6 +166,7 @@
 
 		SetDParam(0, this->vscroll.count);
 		this->DrawWidgets();
+		this->DrawEditBox(SIGN_LIST_WIDGET_FILTER_TEXT);
 
 		/* No signs? */
 		int y = 16; // offset from top of widget
@@ -121,18 +189,70 @@
 
 	virtual void OnClick(Point pt, int widget)
 	{
-		if (widget == 3) {
-			uint32 id_v = (pt.y - 15) / 10;
+		switch (widget) {
+			case SIGN_LIST_WIDGET_LIST:
+			{ // <- needed or the compiler will complain
+				uint32 id_v = (pt.y - 15) / 10;
 
-			if (id_v >= this->vscroll.cap) return;
-			id_v += this->vscroll.pos;
-			if (id_v >= this->vscroll.count) return;
+				if (id_v >= this->vscroll.cap) return;
+				id_v += this->vscroll.pos;
+				if (id_v >= this->vscroll.count) return;
 
-			const Sign *si = this->signs[id_v];
-			ScrollMainWindowToTile(TileVirtXY(si->x, si->y));
+				const Sign *si = this->signs[id_v];
+				ScrollMainWindowToTile(TileVirtXY(si->x, si->y));
+				break;
+			}
+
+			case SIGN_LIST_WIDGET_FILTER_CLEAR_BTN:
+				this->InitializeFilterTextWidget();
+				this->SetFilterText(0);
+				break;
 		}
 	}
 
+	virtual EventState OnKeyPress(uint16 key, uint16 keycode)
+	{
+		EventState state = ES_NOT_HANDLED;
+		switch (this->HandleEditBoxKey(SIGN_LIST_WIDGET_FILTER_TEXT, key, keycode, state)) {
+			case HEBR_EDITING:
+				break;
+
+			case HEBR_CONFIRM: // Enter pressed -> goto first sign in list
+				if (this->signs.Length() >= 1) {
+					const Sign* si = this->signs[0];
+					ScrollMainWindowToTile(TileVirtXY(si->x, si->y));
+				}
+				return state;
+
+			case HEBR_CANCEL: // ESC pressed, clear filter
+				this->InitializeFilterTextWidget(); // Empty the text in the EditBox widget
+				this->SetFilterText(0);             // Use empty text as filter text (= view all signs)
+				this->focused_widget = 0;			// Unfocus the text box
+				return state;
+
+			case HEBR_NOT_FOCUSED: // The filter text box is not globaly focused				
+				if (keycode == 'F') { // Hotkey to enable filter box
+					this->SetFocusedWidget(SIGN_LIST_WIDGET_FILTER_TEXT);
+					state = ES_HANDLED;
+				}
+				break;
+
+			default:
+				NOT_REACHED();
+		}
+
+		if (state == ES_HANDLED)
+			this->SetFilterText(this->text.buf);
+
+
+		return state;
+	}
+
+	virtual void OnMouseLoop()
+	{
+		this->HandleEditBox(SIGN_LIST_WIDGET_FILTER_TEXT);
+	}
+
 	virtual void OnResize(Point new_size, Point delta)
 	{
 		this->vscroll.cap += delta.y / 10;
@@ -140,7 +260,10 @@
 
 	virtual void OnInvalidateData(int data)
 	{
-		if (data == 0) {
+		/* data == 0: new or deleted sign
+		 * data == 1: sign is renamed
+		 */
+		if (data == 0 || strlen(this->filter_text) != 0) {
 			this->signs.ForceRebuild();
 		} else {
 			this->signs.ForceResort();
@@ -150,10 +273,12 @@
 
 static const Widget _sign_list_widget[] = {
 {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,              STR_018B_CLOSE_WINDOW},
-{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_GREY,    11,   345,     0,    13, STR_SIGN_LIST_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
+{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_GREY,    11,   345,     0,    13, STR_SIGN_LIST_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS},   // SIGN_LIST_WIDGET_CAPTION
 {  WWT_STICKYBOX,     RESIZE_LR,  COLOUR_GREY,   346,   357,     0,    13, 0x0,                   STR_STICKY_BUTTON},
-{      WWT_PANEL,     RESIZE_RB,  COLOUR_GREY,     0,   345,    14,   137, 0x0,                   STR_NULL},
-{  WWT_SCROLLBAR,    RESIZE_LRB,  COLOUR_GREY,   346,   357,    14,   125, 0x0,                   STR_0190_SCROLL_BAR_SCROLLS_LIST},
+{      WWT_PANEL,     RESIZE_RB,  COLOUR_GREY,     0,   345,    14,   126, 0x0,                   STR_NULL},                          // SIGN_LIST_WIDGET_LIST
+{  WWT_SCROLLBAR,    RESIZE_LRB,  COLOUR_GREY,   346,   357,    14,   125, 0x0,                   STR_0190_SCROLL_BAR_SCROLLS_LIST},  // SIGN_LIST_WIDGET_SCROLLBAR
+{    WWT_EDITBOX,    RESIZE_RTB,  COLOUR_GREY,     0,   255,   126,   137, STR_FILTER_OSKTITLE,   STR_NULL},                          // SIGN_LIST_WIDGET_FILTER_TEXT
+{    WWT_TEXTBTN,    RESIZE_LRTB, COLOUR_GREY,     256, 345,   126,   137, STR_FILTER_CLEAR,      STR_NULL},                          // SIGN_LIST_WIDGET_FILTER_CLEAR_BTN
 {  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_GREY,   346,   357,   126,   137, 0x0,                   STR_RESIZE_BUTTON},
 {   WIDGETS_END},
 };
@@ -197,20 +322,19 @@
 struct SignWindow : QueryStringBaseWindow, SignList {
 	SignID cur_sign;
 
-	SignWindow(const WindowDesc *desc, const Sign *si) : QueryStringBaseWindow(MAX_LENGTH_SIGN_NAME_BYTES, desc)
+	SignWindow(const WindowDesc *desc, const Sign *si) : QueryStringBaseWindow(MAX_LENGTH_SIGN_NAME_BYTES, desc, QUERY_EDIT_SIGN_WIDGET_CANCEL, QUERY_EDIT_SIGN_WIDGET_OK)
 	{
-		SetBit(_no_scroll, SCROLL_EDIT);
 		this->caption = STR_280B_EDIT_SIGN_TEXT;
 		this->afilter = CS_ALPHANUMERAL;
 		this->LowerWidget(QUERY_EDIT_SIGN_WIDGET_TEXT);
 
 		UpdateSignEditWindow(si);
+		this->SetFocusedWidget(QUERY_EDIT_SIGN_WIDGET_TEXT);
 		this->FindWindowPlacementAndResize(desc);
 	}
 
 	~SignWindow()
 	{
-		ClrBit(_no_scroll, SCROLL_EDIT);
 	}
 
 	void UpdateSignEditWindow(const Sign *si)
@@ -230,6 +354,7 @@
 		InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, MAX_LENGTH_SIGN_NAME_PIXELS);
 
 		this->InvalidateWidget(QUERY_EDIT_SIGN_WIDGET_TEXT);
+		this->SetFocusedWidget(QUERY_EDIT_SIGN_WIDGET_TEXT);
 	}
 
 	/**
@@ -285,10 +410,6 @@
 				break;
 			}
 
-			case QUERY_EDIT_SIGN_WIDGET_TEXT:
-				ShowOnScreenKeyboard(this, widget, QUERY_EDIT_SIGN_WIDGET_CANCEL, QUERY_EDIT_SIGN_WIDGET_OK);
-				break;
-
 			case QUERY_EDIT_SIGN_WIDGET_DELETE:
 				/* Only need to set the buffer to null, the rest is handled as the OK button */
 				RenameSign(this->cur_sign, "");
@@ -326,6 +447,11 @@
 	{
 		this->HandleEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT);
 	}
+
+	virtual void OnOpenOSKWindow(int wid)
+	{
+		ShowOnScreenKeyboard(this, wid, QUERY_EDIT_SIGN_WIDGET_CANCEL, QUERY_EDIT_SIGN_WIDGET_OK);
+	}
 };
 
 static const Widget _query_sign_edit_widgets[] = {
@@ -360,9 +486,8 @@
 
 void ShowRenameSignWindow(const Sign *si)
 {
-	/* Delete all other edit windows and the save window */
+	/* Delete all other edit windows */
 	DeleteWindowById(WC_QUERY_STRING, 0);
-	DeleteWindowById(WC_SAVELOAD, 0);
 
 	new SignWindow(&_query_sign_edit_desc, si);
 }
Index: src/screenshot.cpp
===================================================================
--- src/screenshot.cpp	(revision 14572)
+++ src/screenshot.cpp	(working copy)
@@ -19,6 +19,9 @@
 #include "map_func.h"
 #include "date_func.h"
 #include "company_func.h"
+#include "settings_type.h"
+#include "signs_base.h"
+#include "landscape.h"
 
 #include "table/strings.h"
 
@@ -570,6 +573,37 @@
 	return filename;
 }
 
+static char *MakeTimelapseScreenshotName(const char *ext, const char *name = NULL)
+{
+	/* File name base - "timelapse" */
+	ttd_strlcpy(_screenshot_name, "timelapse", lengthof(_screenshot_name));
+	size_t len = strlen(_screenshot_name);
+	if (name != NULL) {
+		/* For local screens add sign name (starting with #) */
+		snprintf(&_screenshot_name[len], lengthof(_screenshot_name) - len, "%s", name);
+		len = strlen(_screenshot_name);
+	}
+	/* Add '#' */
+	snprintf(&_screenshot_name[len], lengthof(_screenshot_name) - len, "#");
+	SanitizeFilename(_screenshot_name);
+	len = strlen(_screenshot_name);
+	/* Add initial numbers and file extension */
+	snprintf(&_screenshot_name[len], lengthof(_screenshot_name) - len, "000000.%s", ext);
+
+	uint diff = 5; // number of preceding zeros
+	static char filename[MAX_PATH];
+	for (uint serial = 1;; serial++) {
+		/* Try if the file name is available */
+		snprintf(filename, lengthof(filename), "%s%s", _personal_dir, _screenshot_name);
+		if (!FileExists(filename)) break;
+		/* If file already exists increase the serial */
+		if (serial == 10 || serial == 100 || serial == 1000 || serial == 10000 || serial == 100000) diff--;
+		snprintf(&_screenshot_name[len + diff], lengthof(_screenshot_name) - len, "%d.%s", serial, ext);
+	}
+
+	return filename;
+}
+
 void SetScreenshotType(ScreenshotType t)
 {
 	current_screenshot_type = t;
@@ -605,8 +639,54 @@
 	return sf->proc(MakeScreenshotName(sf->extension), LargeWorldCallback, &vp, vp.width, vp.height, BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth(), _cur_palette);
 }
 
-bool MakeScreenshot()
+static bool MakeTimelapseScreenshot()
 {
+	ViewPort vp;
+	const ScreenshotFormat *sf;
+
+	uint8 zoom = _settings_client.gui.auto_screenshot_zoomlvl;
+
+	vp.zoom = (ZoomLevel)zoom;
+	vp.left = 0;
+	vp.top = 0;
+	vp.virtual_left = -(int)MapMaxX() * TILE_PIXELS;
+	vp.virtual_top = 0;
+	vp.virtual_width = (MapMaxX() + MapMaxY()) * TILE_PIXELS >> zoom;
+	vp.width = vp.virtual_width;
+	vp.virtual_height = (MapMaxX() + MapMaxY()) * (TILE_PIXELS >> 1) >> zoom;
+	vp.height = vp.virtual_height;
+
+	sf = _screenshot_formats + _cur_screenshot_format;
+	return sf->proc(MakeTimelapseScreenshotName(sf->extension), LargeWorldCallback, &vp, vp.width, vp.height, BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth(), _cur_palette);
+}
+
+static bool MakeTimelapseLocalScreenshot(const Sign *si)
+{
+	ViewPort vp;
+	const ScreenshotFormat *sf;
+
+	uint16 size_x = _settings_client.gui.auto_local_screen_size_x;
+	uint16 size_y = _settings_client.gui.auto_local_screen_size_y;
+	uint8 zoom = _settings_client.gui.auto_local_screen_zoomlvl;
+
+	vp.zoom = ZoomLevel(zoom);
+
+	Point pt = RemapCoords2(si->x, si->y);
+	vp.left = 0;
+	vp.top = 0;
+	vp.virtual_left = pt.x - ((size_x / 2) << zoom);
+	vp.virtual_top = pt.y - ((size_y / 2) << zoom);
+	vp.virtual_width = size_x;
+	vp.width = vp.virtual_width;
+	vp.virtual_height = size_y;
+	vp.height = vp.virtual_height;
+
+	sf = _screenshot_formats + _cur_screenshot_format;
+	return sf->proc(MakeTimelapseScreenshotName(sf->extension, si->name), LargeWorldCallback, &vp, vp.width, vp.height, BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth(), _cur_palette);
+}
+
+bool MakeScreenshot(const void *si)
+{
 	switch (current_screenshot_type) {
 		case SC_VIEWPORT:
 			UndrawMouseCursor();
@@ -616,6 +696,12 @@
 		case SC_WORLD:
 			current_screenshot_type = SC_NONE;
 			return MakeWorldScreenshot();
+		case SC_TIMELAPSE:
+			current_screenshot_type = SC_NONE;
+			return MakeTimelapseScreenshot();
+		case SC_TIMELAPSE_LOCAL:
+			current_screenshot_type = SC_NONE;
+			return MakeTimelapseLocalScreenshot((const Sign*) si);
 		default: return false;
 	}
 }
Index: src/openttd.cpp
===================================================================
--- src/openttd.cpp	(revision 14572)
+++ src/openttd.cpp	(working copy)
@@ -184,6 +184,8 @@
 		"  -G seed             = Set random seed\n"
 #if defined(ENABLE_NETWORK)
 		"  -n [ip:port#company]= Start networkgame\n"
+		"  -p password         = Join password\n"
+		"  -P password         = Company password\n"
 		"  -D [ip][:port]      = Start dedicated server\n"
 		"  -l ip[:port]        = Redirect DEBUG()\n"
 #if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32)
@@ -380,6 +382,10 @@
 }
 
 byte _savegame_sort_order;
+#if defined(ENABLE_NETWORK)
+char *_login_pw = NULL;
+char *_company_pw = NULL;
+#endif /* ENABLE_NETWORK */
 #if defined(UNIX) && !defined(__MORPHOS__)
 extern void DedicatedFork();
 #endif
@@ -414,7 +420,7 @@
 	 *   a letter means: it accepts that param (e.g.: -h)
 	 *   a ':' behind it means: it need a param (e.g.: -m<driver>)
 	 *   a '::' behind it means: it can optional have a param (e.g.: -d<debug>) */
-	optformat = "m:s:v:b:hD::n::ei::I:t:d::r:g::G:c:xl:"
+	optformat = "m:s:v:b:hD::n::ei::I:t:d::r:g::G:c:xl:p:P:"
 #if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32)
 		"f"
 #endif
@@ -454,6 +460,12 @@
 		case 'l':
 			debuglog_conn = mgo.opt;
 			break;
+		case 'p':
+			_login_pw = mgo.opt;
+			break;
+		case 'P':
+			_company_pw = mgo.opt;
+			break;
 #endif /* ENABLE_NETWORK */
 		case 'r': ParseResolution(&resolution, mgo.opt); break;
 		case 't': startyear = atoi(mgo.opt); break;
Index: src/main_gui.cpp
===================================================================
--- src/main_gui.cpp	(revision 14572)
+++ src/main_gui.cpp	(working copy)
@@ -311,6 +311,10 @@
 				ResetRestoreAllTransparency();
 				break;
 
+			case 'G':
+				PlaceLandBlockInfo();
+				break;
+
 #ifdef ENABLE_NETWORK
 			case WKC_RETURN: case 'T': // smart chat; send to team if any, otherwise to all
 				if (_networking) {
Index: config.lib
===================================================================
--- config.lib	(revision 14572)
+++ config.lib	(working copy)
@@ -841,7 +841,7 @@
 			log 1 "WARNING: in most cases it is not safe for network use"
 			log 1 "WARNING: USE WITH CAUTION!"
 
-			sleep 5
+		#	sleep 5
 		elif [ -f "$ROOT_DIR/version" ]; then
 			revision="`cat $ROOT_DIR/version`"
 
