summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Daniel Stolarski2019-11-09 01:46:47 +0100
committer Willy Sudiarto Raharjo2019-11-09 01:46:47 +0100
commit6d8f6d096727d976935bb032a54bd71fd1f8e18f (patch)
treef0c47d93e44501028f1cbce5c070a38d044468a4
parent4b6fd90d810ee0da0fcf17989ccc00225b334101 (diff)
downloadslackbuilds-6d8f6d096727d976935bb032a54bd71fd1f8e18f.tar.gz
gis/qmapshack: Updated for version 1.14.0.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--gis/qmapshack/addqmaptool.patch25494
-rw-r--r--gis/qmapshack/line_3px_horizontal.pngbin188 -> 0 bytes
-rw-r--r--gis/qmapshack/line_3px_vertical.pngbin189 -> 0 bytes
-rw-r--r--gis/qmapshack/qmapshack.SlackBuild12
-rw-r--r--gis/qmapshack/qmapshack.info8
-rw-r--r--gis/qmapshack/qmt_map2jnx.patch1199
-rw-r--r--gis/qmapshack/rgb2pct.patch971
-rw-r--r--gis/qmapshack/splash.pngbin156794 -> 0 bytes
8 files changed, 7 insertions, 27677 deletions
diff --git a/gis/qmapshack/addqmaptool.patch b/gis/qmapshack/addqmaptool.patch
deleted file mode 100644
index 71553ddcc4..0000000000
--- a/gis/qmapshack/addqmaptool.patch
+++ /dev/null
@@ -1,25494 +0,0 @@
-From c6e5240ec25b91d3320f265346a904b5bd906363 Mon Sep 17 00:00:00 2001
-From: Oliver Eichler <oliver.eichler@dspsolutions.de>
-Date: Thu, 12 Sep 2019 20:29:51 +0200
-Subject: [PATCH] [QMS-3] Add QMapTool from former sub-repo
-
----
- src/qmaptool/.hgtags | 1 +
- src/qmaptool/CAbout.cpp | 46 +
- src/qmaptool/CAbout.h | 35 +
- src/qmaptool/CMainWindow.cpp | 182 ++
- src/qmaptool/CMainWindow.h | 100 +
- src/qmaptool/CMakeLists.txt | 269 +++
- src/qmaptool/CSingleInstanceProxy.cpp | 102 +
- src/qmaptool/CSingleInstanceProxy.h | 41 +
- src/qmaptool/GeoMath.cpp | 54 +
- src/qmaptool/GeoMath.h | 31 +
- src/qmaptool/IAbout.ui | 164 ++
- src/qmaptool/IMainWindow.ui | 208 ++
- src/qmaptool/README.md | 7 +
- src/qmaptool/canvas/CCanvas.cpp | 189 ++
- src/qmaptool/canvas/CCanvas.h | 92 +
- src/qmaptool/canvas/CDrawContextPixel.cpp | 168 ++
- src/qmaptool/canvas/CDrawContextPixel.h | 91 +
- src/qmaptool/canvas/CDrawContextProj.cpp | 166 ++
- src/qmaptool/canvas/CDrawContextProj.h | 89 +
- src/qmaptool/canvas/IDrawContext.cpp | 300 +++
- src/qmaptool/canvas/IDrawContext.h | 164 ++
- src/qmaptool/helpers/CDraw.cpp | 239 +++
- src/qmaptool/helpers/CDraw.h | 96 +
- src/qmaptool/helpers/CGdalFile.cpp | 221 +++
- src/qmaptool/helpers/CGdalFile.h | 93 +
- src/qmaptool/helpers/CSettings.h | 54 +
- src/qmaptool/helpers/mitab.cpp | 260 +++
- src/qmaptool/helpers/mitab.h | 46 +
- src/qmaptool/items/CItemCutMap.cpp | 97 +
- src/qmaptool/items/CItemCutMap.h | 52 +
- src/qmaptool/items/CItemFile.cpp | 37 +
- src/qmaptool/items/CItemFile.h | 38 +
- src/qmaptool/items/CItemListWidget.cpp | 157 ++
- src/qmaptool/items/CItemListWidget.h | 84 +
- src/qmaptool/items/CItemMap.cpp | 82 +
- src/qmaptool/items/CItemMap.h | 54 +
- src/qmaptool/items/CItemMapLayer.cpp | 119 ++
- src/qmaptool/items/CItemMapLayer.h | 57 +
- src/qmaptool/items/CItemRefMap.cpp | 114 ++
- src/qmaptool/items/CItemRefMap.h | 56 +
- src/qmaptool/items/CItemTreeWidget.cpp | 317 +++
- src/qmaptool/items/CItemTreeWidget.h | 94 +
- src/qmaptool/items/IItem.cpp | 141 ++
- src/qmaptool/items/IItem.h | 97 +
- src/qmaptool/items/IItemListWidget.ui | 127 ++
- src/qmaptool/items/IItemTreeWidget.ui | 135 ++
- src/qmaptool/locale/qmaptool.ts | 1675 ++++++++++++++++
- src/qmaptool/locale/qmaptool_de.ts | 1712 ++++++++++++++++
- src/qmaptool/locale/qmaptool_es.ts | 1715 +++++++++++++++++
- src/qmaptool/main.cpp | 76 +
- src/qmaptool/overlay/COverlayCutMap.cpp | 644 +++++++
- src/qmaptool/overlay/COverlayCutMap.h | 105 +
- src/qmaptool/overlay/COverlayGridTool.cpp | 348 ++++
- src/qmaptool/overlay/COverlayGridTool.h | 68 +
- src/qmaptool/overlay/COverlayRefMap.cpp | 747 +++++++
- src/qmaptool/overlay/COverlayRefMap.h | 103 +
- src/qmaptool/overlay/IOverlay.cpp | 36 +
- src/qmaptool/overlay/IOverlay.h | 43 +
- src/qmaptool/overlay/IOverlayCutMap.ui | 202 ++
- src/qmaptool/overlay/IOverlayGridTool.ui | 184 ++
- src/qmaptool/overlay/IOverlayRefMap.ui | 351 ++++
- src/qmaptool/overlay/gridtool/CGridPlacer.cpp | 274 +++
- src/qmaptool/overlay/gridtool/CGridPlacer.h | 85 +
- src/qmaptool/overlay/gridtool/CGridPoint.cpp | 184 ++
- src/qmaptool/overlay/gridtool/CGridPoint.h | 70 +
- .../overlay/gridtool/CGridSelArea.cpp | 240 +++
- src/qmaptool/overlay/gridtool/CGridSelArea.h | 97 +
- src/qmaptool/overlay/gridtool/CGridSetRef.cpp | 105 +
- src/qmaptool/overlay/gridtool/CGridSetRef.h | 86 +
- src/qmaptool/overlay/gridtool/IGridPlacer.ui | 248 +++
- src/qmaptool/overlay/gridtool/IGridSelArea.ui | 49 +
- src/qmaptool/overlay/gridtool/IGridSetRef.ui | 117 ++
- .../overlay/refmap/CDialogRefPoint.cpp | 74 +
- src/qmaptool/overlay/refmap/CDialogRefPoint.h | 46 +
- .../overlay/refmap/COverlayRefMapPoint.cpp | 52 +
- .../overlay/refmap/COverlayRefMapPoint.h | 67 +
- src/qmaptool/overlay/refmap/CProjWizard.cpp | 237 +++
- src/qmaptool/overlay/refmap/CProjWizard.h | 44 +
- .../overlay/refmap/IDialogRefPoint.ui | 131 ++
- src/qmaptool/overlay/refmap/IProjWizard.ui | 210 ++
- src/qmaptool/resources.qrc | 93 +
- src/qmaptool/setup/CAppOpts.h | 47 +
- src/qmaptool/setup/CAppSetupLinux.cpp | 62 +
- src/qmaptool/setup/CAppSetupLinux.h | 44 +
- src/qmaptool/setup/CAppSetupMac.cpp | 140 ++
- src/qmaptool/setup/CAppSetupMac.h | 49 +
- src/qmaptool/setup/CAppSetupWin.cpp | 69 +
- src/qmaptool/setup/CAppSetupWin.h | 45 +
- src/qmaptool/setup/CCommandProcessor.cpp | 58 +
- src/qmaptool/setup/CCommandProcessor.h | 33 +
- src/qmaptool/setup/CLogHandler.cpp | 122 ++
- src/qmaptool/setup/CLogHandler.h | 47 +
- src/qmaptool/setup/CSetupExtTools.cpp | 93 +
- src/qmaptool/setup/CSetupExtTools.h | 46 +
- src/qmaptool/setup/IAppSetup.cpp | 161 ++
- src/qmaptool/setup/IAppSetup.h | 210 ++
- src/qmaptool/setup/ISetupExtTools.ui | 360 ++++
- src/qmaptool/shell/CShell.cpp | 198 ++
- src/qmaptool/shell/CShell.h | 75 +
- src/qmaptool/shell/CShellCmd.cpp | 27 +
- src/qmaptool/shell/CShellCmd.h | 47 +
- src/qmaptool/tool/CToolAddOverview.cpp | 225 +++
- src/qmaptool/tool/CToolAddOverview.h | 51 +
- src/qmaptool/tool/CToolBox.cpp | 44 +
- src/qmaptool/tool/CToolBox.h | 40 +
- src/qmaptool/tool/CToolCutMap.cpp | 202 ++
- src/qmaptool/tool/CToolCutMap.h | 51 +
- src/qmaptool/tool/CToolExport.cpp | 193 ++
- src/qmaptool/tool/CToolExport.h | 63 +
- src/qmaptool/tool/CToolGrid.cpp | 124 ++
- src/qmaptool/tool/CToolGrid.h | 57 +
- src/qmaptool/tool/CToolOverviewGroupBox.cpp | 95 +
- src/qmaptool/tool/CToolOverviewGroupBox.h | 43 +
- src/qmaptool/tool/CToolPalettize.cpp | 319 +++
- src/qmaptool/tool/CToolPalettize.h | 57 +
- src/qmaptool/tool/CToolRefMap.cpp | 257 +++
- src/qmaptool/tool/CToolRefMap.h | 52 +
- src/qmaptool/tool/CToolStack.cpp | 44 +
- src/qmaptool/tool/CToolStack.h | 41 +
- src/qmaptool/tool/ITool.cpp | 20 +
- src/qmaptool/tool/ITool.h | 234 +++
- src/qmaptool/tool/IToolAddOverview.ui | 278 +++
- src/qmaptool/tool/IToolCutMap.ui | 263 +++
- src/qmaptool/tool/IToolExport.ui | 206 ++
- src/qmaptool/tool/IToolGrid.ui | 158 ++
- src/qmaptool/tool/IToolGui.cpp | 111 ++
- src/qmaptool/tool/IToolGui.h | 48 +
- src/qmaptool/tool/IToolOverviewGroupBox.ui | 130 ++
- src/qmaptool/tool/IToolPalettize.ui | 269 +++
- src/qmaptool/tool/IToolRefMap.ui | 276 +++
- src/qmaptool/tool/export/CToolExportJnx.cpp | 28 +
- src/qmaptool/tool/export/CToolExportJnx.h | 68 +
- src/qmaptool/tool/export/IToolExportJnx.ui | 224 +++
- src/qmaptool/units/CCoordFormatSetup.cpp | 67 +
- src/qmaptool/units/CCoordFormatSetup.h | 37 +
- src/qmaptool/units/CTimeZoneSetup.cpp | 105 +
- src/qmaptool/units/CTimeZoneSetup.h | 36 +
- src/qmaptool/units/CUnitImperial.cpp | 113 ++
- src/qmaptool/units/CUnitImperial.h | 41 +
- src/qmaptool/units/CUnitMetric.cpp | 132 ++
- src/qmaptool/units/CUnitMetric.h | 37 +
- src/qmaptool/units/CUnitNautic.cpp | 96 +
- src/qmaptool/units/CUnitNautic.h | 37 +
- src/qmaptool/units/CUnitsSetup.cpp | 59 +
- src/qmaptool/units/CUnitsSetup.h | 35 +
- src/qmaptool/units/ICoordFormatSetup.ui | 125 ++
- src/qmaptool/units/ITimeZoneSetup.ui | 182 ++
- src/qmaptool/units/IUnit.cpp | 776 ++++++++
- src/qmaptool/units/IUnit.h | 153 ++
- src/qmaptool/units/IUnitsSetup.ui | 125 ++
- src/qmaptool/version.h | 33 +
- 154 files changed, 24277 insertions(+)
- create mode 100644 src/qmaptool/.hgtags
- create mode 100644 src/qmaptool/CAbout.cpp
- create mode 100644 src/qmaptool/CAbout.h
- create mode 100644 src/qmaptool/CMainWindow.cpp
- create mode 100644 src/qmaptool/CMainWindow.h
- create mode 100644 src/qmaptool/CMakeLists.txt
- create mode 100644 src/qmaptool/CSingleInstanceProxy.cpp
- create mode 100644 src/qmaptool/CSingleInstanceProxy.h
- create mode 100644 src/qmaptool/GeoMath.cpp
- create mode 100644 src/qmaptool/GeoMath.h
- create mode 100644 src/qmaptool/IAbout.ui
- create mode 100644 src/qmaptool/IMainWindow.ui
- create mode 100644 src/qmaptool/README.md
- create mode 100644 src/qmaptool/canvas/CCanvas.cpp
- create mode 100644 src/qmaptool/canvas/CCanvas.h
- create mode 100644 src/qmaptool/canvas/CDrawContextPixel.cpp
- create mode 100644 src/qmaptool/canvas/CDrawContextPixel.h
- create mode 100644 src/qmaptool/canvas/CDrawContextProj.cpp
- create mode 100644 src/qmaptool/canvas/CDrawContextProj.h
- create mode 100644 src/qmaptool/canvas/IDrawContext.cpp
- create mode 100644 src/qmaptool/canvas/IDrawContext.h
- create mode 100644 src/qmaptool/helpers/CDraw.cpp
- create mode 100644 src/qmaptool/helpers/CDraw.h
- create mode 100644 src/qmaptool/helpers/CGdalFile.cpp
- create mode 100644 src/qmaptool/helpers/CGdalFile.h
- create mode 100644 src/qmaptool/helpers/CSettings.h
- create mode 100644 src/qmaptool/helpers/mitab.cpp
- create mode 100644 src/qmaptool/helpers/mitab.h
- create mode 100644 src/qmaptool/items/CItemCutMap.cpp
- create mode 100644 src/qmaptool/items/CItemCutMap.h
- create mode 100644 src/qmaptool/items/CItemFile.cpp
- create mode 100644 src/qmaptool/items/CItemFile.h
- create mode 100644 src/qmaptool/items/CItemListWidget.cpp
- create mode 100644 src/qmaptool/items/CItemListWidget.h
- create mode 100644 src/qmaptool/items/CItemMap.cpp
- create mode 100644 src/qmaptool/items/CItemMap.h
- create mode 100644 src/qmaptool/items/CItemMapLayer.cpp
- create mode 100644 src/qmaptool/items/CItemMapLayer.h
- create mode 100644 src/qmaptool/items/CItemRefMap.cpp
- create mode 100644 src/qmaptool/items/CItemRefMap.h
- create mode 100644 src/qmaptool/items/CItemTreeWidget.cpp
- create mode 100644 src/qmaptool/items/CItemTreeWidget.h
- create mode 100644 src/qmaptool/items/IItem.cpp
- create mode 100644 src/qmaptool/items/IItem.h
- create mode 100644 src/qmaptool/items/IItemListWidget.ui
- create mode 100644 src/qmaptool/items/IItemTreeWidget.ui
- create mode 100644 src/qmaptool/locale/qmaptool.ts
- create mode 100644 src/qmaptool/locale/qmaptool_de.ts
- create mode 100644 src/qmaptool/locale/qmaptool_es.ts
- create mode 100644 src/qmaptool/main.cpp
- create mode 100644 src/qmaptool/overlay/COverlayCutMap.cpp
- create mode 100644 src/qmaptool/overlay/COverlayCutMap.h
- create mode 100644 src/qmaptool/overlay/COverlayGridTool.cpp
- create mode 100644 src/qmaptool/overlay/COverlayGridTool.h
- create mode 100644 src/qmaptool/overlay/COverlayRefMap.cpp
- create mode 100644 src/qmaptool/overlay/COverlayRefMap.h
- create mode 100644 src/qmaptool/overlay/IOverlay.cpp
- create mode 100644 src/qmaptool/overlay/IOverlay.h
- create mode 100644 src/qmaptool/overlay/IOverlayCutMap.ui
- create mode 100644 src/qmaptool/overlay/IOverlayGridTool.ui
- create mode 100644 src/qmaptool/overlay/IOverlayRefMap.ui
- create mode 100644 src/qmaptool/overlay/gridtool/CGridPlacer.cpp
- create mode 100644 src/qmaptool/overlay/gridtool/CGridPlacer.h
- create mode 100644 src/qmaptool/overlay/gridtool/CGridPoint.cpp
- create mode 100644 src/qmaptool/overlay/gridtool/CGridPoint.h
- create mode 100644 src/qmaptool/overlay/gridtool/CGridSelArea.cpp
- create mode 100644 src/qmaptool/overlay/gridtool/CGridSelArea.h
- create mode 100644 src/qmaptool/overlay/gridtool/CGridSetRef.cpp
- create mode 100644 src/qmaptool/overlay/gridtool/CGridSetRef.h
- create mode 100644 src/qmaptool/overlay/gridtool/IGridPlacer.ui
- create mode 100644 src/qmaptool/overlay/gridtool/IGridSelArea.ui
- create mode 100644 src/qmaptool/overlay/gridtool/IGridSetRef.ui
- create mode 100644 src/qmaptool/overlay/refmap/CDialogRefPoint.cpp
- create mode 100644 src/qmaptool/overlay/refmap/CDialogRefPoint.h
- create mode 100644 src/qmaptool/overlay/refmap/COverlayRefMapPoint.cpp
- create mode 100644 src/qmaptool/overlay/refmap/COverlayRefMapPoint.h
- create mode 100644 src/qmaptool/overlay/refmap/CProjWizard.cpp
- create mode 100644 src/qmaptool/overlay/refmap/CProjWizard.h
- create mode 100644 src/qmaptool/overlay/refmap/IDialogRefPoint.ui
- create mode 100644 src/qmaptool/overlay/refmap/IProjWizard.ui
- create mode 100644 src/qmaptool/resources.qrc
- create mode 100644 src/qmaptool/setup/CAppOpts.h
- create mode 100644 src/qmaptool/setup/CAppSetupLinux.cpp
- create mode 100644 src/qmaptool/setup/CAppSetupLinux.h
- create mode 100644 src/qmaptool/setup/CAppSetupMac.cpp
- create mode 100644 src/qmaptool/setup/CAppSetupMac.h
- create mode 100644 src/qmaptool/setup/CAppSetupWin.cpp
- create mode 100644 src/qmaptool/setup/CAppSetupWin.h
- create mode 100644 src/qmaptool/setup/CCommandProcessor.cpp
- create mode 100644 src/qmaptool/setup/CCommandProcessor.h
- create mode 100644 src/qmaptool/setup/CLogHandler.cpp
- create mode 100644 src/qmaptool/setup/CLogHandler.h
- create mode 100644 src/qmaptool/setup/CSetupExtTools.cpp
- create mode 100644 src/qmaptool/setup/CSetupExtTools.h
- create mode 100644 src/qmaptool/setup/IAppSetup.cpp
- create mode 100644 src/qmaptool/setup/IAppSetup.h
- create mode 100644 src/qmaptool/setup/ISetupExtTools.ui
- create mode 100644 src/qmaptool/shell/CShell.cpp
- create mode 100644 src/qmaptool/shell/CShell.h
- create mode 100644 src/qmaptool/shell/CShellCmd.cpp
- create mode 100644 src/qmaptool/shell/CShellCmd.h
- create mode 100644 src/qmaptool/tool/CToolAddOverview.cpp
- create mode 100644 src/qmaptool/tool/CToolAddOverview.h
- create mode 100644 src/qmaptool/tool/CToolBox.cpp
- create mode 100644 src/qmaptool/tool/CToolBox.h
- create mode 100644 src/qmaptool/tool/CToolCutMap.cpp
- create mode 100644 src/qmaptool/tool/CToolCutMap.h
- create mode 100644 src/qmaptool/tool/CToolExport.cpp
- create mode 100644 src/qmaptool/tool/CToolExport.h
- create mode 100644 src/qmaptool/tool/CToolGrid.cpp
- create mode 100644 src/qmaptool/tool/CToolGrid.h
- create mode 100644 src/qmaptool/tool/CToolOverviewGroupBox.cpp
- create mode 100644 src/qmaptool/tool/CToolOverviewGroupBox.h
- create mode 100644 src/qmaptool/tool/CToolPalettize.cpp
- create mode 100644 src/qmaptool/tool/CToolPalettize.h
- create mode 100644 src/qmaptool/tool/CToolRefMap.cpp
- create mode 100644 src/qmaptool/tool/CToolRefMap.h
- create mode 100644 src/qmaptool/tool/CToolStack.cpp
- create mode 100644 src/qmaptool/tool/CToolStack.h
- create mode 100644 src/qmaptool/tool/ITool.cpp
- create mode 100644 src/qmaptool/tool/ITool.h
- create mode 100644 src/qmaptool/tool/IToolAddOverview.ui
- create mode 100644 src/qmaptool/tool/IToolCutMap.ui
- create mode 100644 src/qmaptool/tool/IToolExport.ui
- create mode 100644 src/qmaptool/tool/IToolGrid.ui
- create mode 100644 src/qmaptool/tool/IToolGui.cpp
- create mode 100644 src/qmaptool/tool/IToolGui.h
- create mode 100644 src/qmaptool/tool/IToolOverviewGroupBox.ui
- create mode 100644 src/qmaptool/tool/IToolPalettize.ui
- create mode 100644 src/qmaptool/tool/IToolRefMap.ui
- create mode 100644 src/qmaptool/tool/export/CToolExportJnx.cpp
- create mode 100644 src/qmaptool/tool/export/CToolExportJnx.h
- create mode 100644 src/qmaptool/tool/export/IToolExportJnx.ui
- create mode 100644 src/qmaptool/units/CCoordFormatSetup.cpp
- create mode 100644 src/qmaptool/units/CCoordFormatSetup.h
- create mode 100644 src/qmaptool/units/CTimeZoneSetup.cpp
- create mode 100644 src/qmaptool/units/CTimeZoneSetup.h
- create mode 100644 src/qmaptool/units/CUnitImperial.cpp
- create mode 100644 src/qmaptool/units/CUnitImperial.h
- create mode 100644 src/qmaptool/units/CUnitMetric.cpp
- create mode 100644 src/qmaptool/units/CUnitMetric.h
- create mode 100644 src/qmaptool/units/CUnitNautic.cpp
- create mode 100644 src/qmaptool/units/CUnitNautic.h
- create mode 100644 src/qmaptool/units/CUnitsSetup.cpp
- create mode 100644 src/qmaptool/units/CUnitsSetup.h
- create mode 100644 src/qmaptool/units/ICoordFormatSetup.ui
- create mode 100644 src/qmaptool/units/ITimeZoneSetup.ui
- create mode 100644 src/qmaptool/units/IUnit.cpp
- create mode 100644 src/qmaptool/units/IUnit.h
- create mode 100644 src/qmaptool/units/IUnitsSetup.ui
- create mode 100644 src/qmaptool/version.h
-
-diff --git a/src/qmaptool/.hgtags b/src/qmaptool/.hgtags
-new file mode 100644
-index 00000000..b3bd51f1
---- /dev/null
-+++ b/src/qmaptool/.hgtags
-@@ -0,0 +1 @@
-+ed93a4558565182ee15572442250f22981d3de56 V 1.1.0
-diff --git a/src/qmaptool/CAbout.cpp b/src/qmaptool/CAbout.cpp
-new file mode 100644
-index 00000000..6c3c2cec
---- /dev/null
-+++ b/src/qmaptool/CAbout.cpp
-@@ -0,0 +1,46 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "CAbout.h"
-+#include "version.h"
-+
-+#include <gdal.h>
-+#include <proj_api.h>
-+#include <QtWidgets>
-+
-+
-+CAbout::CAbout(QWidget *parent)
-+ : QDialog(parent)
-+{
-+ setupUi(this);
-+
-+ if(QString(VER_SUFFIX).isEmpty())
-+ {
-+ labelVersion->setText(VER_STR);
-+ }
-+ else
-+ {
-+ labelVersion->setText(VER_STR "." VER_SUFFIX);
-+ }
-+
-+ labelQtVersion->setText(qVersion());
-+ labelGDALVersion->setText(GDALVersionInfo("--version"));
-+ labelProj4Version->setText(QString::number(PJ_VERSION));
-+}
-+
-+
-diff --git a/src/qmaptool/CAbout.h b/src/qmaptool/CAbout.h
-new file mode 100644
-index 00000000..52a6bfd7
---- /dev/null
-+++ b/src/qmaptool/CAbout.h
-@@ -0,0 +1,35 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CABOUT_H
-+#define CABOUT_H
-+
-+#include "ui_IAbout.h"
-+#include <QDialog>
-+
-+
-+class CAbout : public QDialog, private Ui::IAbout
-+{
-+ Q_OBJECT
-+public:
-+ CAbout(QWidget * parent);
-+ virtual ~CAbout() = default;
-+};
-+
-+#endif //CABOUT_H
-+
-diff --git a/src/qmaptool/CMainWindow.cpp b/src/qmaptool/CMainWindow.cpp
-new file mode 100644
-index 00000000..c21b566b
---- /dev/null
-+++ b/src/qmaptool/CMainWindow.cpp
-@@ -0,0 +1,182 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "CAbout.h"
-+#include "CMainWindow.h"
-+#include "helpers/CSettings.h"
-+#include "setup/CSetupExtTools.h"
-+#include "tool/CToolAddOverview.h"
-+#include "tool/CToolBox.h"
-+#include "tool/CToolCutMap.h"
-+#include "tool/CToolExport.h"
-+#include "tool/CToolGrid.h"
-+#include "tool/CToolPalettize.h"
-+#include "tool/CToolRefMap.h"
-+#include "units/CCoordFormatSetup.h"
-+#include "units/CUnitsSetup.h"
-+#include "units/IUnit.h"
-+#include "version.h"
-+
-+CMainWindow * CMainWindow::pSelf = nullptr;
-+
-+CMainWindow::CMainWindow()
-+{
-+ SETTINGS;
-+ IUnit::setUnitType((IUnit::type_e)cfg.value("Units/units",IUnit::eTypeMetric).toInt(), this);
-+ IUnit::setCoordFormat((IUnit::coord_format_e)cfg.value("Units/coordFormat", IUnit::eCoordFormat1).toInt());
-+
-+ pSelf = this;
-+ setupUi(this);
-+ setWindowTitle(WHAT_STR);
-+
-+ canvas->setToolInterface(toolStack);
-+
-+ connect(actionAbout, &QAction::triggered, this, &CMainWindow::slotAbout);
-+ connect(actionSetupExtTools, &QAction::triggered, this, &CMainWindow::slotSetupExtTools);
-+ connect(actionSetupUnits, &QAction::triggered, this, &CMainWindow::slotSetupUnits);
-+ connect(actionSetupCoordFormat, &QAction::triggered, this, &CMainWindow::slotSetupCoordFormat);
-+ connect(&IAppSetup::self(), &IAppSetup::sigSetupChanged, this, &CMainWindow::slotSetupChanged);
-+
-+ menuWindow->addAction(dockTools->toggleViewAction());
-+ menuWindow->addAction(dockShell->toggleViewAction());
-+ prepareMenuForMac();
-+
-+ toolBox = new CToolBox(this);
-+ toolStack->addWidget(toolBox);
-+
-+ toolAddOverview = new CToolAddOverview(toolBox);
-+ toolBox->addItem(toolAddOverview, QIcon("://icons/32x32/AddOverview.png"), toolAddOverview->objectName());
-+
-+ toolCutMap = new CToolCutMap(toolBox);
-+ toolBox->addItem(toolCutMap, QIcon("://icons/32x32/CutMap.png"), toolCutMap->objectName());
-+
-+ toolRefMap = new CToolRefMap(toolBox);
-+ toolBox->addItem(toolRefMap, QIcon("://icons/32x32/ReferenceMap.png"), toolRefMap->objectName());
-+
-+ toolPalettize = new CToolPalettize(toolBox);
-+ toolBox->addItem(toolPalettize, QIcon("://icons/32x32/Rasterize.png"), toolPalettize->objectName());
-+
-+ toolExport = new CToolExport(toolBox);
-+ toolBox->addItem(toolExport, QIcon("://icons/32x32/Export.png"), toolExport->objectName());
-+
-+ toolGrid = new CToolGrid(this);
-+ toolStack->addWidget(toolGrid);
-+
-+ // start ---- restore window geometry -----
-+ if ( cfg.contains("MainWindow/geometry"))
-+ {
-+ restoreGeometry(cfg.value("MainWindow/geometry").toByteArray());
-+ }
-+ else
-+ {
-+ QTimer::singleShot(500, this, SLOT(showMaximized()));
-+ }
-+
-+ if ( cfg.contains("MainWindow/state"))
-+ {
-+ restoreState(cfg.value("MainWindow/state").toByteArray());
-+ }
-+ // end ---- restore window geometry -----
-+ //toolStack->setCurrentIndex(cfg.value("Tool/Stack/current",0).toInt());
-+ toolBox->setCurrentIndex(cfg.value("Tool/Box/current",0).toInt());
-+ actionShowToolHelp->setChecked(cfg.value("Tool/showHelp", true).toBool());
-+ mapFont = cfg.value("Canvas/mapFont", font()).value<QFont>();
-+ actionFlipMouseWheel->setChecked(cfg.value("Canvas/flipMouseWheel", false).toBool());
-+}
-+
-+CMainWindow::~CMainWindow()
-+{
-+ SETTINGS;
-+ cfg.setValue("MainWindow/state", saveState());
-+ cfg.setValue("MainWindow/geometry", saveGeometry());
-+
-+ cfg.setValue("Canvas/mapFont", mapFont);
-+ cfg.setValue("Canvas/flipMouseWheel", actionFlipMouseWheel->isChecked());
-+
-+ cfg.setValue("Units/units", IUnit::self().type);
-+ cfg.setValue("Units/coordFormat", IUnit::getCoordFormat());
-+
-+ cfg.setValue("Tool/Box/current", toolBox->currentIndex());
-+ cfg.setValue("Tool/showHelp", actionShowToolHelp->isChecked());
-+}
-+
-+QString CMainWindow::getUser()
-+{
-+ QString user = getenv("USER");
-+ if(user.isEmpty())
-+ {
-+ user = getenv("USERNAME"); //for windows
-+
-+ if(user.isEmpty())
-+ {
-+ user = "QMapTool";
-+ }
-+ }
-+
-+ return user;
-+}
-+
-+void CMainWindow::prepareMenuForMac()
-+{
-+ dockTools->toggleViewAction()->setMenuRole(QAction::NoRole);
-+}
-+
-+void CMainWindow::makeShellVisible()
-+{
-+ dockShell->show();
-+}
-+
-+void CMainWindow::startGridTool(CItemRefMap *item)
-+{
-+ toolGrid->registerItem(item);
-+ toolStack->setCurrentWidget(toolGrid);
-+}
-+
-+void CMainWindow::showToolBox()
-+{
-+ toolStack->setCurrentWidget(toolBox);
-+}
-+
-+void CMainWindow::slotAbout()
-+{
-+ CAbout dlg(this);
-+ dlg.exec();
-+}
-+
-+void CMainWindow::slotSetupExtTools()
-+{
-+ CSetupExtTools dlg(this);
-+ dlg.exec();
-+}
-+
-+void CMainWindow::slotSetupUnits()
-+{
-+ CUnitsSetup dlg(this);
-+ dlg.exec();
-+}
-+
-+void CMainWindow::slotSetupCoordFormat()
-+{
-+ CCoordFormatSetup dlg(this);
-+ dlg.exec();
-+}
-+
-+void CMainWindow::slotSetupChanged()
-+{
-+ toolStack->setupChanged();
-+}
-diff --git a/src/qmaptool/CMainWindow.h b/src/qmaptool/CMainWindow.h
-new file mode 100644
-index 00000000..40077106
---- /dev/null
-+++ b/src/qmaptool/CMainWindow.h
-@@ -0,0 +1,100 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CMAINWINDOW_H
-+#define CMAINWINDOW_H
-+
-+#include "ui_IMainWindow.h"
-+#include <QMainWindow>
-+
-+class CToolBox;
-+class CToolAddOverview;
-+class CToolCutMap;
-+class CToolRefMap;
-+class CToolPalettize;
-+class CCanvas;
-+class CToolGrid;
-+class CItemRefMap;
-+class CToolExport;
-+
-+class CMainWindow : public QMainWindow, private Ui::IMainWindow
-+{
-+ Q_OBJECT
-+public:
-+ static CMainWindow& self()
-+ {
-+ return *pSelf;
-+ }
-+
-+ virtual ~CMainWindow();
-+
-+ static QString getUser();
-+
-+ CCanvas * getCanvas() const
-+ {
-+ return canvas;
-+ }
-+
-+ const QFont& getMapFont() const
-+ {
-+ return mapFont;
-+ }
-+
-+ bool flipMouseWheel() const
-+ {
-+ return actionFlipMouseWheel->isChecked();
-+ }
-+
-+ QAction * showToolHelp() const
-+ {
-+ return actionShowToolHelp;
-+ }
-+
-+ void makeShellVisible();
-+
-+ void startGridTool(CItemRefMap * item);
-+ void showToolBox();
-+
-+private slots:
-+ void slotAbout();
-+ void slotSetupExtTools();
-+ void slotSetupUnits();
-+ void slotSetupCoordFormat();
-+ void slotSetupChanged();
-+
-+private:
-+ friend int main(int argc, char ** argv);
-+ CMainWindow();
-+ static CMainWindow * pSelf;
-+
-+ void prepareMenuForMac();
-+
-+ QFont mapFont;
-+
-+ CToolBox * toolBox;
-+ CToolGrid * toolGrid;
-+
-+ CToolAddOverview * toolAddOverview;
-+ CToolCutMap * toolCutMap;
-+ CToolRefMap * toolRefMap;
-+ CToolPalettize * toolPalettize;
-+ CToolExport * toolExport;
-+};
-+
-+#endif //CMAINWINDOW_H
-+
-diff --git a/src/qmaptool/CMakeLists.txt b/src/qmaptool/CMakeLists.txt
-new file mode 100644
-index 00000000..5fd64152
---- /dev/null
-+++ b/src/qmaptool/CMakeLists.txt
-@@ -0,0 +1,269 @@
-+# Prevent custom commands/targets outputs to be deleted by make clean
-+# We need this to prevent .ts files from being deleted with make clean, when
-+# UPDATE_TRANSLATIONS=ON
-+# WARNING: Only works with Makefile generator.
-+set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM TRUE)
-+# Find includes in corresponding build directories
-+set(CMAKE_INCLUDE_CURRENT_DIR ON)
-+# Instruct CMake to run moc automatically when needed.
-+set(CMAKE_AUTOMOC ON)
-+
-+###############################################################################################
-+# Setup application name and version tags
-+###############################################################################################
-+
-+set(APPLICATION_NAME qmaptool)
-+set(QMAPTOOL_VERSION_MAJOR 1)
-+set(QMAPTOOL_VERSION_MINOR 1)
-+set(QMAPTOOL_VERSION_PATCH 1)
-+
-+add_definitions(
-+ -DVER_MAJOR=${QMAPTOOL_VERSION_MAJOR}
-+ -DVER_MINOR=${QMAPTOOL_VERSION_MINOR}
-+ -DVER_STEP=${QMAPTOOL_VERSION_PATCH}
-+ -DVER_TWEAK=${VERSION_SUFFIX}
-+ -DAPPLICATION_NAME=${APPLICATION_NAME}
-+)
-+
-+###############################################################################################
-+# All source files needed to compile
-+###############################################################################################
-+set( SRCS
-+ CAbout.cpp
-+ canvas/CCanvas.cpp
-+ canvas/CDrawContextPixel.cpp
-+ canvas/CDrawContextProj.cpp
-+ canvas/IDrawContext.cpp
-+ CMainWindow.cpp
-+ CSingleInstanceProxy.cpp
-+ GeoMath.cpp
-+ helpers/CDraw.cpp
-+ helpers/CGdalFile.cpp
-+ helpers/mitab.cpp
-+ items/CItemCutMap.cpp
-+ items/CItemFile.cpp
-+ items/CItemListWidget.cpp
-+ items/CItemMap.cpp
-+ items/CItemMapLayer.cpp
-+ items/CItemRefMap.cpp
-+ items/CItemTreeWidget.cpp
-+ items/IItem.cpp
-+ main.cpp
-+ overlay/COverlayCutMap.cpp
-+ overlay/COverlayGridTool.cpp
-+ overlay/COverlayRefMap.cpp
-+ overlay/gridtool/CGridPlacer.cpp
-+ overlay/gridtool/CGridPoint.cpp
-+ overlay/gridtool/CGridSelArea.cpp
-+ overlay/gridtool/CGridSetRef.cpp
-+ overlay/IOverlay.cpp
-+ overlay/refmap/CDialogRefPoint.cpp
-+ overlay/refmap/COverlayRefMapPoint.cpp
-+ overlay/refmap/CProjWizard.cpp
-+ setup/CAppSetupLinux.cpp
-+ setup/CAppSetupMac.cpp
-+ setup/CAppSetupWin.cpp
-+ setup/CCommandProcessor.cpp
-+ setup/CLogHandler.cpp
-+ setup/CSetupExtTools.cpp
-+ setup/IAppSetup.cpp
-+ shell/CShellCmd.cpp
-+ shell/CShell.cpp
-+ tool/export/CToolExportJnx.cpp
-+ tool/CToolAddOverview.cpp
-+ tool/CToolBox.cpp
-+ tool/CToolCutMap.cpp
-+ tool/CToolExport.cpp
-+ tool/CToolGrid.cpp
-+ tool/CToolOverviewGroupBox.cpp
-+ tool/CToolPalettize.cpp
-+ tool/CToolRefMap.cpp
-+ tool/CToolStack.cpp
-+ tool/ITool.cpp
-+ tool/IToolGui.cpp
-+ units/CCoordFormatSetup.cpp
-+ units/CTimeZoneSetup.cpp
-+ units/CUnitImperial.cpp
-+ units/CUnitMetric.cpp
-+ units/CUnitNautic.cpp
-+ units/CUnitsSetup.cpp
-+ units/IUnit.cpp
-+)
-+
-+set( HDRS
-+ CAbout.h
-+ canvas/CCanvas.h
-+ canvas/CDrawContextPixel.h
-+ canvas/CDrawContextProj.h
-+ canvas/IDrawContext.h
-+ CMainWindow.h
-+ CSingleInstanceProxy.h
-+ GeoMath.h
-+ helpers/CDraw.h
-+ helpers/CGdalFile.h
-+ helpers/CSettings.h
-+ helpers/CSettings.h
-+ helpers/mitab.h
-+ items/CItemCutMap.h
-+ items/CItemFile.h
-+ items/CItemListWidget.h
-+ items/CItemMap.h
-+ items/CItemMapLayer.h
-+ items/CItemRefMap.h
-+ items/CItemTreeWidget.h
-+ items/IItem.h
-+ overlay/COverlayCutMap.h
-+ overlay/COverlayGridTool.h
-+ overlay/COverlayRefMap.h
-+ overlay/gridtool/CGridPlacer.h
-+ overlay/gridtool/CGridPoint.h
-+ overlay/gridtool/CGridSelArea.h
-+ overlay/gridtool/CGridSetRef.h
-+ overlay/IOverlay.h
-+ overlay/refmap/CDialogRefPoint.h
-+ overlay/refmap/COverlayRefMapPoint.h
-+ overlay/refmap/CProjWizard.h
-+ setup/CAppOpts.h
-+ setup/CAppSetupLinux.h
-+ setup/CAppSetupMac.h
-+ setup/CAppSetupWin.h
-+ setup/CCommandProcessor.h
-+ setup/CLogHandler.h
-+ setup/CSetupExtTools.h
-+ setup/IAppSetup.h
-+ shell/CShellCmd.h
-+ shell/CShell.h
-+ tool/export/CToolExportJnx.h
-+ tool/CToolAddOverview.h
-+ tool/CToolBox.h
-+ tool/CToolCutMap.h
-+ tool/CToolExport.h
-+ tool/CToolGrid.h
-+ tool/CToolOverviewGroupBox.h
-+ tool/CToolPalettize.h
-+ tool/CToolRefMap.h
-+ tool/CToolStack.h
-+ tool/IToolGui.h
-+ tool/ITool.h
-+ units/CCoordFormatSetup.h
-+ units/CTimeZoneSetup.h
-+ units/CUnitImperial.h
-+ units/CUnitMetric.h
-+ units/CUnitNautic.h
-+ units/CUnitsSetup.h
-+ units/IUnit.h
-+ version.h
-+)
-+
-+set( UIS
-+ IAbout.ui
-+ IMainWindow.ui
-+ items/IItemListWidget.ui
-+ items/IItemTreeWidget.ui
-+ overlay/gridtool/IGridPlacer.ui
-+ overlay/gridtool/IGridSelArea.ui
-+ overlay/gridtool/IGridSetRef.ui
-+ overlay/IOverlayCutMap.ui
-+ overlay/IOverlayGridTool.ui
-+ overlay/IOverlayRefMap.ui
-+ overlay/refmap/IDialogRefPoint.ui
-+ overlay/refmap/IProjWizard.ui
-+ setup/ISetupExtTools.ui
-+ tool/export/IToolExportJnx.ui
-+ tool/IToolAddOverview.ui
-+ tool/IToolCutMap.ui
-+ tool/IToolExport.ui
-+ tool/IToolGrid.ui
-+ tool/IToolOverviewGroupBox.ui
-+ tool/IToolPalettize.ui
-+ tool/IToolRefMap.ui
-+ units/ICoordFormatSetup.ui
-+ units/ITimeZoneSetup.ui
-+ units/IUnitsSetup.ui
-+)
-+
-+
-+set( RCS
-+ resources.qrc
-+)
-+
-+
-+###############################################################################################
-+# Some Qt magic
-+###############################################################################################
-+
-+qt5_wrap_ui(UI_HDRS ${UIS})
-+qt5_add_resources(RC_SRCS ${RCS})
-+
-+###############################################################################################
-+# Translation related stuff
-+###############################################################################################
-+translate_ts(${APPLICATION_NAME}_QM_FILES
-+ UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS}
-+ UPDATE_OPTIONS "-I${CMAKE_CURRENT_SOURCE_DIR}" ${KEEP_OLD_TRANSLATIONS}
-+ SOURCES ${SRCS} ${HDRS} ${UIS}
-+ TEMPLATE ${APPLICATION_NAME}
-+ TRANSLATION_DIR "locale"
-+)
-+
-+if (UNIX AND NOT WIN32 AND NOT APPLE)
-+ translate_desktop(${APPLICATION_NAME}_DESKTOP_FILES
-+ TRANSLATION_DIR "locale"
-+ SOURCES "${PROJECT_SOURCE_DIR}/qmaptool.desktop.in"
-+ )
-+endif()
-+
-+###############################################################################################
-+# Build source file and include paths lists
-+###############################################################################################
-+set(MAININP
-+ ${SRCS}
-+ ${HDRS}
-+ ${UI_HDRS}
-+ ${RC_SRCS}
-+ ${${APPLICATION_NAME}_QM_FILES}
-+ ${${APPLICATION_NAME}_DESKTOP_FILES}
-+)
-+
-+include_directories(
-+ SYSTEM # this prevents warnings from non-QMS headers
-+ ${CMAKE_BINARY_DIR}
-+ ${GDAL_INCLUDE_DIRS}
-+ ${PROJ4_INCLUDE_DIRS}
-+)
-+
-+if(APPLE)
-+ INCLUDE_DIRECTORIES(/System/Library/Frameworks/Foundation.framework)
-+ INCLUDE_DIRECTORIES(/System/Library/Frameworks/DiskArbitration.framework)
-+endif(APPLE)
-+
-+
-+###############################################################################################
-+# Build the executable and define necessary libraries.
-+###############################################################################################
-+add_executable(${APPLICATION_NAME} WIN32 ${MAININP})
-+
-+target_link_libraries(${APPLICATION_NAME}
-+ Qt5::Widgets
-+ Qt5::Network
-+ ${GDAL_LIBRARIES}
-+ ${PROJ4_LIBRARIES}
-+)
-+
-+if(APPLE)
-+ target_link_libraries(${APPLICATION_NAME}
-+ ${Foundation_LIBRARY}
-+ ${DiskArbitration_LIBRARY}
-+ )
-+endif(APPLE)
-+
-+
-+###############################################################################################
-+# Install target related stuff
-+###############################################################################################
-+install(TARGETS ${APPLICATION_NAME} DESTINATION ${BIN_INSTALL_DIR})
-+
-+if (UNIX AND NOT WIN32 AND NOT APPLE)
-+ install(FILES ${${APPLICATION_NAME}_QM_FILES} DESTINATION ${DATA_INSTALL_PREFIX}/${APPLICATION_NAME}/translations)
-+ install(FILES ${${APPLICATION_NAME}_DESKTOP_FILES} DESTINATION ${XDG_APPS_DIR})
-+endif (UNIX AND NOT WIN32 AND NOT APPLE)
-diff --git a/src/qmaptool/CSingleInstanceProxy.cpp b/src/qmaptool/CSingleInstanceProxy.cpp
-new file mode 100644
-index 00000000..58cc933e
---- /dev/null
-+++ b/src/qmaptool/CSingleInstanceProxy.cpp
-@@ -0,0 +1,102 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "CMainWindow.h"
-+#include "CSingleInstanceProxy.h"
-+#include <QtNetwork>
-+
-+CSingleInstanceProxy::CSingleInstanceProxy(const QStringList filenames)
-+{
-+ serverName = CMainWindow::self().getUser();
-+ if(serverName != "QMapTool")
-+ {
-+ serverName = "QMapTool-" + serverName;
-+ }
-+
-+ QLocalSocket socket;
-+ socket.connectToServer(serverName);
-+ if(socket.waitForConnected(1000))
-+ {
-+ // if the connection is successful another instance
-+ // is already running. In that case the list of files to
-+ // open is sent to the primary instance. And this instance
-+ // will be closed imediately.
-+ QDataStream stream(&socket);
-+ stream << filenames;
-+ socket.waitForBytesWritten(3000);
-+
-+ // wait for confirmation
-+ socket.waitForReadyRead(3000);
-+ bool ok;
-+ stream >> ok;
-+ qDebug() << "Sent parameters to primary instance. Result" << ok;
-+ qDebug() << "There can only be one. Exit.";
-+ exit(0);
-+ }
-+
-+ // Looks like we are the first instance.
-+ // Create a server socket and wait for other instances to connect.
-+ server = new QLocalServer(this);
-+ connect(server, &QLocalServer::newConnection, this, &CSingleInstanceProxy::slotNewConnection);
-+ server->removeServer(serverName);
-+ if(!server->listen(serverName))
-+ {
-+ qDebug() << "CSingleInstanceProxy: Failed to start single instance server socket.";
-+ }
-+ else
-+ {
-+ qDebug() << "CSingleInstanceProxy: Single instance server socket listening to" << server->fullServerName();
-+ }
-+}
-+
-+CSingleInstanceProxy::~CSingleInstanceProxy()
-+{
-+ qDebug() << "CSingleInstanceProxy::~CSingleInstanceProxy()";
-+}
-+
-+void CSingleInstanceProxy::slotNewConnection()
-+{
-+ QLocalSocket * socket = server->nextPendingConnection();
-+ if(socket == nullptr)
-+ {
-+ return;
-+ }
-+
-+ // Each secondary instance will send a QStringList with files to open
-+ // The list can be empty.
-+ if(socket->waitForReadyRead(3000))
-+ {
-+ QStringList filenames;
-+ QDataStream stream(socket);
-+ stream >> filenames;
-+
-+ CMainWindow& w = CMainWindow::self();
-+ //w.loadGISData(filenames);
-+
-+ // confirm that files are loaded
-+ stream << true;
-+ socket->waitForBytesWritten(3000);
-+
-+ // raise the application window to top of desktop
-+ w.raise();
-+ QApplication::setActiveWindow(&w);
-+ }
-+
-+ socket->close();
-+ delete socket;
-+}
-diff --git a/src/qmaptool/CSingleInstanceProxy.h b/src/qmaptool/CSingleInstanceProxy.h
-new file mode 100644
-index 00000000..c211c8cb
---- /dev/null
-+++ b/src/qmaptool/CSingleInstanceProxy.h
-@@ -0,0 +1,41 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CSINGLEINSTANCEPROXY_H
-+#define CSINGLEINSTANCEPROXY_H
-+
-+#include <QObject>
-+class QLocalServer;
-+
-+class CSingleInstanceProxy : public QObject
-+{
-+public:
-+ CSingleInstanceProxy(const QStringList filenames);
-+ virtual ~CSingleInstanceProxy();
-+
-+private slots:
-+ void slotNewConnection();
-+
-+private:
-+ QLocalServer * server = nullptr;
-+
-+ QString serverName;
-+};
-+
-+#endif //CSINGLEINSTANCEPROXY_H
-+
-diff --git a/src/qmaptool/GeoMath.cpp b/src/qmaptool/GeoMath.cpp
-new file mode 100644
-index 00000000..00596006
---- /dev/null
-+++ b/src/qmaptool/GeoMath.cpp
-@@ -0,0 +1,54 @@
-+/**********************************************************************************************
-+ Copyright (C) 2009 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 2 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-+
-+**********************************************************************************************/
-+
-+#include "GeoMath.h"
-+
-+#define PI M_PI
-+#define TWOPI (2*PI)
-+
-+
-+void GPS_Math_DegMinSec_To_Deg(bool sign, const qint32 d, const qint32 m, const qreal s, qreal &deg)
-+{
-+ deg = qAbs(d) + qreal(m) / 60.0 + s / 3600;
-+ if(sign)
-+ {
-+ deg = -deg;
-+ }
-+}
-+
-+
-+bool GPS_Math_Deg_To_DegMin(qreal v, qint32 *deg, qreal *min)
-+{
-+ *deg = qAbs(v);
-+ *min = (qAbs(v) - *deg) * 60.0;
-+
-+ return v < 0;
-+}
-+
-+
-+void GPS_Math_DegMin_To_Deg(bool sign, const qint32 d, const qreal m, qreal& deg)
-+{
-+ deg = qAbs(d) + m / 60.0;
-+ if(sign)
-+ {
-+ deg = -deg;
-+ }
-+}
-+
-+
-diff --git a/src/qmaptool/GeoMath.h b/src/qmaptool/GeoMath.h
-new file mode 100644
-index 00000000..7f48a1fe
---- /dev/null
-+++ b/src/qmaptool/GeoMath.h
-@@ -0,0 +1,31 @@
-+/**********************************************************************************************
-+ Copyright (C) 2009 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 2 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-+
-+**********************************************************************************************/
-+
-+#ifndef GEOMATH_H
-+#define GEOMATH_H
-+
-+#include <QtGlobal>
-+#include <stdint.h>
-+
-+void GPS_Math_DegMin_To_Deg(bool sign, const qint32 d, const qreal m, qreal& deg);
-+void GPS_Math_DegMinSec_To_Deg(bool sign, const qint32 d, const qint32 m, const qreal s, qreal& deg);
-+bool GPS_Math_Deg_To_DegMin(qreal v, qint32 *deg, qreal *min);
-+
-+#endif //GEOMATH_H
-+
-diff --git a/src/qmaptool/IAbout.ui b/src/qmaptool/IAbout.ui
-new file mode 100644
-index 00000000..17d509bd
---- /dev/null
-+++ b/src/qmaptool/IAbout.ui
-@@ -0,0 +1,164 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<ui version="4.0">
-+ <class>IAbout</class>
-+ <widget class="QDialog" name="IAbout">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>418</width>
-+ <height>407</height>
-+ </rect>
-+ </property>
-+ <property name="windowTitle">
-+ <string>About...</string>
-+ </property>
-+ <property name="windowIcon">
-+ <iconset resource="resources.qrc">
-+ <normaloff>:/icons/32x32/QMapTool.png</normaloff>:/icons/32x32/QMapTool.png</iconset>
-+ </property>
-+ <layout class="QVBoxLayout" name="verticalLayout">
-+ <item>
-+ <layout class="QHBoxLayout" name="horizontalLayout">
-+ <item>
-+ <widget class="QLabel" name="label_2">
-+ <property name="text">
-+ <string>&lt;b&gt;QMapTool&lt;/b&gt;, Version</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QLabel" name="labelVersion">
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="text">
-+ <string>TextLabel</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QLabel" name="label_4">
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="pixmap">
-+ <pixmap resource="resources.qrc">:/icons/48x48/QMapTool.png</pixmap>
-+ </property>
-+ </widget>
-+ </item>
-+ </layout>
-+ </item>
-+ <item>
-+ <widget class="Line" name="line">
-+ <property name="orientation">
-+ <enum>Qt::Horizontal</enum>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <layout class="QFormLayout" name="formLayout">
-+ <property name="fieldGrowthPolicy">
-+ <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
-+ </property>
-+ <item row="0" column="0">
-+ <widget class="QLabel" name="label_5">
-+ <property name="text">
-+ <string>Qt</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="0" column="1">
-+ <widget class="QLabel" name="labelQtVersion">
-+ <property name="text">
-+ <string>TextLabel</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="1" column="0">
-+ <widget class="QLabel" name="label_6">
-+ <property name="text">
-+ <string>GDAL</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="1" column="1">
-+ <widget class="QLabel" name="labelGDALVersion">
-+ <property name="text">
-+ <string>TextLabel</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="2" column="0">
-+ <widget class="QLabel" name="label_7">
-+ <property name="text">
-+ <string>Proj4</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="2" column="1">
-+ <widget class="QLabel" name="labelProj4Version">
-+ <property name="text">
-+ <string>TextLabel</string>
-+ </property>
-+ </widget>
-+ </item>
-+ </layout>
-+ </item>
-+ <item>
-+ <widget class="Line" name="line_2">
-+ <property name="orientation">
-+ <enum>Qt::Horizontal</enum>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QLabel" name="label_35">
-+ <property name="text">
-+ <string>This software is licensed under GPL3 or any later version</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QLabel" name="label_36">
-+ <property name="text">
-+ <string>© 2017 Oliver Eichler (oliver.eichler@gmx.de)</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <spacer name="verticalSpacer">
-+ <property name="orientation">
-+ <enum>Qt::Vertical</enum>
-+ </property>
-+ <property name="sizeHint" stdset="0">
-+ <size>
-+ <width>20</width>
-+ <height>40</height>
-+ </size>
-+ </property>
-+ </spacer>
-+ </item>
-+ <item>
-+ <widget class="QLabel" name="label">
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="pixmap">
-+ <pixmap resource="resources.qrc">:/pic/splash.png</pixmap>
-+ </property>
-+ <property name="scaledContents">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ </layout>
-+ </widget>
-+ <resources>
-+ <include location="resources.qrc"/>
-+ </resources>
-+ <connections/>
-+</ui>
-diff --git a/src/qmaptool/IMainWindow.ui b/src/qmaptool/IMainWindow.ui
-new file mode 100644
-index 00000000..6b11c3bb
---- /dev/null
-+++ b/src/qmaptool/IMainWindow.ui
-@@ -0,0 +1,208 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<ui version="4.0">
-+ <class>IMainWindow</class>
-+ <widget class="QMainWindow" name="IMainWindow">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>800</width>
-+ <height>600</height>
-+ </rect>
-+ </property>
-+ <property name="windowTitle">
-+ <string>MainWindow</string>
-+ </property>
-+ <property name="windowIcon">
-+ <iconset resource="resources.qrc">
-+ <normaloff>:/icons/48x48/QMapTool.png</normaloff>:/icons/48x48/QMapTool.png</iconset>
-+ </property>
-+ <widget class="CCanvas" name="canvas"/>
-+ <widget class="QMenuBar" name="menubar">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>800</width>
-+ <height>23</height>
-+ </rect>
-+ </property>
-+ <widget class="QMenu" name="menuSetup">
-+ <property name="title">
-+ <string>Setup</string>
-+ </property>
-+ <addaction name="actionSetupExtTools"/>
-+ <addaction name="actionSetupUnits"/>
-+ <addaction name="actionSetupCoordFormat"/>
-+ <addaction name="actionShowToolHelp"/>
-+ </widget>
-+ <widget class="QMenu" name="menuView">
-+ <property name="title">
-+ <string>View</string>
-+ </property>
-+ <addaction name="actionFlipMouseWheel"/>
-+ </widget>
-+ <widget class="QMenu" name="menuWindow">
-+ <property name="title">
-+ <string>Window</string>
-+ </property>
-+ </widget>
-+ <widget class="QMenu" name="menu">
-+ <property name="title">
-+ <string>?</string>
-+ </property>
-+ <addaction name="actionAbout"/>
-+ </widget>
-+ <addaction name="menuSetup"/>
-+ <addaction name="menuView"/>
-+ <addaction name="menuWindow"/>
-+ <addaction name="menu"/>
-+ </widget>
-+ <widget class="QStatusBar" name="statusbar"/>
-+ <widget class="QDockWidget" name="dockTools">
-+ <property name="features">
-+ <set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetVerticalTitleBar</set>
-+ </property>
-+ <property name="windowTitle">
-+ <string>Tools</string>
-+ </property>
-+ <attribute name="dockWidgetArea">
-+ <number>1</number>
-+ </attribute>
-+ <widget class="QWidget" name="dockWidgetContents">
-+ <layout class="QVBoxLayout" name="verticalLayout_2">
-+ <property name="spacing">
-+ <number>0</number>
-+ </property>
-+ <property name="leftMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="topMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="rightMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="bottomMargin">
-+ <number>0</number>
-+ </property>
-+ <item>
-+ <widget class="CToolStack" name="toolStack"/>
-+ </item>
-+ </layout>
-+ </widget>
-+ </widget>
-+ <widget class="QDockWidget" name="dockShell">
-+ <property name="features">
-+ <set>QDockWidget::DockWidgetFeatureMask</set>
-+ </property>
-+ <property name="windowTitle">
-+ <string>Shell</string>
-+ </property>
-+ <attribute name="dockWidgetArea">
-+ <number>8</number>
-+ </attribute>
-+ <widget class="QWidget" name="dockWidgetContents_3">
-+ <layout class="QVBoxLayout" name="verticalLayout">
-+ <item>
-+ <widget class="CShell" name="textBrowser"/>
-+ </item>
-+ </layout>
-+ </widget>
-+ </widget>
-+ <action name="actionAbout">
-+ <property name="icon">
-+ <iconset resource="resources.qrc">
-+ <normaloff>:/icons/32x32/Info.png</normaloff>:/icons/32x32/Info.png</iconset>
-+ </property>
-+ <property name="text">
-+ <string>About</string>
-+ </property>
-+ </action>
-+ <action name="actionSetupExtTools">
-+ <property name="icon">
-+ <iconset resource="resources.qrc">
-+ <normaloff>:/icons/32x32/Apply.png</normaloff>:/icons/32x32/Apply.png</iconset>
-+ </property>
-+ <property name="text">
-+ <string>Ext. Tools</string>
-+ </property>
-+ <property name="toolTip">
-+ <string>Setup paths to external tools, like gdalwarp etc.</string>
-+ </property>
-+ </action>
-+ <action name="actionFlipMouseWheel">
-+ <property name="checkable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="resources.qrc">
-+ <normaloff>:/icons/32x32/MouseWheel.png</normaloff>:/icons/32x32/MouseWheel.png</iconset>
-+ </property>
-+ <property name="text">
-+ <string>Flip Mouse Wheel</string>
-+ </property>
-+ <property name="toolTip">
-+ <string>Flip Mouse Wheel</string>
-+ </property>
-+ </action>
-+ <action name="actionSetupUnits">
-+ <property name="icon">
-+ <iconset resource="resources.qrc">
-+ <normaloff>:/icons/32x32/UnitSetup.png</normaloff>:/icons/32x32/UnitSetup.png</iconset>
-+ </property>
-+ <property name="text">
-+ <string>Setup Units</string>
-+ </property>
-+ <property name="toolTip">
-+ <string>Setup Units</string>
-+ </property>
-+ </action>
-+ <action name="actionSetupCoordFormat">
-+ <property name="icon">
-+ <iconset resource="resources.qrc">
-+ <normaloff>:/icons/32x32/SetupCoordFormat.png</normaloff>:/icons/32x32/SetupCoordFormat.png</iconset>
-+ </property>
-+ <property name="text">
-+ <string>Setup Coord. Format</string>
-+ </property>
-+ <property name="toolTip">
-+ <string>Change the format coordinates are displayed</string>
-+ </property>
-+ </action>
-+ <action name="actionShowToolHelp">
-+ <property name="checkable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="checked">
-+ <bool>true</bool>
-+ </property>
-+ <property name="text">
-+ <string>Show Tool Help</string>
-+ </property>
-+ </action>
-+ </widget>
-+ <customwidgets>
-+ <customwidget>
-+ <class>CShell</class>
-+ <extends>QTextBrowser</extends>
-+ <header>shell/CShell.h</header>
-+ </customwidget>
-+ <customwidget>
-+ <class>CCanvas</class>
-+ <extends>QWidget</extends>
-+ <header>canvas/CCanvas.h</header>
-+ <container>1</container>
-+ </customwidget>
-+ <customwidget>
-+ <class>CToolStack</class>
-+ <extends>QStackedWidget</extends>
-+ <header>tool/CToolStack.h</header>
-+ <container>1</container>
-+ </customwidget>
-+ </customwidgets>
-+ <resources>
-+ <include location="resources.qrc"/>
-+ </resources>
-+ <connections/>
-+</ui>
-diff --git a/src/qmaptool/README.md b/src/qmaptool/README.md
-new file mode 100644
-index 00000000..2db8ed98
---- /dev/null
-+++ b/src/qmaptool/README.md
-@@ -0,0 +1,7 @@
-+# README #
-+
-+This is a sub-project of QMapShack and it's not supposed to compile on it's own. Please refere to
-+
-+https://bitbucket.org/maproom/qmapshack/overview
-+
-+to check out and compile this project.
-\ No newline at end of file
-diff --git a/src/qmaptool/canvas/CCanvas.cpp b/src/qmaptool/canvas/CCanvas.cpp
-new file mode 100644
-index 00000000..11b65e54
---- /dev/null
-+++ b/src/qmaptool/canvas/CCanvas.cpp
-@@ -0,0 +1,189 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/CCanvas.h"
-+#include "canvas/IDrawContext.h"
-+#include "helpers/CDraw.h"
-+
-+
-+#include <QtWidgets>
-+
-+CCanvas::CCanvas(QWidget *parent)
-+ : QWidget(parent)
-+{
-+ setFocusPolicy(Qt::WheelFocus);
-+ setMouseTracking(true);
-+
-+ loadIndicator1 = new QMovie("://animation/loader.gif", QByteArray(), this);
-+ mapLoadIndicator = new QLabel(this);
-+ mapLoadIndicator->setMovie(loadIndicator1);
-+ loadIndicator1->start();
-+ mapLoadIndicator->show();
-+}
-+
-+void CCanvas::setOverrideCursor(const QCursor &cursor, const QString&)
-+{
-+// qDebug() << "setOverrideCursor" << src;
-+ QApplication::setOverrideCursor(cursor);
-+}
-+
-+void CCanvas::restoreOverrideCursor(const QString& src)
-+{
-+// qDebug() << "restoreOverrideCursor" << src;
-+ QApplication::restoreOverrideCursor();
-+}
-+
-+void CCanvas::changeOverrideCursor(const QCursor& cursor, const QString &src)
-+{
-+// qDebug() << "changeOverrideCursor" << src;
-+ QApplication::changeOverrideCursor(cursor);
-+}
-+
-+
-+void CCanvas::resizeEvent(QResizeEvent *e)
-+{
-+ QMutexLocker lock(&mutex);
-+
-+ needsRedraw = eRedrawAll;
-+
-+ // move map loading indicator to new center of canvas
-+ QPoint p1(mapLoadIndicator->width()>>1, mapLoadIndicator->height()>>1);
-+ mapLoadIndicator->move(rect().center() - p1);
-+
-+ emit sigChangedSize(e->size());
-+
-+ QWidget::resizeEvent(e);
-+}
-+
-+void CCanvas::paintEvent(QPaintEvent *e)
-+{
-+ QPainter p;
-+ p.begin(this);
-+ USE_ANTI_ALIASING(p,true);
-+
-+ // fill the background with default pattern
-+ p.fillRect(rect(), backColor);
-+
-+ // ----- start to draw thread based content -----
-+
-+ mutex.lock();
-+ if(!tool->drawFx(p,needsRedraw))
-+ {
-+ mutex.unlock();
-+ slotHideLoadIndicator();
-+ CDraw::text(tr("No map view available."), p, rect(), Qt::black);
-+ mutex.lock();
-+ }
-+ mutex.unlock();
-+ // ----- start to draw fast content -----
-+ p.end();
-+ needsRedraw = eRedrawNone;
-+}
-+
-+void CCanvas::mousePressEvent(QMouseEvent *e)
-+{
-+ QMutexLocker lock(&mutex);
-+ tool->mousePressEventFx(e);
-+ e->accept();
-+}
-+
-+void CCanvas::mouseMoveEvent(QMouseEvent *e)
-+{
-+ QMutexLocker lock(&mutex);
-+ tool->mouseMoveEventFx(e);
-+ e->accept();
-+}
-+
-+void CCanvas::mouseReleaseEvent(QMouseEvent *e)
-+{
-+ QMutexLocker lock(&mutex);
-+ tool->mouseReleaseEventFx(e);
-+ e->accept();
-+}
-+
-+void CCanvas::mouseDoubleClickEvent(QMouseEvent *e)
-+{
-+ QMutexLocker lock(&mutex);
-+ tool->mouseDoubleClickEventFx(e);
-+ e->accept();
-+}
-+
-+void CCanvas::wheelEvent(QWheelEvent *e)
-+{
-+ QMutexLocker lock(&mutex);
-+ tool->wheelEventFx(e);
-+}
-+
-+void CCanvas::enterEvent(QEvent *e)
-+{
-+ QMutexLocker lock(&mutex);
-+
-+ tool->enterEventFx(e);
-+ CCanvas::setOverrideCursor(tool->getCursorFx(), "enterEvent");
-+
-+ setMouseTracking(true);
-+}
-+
-+void CCanvas::leaveEvent(QEvent *e)
-+{
-+ QMutexLocker lock(&mutex);
-+
-+ tool->leaveEventFx(e);
-+
-+ // bad hack to stop bad number of override cursors.
-+ while(QApplication::overrideCursor())
-+ {
-+ CCanvas::restoreOverrideCursor("leaveEvent");
-+ }
-+
-+
-+ setMouseTracking(false);
-+}
-+
-+void CCanvas::keyPressEvent(QKeyEvent *e)
-+{
-+ QMutexLocker lock(&mutex);
-+ if(!tool->keyPressEventFx(e))
-+ {
-+ e->ignore();
-+ }
-+}
-+
-+
-+void CCanvas::slotTriggerCompleteUpdate(CCanvas::redraw_e flags)
-+{
-+ needsRedraw = (redraw_e)(needsRedraw | flags);
-+ update();
-+}
-+
-+void CCanvas::slotShowLoadIndicator()
-+{
-+ QMutexLocker lock(&mutex);
-+ mapLoadIndicator->show();
-+ mapLoadIndicatorCount++;
-+}
-+
-+void CCanvas::slotHideLoadIndicator()
-+{
-+ QMutexLocker lock(&mutex);
-+ if(--mapLoadIndicatorCount <= 0)
-+ {
-+ mapLoadIndicator->hide();
-+ mapLoadIndicatorCount = 0;
-+ }
-+}
-diff --git a/src/qmaptool/canvas/CCanvas.h b/src/qmaptool/canvas/CCanvas.h
-new file mode 100644
-index 00000000..552085ea
---- /dev/null
-+++ b/src/qmaptool/canvas/CCanvas.h
-@@ -0,0 +1,92 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CCANVAS_H
-+#define CCANVAS_H
-+
-+#include <QLabel>
-+#include <QMovie>
-+#include <QMutex>
-+#include <QPointer>
-+#include <QWidget>
-+
-+class ITool;
-+class CMainWindow;
-+class QStackedWidget;
-+
-+class CCanvas : public QWidget
-+{
-+ Q_OBJECT
-+public:
-+ CCanvas(QWidget *parent);
-+ virtual ~CCanvas() = default;
-+
-+ static void setOverrideCursor(const QCursor &cursor, const QString&);
-+ static void restoreOverrideCursor(const QString &src);
-+ static void changeOverrideCursor(const QCursor& cursor, const QString &src);
-+
-+ enum redraw_e
-+ {
-+ eRedrawNone = 0
-+ , eRedrawMap = 0x01
-+ , eRedrawOverlay = 0x08
-+ , eRedrawAll = 0xFFFFFFFF
-+ };
-+
-+ void setToolInterface(ITool * t)
-+ {
-+ tool = t;
-+ }
-+
-+signals:
-+ void sigChangedSize(const QSize& size);
-+
-+public slots:
-+ void slotTriggerCompleteUpdate(CCanvas::redraw_e flags);
-+
-+ void slotShowLoadIndicator();
-+ void slotHideLoadIndicator();
-+
-+protected:
-+ void resizeEvent(QResizeEvent *e) override;
-+ void paintEvent(QPaintEvent *e) override;
-+ void mousePressEvent(QMouseEvent *e) override;
-+ void mouseMoveEvent(QMouseEvent *e) override;
-+ void mouseReleaseEvent(QMouseEvent *e) override;
-+ void mouseDoubleClickEvent(QMouseEvent *e) override;
-+ void wheelEvent(QWheelEvent *e) override;
-+ void enterEvent(QEvent *e) override;
-+ void leaveEvent(QEvent *e) override;
-+ void keyPressEvent(QKeyEvent *e) override;
-+
-+private:
-+ mutable QMutex mutex {QMutex::Recursive};
-+
-+ QColor backColor = "#FFFFBF"; //< the background color used in case of missing map tiles
-+ redraw_e needsRedraw = eRedrawAll; //< set true to initiate a complete redraw of the screen content
-+
-+ /// load indicator for maps
-+ QMovie * loadIndicator1;
-+ QLabel * mapLoadIndicator;
-+ qint32 mapLoadIndicatorCount = 0;
-+
-+ ITool * tool = nullptr;
-+};
-+
-+#endif //CCANVAS_H
-+
-diff --git a/src/qmaptool/canvas/CDrawContextPixel.cpp b/src/qmaptool/canvas/CDrawContextPixel.cpp
-new file mode 100644
-index 00000000..a28c383e
---- /dev/null
-+++ b/src/qmaptool/canvas/CDrawContextPixel.cpp
-@@ -0,0 +1,168 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/CDrawContextPixel.h"
-+#include "helpers/CDraw.h"
-+
-+#include <gdal_priv.h>
-+#include <ogr_spatialref.h>
-+#include <QtWidgets>
-+
-+CDrawContextPixel::CDrawContextPixel(CCanvas *canvas, QObject * parent)
-+ : IDrawContext(canvas, parent)
-+{
-+ scale = QPointF(1.0, 1.0);
-+}
-+
-+CDrawContextPixel::~CDrawContextPixel()
-+{
-+ unload();
-+}
-+
-+void CDrawContextPixel::convertMap2Coord(QPointF &pt) const
-+{
-+ pt = trFwd.map(pt);
-+}
-+
-+void CDrawContextPixel::convertCoord2Map(QPointF &pt) const
-+{
-+ pt = trInv.map(pt);
-+}
-+
-+
-+void CDrawContextPixel::setSourceFile(const QString& filename, bool resetContext)
-+{
-+ unload();
-+
-+ if(resetContext)
-+ {
-+ focus = QPointF(0,0);
-+ zoom(6);
-+ }
-+
-+ if(filename.isEmpty())
-+ {
-+ return;
-+ }
-+
-+ load(filename);
-+
-+ intNeedsRedraw = true;
-+}
-+
-+void CDrawContextPixel::drawt(buffer_t& buf)
-+{
-+ QPainter p(&buf.image);
-+
-+ if(needsRedraw() || (dataset == nullptr) || (isValid == false))
-+ {
-+ CDraw::text(tr("Failed to load"), p, canvas->rect(), Qt::black);
-+ return;
-+ }
-+
-+ // calculate area to read from file
-+ QPointF pt1 = buf.ref1;
-+ QPointF pt2 = buf.ref2;
-+ QPointF pt4 = buf.ref4;
-+
-+ pt1.rx() = qMax(pt1.x(), 0.0);
-+ pt1.rx() = qMin(pt1.x(), xsize_px);
-+
-+ pt2.rx() = qMax(pt2.x(), 0.0);
-+ pt2.rx() = qMin(pt2.x(), xsize_px);
-+
-+ pt1.ry() = qMax(pt1.y(), 0.0);
-+ pt1.ry() = qMin(pt1.y(), ysize_px);
-+
-+ pt4.ry() = qMax(pt4.y(), 0.0);
-+ pt4.ry() = qMin(pt4.y(), ysize_px);
-+
-+ qint32 mapWidth = qRound(pt2.x() - pt1.x());
-+ qint32 mapHeight = qRound(pt4.y() - pt1.y());
-+ QPointF mapOff = pt1;
-+
-+ convertMap2Screen(pt1);
-+ convertMap2Screen(pt2);
-+ convertMap2Screen(pt4);
-+
-+ qint32 screenWidth = qRound(pt2.x() - pt1.x()) & 0xFFFFFFFC;
-+ qint32 screenHeight = qRound(pt4.y() - pt1.y());
-+ QPointF screenOff = pt1;
-+
-+
-+ // start to draw the map
-+ QImage img;
-+ QVector<quint8> buffer(screenWidth * screenHeight, 0);
-+
-+ CPLErr err = CE_Failure;
-+
-+ if(rasterBandCount == 1)
-+ {
-+ GDALRasterBand * pBand;
-+ pBand = dataset->GetRasterBand(1);
-+
-+ img = QImage(screenWidth,screenHeight,QImage::Format_Indexed8);
-+ img.setColorTable(colortable);
-+
-+ mutex.lock();
-+ err = pBand->RasterIO(GF_Read, mapOff.x(), mapOff.y(), mapWidth, mapHeight, img.bits(), screenWidth, screenHeight, GDT_Byte, 0, 0);
-+ mutex.unlock();
-+ }
-+ else
-+ {
-+ const QRgb testPix = qRgba(GCI_RedBand, GCI_GreenBand, GCI_BlueBand, GCI_AlphaBand);
-+ img = QImage(screenWidth, screenHeight, QImage::Format_ARGB32);
-+ // fill alpha channel of image buffer
-+ img.fill(Qt::white);
-+
-+ // read map band by band and copy color values into the image buffer
-+ for(int b = 1; b <= rasterBandCount; ++b)
-+ {
-+ GDALRasterBand * pBand;
-+ pBand = dataset->GetRasterBand(b);
-+
-+ mutex.lock();
-+ err = pBand->RasterIO(GF_Read, mapOff.x(), mapOff.y(), mapWidth, mapHeight, buffer.data(), screenWidth, screenHeight, GDT_Byte, 0, 0);
-+ mutex.unlock();
-+ if(err == CE_None)
-+ {
-+ int pbandColour = pBand->GetColorInterpretation();
-+ unsigned int offset;
-+
-+ for (offset = 0; offset < sizeof(testPix) && *(((quint8 *)&testPix) + offset) != pbandColour; offset++)
-+ {
-+ }
-+ if(offset < sizeof(testPix))
-+ {
-+ quint8 * pTar = img.bits() + offset;
-+ quint8 * pSrc = buffer.data();
-+ const int size = buffer.size();
-+
-+ for(int i = 0; i < size; ++i)
-+ {
-+ *pTar = *pSrc;
-+ pTar += sizeof(testPix);
-+ pSrc += 1;
-+ }
-+ }
-+ }
-+ }
-+ }
-+
-+ p.drawImage(screenOff, img);
-+}
-diff --git a/src/qmaptool/canvas/CDrawContextPixel.h b/src/qmaptool/canvas/CDrawContextPixel.h
-new file mode 100644
-index 00000000..7ebc598f
---- /dev/null
-+++ b/src/qmaptool/canvas/CDrawContextPixel.h
-@@ -0,0 +1,91 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CDRAWCONTEXTPIXEL_H
-+#define CDRAWCONTEXTPIXEL_H
-+
-+#include "canvas/IDrawContext.h"
-+#include "helpers/CGdalFile.h"
-+
-+class GDALDataset;
-+
-+
-+class CDrawContextPixel : public IDrawContext, public CGdalFile
-+{
-+ Q_OBJECT
-+public:
-+ CDrawContextPixel(CCanvas *canvas, QObject *parent);
-+ virtual ~CDrawContextPixel();
-+
-+ void setSourceFile(const QString& filename, bool resetContext) override;
-+
-+ void unload() override
-+ {
-+ CGdalFile::unload();
-+ }
-+
-+ bool getIsValid() const override
-+ {
-+ return isValid;
-+ }
-+
-+ const QString& getProjection() const override
-+ {
-+ return proj4str;
-+ }
-+
-+ const QTransform& getTrFwd() const override
-+ {
-+ return trFwd;
-+ }
-+
-+ bool getNoData() const override
-+ {
-+ return hasNoData != -1;
-+ }
-+
-+ int getRasterBandCount() const override
-+ {
-+ return rasterBandCount;
-+ }
-+
-+ QString getInfo() const override
-+ {
-+ return CGdalFile::getInfo();
-+ }
-+
-+ bool is32BitRgb() const override
-+ {
-+ return rasterBandCount >= 3;
-+ }
-+
-+
-+ QRectF getMapArea() const override
-+ {
-+ return QRectF(0,0, xsize_px, ysize_px);
-+ }
-+
-+ void convertMap2Coord(QPointF &pt) const override;
-+ void convertCoord2Map(QPointF &pt) const override;
-+
-+protected:
-+ void drawt(buffer_t& buf) override;
-+};
-+
-+#endif //CDRAWCONTEXTPIXEL_H
-+
-diff --git a/src/qmaptool/canvas/CDrawContextProj.cpp b/src/qmaptool/canvas/CDrawContextProj.cpp
-new file mode 100644
-index 00000000..c2ac302a
---- /dev/null
-+++ b/src/qmaptool/canvas/CDrawContextProj.cpp
-@@ -0,0 +1,166 @@
-+/**********************************************************************************************
-+ Copyright (C) 2018 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/CDrawContextProj.h"
-+#include "helpers/CDraw.h"
-+
-+#include <gdal_priv.h>
-+#include <QtWidgets>
-+
-+CDrawContextProj::CDrawContextProj(CCanvas *canvas, QObject *parent)
-+ : IDrawContext(canvas, parent)
-+{
-+}
-+
-+void CDrawContextProj::setSourceFile(const QString& filename, bool resetContext)
-+{
-+ unload();
-+
-+ if(resetContext)
-+ {
-+ focus = QPointF(0,0);
-+ zoom(6);
-+ }
-+
-+ if(filename.isEmpty())
-+ {
-+ return;
-+ }
-+
-+ load(filename);
-+
-+ if(resetContext)
-+ {
-+ convertMap2Coord(focus);
-+ }
-+
-+ intNeedsRedraw = true;
-+}
-+
-+void CDrawContextProj::convertMap2Coord(QPointF &pt) const
-+{
-+ pt = trFwd.map(pt);
-+}
-+
-+void CDrawContextProj::convertCoord2Map(QPointF &pt) const
-+{
-+ pt = trInv.map(pt);
-+}
-+
-+
-+void CDrawContextProj::drawt(buffer_t& buf)
-+{
-+ QPainter p(&buf.image);
-+
-+ if(needsRedraw() || (dataset == nullptr) || (isValid == false))
-+ {
-+ CDraw::text(tr("Failed to load"), p, canvas->rect(), Qt::black);
-+ return;
-+ }
-+
-+ // calculate area to read from file
-+ QPointF pt1 = buf.ref1;
-+ QPointF pt3 = buf.ref3;
-+
-+ pt1.rx() = qMax(CGdalFile::ref1.x(), pt1.x());
-+ pt1.rx() = qMin(CGdalFile::ref2.x(), pt1.x());
-+
-+ pt1.ry() = qMin(CGdalFile::ref1.y(), pt1.y());
-+ pt1.ry() = qMax(CGdalFile::ref3.y(), pt1.y());
-+
-+ pt3.rx() = qMax(CGdalFile::ref1.x(), pt3.x());
-+ pt3.rx() = qMin(CGdalFile::ref2.x(), pt3.x());
-+
-+ pt3.ry() = qMin(CGdalFile::ref1.y(), pt3.y());
-+ pt3.ry() = qMax(CGdalFile::ref3.y(), pt3.y());
-+
-+ convertCoord2Map(pt1);
-+ convertCoord2Map(pt3);
-+
-+ qint32 mapWidth = qRound(pt3.x() - pt1.x());
-+ qint32 mapHeight = qRound(pt3.y() - pt1.y());
-+ QPointF mapOff = pt1;
-+
-+ convertMap2Screen(pt1);
-+ convertMap2Screen(pt3);
-+
-+ qint32 screenWidth = qRound(pt3.x() - pt1.x()) & 0xFFFFFFFC;
-+ qint32 screenHeight = qRound(pt3.y() - pt1.y());
-+ QPointF screenOff = pt1;
-+
-+ // start to draw the map
-+ QImage img;
-+ QVector<quint8> buffer(screenWidth * screenHeight, 0);
-+
-+ CPLErr err = CE_Failure;
-+
-+ if(rasterBandCount == 1)
-+ {
-+ GDALRasterBand * pBand;
-+ pBand = dataset->GetRasterBand(1);
-+
-+ img = QImage(screenWidth,screenHeight,QImage::Format_Indexed8);
-+ img.setColorTable(colortable);
-+
-+ mutex.lock();
-+ err = pBand->RasterIO(GF_Read, mapOff.x(), mapOff.y(), mapWidth, mapHeight, img.bits(), screenWidth, screenHeight, GDT_Byte, 0, 0);
-+ mutex.unlock();
-+ }
-+ else
-+ {
-+ const QRgb testPix = qRgba(GCI_RedBand, GCI_GreenBand, GCI_BlueBand, GCI_AlphaBand);
-+ img = QImage(screenWidth, screenHeight, QImage::Format_ARGB32);
-+ // fill alpha channel of image buffer
-+ img.fill(Qt::white);
-+
-+ // read map band by band and copy color values into the image buffer
-+ for(int b = 1; b <= rasterBandCount; ++b)
-+ {
-+ GDALRasterBand * pBand;
-+ pBand = dataset->GetRasterBand(b);
-+
-+ mutex.lock();
-+ err = pBand->RasterIO(GF_Read, mapOff.x(), mapOff.y(), mapWidth, mapHeight, buffer.data(), screenWidth, screenHeight, GDT_Byte, 0, 0);
-+ mutex.unlock();
-+ if(err == CE_None)
-+ {
-+ int pbandColour = pBand->GetColorInterpretation();
-+ unsigned int offset;
-+
-+ for (offset = 0; offset < sizeof(testPix) && *(((quint8 *)&testPix) + offset) != pbandColour; offset++)
-+ {
-+ }
-+ if(offset < sizeof(testPix))
-+ {
-+ quint8 * pTar = img.bits() + offset;
-+ quint8 * pSrc = buffer.data();
-+ const int size = buffer.size();
-+
-+ for(int i = 0; i < size; ++i)
-+ {
-+ *pTar = *pSrc;
-+ pTar += sizeof(testPix);
-+ pSrc += 1;
-+ }
-+ }
-+ }
-+ }
-+ }
-+
-+ p.drawImage(screenOff, img);
-+}
-diff --git a/src/qmaptool/canvas/CDrawContextProj.h b/src/qmaptool/canvas/CDrawContextProj.h
-new file mode 100644
-index 00000000..ecb10f92
---- /dev/null
-+++ b/src/qmaptool/canvas/CDrawContextProj.h
-@@ -0,0 +1,89 @@
-+/**********************************************************************************************
-+ Copyright (C) 2018 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CDRAWCONTEXTPROJ_H
-+#define CDRAWCONTEXTPROJ_H
-+
-+#include "canvas/IDrawContext.h"
-+#include "helpers/CGdalFile.h"
-+
-+#include <proj_api.h>
-+
-+class CDrawContextProj : public IDrawContext, public CGdalFile
-+{
-+ Q_OBJECT
-+public:
-+ CDrawContextProj(CCanvas *canvas, QObject *parent);
-+ virtual ~CDrawContextProj() = default;
-+
-+ void setSourceFile(const QString& filename, bool resetContext) override;
-+
-+ void unload() override
-+ {
-+ CGdalFile::unload();
-+ }
-+
-+ bool getIsValid() const override
-+ {
-+ return isValid;
-+ }
-+
-+ const QString& getProjection() const override
-+ {
-+ return proj4str;
-+ }
-+
-+ const QTransform& getTrFwd() const override
-+ {
-+ return trFwd;
-+ }
-+
-+ bool getNoData() const override
-+ {
-+ return hasNoData != -1;
-+ }
-+
-+ int getRasterBandCount() const override
-+ {
-+ return rasterBandCount;
-+ }
-+
-+ QString getInfo() const override
-+ {
-+ return CGdalFile::getInfo();
-+ }
-+
-+ bool is32BitRgb() const override
-+ {
-+ return rasterBandCount >= 3;
-+ }
-+
-+
-+ QRectF getMapArea() const override
-+ {
-+ return QRectF(0,0, xsize_px, ysize_px);
-+ }
-+
-+ void convertMap2Coord(QPointF &pt) const override;
-+ void convertCoord2Map(QPointF &pt) const override;
-+
-+ void drawt(buffer_t& buf) override;
-+};
-+
-+#endif //CDRAWCONTEXTPROJ_H
-+
-diff --git a/src/qmaptool/canvas/IDrawContext.cpp b/src/qmaptool/canvas/IDrawContext.cpp
-new file mode 100644
-index 00000000..ce960e24
---- /dev/null
-+++ b/src/qmaptool/canvas/IDrawContext.cpp
-@@ -0,0 +1,300 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/IDrawContext.h"
-+
-+#include <QtWidgets>
-+
-+#define N_DEFAULT_ZOOM_LEVELS 31
-+const qreal IDrawContext::scales[N_DEFAULT_ZOOM_LEVELS] =
-+{
-+ 0.10, 0.15, 0.20, 0.30, 0.50, 0.70, 1.0, 1.5, 2.0, 3.0,
-+ 5.0, 7.0, 10.0, 15.0, 20.0, 30.0, 50.0, 70.0, 100.0, 150.0,
-+ 200.0, 300.0, 500.0, 700.0, 1000.0, 1500.0, 2000.0, 3000.0, 5000.0, 7000.0,
-+ 10000.0
-+ //, 15000.0, 20000.0, 30000.0, 50000.0, 70000.0
-+};
-+
-+QPointF operator*(const QPointF& p1, const QPointF& p2)
-+{
-+ return QPointF(p1.x() * p2.x(), p1.y() * p2.y());
-+}
-+
-+QPointF operator/(const QPointF& p1, const QPointF& p2)
-+{
-+ return QPointF(p1.x() / p2.x(), p1.y() / p2.y());
-+}
-+
-+QMutex IDrawContext::mutex(QMutex::Recursive);
-+
-+
-+IDrawContext::IDrawContext(CCanvas * canvas, QObject * parent)
-+ : QThread(parent)
-+ , canvas(canvas)
-+{
-+ init();
-+}
-+
-+void IDrawContext::init()
-+{
-+ connect(this, &IDrawContext::finished, canvas, static_cast<void (CCanvas::*)()>(&CCanvas::update));
-+ connect(this, &IDrawContext::started, canvas, &CCanvas::slotShowLoadIndicator);
-+ connect(this, &IDrawContext::finished, canvas, &CCanvas::slotHideLoadIndicator);
-+ connect(canvas, &CCanvas::sigChangedSize, this, &IDrawContext::slotResize);
-+
-+ slotResize(canvas->size());
-+}
-+
-+
-+void IDrawContext::saveSettings(QSettings& cfg) const
-+{
-+ QMutexLocker lock(&mutex);
-+
-+ cfg.beginGroup("DrawContext");
-+ cfg.setValue("focus", focus);
-+ cfg.setValue("zoomFactorIdx", zoomFactorIdx);
-+ cfg.endGroup();
-+}
-+
-+void IDrawContext::loadSettings(QSettings& cfg)
-+{
-+ QMutexLocker lock(&mutex);
-+
-+ cfg.beginGroup("DrawContext");
-+ focus = cfg.value("focus", focus).toPointF();
-+ zoomFactorIdx = cfg.value("zoomFactorIdx", zoomFactorIdx).toInt();
-+ cfg.endGroup();
-+
-+ zoom(zoomFactorIdx);
-+}
-+
-+
-+void IDrawContext::slotResize(const QSize& size)
-+{
-+ if(isRunning())
-+ {
-+ wait();
-+ }
-+
-+ QMutexLocker lock(&mutex);
-+ viewWidth = size.width();
-+ viewHeight = size.height();
-+
-+ bufWidth = viewWidth;
-+ bufHeight = viewHeight;
-+
-+ buffer[0].image = QImage(qRound(bufWidth), qRound(bufHeight), QImage::Format_ARGB32);
-+ buffer[1].image = QImage(qRound(bufWidth), qRound(bufHeight), QImage::Format_ARGB32);
-+}
-+
-+bool IDrawContext::needsRedraw() const
-+{
-+ mutex.lock(); // --------- start serialize with thread
-+ bool res = intNeedsRedraw;
-+ mutex.unlock(); // --------- stop serialize with thread
-+ return res;
-+}
-+
-+void IDrawContext::convertScreen2Map(QPointF& pt) const
-+{
-+ mutex.lock(); // --------- start serialize with thread
-+
-+ QPointF f = focus;
-+ convertCoord2Map(f);
-+
-+ pt = f + pt * scale * zoomFactor;
-+
-+ mutex.unlock(); // --------- stop serialize with thread
-+}
-+
-+void IDrawContext::convertMap2Screen(QPointF& pt) const
-+{
-+ mutex.lock(); // --------- start serialize with thread
-+
-+ QPointF f = focus;
-+ convertCoord2Map(f);
-+
-+ pt = (pt - f) / (scale * zoomFactor);
-+
-+ mutex.unlock(); // --------- stop serialize with thread
-+}
-+
-+void IDrawContext::convertMap2Screen(QPolygonF& line) const
-+{
-+ mutex.lock(); // --------- start serialize with thread
-+
-+ const int N = line.size();
-+ for(int n = 0; n < N; n++)
-+ {
-+ line[n] = (line[n] - focus) / (scale * zoomFactor);
-+ }
-+
-+ mutex.unlock(); // --------- stop serialize with thread
-+}
-+
-+void IDrawContext::convertMap2Screen(QRectF& rect) const
-+{
-+ mutex.lock(); // --------- start serialize with thread
-+
-+ QPointF topLeft = rect.topLeft();
-+ convertMap2Screen(topLeft);
-+ rect.setTopLeft(topLeft);
-+
-+ QPointF bottomRight = rect.bottomRight();
-+ convertMap2Screen(bottomRight);
-+ rect.setBottomRight(bottomRight);
-+
-+ mutex.unlock(); // --------- stop serialize with thread
-+}
-+
-+
-+void IDrawContext::move(const QPointF& delta)
-+{
-+ mutex.lock(); // --------- start serialize with thread
-+ QPointF f = focus;
-+
-+ convertCoord2Map(f);
-+ convertMap2Screen(f);
-+ f -= delta;
-+ convertScreen2Map(f);
-+ convertMap2Coord(f);
-+
-+ focus = f;
-+ mutex.unlock(); // --------- stop serialize with thread
-+}
-+
-+void IDrawContext::zoom(bool in, const QPointF& pt)
-+{
-+ mutex.lock(); // --------- start serialize with thread
-+
-+ QPointF pt2 = pt;
-+
-+ convertScreen2Map(pt2);
-+ zoom(zoomFactorIdx + (in ? -1 : 1));
-+ convertMap2Screen(pt2);
-+
-+ move(pt - pt2);
-+
-+ mutex.unlock(); // --------- stop serialize with thread
-+}
-+
-+void IDrawContext::zoom(int idx)
-+{
-+ idx = qMax(idx, 0);
-+ idx = qMin(idx, N_DEFAULT_ZOOM_LEVELS - 1);
-+
-+ mutex.lock(); // --------- start serialize with thread
-+ if((zoomFactorIdx != idx) || (zoomFactor.x() != scales[idx]))
-+ {
-+ zoomFactorIdx = idx;
-+ zoomFactor.rx() = scales[idx];
-+ zoomFactor.ry() = scales[idx];
-+ intNeedsRedraw = true;
-+ }
-+ mutex.unlock(); // --------- stop serialize with thread
-+}
-+
-+void IDrawContext::draw(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ mutex.lock(); // --------- start serialize with thread
-+ // derive map reference points for all corners coordinate of map buffer
-+ ref1 = QPointF( 0, 0);
-+ ref2 = QPointF( bufWidth, 0);
-+ ref3 = QPointF( bufWidth, bufHeight);
-+ ref4 = QPointF( 0, bufHeight);
-+
-+ convertScreen2Map(ref1);
-+ convertScreen2Map(ref2);
-+ convertScreen2Map(ref3);
-+ convertScreen2Map(ref4);
-+
-+ convertMap2Coord(ref1);
-+ convertMap2Coord(ref2);
-+ convertMap2Coord(ref3);
-+ convertMap2Coord(ref4);
-+
-+ // get current active buffer
-+ const buffer_t& currentBuffer = buffer[bufIndex];
-+
-+ // calculate screen offset of current buffer
-+ QPointF offset = currentBuffer.ref1;
-+ convertCoord2Map(offset);
-+ convertMap2Screen(offset);
-+
-+ p.save();
-+ // add offset
-+ p.translate(offset);
-+ // scale image if current zoomfactor does not match buffer's zoomfactor
-+ p.scale(currentBuffer.zoomFactor.x()/zoomFactor.x(), currentBuffer.zoomFactor.y()/zoomFactor.y());
-+ // draw buffer to painter
-+ p.drawImage(0,0, currentBuffer.image);
-+ p.restore();
-+
-+ emit sigDraw(p);
-+
-+ // intNeedsRedraw is reset by the thread
-+ if(needsRedraw & maskRedraw)
-+ {
-+ intNeedsRedraw = true;
-+ }
-+ mutex.unlock(); // --------- stop serialize with thread
-+
-+ if((needsRedraw & maskRedraw) && !isRunning())
-+ {
-+ start();
-+ }
-+}
-+
-+
-+void IDrawContext::run()
-+{
-+ mutex.lock();
-+
-+ QTime t;
-+ t.start();
-+ qDebug() << "start thread" << objectName();
-+
-+ IDrawContext::buffer_t& currentBuffer = buffer[!bufIndex];
-+ while(intNeedsRedraw)
-+ {
-+ // copy all projection information need by the
-+ // map render objects to buffer structure
-+ currentBuffer.zoomFactor = zoomFactor;
-+ currentBuffer.scale = scale;
-+ currentBuffer.ref1 = ref1;
-+ currentBuffer.ref2 = ref2;
-+ currentBuffer.ref3 = ref3;
-+ currentBuffer.ref4 = ref4;
-+ currentBuffer.focus = focus;
-+ intNeedsRedraw = false;
-+
-+ mutex.unlock();
-+ // ----- reset buffer -----
-+ currentBuffer.image.fill(Qt::transparent);
-+
-+ drawt(currentBuffer);
-+
-+ mutex.lock();
-+ }
-+ // ----- switch buffer ------
-+ bufIndex = !bufIndex;
-+ qDebug() << "stop thread" << objectName() << "after" << t.elapsed() << "ms";
-+
-+ mutex.unlock();
-+}
-+
-diff --git a/src/qmaptool/canvas/IDrawContext.h b/src/qmaptool/canvas/IDrawContext.h
-new file mode 100644
-index 00000000..c87d4403
---- /dev/null
-+++ b/src/qmaptool/canvas/IDrawContext.h
-@@ -0,0 +1,164 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef IDRAWCONTEXT_H
-+#define IDRAWCONTEXT_H
-+
-+#include "canvas/CCanvas.h"
-+#include "units/IUnit.h"
-+
-+#include <QMutex>
-+#include <QThread>
-+class QPainter;
-+class QSettings;
-+
-+class IDrawContext : public QThread
-+{
-+ Q_OBJECT
-+public:
-+ IDrawContext(CCanvas *canvas, QObject *parent);
-+ virtual ~IDrawContext() = default;
-+
-+ virtual QString getInfo() const = 0;
-+
-+ virtual bool is32BitRgb() const = 0;
-+
-+ virtual int getRasterBandCount() const = 0;
-+
-+ virtual bool getNoData() const = 0;
-+
-+ virtual const QString& getProjection() const = 0;
-+
-+ virtual const QTransform& getTrFwd() const = 0;
-+
-+ virtual QRectF getMapArea() const = 0;
-+
-+ virtual void setSourceFile(const QString& filename, bool resetContext) = 0;
-+
-+ virtual void unload() = 0;
-+
-+ virtual bool getIsValid() const = 0;
-+
-+ virtual void saveSettings(QSettings& cfg) const;
-+
-+ virtual void loadSettings(QSettings& cfg);
-+
-+ void move(const QPointF& delta);
-+
-+ void zoom(bool in, const QPointF& pt);
-+
-+ bool needsRedraw() const;
-+
-+ void convertScreen2Map(QPointF &pt) const;
-+ void convertMap2Screen(QPointF& pt) const;
-+ void convertMap2Screen(QPolygonF& line) const;
-+ void convertMap2Screen(QRectF &rect) const;
-+
-+ virtual void convertMap2Coord(QPointF &pt) const = 0;
-+ virtual void convertCoord2Map(QPointF &pt) const = 0;
-+
-+ /**
-+ @brief draw
-+ @param p
-+ @param needsRedraw
-+ */
-+ void draw(QPainter& p, CCanvas::redraw_e needsRedraw);
-+
-+ void triggerCompleteUpdate(CCanvas::redraw_e flags) const
-+ {
-+ canvas->slotTriggerCompleteUpdate(flags);
-+ }
-+
-+ const CCanvas * getCanvas() const
-+ {
-+ return canvas;
-+ }
-+
-+signals:
-+ void sigDraw(QPainter& p);
-+
-+protected slots:
-+ void slotResize(const QSize& size);
-+
-+protected:
-+ CCanvas *canvas;
-+
-+ struct buffer_t
-+ {
-+ QImage image;
-+
-+ QPointF zoomFactor {1.0,1.0}; //< the zoomfactor used to draw the canvas
-+ QPointF scale {1.0,1.0}; //< the scale of the global viewport
-+
-+ QPointF ref1; //< top left corner
-+ QPointF ref2; //< top right corner
-+ QPointF ref3; //< bottom right corner
-+ QPointF ref4; //< bottom left corner
-+ QPointF focus; //< point of focus
-+ };
-+
-+ void run() override;
-+
-+ virtual void drawt(buffer_t& currentBuffer) = 0;
-+
-+ void zoom(int idx);
-+
-+ static QMutex mutex;
-+
-+ /// internal needs redraw flag
-+ bool intNeedsRedraw = true;
-+
-+ const CCanvas::redraw_e maskRedraw = CCanvas::eRedrawMap;
-+
-+ /// map canvas twin buffer
-+ buffer_t buffer[2];
-+ /// the main threads currently used map canvas buffer
-+ bool bufIndex = false;
-+
-+ qreal bufWidth = 100; //< buffer width [px]
-+ qreal bufHeight = 100; //< buffer height [px]
-+ qreal viewWidth = 100; //< the viewports width [px]
-+ qreal viewHeight = 100; //< the viewports height [px]
-+
-+ QPointF focus {0, 0};
-+
-+ /// the basic scale of the map canvas
-+ QPointF scale = QPoint(1.0, 1.0);
-+
-+private:
-+ void init();
-+
-+ static const qreal scales[];
-+ qint32 zoomFactorIdx = 6;
-+
-+ /// the actual used scaleFactor
-+ QPointF zoomFactor {scales[zoomFactorIdx], scales[zoomFactorIdx]};
-+
-+ QPointF ref1; //< top left corner of next buffer
-+ QPointF ref2; //< top right corner of next buffer
-+ QPointF ref3; //< bottom right corner of next buffer
-+ QPointF ref4; //< bottom left corner of next buffer
-+};
-+
-+extern QPointF operator*(const QPointF& p1, const QPointF& p2);
-+
-+extern QPointF operator/(const QPointF& p1, const QPointF& p2);
-+
-+
-+#endif //IDRAWCONTEXT_H
-+
-diff --git a/src/qmaptool/helpers/CDraw.cpp b/src/qmaptool/helpers/CDraw.cpp
-new file mode 100644
-index 00000000..ef2367d7
---- /dev/null
-+++ b/src/qmaptool/helpers/CDraw.cpp
-@@ -0,0 +1,239 @@
-+/**********************************************************************************************
-+ Copyright (C) 2014 Oliver Eichler oliver.eichler@gmx.de
-+ Copyright (C) 2015 Christian Eichler code@christian-eichler.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/CCanvas.h"
-+#include "helpers/CDraw.h"
-+
-+#include <QDebug>
-+#include <QImage>
-+#include <QPointF>
-+#include <QtMath>
-+
-+QPen CDraw::penBorderBlue(QColor(10,10,150,220),2);
-+QPen CDraw::penBorderGray(Qt::lightGray,2);
-+QPen CDraw::penBorderBlack(QColor(0,0,0,200),2);
-+QBrush CDraw::brushBackWhite(QColor(255,255,255,255));
-+QBrush CDraw::brushBackYellow(QColor(0xff, 0xff, 0xcc, 0xE0));
-+
-+
-+QImage CDraw::createBasicArrow(const QBrush &brush, qreal scale)
-+{
-+ QImage arrow(21*scale, 16*scale, QImage::Format_ARGB32);
-+ arrow.fill(qRgba(0, 0, 0, 0));
-+
-+ QPainter painter(&arrow);
-+ USE_ANTI_ALIASING(painter, true);
-+
-+ // white background, same foreground as p
-+ painter.setPen(QPen(Qt::white, 2));
-+ painter.setBrush(brush);
-+
-+ QPointF arrowPoints[4] =
-+ {
-+ QPointF(20.0*scale, 7.0*scale), // front
-+ QPointF( 0.0*scale, 0.0*scale), // upper tail
-+ QPointF( 5.0*scale, 7.0*scale), // mid tail
-+ QPointF( 0.0*scale, 15.0*scale) // lower tail
-+ };
-+ painter.drawPolygon(arrowPoints, 4);
-+ painter.end();
-+
-+ return arrow;
-+}
-+
-+/**
-+ @brief Calculates the square distance between two points
-+ @return (int) ( (x2 - x1)^2 + (y2 - y1)^2 )
-+ */
-+
-+static inline int pointDistanceSquare(const QPointF &p1, const QPointF &p2)
-+{
-+ return (p2.x() - p1.x()) * (p2.x() - p1.x()) + (p2.y() - p1.y()) * (p2.y() - p1.y());
-+}
-+
-+void CDraw::arrows(const QPolygonF &line, const QRectF &viewport, QPainter &p, int minPointDist, int minArrowDist, qreal scale)
-+{
-+ QImage arrow = createBasicArrow(p.brush(), scale);
-+ qreal xoff = qCeil(arrow.width()/2.0);
-+ qreal yoff = qFloor((arrow.height()-1)/2.0);
-+
-+ const qreal minArrowDistSquare = minArrowDist * minArrowDist;
-+ const qreal minPointDistSquare = minPointDist * minPointDist;
-+
-+ QPointF prevArrow;
-+ bool firstArrow = true;
-+ for(int i = 1; i < line.size(); i++)
-+ {
-+ const QPointF &pt = line[i ];
-+ const QPointF &prevPt = line[i - 1];
-+
-+ // ensure there is enough space between two line points
-+ if( pointDistanceSquare(pt, prevPt) >= minPointDistSquare )
-+ {
-+ QPointF arrowPos = prevPt + (pt - prevPt)/2;
-+
-+ if( (viewport.contains(pt) || 0 == viewport.height()) // ensure the point is visible
-+ && (firstArrow || pointDistanceSquare(prevArrow, arrowPos) >= minArrowDistSquare) )
-+ {
-+ p.save();
-+
-+ // rotate and draw the arrow (between bullets)
-+ p.translate(arrowPos);
-+ qreal direction = ( qAtan2((pt.y() - prevPt.y()), (pt.x() - prevPt.x())) * 180.) / M_PI;
-+ p.rotate(direction);
-+ p.drawImage(-xoff, -yoff, arrow);
-+
-+ p.restore();
-+
-+ prevArrow = arrowPos;
-+ firstArrow = false;
-+ }
-+ }
-+ }
-+}
-+
-+void CDraw::text(const QString &str, QPainter &p, const QPoint &center, const QColor &color, const QFont &font)
-+{
-+ QFontMetrics fm(font);
-+ QRect r = fm.boundingRect(str);
-+
-+ r.moveCenter(center);
-+ p.setFont(font);
-+
-+ // draw the white `shadow`
-+ p.setPen(Qt::white);
-+ p.drawText(r.topLeft() - QPoint(-1, -1), str);
-+ p.drawText(r.topLeft() - QPoint( 0, -1), str);
-+ p.drawText(r.topLeft() - QPoint(+1, -1), str);
-+
-+ p.drawText(r.topLeft() - QPoint(-1, 0), str);
-+ p.drawText(r.topLeft() - QPoint(+1, 0), str);
-+
-+ p.drawText(r.topLeft() - QPoint(-1, +1), str);
-+ p.drawText(r.topLeft() - QPoint( 0, +1), str);
-+ p.drawText(r.topLeft() - QPoint(+1, +1), str);
-+
-+ p.setPen(color);
-+ p.drawText(r.topLeft(), str);
-+}
-+
-+void CDraw::text(const QString &str, QPainter &p, const QRect &r, const QColor &color)
-+{
-+ p.setPen(Qt::white);
-+ p.setFont(CMainWindow::self().getMapFont());
-+
-+ // draw the white `shadow`
-+ p.drawText(r.adjusted(-1, -1, -1, -1), Qt::AlignCenter, str);
-+ p.drawText(r.adjusted( 0, -1, 0, -1), Qt::AlignCenter, str);
-+ p.drawText(r.adjusted(+1, -1, +1, -1), Qt::AlignCenter, str);
-+
-+ p.drawText(r.adjusted(-1, 0, -1, 0), Qt::AlignCenter, str);
-+ p.drawText(r.adjusted(+1, 0, +1, 0), Qt::AlignCenter, str);
-+
-+ p.drawText(r.adjusted(-1, +1, -1, +1), Qt::AlignCenter, str);
-+ p.drawText(r.adjusted( 0, +1, 0, +1), Qt::AlignCenter, str);
-+ p.drawText(r.adjusted(+1, +1, +1, +1), Qt::AlignCenter, str);
-+
-+ p.setPen(color);
-+ p.drawText(r, Qt::AlignCenter, str);
-+}
-+
-+QPoint CDraw::bubble(QPainter &p, const QRect &contentRect, const QPoint &pointerPos, int pointerBaseWidth, float pointerBasePos)
-+{
-+ QPainterPath bubblePath;
-+ bubblePath.addRoundedRect(contentRect, RECT_RADIUS, RECT_RADIUS);
-+
-+ // draw the arrow
-+ int pointerBaseCenterX = (pointerBasePos <= 1)
-+ ? contentRect.left() + (pointerBasePos * contentRect.width())
-+ : contentRect.left() + (int) pointerBasePos;
-+
-+ int pointerHeight = 0;
-+ if(pointerPos.y() < contentRect.top())
-+ {
-+ pointerHeight = contentRect.top() - pointerPos.y() + 1;
-+ }
-+ else if(pointerPos.y() > contentRect.bottom())
-+ {
-+ pointerHeight = contentRect.bottom() - pointerPos.y() - 1;
-+ }
-+ else
-+ {
-+ qDebug() << "cannot calculate pointerHeight/pointerBaseCenterX due to invalid parameters";
-+ }
-+
-+ if(0 != pointerHeight)
-+ {
-+ QPolygonF pointerPoly;
-+ pointerPoly << pointerPos
-+ << QPointF(pointerBaseCenterX - pointerBaseWidth / 2, pointerPos.y() + pointerHeight)
-+ << QPointF(pointerBaseCenterX + pointerBaseWidth / 2, pointerPos.y() + pointerHeight)
-+ << pointerPos;
-+
-+ QPainterPath pointerPath;
-+ pointerPath.addPolygon(pointerPoly);
-+
-+ bubblePath = bubblePath.united(pointerPath);
-+ }
-+
-+ p.setPen (CDraw::penBorderGray);
-+ p.setBrush(CDraw::brushBackWhite);
-+
-+ p.drawPolygon(bubblePath.toFillPolygon());
-+
-+ return contentRect.topLeft();
-+}
-+
-+void CDraw::drawCrossHairDot(QPainter& p, const QPointF& pt)
-+{
-+ USE_ANTI_ALIASING(p, false);
-+ p.setBrush(Qt::NoBrush);
-+ QRectF dot2(0,0,7,7);
-+ p.setPen(QPen(Qt::white, 3));
-+ p.drawLine(pt.x(), pt.y() + 3, pt.x(), pt.y() + 20);
-+ p.drawLine(pt.x(), pt.y() - 3, pt.x(), pt.y() - 20);
-+ p.drawLine(pt.x() - 3, pt.y(), pt.x() - +20, pt.y());
-+ p.drawLine(pt.x() + 3, pt.y(), pt.x() + 20, pt.y());
-+ p.setPen(QPen(Qt::red, 1));
-+ p.drawLine(pt.x(), pt.y() + 3, pt.x(), pt.y() + 20);
-+ p.drawLine(pt.x(), pt.y() - 3, pt.x(), pt.y() - 20);
-+ p.drawLine(pt.x() - 3, pt.y(), pt.x() - +20, pt.y());
-+ p.drawLine(pt.x() + 3, pt.y(), pt.x() + 20, pt.y());
-+
-+ dot2.moveCenter(pt);
-+ p.setPen(QPen(Qt::white, 3));
-+ p.drawRect(dot2);
-+ p.setPen(QPen(Qt::red, 1));
-+ p.drawRect(dot2);
-+ USE_ANTI_ALIASING(p, true);
-+}
-+
-+void CDraw::drawRectangle(QPainter& p, const QRectF& rect, const QPen& pen, const QBrush& brush)
-+{
-+ p.setBrush(brush);
-+ p.setPen(QPen(Qt::white, pen.width() + 2));
-+ p.drawRect(rect);
-+ p.setPen(pen);
-+ p.drawRect(rect);
-+}
-+
-+void CDraw::drawRectangle(QPainter& p, const QRectF& rect, const Qt::GlobalColor& pen, const Qt::GlobalColor& brush)
-+{
-+ drawRectangle(p,rect, QPen(pen), QBrush(brush));
-+}
-diff --git a/src/qmaptool/helpers/CDraw.h b/src/qmaptool/helpers/CDraw.h
-new file mode 100644
-index 00000000..517d6baf
---- /dev/null
-+++ b/src/qmaptool/helpers/CDraw.h
-@@ -0,0 +1,96 @@
-+/**********************************************************************************************
-+ Copyright (C) 2014 Oliver Eichler oliver.eichler@gmx.de
-+ Copyright (C) 2015 Christian Eichler code@christian-eichler.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CPAINTER_H
-+#define CPAINTER_H
-+
-+#include <QPainter>
-+#include <QPolygonF>
-+#include <QRectF>
-+
-+#include "CMainWindow.h"
-+inline void USE_ANTI_ALIASING(QPainter& p, bool useAntiAliasing)
-+{
-+ p.setRenderHints(QPainter::TextAntialiasing|QPainter::Antialiasing|QPainter::SmoothPixmapTransform|QPainter::HighQualityAntialiasing, useAntiAliasing);
-+}
-+
-+#define RECT_RADIUS 3
-+#define PAINT_ROUNDED_RECT(p,r) p.drawRoundedRect(r,RECT_RADIUS,RECT_RADIUS)
-+
-+
-+class CDraw
-+{
-+public:
-+
-+ static QPen penBorderBlue;
-+ static QPen penBorderGray;
-+ static QPen penBorderBlack;
-+ static QBrush brushBackWhite;
-+ static QBrush brushBackYellow;
-+
-+ /**
-+ @brief Draw arrows along a line
-+
-+ An arrow is drawn if all the following requirements are met:
-+ * the position the new arrow would have been drawn is within viewport
-+ OR
-+ `viewport.height() == 0`
-+ * the two points have a distance of at least `minPointDist`
-+ * the (potential) position of the new arrow has at least a distance of `minArrowDist` from the previous arrow
-+
-+ @param line The line to draw the arrows along
-+ @param viewport Restrict drawing of arrows to this viewport (no limitation is applied if `viewport.height() == 0`)
-+ @param minPointDist The minimum distance of two points (in px)
-+ @param minArrowDist The minimum distance of two consecutive arrows (in px)
-+ */
-+ static void arrows(const QPolygonF &line, const QRectF &viewport, QPainter &p, int minPointDist, int minArrowDist, qreal scale);
-+
-+ static void text(const QString& str, QPainter &p, const QPoint &center, const QColor &color, const QFont &font = CMainWindow::self().getMapFont());
-+ static void text(const QString& str, QPainter &p, const QRect &r, const QColor &color);
-+
-+ /**
-+ @brief Draw a cartoon bubble
-+
-+ `pointerBasePos` denotes the position of the pointer's base, where 0 is `at the very left of the content`, and 1 is `at the very right`.
-+ Be careful with small values (near 0) or large values (near 1) for pointerBasePos, this might lead to incorrect drawing,
-+ especially if pointerBaseWidth is large.
-+ If is larger than 1, a value in pixels is assumed.
-+
-+ @param p An active QPainter
-+ @param contentRect The area the actual content will be in
-+ @param pointerPos The position of the pointer's head
-+ @param pointerBaseWidth The width of the pointer
-+ @param pointerBasePos The (relative) location of the pointer (in percent / pixels)
-+ */
-+ static QPoint bubble(QPainter &p, const QRect &contentRect, const QPoint &pointerPos, int pointerBaseWidth = 20, float pointerBasePos = .5f);
-+
-+ static void drawCrossHairDot(QPainter& p, const QPointF& pt);
-+
-+ static void drawRectangle(QPainter& p, const QRectF& rect, const Qt::GlobalColor& pen, const Qt::GlobalColor& brush);
-+ static void drawRectangle(QPainter& p, const QRectF& rect, const QPen& pen, const QBrush& brush);
-+private:
-+ /**
-+ @brief Creates a new arrow using the brush specified
-+ @return A QImage containing the arrow
-+ */
-+ static QImage createBasicArrow(const QBrush &brush, qreal scale);
-+};
-+
-+#endif // CPAINTER_H
-+
-diff --git a/src/qmaptool/helpers/CGdalFile.cpp b/src/qmaptool/helpers/CGdalFile.cpp
-new file mode 100644
-index 00000000..f1d875ec
---- /dev/null
-+++ b/src/qmaptool/helpers/CGdalFile.cpp
-@@ -0,0 +1,221 @@
-+/**********************************************************************************************
-+ Copyright (C) 2018 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/CCanvas.h"
-+#include "CMainWindow.h"
-+#include "helpers/CGdalFile.h"
-+
-+#include <gdal_priv.h>
-+#include <ogr_spatialref.h>
-+
-+#include <QtWidgets>
-+
-+CGdalFile::CGdalFile()
-+{
-+}
-+
-+
-+void CGdalFile::unload()
-+{
-+ isValid = false;
-+ if(dataset != nullptr)
-+ {
-+ GDALClose(dataset);
-+ }
-+ dataset = nullptr;
-+}
-+
-+
-+void CGdalFile::load(const QString& filename)
-+{
-+ qDebug() << filename;
-+ CCanvas * canvas = CMainWindow::self().getCanvas();
-+
-+ dataset = (GDALDataset*)GDALOpenShared(filename.toUtf8(),GA_ReadOnly);
-+
-+ if(nullptr == dataset)
-+ {
-+ QMessageBox::warning(canvas, tr("Error..."), tr("Failed to load file: %1").arg(filename));
-+ return;
-+ }
-+
-+ char str[1025] = {0};
-+ if(dataset->GetProjectionRef())
-+ {
-+ strncpy(str, dataset->GetProjectionRef(), sizeof(str) - 1);
-+ }
-+
-+ {
-+ OGRSpatialReference oSRS;
-+ char *wkt = str;
-+ oSRS.importFromWkt(&wkt);
-+
-+ char *proj4 = nullptr;
-+ oSRS.exportToProj4(&proj4);
-+ proj4str = proj4;
-+ pjsrc = pj_init_plus(proj4);
-+ free(proj4);
-+ }
-+
-+ GDALRasterBand *pBand = dataset->GetRasterBand(1);
-+
-+ if(nullptr == pBand)
-+ {
-+ GDALClose(dataset);
-+ dataset = nullptr;
-+ QMessageBox::warning(canvas, tr("Error..."), tr("Failed to load file: %1").arg(filename));
-+ return;
-+ }
-+ hasOverviews = pBand->GetOverviewCount();
-+ qDebug() << "hasOverviews" << hasOverviews;
-+
-+ // ------- setup color table ---------
-+ rasterBandCount = dataset->GetRasterCount();
-+ if(rasterBandCount == 1)
-+ {
-+ if(pBand->GetColorInterpretation() == GCI_PaletteIndex )
-+ {
-+ GDALColorTable * pct = pBand->GetColorTable();
-+ for(int i=0; i < pct->GetColorEntryCount(); ++i)
-+ {
-+ const GDALColorEntry& e = *pct->GetColorEntry(i);
-+ colortable << qRgba(e.c1, e.c2, e.c3, e.c4);
-+ }
-+ }
-+ else if(pBand->GetColorInterpretation() == GCI_GrayIndex )
-+ {
-+ for(int i=0; i < 256; ++i)
-+ {
-+ colortable << qRgba(i, i, i, 255);
-+ }
-+ }
-+ else
-+ {
-+ GDALClose(dataset);
-+ dataset = nullptr;
-+ QMessageBox::warning(canvas, tr("Error..."), tr("File must be 8 bit palette or gray indexed."));
-+ return;
-+ }
-+
-+ int success = 0;
-+ qreal idx = pBand->GetNoDataValue(&success);
-+ if(success)
-+ {
-+ if((idx >= 0) && (idx < colortable.size()))
-+ {
-+ QColor tmp(colortable[idx]);
-+ tmp.setAlpha(0);
-+ colortable[idx] = tmp.rgba();
-+ hasNoData = idx;
-+ }
-+ else
-+ {
-+ qDebug() << "Index for no data value is out of bound";
-+ return;
-+ }
-+ }
-+ }
-+ qDebug() << "hasNoData" << hasNoData;
-+
-+ xsize_px = dataset->GetRasterXSize();
-+ ysize_px = dataset->GetRasterYSize();
-+
-+ qreal adfGeoTransform[6];
-+ dataset->GetGeoTransform( adfGeoTransform );
-+
-+ xscale = adfGeoTransform[1];
-+ yscale = adfGeoTransform[5];
-+ xrot = adfGeoTransform[4];
-+ yrot = adfGeoTransform[2];
-+
-+ trFwd = QTransform();
-+ trFwd.translate(adfGeoTransform[0], adfGeoTransform[3]);
-+ trFwd.scale(adfGeoTransform[1], adfGeoTransform[5]);
-+
-+ if(adfGeoTransform[4] != 0.0)
-+ {
-+ trFwd.rotate(qAtan(adfGeoTransform[2]/adfGeoTransform[4]));
-+ }
-+
-+ trInv = trFwd.inverted();
-+
-+ ref1 = trFwd.map(QPointF(0,0));
-+ ref2 = trFwd.map(QPointF(xsize_px,0));
-+ ref3 = trFwd.map(QPointF(xsize_px,ysize_px));
-+ ref4 = trFwd.map(QPointF(0,ysize_px));
-+
-+ isValid = true;
-+}
-+
-+QString CGdalFile::getProjection() const
-+{
-+ return proj4str;
-+}
-+
-+QString CGdalFile::getInfo() const
-+{
-+ QString str;
-+ QTextStream out(&str);
-+
-+ if(proj4str.isEmpty())
-+ {
-+ out << "no projection" << endl;
-+ }
-+ else
-+ {
-+ out << getProjection() << endl;
-+ if(pj_is_latlong(pjsrc))
-+ {
-+ out << "xscale: " << xscale << "px/rad\tyscale: " << yscale << "px/rad" << endl;
-+ }
-+ else
-+ {
-+ out << "xscale: " << xscale << "px/m\tyscale: " << yscale << "px/m" << endl;
-+ }
-+ }
-+
-+ out << "num. bands:\t" << rasterBandCount << " ";
-+ switch(rasterBandCount)
-+ {
-+ case 1:
-+ out << tr("(color table)");
-+ break;
-+
-+ case 3:
-+ out << tr("(RGB)");
-+ break;
-+
-+ case 4:
-+ out << tr("(RGBA)");
-+ break;
-+
-+ default:
-+ out << tr("(unknown)");
-+ }
-+
-+ out << endl;
-+
-+ out << "has overviews:\t" << hasOverviews << endl;
-+
-+ if((rasterBandCount != 4) && (hasNoData != -1))
-+ {
-+ out << "has no data:\t" << hasNoData << endl;
-+ }
-+
-+ return str;
-+}
-diff --git a/src/qmaptool/helpers/CGdalFile.h b/src/qmaptool/helpers/CGdalFile.h
-new file mode 100644
-index 00000000..49d77db2
---- /dev/null
-+++ b/src/qmaptool/helpers/CGdalFile.h
-@@ -0,0 +1,93 @@
-+/**********************************************************************************************
-+ Copyright (C) 2018 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CGDALFILE_H
-+#define CGDALFILE_H
-+
-+
-+#include <proj_api.h>
-+#include <QCoreApplication>
-+#include <QPointF>
-+#include <QRgb>
-+#include <QTransform>
-+#include <QVector>
-+
-+class GDALDataset;
-+
-+class CGdalFile
-+{
-+ Q_DECLARE_TR_FUNCTIONS(CGdalFile)
-+public:
-+ CGdalFile();
-+ virtual ~CGdalFile() = default;
-+
-+ bool getIsValid() const
-+ {
-+ return isValid;
-+ }
-+
-+ QString getProjection() const;
-+
-+protected:
-+ virtual QString getInfo() const;
-+ virtual void load(const QString& filename);
-+ virtual void unload();
-+
-+ GDALDataset * dataset = nullptr;
-+
-+ /// number of color bands used by the *vrt
-+ int rasterBandCount = 0;
-+ /// QT representation of the vrt's color table
-+ QVector<QRgb> colortable;
-+
-+ // true if the map file has overviews
-+ qint32 hasOverviews = -1;
-+ qint32 hasNoData = -1;
-+
-+
-+ /// true if the map file could be loaded
-+ bool isValid = false;
-+
-+ /// width in number of px
-+ qreal xsize_px = 0;
-+ /// height in number of px
-+ qreal ysize_px = 0;
-+
-+ /// scale [px/m]
-+ qreal xscale = 0;
-+ /// scale [px/m]
-+ qreal yscale = 0;
-+
-+ qreal xrot = 0;
-+ qreal yrot = 0;
-+
-+ QPointF ref1;
-+ QPointF ref2;
-+ QPointF ref3;
-+ QPointF ref4;
-+
-+ QTransform trFwd;
-+ QTransform trInv;
-+
-+ QString proj4str;
-+
-+ projPJ pjsrc = nullptr;
-+};
-+
-+#endif //CGDALFILE_H
-+
-diff --git a/src/qmaptool/helpers/CSettings.h b/src/qmaptool/helpers/CSettings.h
-new file mode 100644
-index 00000000..6abe4ecd
---- /dev/null
-+++ b/src/qmaptool/helpers/CSettings.h
-@@ -0,0 +1,54 @@
-+/**********************************************************************************************
-+ Copyright (C) 2012 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+#ifndef CSETTINGS_H
-+#define CSETTINGS_H
-+
-+#include "setup/CAppOpts.h"
-+#include <QtCore>
-+
-+class CSettings : public QObject
-+{
-+public:
-+ CSettings()
-+ {
-+ if(!qlOpts->configfile.isEmpty())
-+ {
-+ cfg = new QSettings(qlOpts->configfile, QSettings::IniFormat, this);
-+ }
-+ else
-+ {
-+ cfg = new QSettings(this);
-+ }
-+ }
-+ ~CSettings()
-+ {
-+ }
-+
-+ QSettings& get()
-+ {
-+ return *cfg;
-+ }
-+
-+private:
-+ QSettings * cfg;
-+};
-+
-+#define SETTINGS \
-+ CSettings ccfg; \
-+ QSettings& cfg = ccfg.get()
-+#endif //CSETTINGS_H
-diff --git a/src/qmaptool/helpers/mitab.cpp b/src/qmaptool/helpers/mitab.cpp
-new file mode 100644
-index 00000000..4569a17d
---- /dev/null
-+++ b/src/qmaptool/helpers/mitab.cpp
-@@ -0,0 +1,260 @@
-+/**********************************************************************************************
-+ Copyright (C) 2008 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+#include "mitab.h"
-+
-+const MapInfoDatumInfo asDatumInfoListQL[] =
-+{
-+ { // Datum ignore
-+ 0, "", 29, 0, 0, 0, 0, 0, 0, 0, 0
-+ },
-+ {74, "North_American_Datum_1983", 0, 0, 0, 0, 0, 0, 0, 0, 0},
-+ {1, "Adindan", 6, -162, -12, 206, 0, 0, 0, 0, 0},
-+ {2, "Afgooye", 3, -43, -163, 45, 0, 0, 0, 0, 0},
-+ {3, "Ain_el_Abd_1970", 4, -150, -251, -2, 0, 0, 0, 0, 0},
-+ {4, "Anna_1_Astro_1965", 2, -491, -22, 435, 0, 0, 0, 0, 0},
-+ {5, "Arc_1950", 15,-143, -90, -294,0, 0, 0, 0, 0},
-+ {6, "Arc_1960", 6, -160, -8, -300,0, 0, 0, 0, 0},
-+ {7, "Ascension_Islands", 4, -207, 107, 52, 0, 0, 0, 0, 0},
-+ {8, "Astro_Beacon_E", 4, 145, 75, -272,0, 0, 0, 0, 0},
-+ {9, "Astro_B4_Sorol_Atoll", 4, 114, -116, -333,0, 0, 0, 0, 0},
-+ {10, "Astro_Dos_71_4", 4, -320, 550, -494,0, 0, 0, 0, 0},
-+ {11, "Astronomic_Station_1952", 4, 124, -234, -25, 0, 0, 0, 0, 0},
-+ {12, "Australian_Geodetic_Datum_66",2, -133, -48, 148, 0, 0, 0, 0, 0},
-+ {13, "Australian_Geodetic_Datum_84",2, -134, -48, 149, 0, 0, 0, 0, 0},
-+ {14, "Bellevue_Ign", 4, -127, -769, 472, 0, 0, 0, 0, 0},
-+ {15, "Bermuda_1957", 7, -73, 213, 296, 0, 0, 0, 0, 0},
-+ {16, "Bogota", 4, 307, 304, -318,0, 0, 0, 0, 0},
-+ {17, "Campo_Inchauspe", 4, -148, 136, 90, 0, 0, 0, 0, 0},
-+ {18, "Canton_Astro_1966", 4, 298, -304, -375,0, 0, 0, 0, 0},
-+ {19, "Cape", 6, -136, -108, -292,0, 0, 0, 0, 0},
-+ {20, "Cape_Canaveral", 7, -2, 150, 181, 0, 0, 0, 0, 0},
-+ {21, "Carthage", 6, -263, 6, 431, 0, 0, 0, 0, 0},
-+ {22, "Chatham_1971", 4, 175, -38, 113, 0, 0, 0, 0, 0},
-+ {23, "Chua", 4, -134, 229, -29, 0, 0, 0, 0, 0},
-+ {24, "Corrego_Alegre", 4, -206, 172, -6, 0, 0, 0, 0, 0},
-+ {25, "Batavia", 10,-377,681, -50, 0, 0, 0, 0, 0},
-+ {26, "Dos_1968", 4, 230, -199, -752,0, 0, 0, 0, 0},
-+ {27, "Easter_Island_1967", 4, 211, 147, 111, 0, 0, 0, 0, 0},
-+ {28, "European_Datum_1950", 4, -87, -98, -121,0, 0, 0, 0, 0},
-+ {29, "European_Datum_1979", 4, -86, -98, -119,0, 0, 0, 0, 0},
-+ {30, "Gandajika_1970", 4, -133, -321, 50, 0, 0, 0, 0, 0},
-+ {31, "New_Zealand_GD49", 4, 84, -22, 209, 0, 0, 0, 0, 0},
-+ {32, "GRS_67", 21,0, 0, 0, 0, 0, 0, 0, 0},
-+ {33, "GRS_80", 0, 0, 0, 0, 0, 0, 0, 0, 0},
-+ {34, "Guam_1963", 7, -100, -248, 259, 0, 0, 0, 0, 0},
-+ {35, "Gux_1_Astro", 4, 252, -209, -751,0, 0, 0, 0, 0},
-+ {36, "Hito_XVIII_1963", 4, 16, 196, 93, 0, 0, 0, 0, 0},
-+ {37, "Hjorsey_1955", 4, -73, 46, -86, 0, 0, 0, 0, 0},
-+ {38, "Hong_Kong_1963", 4, -156, -271, -189,0, 0, 0, 0, 0},
-+ {39, "Hu_Tzu_Shan", 4, -634, -549, -201,0, 0, 0, 0, 0},
-+ {40, "Indian_Thailand_Vietnam", 11,214, 836, 303, 0, 0, 0, 0, 0},
-+ {41, "Indian_Bangladesh", 11,289, 734, 257, 0, 0, 0, 0, 0},
-+ {42, "Ireland_1965", 13,506, -122, 611, 0, 0, 0, 0, 0},
-+ {43, "ISTS_073_Astro_1969", 4, 208, -435, -229,0, 0, 0, 0, 0},
-+ {44, "Johnston_Island_1961", 4, 191, -77, -204,0, 0, 0, 0, 0},
-+ {45, "Kandawala", 11,-97, 787, 86, 0, 0, 0, 0, 0},
-+ {46, "Kerguyelen_Island", 4, 145, -187, 103, 0, 0, 0, 0, 0},
-+ {47, "Kertau", 17,-11, 851, 5, 0, 0, 0, 0, 0},
-+ {48, "L_C_5_Astro", 7, 42, 124, 147, 0, 0, 0, 0, 0},
-+ {49, "Liberia_1964", 6, -90, 40, 88, 0, 0, 0, 0, 0},
-+ {50, "Luzon_Phillippines", 7, -133, -77, -51, 0, 0, 0, 0, 0},
-+ {51, "Luzon_Mindanao_Island", 7, -133, -79, -72, 0, 0, 0, 0, 0},
-+ {52, "Mahe_1971", 6, 41, -220, -134,0, 0, 0, 0, 0},
-+ {53, "Marco_Astro", 4, -289, -124, 60, 0, 0, 0, 0, 0},
-+ {54, "Massawa", 10,639, 405, 60, 0, 0, 0, 0, 0},
-+ {55, "Merchich", 16,31, 146, 47, 0, 0, 0, 0, 0},
-+ {56, "Midway_Astro_1961", 4, 912, -58, 1227,0, 0, 0, 0, 0},
-+ {57, "Minna", 6, -92, -93, 122, 0, 0, 0, 0, 0},
-+ {58, "Nahrwan_Masirah_Island", 6, -247, -148, 369, 0, 0, 0, 0, 0},
-+ {59, "Nahrwan_Un_Arab_Emirates", 6, -249, -156, 381, 0, 0, 0, 0, 0},
-+ {60, "Nahrwan_Saudi_Arabia", 6, -231, -196, 482, 0, 0, 0, 0, 0},
-+ {61, "Naparima_1972", 4, -2, 374, 172, 0, 0, 0, 0, 0},
-+ {62, "NAD_1927", 7, -8, 160, 176, 0, 0, 0, 0, 0},
-+ {62, "North_American_Datum_1927", 7, -8, 160, 176, 0, 0, 0, 0, 0},
-+ {63, "NAD_27_Alaska", 7, -5, 135, 172, 0, 0, 0, 0, 0},
-+ {64, "NAD_27_Bahamas", 7, -4, 154, 178, 0, 0, 0, 0, 0},
-+ {65, "NAD_27_San_Salvador", 7, 1, 140, 165, 0, 0, 0, 0, 0},
-+ {66, "NAD_27_Canada", 7, -10, 158, 187, 0, 0, 0, 0, 0},
-+ {67, "NAD_27_Canal_Zone", 7, 0, 125, 201, 0, 0, 0, 0, 0},
-+ {68, "NAD_27_Caribbean", 7, -7, 152, 178, 0, 0, 0, 0, 0},
-+ {69, "NAD_27_Central_America", 7, 0, 125, 194, 0, 0, 0, 0, 0},
-+ {70, "NAD_27_Cuba", 7, -9, 152, 178, 0, 0, 0, 0, 0},
-+ {71, "NAD_27_Greenland", 7, 11, 114, 195, 0, 0, 0, 0, 0},
-+ {72, "NAD_27_Mexico", 7, -12, 130, 190, 0, 0, 0, 0, 0},
-+ {73, "NAD_27_Michigan", 8, -8, 160, 176, 0, 0, 0, 0, 0},
-+ {75, "Observatorio_1966", 4, -425, -169, 81, 0, 0, 0, 0, 0},
-+ {76, "Old_Egyptian", 22,-130, 110, -13, 0, 0, 0, 0, 0},
-+ {77, "Old_Hawaiian", 7, 61, -285, -181,0, 0, 0, 0, 0},
-+ {78, "Oman", 6, -346, -1, 224, 0, 0, 0, 0, 0},
-+ {79, "OSGB_1936", 9, 375, -111, 431, 0, 0, 0, 0, 0},
-+ {80, "Pico_De_Las_Nieves", 4, -307, -92, 127, 0, 0, 0, 0, 0},
-+ {81, "Pitcairn_Astro_1967", 4, 185, 165, 42, 0, 0, 0, 0, 0},
-+ {82, "Provisional_South_American", 4, -288, 175, -376,0, 0, 0, 0, 0},
-+ {83, "Puerto_Rico", 7, 11, 72, -101,0, 0, 0, 0, 0},
-+ {84, "Qatar_National", 4, -128, -283, 22, 0, 0, 0, 0, 0},
-+ {85, "Qornoq", 4, 164, 138, -189, 0, 0, 0, 0, 0},
-+ {86, "Reunion", 4, 94, -948,-1262,0, 0, 0, 0, 0},
-+ {87, "Monte_Mario", 4, -225, -65, 9, 0, 0, 0, 0, 0},
-+ {88, "Santo_Dos", 4, 170, 42, 84, 0, 0, 0, 0, 0},
-+ {89, "Sao_Braz", 4, -203, 141, 53, 0, 0, 0, 0, 0},
-+ {90, "Sapper_Hill_1943", 4, -355, 16, 74, 0, 0, 0, 0, 0},
-+ {91, "Schwarzeck", 14,616, 97, -251, 0, 0, 0, 0, 0},
-+ {92, "South_American_Datum_1969", 24,-57, 1, -41, 0, 0, 0, 0, 0},
-+ {93, "South_Asia", 19,7, -10, -26, 0, 0, 0, 0, 0},
-+ {94, "Southeast_Base", 4, -499, -249,314, 0, 0, 0, 0, 0},
-+ {95, "Southwest_Base", 4, -104, 167, -38, 0, 0, 0, 0, 0},
-+ {96, "Timbalai_1948", 11,-689, 691, -46, 0, 0, 0, 0, 0},
-+ {97, "Tokyo", 10,-128, 481, 664, 0, 0, 0, 0, 0},
-+ {98, "Tristan_Astro_1968", 4, -632, 438, -609, 0, 0, 0, 0, 0},
-+ {99, "Viti_Levu_1916", 6, 51, 391, -36, 0, 0, 0, 0, 0},
-+ {100, "Wake_Entiwetok_1960", 23,101, 52, -39, 0, 0, 0, 0, 0},
-+ {101, "WGS_60", 26,0, 0, 0, 0, 0, 0, 0, 0},
-+ {102, "WGS_66", 27,0, 0, 0, 0, 0, 0, 0, 0},
-+ {103, "WGS_1972", 1, 0, 8, 10, 0, 0, 0, 0, 0},
-+ {104, "WGS_1984", 28,0, 0, 0, 0, 0, 0, 0, 0},
-+ {105, "Yacare", 4, -155, 171, 37, 0, 0, 0, 0, 0},
-+ {106, "Zanderij", 4, -265, 120, -358, 0, 0, 0, 0, 0},
-+ {107, "NTF", 30,-168, -60, 320, 0, 0, 0, 0, 0},
-+ {108, "European_Datum_1987", 4, -83, -96, -113, 0, 0, 0, 0, 0},
-+ {109, "Netherlands_Bessel", 10,593, 26, 478, 0, 0, 0, 0, 0},
-+ {110, "Belgium_Hayford", 4, 81, 120, 129, 0, 0, 0, 0, 0},
-+ {111, "NWGL_10", 1, -1, 15, 1, 0, 0, 0, 0, 0},
-+ {112, "Rikets_koordinatsystem_1990",10,498, -36, 568, 0, 0, 0, 0, 0},
-+ {113, "Lisboa_DLX", 4, -303, -62, 105, 0, 0, 0, 0, 0},
-+ {114, "Melrica_1973_D73", 4, -223, 110, 37, 0, 0, 0, 0, 0},
-+ {115, "Euref_98", 0, 0, 0, 0, 0, 0, 0, 0, 0},
-+ {116, "GDA94", 0, 0, 0, 0, 0, 0, 0, 0, 0},
-+ {117, "NZGD2000", 0, 0, 0, 0, 0, 0, 0, 0, 0},
-+ {118, "America_Samoa", 7, -115, 118, 426, 0, 0, 0, 0, 0},
-+ {119, "Antigua_Astro_1965", 6, -270, 13, 62, 0, 0, 0, 0, 0},
-+ {120, "Ayabelle_Lighthouse", 6, -79, -129, 145, 0, 0, 0, 0, 0},
-+ {121, "Bukit_Rimpah", 10,-384, 664, -48, 0, 0, 0, 0, 0},
-+ {122, "Estonia_1937", 10,374, 150, 588, 0, 0, 0, 0, 0},
-+ {123, "Dabola", 6, -83, 37, 124, 0, 0, 0, 0, 0},
-+ {124, "Deception_Island", 6, 260, 12, -147, 0, 0, 0, 0, 0},
-+ {125, "Fort_Thomas_1955", 6, -7, 215, 225, 0, 0, 0, 0, 0},
-+ {126, "Graciosa_base_1948", 4, -104, 167, -38, 0, 0, 0, 0, 0},
-+ {127, "Herat_North", 4, -333, -222,114, 0, 0, 0, 0, 0},
-+ {128, "Hermanns_Kogel", 10,682, -203, 480, 0, 0, 0, 0, 0},
-+ {129, "Indian", 50,283, 682, 231, 0, 0, 0, 0, 0},
-+ {130, "Indian_1954", 11,217, 823, 299, 0, 0, 0, 0, 0},
-+ {131, "Indian_1960", 11,198, 881, 317, 0, 0, 0, 0, 0},
-+ {132, "Indian_1975", 11,210, 814, 289, 0, 0, 0, 0, 0},
-+ {133, "Indonesian_Datum_1974", 4, -24, -15, 5, 0, 0, 0, 0, 0},
-+ {134, "ISTS061_Astro_1968", 4, -794, 119, -298, 0, 0, 0, 0, 0},
-+ {135, "Kusaie_Astro_1951", 4, 647, 1777, -1124,0, 0, 0, 0, 0},
-+ {136, "Leigon", 6, -130, 29, 364, 0, 0, 0, 0, 0},
-+ {137, "Montserrat_Astro_1958", 6, 174, 359, 365, 0, 0, 0, 0, 0},
-+ {138, "Mporaloko", 6, -74, -130, 42, 0, 0, 0, 0, 0},
-+ {139, "North_Sahara_1959", 6, -186, -93, 310, 0, 0, 0, 0, 0},
-+ {140, "Observatorio_Met_1939", 4, -425, -169,81, 0, 0, 0, 0, 0},
-+ {141, "Point_58", 6, -106, -129,165, 0, 0, 0, 0, 0},
-+ {142, "Pointe_Noire", 6, -148, 51, -291, 0, 0, 0, 0, 0},
-+ {143, "Porto_Santo_1936", 4, -499, -249,314, 0, 0, 0, 0, 0},
-+ {144, "Selvagem_Grande_1938", 4, -289, -124,60, 0, 0, 0, 0, 0},
-+ {145, "Sierra_Leone_1960", 6, -88, 4, 101, 0, 0, 0, 0, 0},
-+ {146, "S_JTSK_Ferro", 10, 589, 76, 480, 0, 0, 0, 0, 0},
-+ {147, "Tananarive_1925", 4, -189, -242,-91, 0, 0, 0, 0, 0},
-+ {148, "Voirol_1874", 6, -73, -247,227, 0, 0, 0, 0, 0},
-+ {149, "Virol_1960", 6, -123, -206,219, 0, 0, 0, 0, 0},
-+ {150, "Hartebeesthoek94", 0, 0, 0, 0, 0, 0, 0, 0, 0},
-+ {151, "ATS77", 51, 0, 0, 0, 0, 0, 0, 0, 0},
-+ {152, "JGD2000", 0, 0, 0, 0, 0, 0, 0, 0, 0},
-+ {1000,"DHDN_Potsdam_Rauenberg", 10,582, 105, 414, -1.04, -0.35, 3.08, 8.3, 0},
-+ {1001,"Pulkovo_1942", 3, 24, -123, -94, -0.02, 0.25, 0.13, 1.1, 0},
-+ {1002,"NTF_Paris_Meridian", 30,-168, -60, 320, 0, 0, 0, 0, 2.337229166667},
-+ {1003,"Switzerland_CH_1903", 10,660.077,13.551, 369.344, 0.804816, 0.577692, 0.952236, 5.66,0},
-+ {1004,"Hungarian_Datum_1972", 21,-56, 75.77, 15.31, -0.37, -0.2, -0.21, -1.01, 0},
-+ {1005,"Cape_7_Parameter", 28,-134.73,-110.92, -292.66, 0, 0, 0, 1, 0},
-+ {1006,"AGD84_7_Param_Aust", 2, -117.763,-51.51, 139.061, -0.292, -0.443, -0.277, -0.191, 0},
-+ {1007,"AGD66_7_Param_ACT", 2, -129.193,-41.212, 130.73, -0.246, -0.374, -0.329, -2.955, 0},
-+ {1008,"AGD66_7_Param_TAS", 2, -120.271,-64.543, 161.632, -0.2175, 0.0672, 0.1291, 2.4985, 0},
-+ {1009,"AGD66_7_Param_VIC_NSW", 2, -119.353,-48.301, 139.484, -0.415, -0.26, -0.437, -0.613, 0},
-+ {1010,"NZGD_7_Param_49", 4, 59.47, -5.04, 187.44, -0.47, 0.1, -1.024, -4.5993, 0},
-+ {1011,"Rikets_Tri_7_Param_1990", 10,419.3836, 99.3335, 591.3451, -0.850389, -1.817277, 7.862238, -0.99496, 0},
-+ {1012,"Russia_PZ90", 52, -1.08,-0.27,-0.9,0, 0, -0.16,-0.12, 0},
-+ {1013,"Russia_SK42", 52, 23.92,-141.27,-80.9, 0, -0.35,-0.82, -0.12, 0},
-+ {1014,"Russia_SK95", 52, 24.82,-131.21,-82.66,0,0,-0.16,-0.12, 0},
-+ {1015,"Tokyo", 10, -146.414, 507.337, 680.507,0,0,0,0,0},
-+ {1016,"Finnish_KKJ", 4, -96.062, -82.428, -121.754, -4.801, -0.345, 1.376, 1.496, 0},
-+
-+ {-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
-+};
-+
-+/* -------------------------------------------------------------------- */
-+/* This table was hand entered from Appendix I of the mapinfo 6 */
-+/* manuals. */
-+/* -------------------------------------------------------------------- */
-+
-+const MapInfoSpheroidInfo asSpheroidInfoList[] =
-+{
-+ { 9,"Airy 1930", 6377563.396, 299.3249646},
-+ {13,"Airy 1930 (modified for Ireland 1965", 6377340.189, 299.3249646},
-+ {51,"ATS77 (Average Terrestrial System 1977)", 6378135, 298.257},
-+ { 2,"Australian", 6378160.0, 298.25},
-+ {10,"Bessel 1841", 6377397.155, 299.1528128},
-+ {35,"Bessel 1841 (modified for NGO 1948)", 6377492.0176, 299.15281},
-+ {14,"Bessel 1841 (modified for Schwarzeck)", 6377483.865, 299.1528128},
-+ {36,"Clarke 1858", 6378293.639, 294.26068},
-+ { 7,"Clarke 1866", 6378206.4, 294.9786982},
-+ { 8,"Clarke 1866 (modified for Michigan)", 6378450.047484481,294.9786982},
-+ { 6,"Clarke 1880", 6378249.145, 293.465},
-+ {15,"Clarke 1880 (modified for Arc 1950)", 6378249.145326, 293.4663076},
-+ {30,"Clarke 1880 (modified for IGN)", 6378249.2, 293.4660213},
-+ {37,"Clarke 1880 (modified for Jamaica)", 6378249.136, 293.46631},
-+ {16,"Clarke 1880 (modified for Merchich)", 6378249.2, 293.46598},
-+ {38,"Clarke 1880 (modified for Palestine)", 6378300.79, 293.46623},
-+ {39,"Everest (Brunei and East Malaysia)", 6377298.556, 300.8017},
-+ {11,"Everest (India 1830)", 6377276.345, 300.8017},
-+ {40,"Everest (India 1956)", 6377301.243, 300.80174},
-+ {50,"Everest (Pakistan)", 6377309.613, 300.8017},
-+ {17,"Everest (W. Malaysia and Singapore 1948)", 6377304.063, 300.8017},
-+ {48,"Everest (West Malaysia 1969)", 6377304.063, 300.8017},
-+ {18,"Fischer 1960", 6378166.0, 298.3},
-+ {19,"Fischer 1960 (modified for South Asia)", 6378155.0, 298.3},
-+ {20,"Fischer 1968", 6378150.0, 298.3},
-+ {21,"GRS 67", 6378160.0, 298.247167427},
-+ { 0,"GRS 80", 6378137.0, 298.257222101},
-+ { 5,"Hayford", 6378388.0, 297.0},
-+ {22,"Helmert 1906", 6378200.0, 298.3},
-+ {23,"Hough", 6378270.0, 297.0},
-+ {31,"IAG 75", 6378140.0, 298.257222},
-+ {41,"Indonesian", 6378160.0, 298.247},
-+ { 4,"International 1924", 6378388.0, 297.0},
-+ {49,"Irish (WOFO)", 6377542.178, 299.325},
-+ { 3,"Krassovsky", 6378245.0, 298.3},
-+ {32,"MERIT 83", 6378137.0, 298.257},
-+ {33,"New International 1967", 6378157.5, 298.25},
-+ {42,"NWL 9D", 6378145.0, 298.25},
-+ {43,"NWL 10D", 6378135.0, 298.26},
-+ {44,"OSU86F", 6378136.2, 298.25722},
-+ {45,"OSU91A", 6378136.3, 298.25722},
-+ {46,"Plessis 1817", 6376523.0, 308.64},
-+ {52,"PZ90", 6378136.0, 298.257839303},
-+ {24,"South American", 6378160.0, 298.25},
-+ {12,"Sphere", 6370997.0, 0.0},
-+ {47,"Struve 1860", 6378297.0, 294.73},
-+ {34,"Walbeck", 6376896.0, 302.78},
-+ {25,"War Office", 6378300.583, 296.0},
-+ {26,"WGS 60", 6378165.0, 298.3},
-+ {27,"WGS 66", 6378145.0, 298.25},
-+ { 1,"WGS 72", 6378135.0, 298.26},
-+ {28,"WGS 84", 6378137.0, 298.257223563},
-+ {29,"WGS 84 (MAPINFO Datum 0)", 6378137.01, 298.257223563},
-+ {-1,0, 0.0, 0.0}
-+};
-diff --git a/src/qmaptool/helpers/mitab.h b/src/qmaptool/helpers/mitab.h
-new file mode 100644
-index 00000000..6229b557
---- /dev/null
-+++ b/src/qmaptool/helpers/mitab.h
-@@ -0,0 +1,46 @@
-+/**********************************************************************************************
-+ Copyright (C) 2008 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+#ifndef MITAB_H
-+#define MITAB_H
-+
-+struct MapInfoDatumInfo
-+{
-+ int nMapInfoDatumID;
-+ const char *pszOGCDatumName;
-+ int nEllipsoid;
-+ double dfShiftX;
-+ double dfShiftY;
-+ double dfShiftZ;
-+ double dfDatumParm0; /* RotX */
-+ double dfDatumParm1; /* RotY */
-+ double dfDatumParm2; /* RotZ */
-+ double dfDatumParm3; /* Scale Factor */
-+ double dfDatumParm4; /* Prime Meridian */
-+};
-+
-+struct MapInfoSpheroidInfo
-+{
-+ int nMapInfoId;
-+ const char *pszMapinfoName;
-+ double dfA; /* semi major axis in meters */
-+ double dfInvFlattening; /* Inverse flattening */
-+};
-+
-+extern const MapInfoDatumInfo asDatumInfoListQL[];
-+extern const MapInfoSpheroidInfo asSpheroidInfoList[];
-+#endif //MITAB_H
-diff --git a/src/qmaptool/items/CItemCutMap.cpp b/src/qmaptool/items/CItemCutMap.cpp
-new file mode 100644
-index 00000000..197b81b2
---- /dev/null
-+++ b/src/qmaptool/items/CItemCutMap.cpp
-@@ -0,0 +1,97 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "items/CItemCutMap.h"
-+#include "overlay/COverlayCutMap.h"
-+
-+#include <QtWidgets>
-+
-+CItemCutMap::CItemCutMap(const QString &filename, QStackedWidget *stackedWidget, QListWidget *parent)
-+ : CItemFile(filename, parent)
-+{
-+ overlay = new COverlayCutMap(this, stackedWidget);
-+ connect(overlay, &COverlayCutMap::sigChanged, this, &CItemCutMap::sigChanged);
-+}
-+
-+CItemCutMap::~CItemCutMap()
-+{
-+ overlay->deleteLater();
-+}
-+
-+void CItemCutMap::saveSettings(QSettings& cfg)
-+{
-+ CItemFile::saveSettings(cfg);
-+ overlay->saveSettings(cfg);
-+}
-+
-+void CItemCutMap::loadSettings(QSettings& cfg)
-+{
-+ CItemFile::loadSettings(cfg);
-+ overlay->loadSettings(cfg);
-+}
-+
-+void CItemCutMap::toFront()
-+{
-+ overlay->toFront();
-+}
-+
-+bool CItemCutMap::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ CItemFile::drawFx(p, needsRedraw);
-+ overlay->drawFx(p, needsRedraw);
-+ return true;
-+}
-+
-+void CItemCutMap::mouseMoveEventFx(QMouseEvent *e)
-+{
-+ CItemFile::mouseMoveEventFx(e);
-+ if(!mapIsMoving)
-+ {
-+ overlay->mouseMoveEventFx(e);
-+ }
-+}
-+
-+void CItemCutMap::mouseReleaseEventFx(QMouseEvent *e)
-+{
-+ if(!mapDidMove)
-+ {
-+ overlay->mouseReleaseEventFx(e);
-+ }
-+ CItemFile::mouseReleaseEventFx(e);
-+}
-+
-+void CItemCutMap::leaveEventFx(QEvent *e)
-+{
-+ CItemFile::leaveEventFx(e);
-+ overlay->abortStep();
-+}
-+
-+QCursor CItemCutMap::getCursorFx()
-+{
-+ return overlay->getCursorFx();
-+}
-+
-+void CItemCutMap::saveShape(const QString& filename) const
-+{
-+ overlay->saveShape(filename);
-+}
-+
-+bool CItemCutMap::isOk() const
-+{
-+ return overlay->isOk();
-+}
-diff --git a/src/qmaptool/items/CItemCutMap.h b/src/qmaptool/items/CItemCutMap.h
-new file mode 100644
-index 00000000..851589b3
---- /dev/null
-+++ b/src/qmaptool/items/CItemCutMap.h
-@@ -0,0 +1,52 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CITEMCUTMAP_H
-+#define CITEMCUTMAP_H
-+
-+#include "items/CItemFile.h"
-+
-+class COverlayCutMap;
-+
-+class CItemCutMap : public CItemFile
-+{
-+public:
-+ CItemCutMap(const QString& filename, QStackedWidget * stackedWidget, QListWidget *parent);
-+ virtual ~CItemCutMap();
-+
-+ void saveSettings(QSettings& cfg) override;
-+ void loadSettings(QSettings& cfg) override;
-+
-+ void toFront() override;
-+
-+ bool drawFx(QPainter& p, CCanvas::redraw_e needsRedraw) override;
-+ void mouseMoveEventFx(QMouseEvent *e) override;
-+ void mouseReleaseEventFx(QMouseEvent *e) override;
-+ void leaveEventFx(QEvent *e) override;
-+ QCursor getCursorFx() override;
-+
-+ void saveShape(const QString& filename) const;
-+
-+ bool isOk() const override;
-+
-+private:
-+ COverlayCutMap * overlay;
-+};
-+
-+#endif //CITEMCUTMAP_H
-+
-diff --git a/src/qmaptool/items/CItemFile.cpp b/src/qmaptool/items/CItemFile.cpp
-new file mode 100644
-index 00000000..3aeff434
---- /dev/null
-+++ b/src/qmaptool/items/CItemFile.cpp
-@@ -0,0 +1,37 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/CDrawContextPixel.h"
-+#include "CMainWindow.h"
-+#include "items/CItemFile.h"
-+
-+CItemFile::CItemFile(const QString &filename, QListWidget *parent)
-+ : IItem(filename)
-+ , QListWidgetItem(parent)
-+{
-+ setText(QFileInfo(filename).completeBaseName());
-+ drawContext = new CDrawContextPixel(CMainWindow::self().getCanvas(), this);
-+ reload();
-+}
-+
-+
-+void CItemFile::reload()
-+{
-+ IItem::reload();
-+ setToolTip(filename + "\n" + drawContext->getInfo());
-+}
-diff --git a/src/qmaptool/items/CItemFile.h b/src/qmaptool/items/CItemFile.h
-new file mode 100644
-index 00000000..66b31321
---- /dev/null
-+++ b/src/qmaptool/items/CItemFile.h
-@@ -0,0 +1,38 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CITEMFILE_H
-+#define CITEMFILE_H
-+
-+#include "items/IItem.h"
-+
-+#include <QListWidgetItem>
-+
-+class CItemFile : public IItem, public QListWidgetItem
-+{
-+public:
-+ CItemFile(const QString& filename, QListWidget *parent);
-+ virtual ~CItemFile() = default;
-+
-+ void setupChanged() override {}
-+
-+ void reload() override;
-+};
-+
-+#endif //CITEMFILE_H
-+
-diff --git a/src/qmaptool/items/CItemListWidget.cpp b/src/qmaptool/items/CItemListWidget.cpp
-new file mode 100644
-index 00000000..5776be22
---- /dev/null
-+++ b/src/qmaptool/items/CItemListWidget.cpp
-@@ -0,0 +1,157 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "helpers/CSettings.h"
-+#include "items/CItemListWidget.h"
-+#include "items/IItem.h"
-+
-+
-+#include <QtWidgets>
-+
-+CItemListWidget::CItemListWidget(QWidget *parent)
-+ : QWidget(parent)
-+{
-+ setupUi(this);
-+
-+ connect(toolFiles, &QToolButton::clicked, this, &CItemListWidget::slotFiles);
-+ connect(toolDelFile, &QToolButton::clicked, this, &CItemListWidget::slotDeleteFile);
-+ connect(toolDelFiles, &QToolButton::clicked, this, &CItemListWidget::slotDeleteFiles);
-+ connect(toolReloadFile, &QToolButton::clicked, this, &CItemListWidget::slotLoadCurrentMap);
-+ connect(listFiles, &QListWidget::itemSelectionChanged, this, &CItemListWidget::slotSelectionChanged);
-+}
-+
-+void CItemListWidget::saveSettings(QSettings& cfg)
-+{
-+ QStringList files;
-+ const int N = listFiles->count();
-+ for(int n = 0; n < N; n++)
-+ {
-+ IItem * item = dynamic_cast<IItem*>(listFiles->item(n));
-+ if(item != nullptr)
-+ {
-+ files << item->getFilename();
-+ cfg.beginGroup(QString("%1").arg(n));
-+ item->saveSettings(cfg);
-+ cfg.endGroup();
-+ }
-+ }
-+ cfg.setValue("files", files);
-+ cfg.setValue("lastFile", listFiles->currentRow());
-+}
-+
-+void CItemListWidget::loadSettings(QSettings& cfg)
-+{
-+ QStringList files = cfg.value("files", QStringList()).toStringList();
-+ addFiles(files);
-+
-+ const int N = listFiles->count();
-+ for(int n = 0; n < N; n++)
-+ {
-+ IItem * item = dynamic_cast<IItem*>(listFiles->item(n));
-+ if(item != nullptr)
-+ {
-+ cfg.beginGroup(QString("%1").arg(n));
-+ item->loadSettings(cfg);
-+ cfg.endGroup();
-+ }
-+ }
-+
-+ listFiles->setCurrentRow(cfg.value("lastFile",0).toInt());
-+}
-+
-+IItem * CItemListWidget::currentItem()
-+{
-+ return dynamic_cast<IItem*>(listFiles->currentItem());
-+}
-+
-+IItem * CItemListWidget::item(int n)
-+{
-+ return dynamic_cast<IItem*>(listFiles->item(n));
-+}
-+
-+void CItemListWidget::addFiles(const QStringList& files)
-+{
-+ for(const QString& file : files)
-+ {
-+ emit sigAddItem(file, listFiles);
-+ }
-+
-+ listFiles->setCurrentRow(listFiles->count() - 1);
-+ slotSelectionChanged();
-+}
-+
-+void CItemListWidget::slotFiles()
-+{
-+ SETTINGS;
-+ QString path = cfg.value("Path/mapInput", QDir::homePath()).toString();
-+
-+ const QStringList& files = QFileDialog::getOpenFileNames(this, tr("Select files..."), path);
-+ if(files.isEmpty())
-+ {
-+ return;
-+ }
-+
-+ cfg.setValue("Path/mapInput", QFileInfo(files.first()).absolutePath());
-+ addFiles(files);
-+
-+ if(listFiles->count() && (listFiles->currentItem() ==nullptr))
-+ {
-+ listFiles->setCurrentRow(0);
-+ }
-+}
-+
-+void CItemListWidget::slotLoadCurrentMap()
-+{
-+ IItem * item = dynamic_cast<IItem*>(listFiles->currentItem());
-+ if(item != nullptr)
-+ {
-+ item->reload();
-+ }
-+}
-+
-+void CItemListWidget::slotDeleteFiles()
-+{
-+ listFiles->clear();
-+ slotSelectionChanged();
-+}
-+
-+void CItemListWidget::slotDeleteFile()
-+{
-+ QListWidgetItem * item = listFiles->takeItem(listFiles->currentRow());
-+ delete item;
-+ slotSelectionChanged();
-+}
-+
-+void CItemListWidget::slotSelectionChanged()
-+{
-+ IItem * item = dynamic_cast<IItem*>(listFiles->currentItem());
-+ if(item != nullptr)
-+ {
-+ item->toFront();
-+ }
-+
-+ bool isNotEmpty = listFiles->count() != 0;
-+ int row = listFiles->currentRow();
-+
-+ toolDelFile->setEnabled(row != -1);
-+ toolDelFiles->setEnabled(isNotEmpty);
-+ toolReloadFile->setEnabled(row != -1);
-+
-+ emit sigSelectionChanged();
-+}
-+
-diff --git a/src/qmaptool/items/CItemListWidget.h b/src/qmaptool/items/CItemListWidget.h
-new file mode 100644
-index 00000000..ad5123b1
---- /dev/null
-+++ b/src/qmaptool/items/CItemListWidget.h
-@@ -0,0 +1,84 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CITEMLISTWIDGET_H
-+#define CITEMLISTWIDGET_H
-+
-+#include "ui_IItemListWidget.h"
-+
-+class QSettings;
-+class IItem;
-+
-+class CItemListWidget : public QWidget, private Ui::IItemListWidget
-+{
-+ Q_OBJECT
-+public:
-+ CItemListWidget(QWidget * parent);
-+ virtual ~CItemListWidget() = default;
-+
-+ void saveSettings(QSettings& cfg);
-+ void loadSettings(QSettings& cfg);
-+
-+ IItem * currentItem();
-+ IItem * item(int n);
-+
-+ qint32 count() const
-+ {
-+ return listFiles->count();
-+ }
-+
-+ template< typename LessThan>
-+ void sort(LessThan lessThan)
-+ {
-+ listFiles->blockSignals(true);
-+
-+ QList<QListWidgetItem*> items;
-+ while(listFiles->count() != 0)
-+ {
-+ items << listFiles->takeItem(0);
-+ }
-+
-+ qSort(items.begin(), items.end(), lessThan);
-+
-+ for(QListWidgetItem* item : items)
-+ {
-+ listFiles->addItem(item);
-+ }
-+
-+ listFiles->blockSignals(false);
-+ }
-+
-+
-+signals:
-+ void sigAddItem(const QString& filename, QListWidget * list);
-+ void sigSelectionChanged();
-+ void sigChanged();
-+
-+protected slots:
-+ void slotFiles();
-+ void slotLoadCurrentMap();
-+ void slotDeleteFiles();
-+ void slotDeleteFile();
-+ void slotSelectionChanged();
-+
-+protected:
-+ void addFiles(const QStringList& files);
-+};
-+
-+#endif //CITEMLISTWIDGET_H
-+
-diff --git a/src/qmaptool/items/CItemMap.cpp b/src/qmaptool/items/CItemMap.cpp
-new file mode 100644
-index 00000000..db007897
---- /dev/null
-+++ b/src/qmaptool/items/CItemMap.cpp
-@@ -0,0 +1,82 @@
-+/**********************************************************************************************
-+ Copyright (C) 2018 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/CCanvas.h"
-+#include "canvas/IDrawContext.h"
-+#include "CMainWindow.h"
-+#include "items/CItemMap.h"
-+#include "items/CItemMapLayer.h"
-+#include "items/CItemTreeWidget.h"
-+
-+#include <QtWidgets>
-+
-+CItemMap::CItemMap(const QString &filename)
-+ : IItem(filename)
-+{
-+ setText(CItemTreeWidget::eColumnName, QFileInfo(filename).completeBaseName());
-+ setIcon(CItemTreeWidget::eColumnName, QIcon("://icons/32x32/FolderMap.png"));
-+
-+ reload();
-+}
-+
-+CItemMap::~CItemMap()
-+{
-+ unload();
-+}
-+
-+QPointF CItemMap::getScale() const
-+{
-+ return QPointF(xscale, yscale);
-+}
-+
-+void CItemMap::reload()
-+{
-+ load(filename);
-+ setToolTip(CItemTreeWidget::eColumnName,filename + "\n" + getInfo());
-+
-+ QFile f(filename);
-+ f.open(QIODevice::ReadOnly);
-+ QCryptographicHash md5(QCryptographicHash::Md5);
-+ md5.addData(f.read(1024));
-+ hash = md5.result().toHex();
-+ f.close();
-+}
-+
-+void CItemMap::drawBoundingBox(QPainter& p, IDrawContext * dc)
-+{
-+ QPointF pt1 = ref1;
-+ QPointF pt2 = ref2;
-+ QPointF pt3 = ref3;
-+ QPointF pt4 = ref4;
-+
-+ dc->convertCoord2Map(pt1);
-+ dc->convertCoord2Map(pt2);
-+ dc->convertCoord2Map(pt3);
-+ dc->convertCoord2Map(pt4);
-+
-+ dc->convertMap2Screen(pt1);
-+ dc->convertMap2Screen(pt2);
-+ dc->convertMap2Screen(pt3);
-+ dc->convertMap2Screen(pt4);
-+
-+ p.setPen(QPen(Qt::red, 2));
-+ QPolygonF line;
-+ line << pt1 << pt2 << pt3 << pt4 << pt1;
-+ p.drawPolyline(line);
-+
-+}
-diff --git a/src/qmaptool/items/CItemMap.h b/src/qmaptool/items/CItemMap.h
-new file mode 100644
-index 00000000..b0b8ca84
---- /dev/null
-+++ b/src/qmaptool/items/CItemMap.h
-@@ -0,0 +1,54 @@
-+/**********************************************************************************************
-+ Copyright (C) 2018 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CITEMMAP_H
-+#define CITEMMAP_H
-+
-+#include "helpers/CGdalFile.h"
-+#include "items/IItem.h"
-+
-+#include <QTreeWidgetItem>
-+
-+class GDALDataset;
-+class CItemMapLayer;
-+
-+class CItemMap : public CGdalFile, public IItem, public QTreeWidgetItem
-+{
-+public:
-+ CItemMap(const QString& filename);
-+ virtual ~CItemMap();
-+
-+ void setupChanged() override {}
-+
-+ QPointF getScale() const;
-+
-+ const QString& getHash() const
-+ {
-+ return hash;
-+ }
-+
-+ void reload() override;
-+
-+ void drawBoundingBox(QPainter& p, IDrawContext *dc);
-+
-+private:
-+ QString hash;
-+};
-+
-+#endif //CITEMMAP_H
-+
-diff --git a/src/qmaptool/items/CItemMapLayer.cpp b/src/qmaptool/items/CItemMapLayer.cpp
-new file mode 100644
-index 00000000..a72a81a3
---- /dev/null
-+++ b/src/qmaptool/items/CItemMapLayer.cpp
-@@ -0,0 +1,119 @@
-+/**********************************************************************************************
-+ Copyright (C) 2018 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/CDrawContextProj.h"
-+#include "CMainWindow.h"
-+#include "items/CItemMap.h"
-+#include "items/CItemMapLayer.h"
-+#include "items/CItemTreeWidget.h"
-+
-+#include <QtWidgets>
-+
-+CItemMapLayer::CItemMapLayer(QTreeWidget *parent)
-+ : IItem("")
-+ , QTreeWidgetItem(parent)
-+ , vrt(QDir::temp().absoluteFilePath("QMapTool_XXXXXX.vrt"))
-+{
-+ drawContext = new CDrawContextProj(CMainWindow::self().getCanvas(), parent);
-+
-+ setText(CItemTreeWidget::eColumnName, tr("Layer"));
-+ setIcon(CItemTreeWidget::eColumnName, QIcon("://icons/32x32/MapLayer.png"));
-+
-+ // this is needed to create a filename
-+ vrt.open();
-+ vrt.close();
-+}
-+
-+
-+const QString& CItemMapLayer::getProjection() const
-+{
-+ return drawContext->getProjection();
-+}
-+
-+bool CItemMapLayer::addMap(CItemMap *map)
-+{
-+ const QPointF& mapScale = map->getScale();
-+
-+ const QTransform& trFwd = drawContext->getTrFwd();
-+
-+ if(trFwd.isScaling())
-+ {
-+ if((qAbs((mapScale.x() - trFwd.m11())/trFwd.m11()) > 0.2) || (qAbs((mapScale.y() - trFwd.m22())/trFwd.m22()) > 0.2))
-+ {
-+ return false;
-+ }
-+ }
-+
-+ addChild(map);
-+ updateLayer();
-+
-+ return drawContext->getIsValid();
-+}
-+
-+void CItemMapLayer::updateLayer()
-+{
-+ drawContext->unload();
-+ setToolTip(CItemTreeWidget::eColumnName, "");
-+
-+ const int N = childCount();
-+ if(N == 0)
-+ {
-+ return;
-+ }
-+
-+ QStringList args;
-+ args << vrt.fileName();
-+
-+ for(int n = 0; n < N; n++)
-+ {
-+ CItemMap * map = dynamic_cast<CItemMap*>(child(n));
-+ if(map != nullptr)
-+ {
-+ args << map->getFilename();
-+ }
-+ }
-+
-+ QProcess proc;
-+ proc.start(IAppSetup::self().getGdalbuildvrt(), args);
-+ proc.waitForStarted();
-+ proc.waitForFinished();
-+
-+ drawContext->setSourceFile(vrt.fileName(), true);
-+ setToolTip(CItemTreeWidget::eColumnName, drawContext->getInfo());
-+}
-+
-+bool CItemMapLayer::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ drawContext->draw(p, needsRedraw);
-+ return true;
-+}
-+
-+void CItemMapLayer::drawBoundingBoxes(QPainter& p, IDrawContext * dc)
-+{
-+ const int N = childCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ CItemMap * map = dynamic_cast<CItemMap*>(child(n));
-+ if(map == nullptr)
-+ {
-+ continue;
-+ }
-+
-+ map->drawBoundingBox(p, dc);
-+ }
-+}
-diff --git a/src/qmaptool/items/CItemMapLayer.h b/src/qmaptool/items/CItemMapLayer.h
-new file mode 100644
-index 00000000..1165c529
---- /dev/null
-+++ b/src/qmaptool/items/CItemMapLayer.h
-@@ -0,0 +1,57 @@
-+/**********************************************************************************************
-+ Copyright (C) 2018 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CITEMMAPLAYER_H
-+#define CITEMMAPLAYER_H
-+
-+#include "items/IItem.h"
-+
-+#include <QCoreApplication>
-+#include <QTemporaryFile>
-+#include <QTreeWidgetItem>
-+
-+class CItemMap;
-+class CDrawContextProj;
-+
-+class CItemMapLayer : public IItem, public QTreeWidgetItem
-+{
-+ Q_OBJECT
-+public:
-+ CItemMapLayer(QTreeWidget * parent);
-+ virtual ~CItemMapLayer() = default;
-+
-+ bool addMap(CItemMap * map);
-+
-+ bool drawFx(QPainter& p, CCanvas::redraw_e needsRedraw) override;
-+
-+ void drawBoundingBoxes(QPainter& p, IDrawContext *dc);
-+
-+ void setupChanged() override {}
-+
-+ const QString& getProjection() const;
-+
-+protected:
-+ friend bool sortByScale(QTreeWidgetItem * item1, QTreeWidgetItem * item2);
-+
-+ void updateLayer();
-+
-+ QTemporaryFile vrt;
-+};
-+
-+#endif //CITEMMAPLAYER_H
-+
-diff --git a/src/qmaptool/items/CItemRefMap.cpp b/src/qmaptool/items/CItemRefMap.cpp
-new file mode 100644
-index 00000000..1bbcad76
---- /dev/null
-+++ b/src/qmaptool/items/CItemRefMap.cpp
-@@ -0,0 +1,114 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "items/CItemRefMap.h"
-+#include "overlay/COverlayRefMap.h"
-+#include "overlay/refmap/COverlayRefMapPoint.h"
-+
-+#include <QtWidgets>
-+
-+CItemRefMap::CItemRefMap(const QString &filename, QStackedWidget *stackedWidget, QListWidget *parent)
-+ : CItemFile(filename, parent)
-+{
-+ overlay = new COverlayRefMap(this, stackedWidget);
-+ connect(overlay, &COverlayRefMap::sigChanged, this, &CItemRefMap::sigChanged);
-+}
-+
-+CItemRefMap::~CItemRefMap()
-+{
-+ overlay->deleteLater();
-+}
-+
-+void CItemRefMap::saveSettings(QSettings& cfg)
-+{
-+ CItemFile::saveSettings(cfg);
-+ overlay->saveSettings(cfg);
-+}
-+
-+void CItemRefMap::loadSettings(QSettings& cfg)
-+{
-+ CItemFile::loadSettings(cfg);
-+ overlay->loadSettings(cfg);
-+}
-+
-+void CItemRefMap::addRefPoints(QList<COverlayRefMapPoint*>& points)
-+{
-+ overlay->addRefPoints(points);
-+}
-+
-+QString CItemRefMap::getMapProjection() const
-+{
-+ return overlay->getMapProjection();
-+}
-+
-+const QList<COverlayRefMapPoint *> CItemRefMap::getRefPoints() const
-+{
-+ return overlay->getRefPoints();
-+}
-+
-+
-+void CItemRefMap::toFront()
-+{
-+ overlay->toFront();
-+}
-+
-+bool CItemRefMap::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ CItemFile::drawFx(p, needsRedraw);
-+ overlay->drawFx(p, needsRedraw);
-+ return true;
-+}
-+
-+void CItemRefMap::mouseMoveEventFx(QMouseEvent *e)
-+{
-+ CItemFile::mouseMoveEventFx(e);
-+ if(!mapIsMoving)
-+ {
-+ overlay->mouseMoveEventFx(e);
-+ }
-+}
-+
-+void CItemRefMap::mouseReleaseEventFx(QMouseEvent *e)
-+{
-+ if(!mapDidMove)
-+ {
-+ overlay->mouseReleaseEventFx(e);
-+ }
-+ CItemFile::mouseReleaseEventFx(e);
-+}
-+
-+bool CItemRefMap::keyPressEventFx(QKeyEvent *e)
-+{
-+ return overlay->keyPressEventFx(e);
-+}
-+
-+void CItemRefMap::leaveEventFx(QEvent *e)
-+{
-+ CItemFile::leaveEventFx(e);
-+ overlay->abortStep();
-+}
-+
-+QCursor CItemRefMap::getCursorFx()
-+{
-+ return overlay->getCursorFx();
-+}
-+
-+bool CItemRefMap::isOk() const
-+{
-+ return overlay->isOk();
-+}
-diff --git a/src/qmaptool/items/CItemRefMap.h b/src/qmaptool/items/CItemRefMap.h
-new file mode 100644
-index 00000000..5e74e8bf
---- /dev/null
-+++ b/src/qmaptool/items/CItemRefMap.h
-@@ -0,0 +1,56 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CITEMREFMAP_H
-+#define CITEMREFMAP_H
-+
-+#include "items/CItemFile.h"
-+
-+class COverlayRefMap;
-+class COverlayRefMapPoint;
-+
-+class CItemRefMap : public CItemFile
-+{
-+public:
-+ CItemRefMap(const QString& filename, QStackedWidget * stackedWidget, QListWidget *parent);
-+ virtual ~CItemRefMap();
-+
-+ void saveSettings(QSettings& cfg) override;
-+ void loadSettings(QSettings& cfg) override;
-+
-+ void addRefPoints(QList<COverlayRefMapPoint *> &points);
-+ QString getMapProjection() const;
-+ const QList<COverlayRefMapPoint*> getRefPoints() const;
-+
-+ void toFront() override;
-+
-+ bool drawFx(QPainter& p, CCanvas::redraw_e needsRedraw) override;
-+ void mouseMoveEventFx(QMouseEvent *e) override;
-+ void mouseReleaseEventFx(QMouseEvent *e) override;
-+ void leaveEventFx(QEvent *e) override;
-+ bool keyPressEventFx(QKeyEvent *e) override;
-+ QCursor getCursorFx() override;
-+
-+ bool isOk() const override;
-+
-+private:
-+ COverlayRefMap * overlay;
-+};
-+
-+#endif //CITEMREFMAP_H
-+
-diff --git a/src/qmaptool/items/CItemTreeWidget.cpp b/src/qmaptool/items/CItemTreeWidget.cpp
-new file mode 100644
-index 00000000..9a68beaf
---- /dev/null
-+++ b/src/qmaptool/items/CItemTreeWidget.cpp
-@@ -0,0 +1,317 @@
-+/**********************************************************************************************
-+ Copyright (C) 2018 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/CDrawContextProj.h"
-+#include "helpers/CDraw.h"
-+#include "helpers/CSettings.h"
-+#include "items/CItemMap.h"
-+#include "items/CItemMapLayer.h"
-+#include "items/CItemTreeWidget.h"
-+
-+#include <QtWidgets>
-+
-+CItemTreeWidget::CItemTreeWidget(QWidget *parent)
-+ : QWidget(parent)
-+{
-+ setupUi(this);
-+
-+ connect(toolFiles, &QToolButton::clicked, this, &CItemTreeWidget::slotFiles);
-+ connect(toolDelFile, &QToolButton::clicked, this, &CItemTreeWidget::slotDeleteFile);
-+ connect(toolDelFiles, &QToolButton::clicked, this, &CItemTreeWidget::slotDeleteFiles);
-+ connect(treeFiles, &QTreeWidget::itemSelectionChanged, this, &CItemTreeWidget::slotSelectionChanged);
-+}
-+
-+void CItemTreeWidget::saveSettings(QSettings& cfg)
-+{
-+ QStringList files;
-+ const int N = treeFiles->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ CItemMapLayer * layer = dynamic_cast<CItemMapLayer*>(treeFiles->topLevelItem(n));
-+ if(layer == nullptr)
-+ {
-+ continue;
-+ }
-+
-+ const int M = layer->childCount();
-+ for(int m = 0; m < M; m++)
-+ {
-+ CItemMap * map = dynamic_cast<CItemMap*>(layer->child(m));
-+ if(map != nullptr)
-+ {
-+ files << map->getFilename();
-+ cfg.beginGroup(QString("%1_%2").arg(n).arg(m));
-+ map->saveSettings(cfg);
-+ cfg.endGroup();
-+ }
-+ }
-+ }
-+
-+ cfg.setValue("files", files);
-+}
-+
-+void CItemTreeWidget::loadSettings(QSettings& cfg)
-+{
-+ QStringList files = cfg.value("files", QStringList()).toStringList();
-+ addFiles(files);
-+
-+ const int N = treeFiles->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ CItemMapLayer * layer = dynamic_cast<CItemMapLayer*>(treeFiles->topLevelItem(n));
-+ if(layer == nullptr)
-+ {
-+ continue;
-+ }
-+
-+ const int M = layer->childCount();
-+ for(int m = 0; m < M; m++)
-+ {
-+ CItemMap * map = dynamic_cast<CItemMap*>(layer->child(m));
-+ if(map != nullptr)
-+ {
-+ cfg.beginGroup(QString("%1_%2").arg(n).arg(m));
-+ map->loadSettings(cfg);
-+ cfg.endGroup();
-+ }
-+ }
-+ }
-+}
-+
-+ITool * CItemTreeWidget::currentItem()
-+{
-+ CItemMapLayer * layer = dynamic_cast<CItemMapLayer*>(treeFiles->currentItem());
-+ if(layer != nullptr)
-+ {
-+ return layer;
-+ }
-+
-+ CItemMap * map = dynamic_cast<CItemMap*>(treeFiles->currentItem());
-+ if(map != nullptr)
-+ {
-+ return dynamic_cast<CItemMapLayer*>(map->QTreeWidgetItem::parent());
-+ }
-+
-+ return nullptr;
-+}
-+
-+bool sortByScale(QTreeWidgetItem * item1, QTreeWidgetItem * item2)
-+{
-+ CItemMapLayer * layer1 = dynamic_cast<CItemMapLayer*>(item1);
-+ CItemMapLayer * layer2 = dynamic_cast<CItemMapLayer*>(item2);
-+ if(layer1 == nullptr || layer2 == nullptr)
-+ {
-+ return false;
-+ }
-+
-+ return layer1->drawContext->getTrFwd().m11() < layer2->drawContext->getTrFwd().m11();
-+}
-+
-+
-+void CItemTreeWidget::addFiles(const QStringList& files)
-+{
-+ QString projstr;
-+
-+ // preset projstr if there is already a layer with a projection.
-+ if(treeFiles->topLevelItemCount() != 0)
-+ {
-+ CItemMapLayer * layer = dynamic_cast<CItemMapLayer*>(treeFiles->topLevelItem(0));
-+ if(layer != nullptr)
-+ {
-+ projstr = layer->getProjection();
-+ }
-+ }
-+
-+
-+ for(const QString& file : files)
-+ {
-+ CItemMap * map = new CItemMap(file);
-+
-+ // if something failed simply go on.
-+ if(!map->getIsValid())
-+ {
-+ delete map;
-+ continue;
-+ }
-+
-+ // setup/test for common projection
-+ if(projstr.isEmpty())
-+ {
-+ projstr = map->getProjection();
-+ }
-+ else if(map->getProjection() != projstr)
-+ {
-+ const QString msg = tr("<p>The current map <i>'%1'</i> does not match the projection of previous loaded maps. "
-+ "All map files need to have the same projection.</p>"
-+ "<p><b>This file</b>: %2</p>"
-+ "<p><b>Expected</b>: %3</p>"
-+ ).arg(file).arg(map->getProjection()).arg(projstr);
-+ QMessageBox::warning(this, tr("Error..."), msg, QMessageBox::Abort);
-+ delete map;
-+ continue;
-+ }
-+
-+ // if the map is already in the list simply go on
-+ if(findMapByHash(map->getHash()) != nullptr)
-+ {
-+ delete map;
-+ continue;
-+ }
-+
-+ CItemMapLayer * layer = nullptr;
-+ const int N = treeFiles->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ layer = dynamic_cast<CItemMapLayer*>(treeFiles->topLevelItem(n));
-+ if(layer == nullptr)
-+ {
-+ continue;
-+ }
-+
-+ if(layer->addMap(map))
-+ {
-+ break;
-+ }
-+ layer = nullptr;
-+ }
-+
-+ if(layer == nullptr)
-+ {
-+ layer = new CItemMapLayer(treeFiles);
-+ layer->addMap(map);
-+ }
-+ } // for(const QString& file : files)
-+
-+ sort(sortByScale);
-+ treeFiles->expandAll();
-+ slotSelectionChanged();
-+}
-+
-+CItemMap * CItemTreeWidget::findMapByHash(const QString& hash)
-+{
-+ const int N = treeFiles->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ CItemMapLayer * layer = dynamic_cast<CItemMapLayer*>(treeFiles->topLevelItem(n));
-+ if(layer == nullptr)
-+ {
-+ continue;
-+ }
-+
-+ const int M = layer->childCount();
-+ for(int m = 0; m < M; m++)
-+ {
-+ CItemMap * map = dynamic_cast<CItemMap*>(layer->child(m));
-+ if((map != nullptr) && (map->getHash() == hash))
-+ {
-+ return map;
-+ }
-+ }
-+ }
-+
-+ return nullptr;
-+}
-+
-+void CItemTreeWidget::slotFiles()
-+{
-+ SETTINGS;
-+ QString path = cfg.value("Path/mapInput", QDir::homePath()).toString();
-+
-+ const QStringList& files = QFileDialog::getOpenFileNames(this, tr("Select files..."), path);
-+ if(files.isEmpty())
-+ {
-+ return;
-+ }
-+
-+ cfg.setValue("Path/mapInput", QFileInfo(files.first()).absolutePath());
-+ addFiles(files);
-+}
-+
-+void CItemTreeWidget::slotDeleteFiles()
-+{
-+ treeFiles->clear();
-+ slotSelectionChanged();
-+}
-+
-+void CItemTreeWidget::slotDeleteFile()
-+{
-+ CItemMap * map = dynamic_cast<CItemMap*>(treeFiles->currentItem());
-+ if(map != nullptr)
-+ {
-+ QTreeWidgetItem * layer = map->QTreeWidgetItem::parent();
-+ delete map;
-+ if(layer->childCount() == 0)
-+ {
-+ delete layer;
-+ }
-+ slotSelectionChanged();
-+ return;
-+ }
-+
-+ CItemMapLayer * layer = dynamic_cast<CItemMapLayer*>(treeFiles->currentItem());
-+ if(layer != nullptr)
-+ {
-+ delete layer;
-+ slotSelectionChanged();
-+ return;
-+ }
-+}
-+
-+void CItemTreeWidget::slotSelectionChanged()
-+{
-+ bool isNotEmpty = treeFiles->topLevelItemCount() != 0;
-+ bool isSelected = !treeFiles->selectedItems().isEmpty();
-+
-+ toolDelFile->setEnabled(isSelected);
-+ toolDelFiles->setEnabled(isNotEmpty);
-+ toolReloadFile->setEnabled(isSelected);
-+
-+ emit sigSelectionChanged();
-+}
-+
-+bool CItemTreeWidget::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ bool res = false;
-+
-+ CItemMapLayer * layer = dynamic_cast<CItemMapLayer*>(currentItem());
-+ if(layer != nullptr)
-+ {
-+ res = layer->drawFx(p, needsRedraw);
-+
-+ IDrawContext * dc = layer->getDrawContext();
-+
-+ if(dc == nullptr)
-+ {
-+ return res;
-+ }
-+
-+ const int N = treeFiles->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ CItemMapLayer * layer = dynamic_cast<CItemMapLayer*>(treeFiles->topLevelItem(n));
-+ if(layer == nullptr)
-+ {
-+ continue;
-+ }
-+
-+ layer->drawBoundingBoxes(p, dc);
-+ }
-+ }
-+
-+ return res;
-+}
-diff --git a/src/qmaptool/items/CItemTreeWidget.h b/src/qmaptool/items/CItemTreeWidget.h
-new file mode 100644
-index 00000000..25d87935
---- /dev/null
-+++ b/src/qmaptool/items/CItemTreeWidget.h
-@@ -0,0 +1,94 @@
-+/**********************************************************************************************
-+ Copyright (C) 2018 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CITEMTREEWIDGET_H
-+#define CITEMTREEWIDGET_H
-+
-+#include "ui_IItemTreeWidget.h"
-+
-+class QSettings;
-+class ITool;
-+class CItemMap;
-+
-+class CItemTreeWidget : public QWidget, private Ui::IItemTreeWidget
-+{
-+ Q_OBJECT
-+public:
-+ enum column_e
-+ {
-+ eColumnName
-+ };
-+
-+ CItemTreeWidget(QWidget * parent);
-+ virtual ~CItemTreeWidget() = default;
-+
-+ void saveSettings(QSettings& cfg);
-+ void loadSettings(QSettings& cfg);
-+
-+ ITool *currentItem();
-+
-+ template< typename LessThan>
-+ void sort(LessThan lessThan)
-+ {
-+ treeFiles->blockSignals(true);
-+
-+ QList<QTreeWidgetItem*> items;
-+ while(treeFiles->topLevelItemCount() != 0)
-+ {
-+ items << treeFiles->takeTopLevelItem(0);
-+ }
-+
-+ qSort(items.begin(), items.end(), lessThan);
-+
-+ for(QTreeWidgetItem* item : items)
-+ {
-+ treeFiles->addTopLevelItem(item);
-+ }
-+
-+ treeFiles->blockSignals(false);
-+ }
-+
-+ qint32 topLevelItemCount() const
-+ {
-+ return treeFiles->topLevelItemCount();
-+ }
-+
-+ QTreeWidgetItem * topLevelItem(int n)
-+ {
-+ return treeFiles->topLevelItem(n);
-+ }
-+
-+ bool drawFx(QPainter& p, CCanvas::redraw_e needsRedraw);
-+
-+signals:
-+ void sigSelectionChanged();
-+ void sigChanged();
-+
-+protected slots:
-+ void slotFiles();
-+ void slotDeleteFiles();
-+ void slotDeleteFile();
-+ void slotSelectionChanged();
-+
-+protected:
-+ void addFiles(const QStringList& files);
-+ CItemMap *findMapByHash(const QString& hash);
-+};
-+
-+#endif //CITEMTREEWIDGET_H
-+
-diff --git a/src/qmaptool/items/IItem.cpp b/src/qmaptool/items/IItem.cpp
-new file mode 100644
-index 00000000..9e8e636f
---- /dev/null
-+++ b/src/qmaptool/items/IItem.cpp
-@@ -0,0 +1,141 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/IDrawContext.h"
-+#include "CMainWindow.h"
-+#include "items/IItem.h"
-+
-+#include <QtWidgets>
-+
-+IItem::IItem(const QString &filename)
-+ : filename(filename)
-+{
-+}
-+
-+void IItem::saveSettings(QSettings& cfg)
-+{
-+ if(nullptr != drawContext)
-+ {
-+ drawContext->saveSettings(cfg);
-+ }
-+}
-+
-+void IItem::loadSettings(QSettings& cfg)
-+{
-+ if(nullptr != drawContext)
-+ {
-+ drawContext->loadSettings(cfg);
-+ }
-+}
-+
-+void IItem::reload()
-+{
-+ if(nullptr == drawContext)
-+ {
-+ return;
-+ }
-+ drawContext->setSourceFile(filename, false);
-+}
-+
-+bool IItem::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ if(nullptr == drawContext)
-+ {
-+ return false;
-+ }
-+
-+ drawContext->draw(p, needsRedraw);
-+ return true;
-+}
-+
-+void IItem::mousePressEventFx(QMouseEvent *e)
-+{
-+ if(nullptr == drawContext)
-+ {
-+ return;
-+ }
-+
-+ if(e->button() == Qt::LeftButton)
-+ {
-+ lastPos = e->pos();
-+ firstPos = lastPos;
-+ mapIsMoving = true;
-+ mapDidMove = false;
-+ }
-+}
-+
-+void IItem::mouseMoveEventFx(QMouseEvent *e)
-+{
-+ if(nullptr == drawContext)
-+ {
-+ return;
-+ }
-+
-+ const QPoint& point = e->pos();
-+ if(mapIsMoving)
-+ {
-+ if((point - firstPos).manhattanLength() >= 4)
-+ {
-+ drawContext->move(point - lastPos);
-+
-+ lastPos = point;
-+ mapDidMove = true;
-+
-+ drawContext->triggerCompleteUpdate(CCanvas::eRedrawMap);
-+ }
-+ }
-+}
-+
-+void IItem::mouseReleaseEventFx(QMouseEvent *e)
-+{
-+ if(nullptr == drawContext)
-+ {
-+ return;
-+ }
-+
-+ if(e->button() == Qt::LeftButton)
-+ {
-+ lastPos = e->pos();
-+ mapIsMoving = false;
-+ mapDidMove = false;
-+ }
-+}
-+
-+void IItem::wheelEventFx(QWheelEvent *e)
-+{
-+ if(nullptr == drawContext)
-+ {
-+ return;
-+ }
-+
-+ // angleDelta() returns the eighths of a degree
-+ // of the mousewheel
-+ // -> zoom in/out every 15 degress = every 120 eights
-+ const int EIGHTS_ZOOM = 15 * 8;
-+ zoomAngleDelta += e->angleDelta().y();
-+ if(abs(zoomAngleDelta) < EIGHTS_ZOOM)
-+ {
-+ return;
-+ }
-+
-+ zoomAngleDelta = 0;
-+
-+ drawContext->zoom(CMainWindow::self().flipMouseWheel() ? (e->delta() < 0) : (e->delta() > 0), e->posF());
-+ drawContext->triggerCompleteUpdate(CCanvas::eRedrawAll);
-+}
-+
-diff --git a/src/qmaptool/items/IItem.h b/src/qmaptool/items/IItem.h
-new file mode 100644
-index 00000000..59697d2c
---- /dev/null
-+++ b/src/qmaptool/items/IItem.h
-@@ -0,0 +1,97 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef IITEM_H
-+#define IITEM_H
-+
-+
-+#include "tool/ITool.h"
-+#include <QObject>
-+
-+class QSettings;
-+class IDrawContext;
-+
-+class IItem : public QObject, public ITool
-+{
-+ Q_OBJECT
-+public:
-+ IItem(const QString& filename);
-+ virtual ~IItem() = default;
-+
-+ virtual void saveSettings(QSettings& cfg);
-+ virtual void loadSettings(QSettings& cfg);
-+
-+ const QString& getFilename() const
-+ {
-+ return filename;
-+ }
-+
-+ IDrawContext* getDrawContext() const
-+ {
-+ return drawContext;
-+ }
-+
-+ bool getMapDidMove() const
-+ {
-+ return mapDidMove;
-+ }
-+
-+ bool getMapIsMoving() const
-+ {
-+ return mapIsMoving;
-+ }
-+
-+ /// reload file into draw context
-+ virtual void reload();
-+ /// item has been selected, bring everything to front (to be displayed)
-+ virtual void toFront(){}
-+
-+ bool drawFx(QPainter& p, CCanvas::redraw_e needsRedraw) override;
-+ void mousePressEventFx(QMouseEvent *e) override;
-+ void mouseMoveEventFx(QMouseEvent *e) override;
-+ void mouseReleaseEventFx(QMouseEvent *e) override;
-+ void wheelEventFx(QWheelEvent *e) override;
-+
-+ virtual bool isOk() const
-+ {
-+ return false;
-+ }
-+
-+signals:
-+ void sigChanged();
-+
-+protected:
-+ QString filename;
-+ IDrawContext * drawContext = nullptr;
-+
-+ /// true while left mouse button is pressed down
-+ bool mapIsMoving = false;
-+ /// true if map actually moved, if not it's a single click
-+ bool mapDidMove = false;
-+
-+ /// last mouse position
-+ QPoint lastPos;
-+ /// mouse position when left button was pressed
-+ QPoint firstPos;
-+
-+ /// current accumulated angleDelta, used/required for zooming on track pads
-+ int zoomAngleDelta = 0;
-+};
-+
-+#endif //IITEM_H
-+
-diff --git a/src/qmaptool/items/IItemListWidget.ui b/src/qmaptool/items/IItemListWidget.ui
-new file mode 100644
-index 00000000..ae057f1a
---- /dev/null
-+++ b/src/qmaptool/items/IItemListWidget.ui
-@@ -0,0 +1,127 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<ui version="4.0">
-+ <class>IItemListWidget</class>
-+ <widget class="QWidget" name="IItemListWidget">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>258</width>
-+ <height>152</height>
-+ </rect>
-+ </property>
-+ <property name="windowTitle">
-+ <string>Form</string>
-+ </property>
-+ <layout class="QVBoxLayout" name="verticalLayout">
-+ <property name="spacing">
-+ <number>3</number>
-+ </property>
-+ <property name="leftMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="topMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="rightMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="bottomMargin">
-+ <number>0</number>
-+ </property>
-+ <item>
-+ <layout class="QHBoxLayout" name="horizontalLayout_3">
-+ <property name="spacing">
-+ <number>3</number>
-+ </property>
-+ <item>
-+ <widget class="QToolButton" name="toolFiles">
-+ <property name="toolTip">
-+ <string>Add map files to list</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../../qmapshack/resources.qrc">
-+ <normaloff>:/icons/32x32/PathBlue.png</normaloff>:/icons/32x32/PathBlue.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolDelFile">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Remove selected file from the list.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../../qmapshack/resources.qrc">
-+ <normaloff>:/icons/32x32/DeleteOne.png</normaloff>:/icons/32x32/DeleteOne.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolDelFiles">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Clear complete list of map files.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../../qmapshack/resources.qrc">
-+ <normaloff>:/icons/32x32/DeleteMultiple.png</normaloff>:/icons/32x32/DeleteMultiple.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolReloadFile">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Reload the currently selected map.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/Reload.png</normaloff>:/icons/32x32/Reload.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <spacer name="horizontalSpacer_3">
-+ <property name="orientation">
-+ <enum>Qt::Horizontal</enum>
-+ </property>
-+ <property name="sizeHint" stdset="0">
-+ <size>
-+ <width>40</width>
-+ <height>20</height>
-+ </size>
-+ </property>
-+ </spacer>
-+ </item>
-+ </layout>
-+ </item>
-+ <item>
-+ <widget class="QListWidget" name="listFiles"/>
-+ </item>
-+ </layout>
-+ </widget>
-+ <resources>
-+ <include location="../../qmapshack/resources.qrc"/>
-+ <include location="../resources.qrc"/>
-+ </resources>
-+ <connections/>
-+</ui>
-diff --git a/src/qmaptool/items/IItemTreeWidget.ui b/src/qmaptool/items/IItemTreeWidget.ui
-new file mode 100644
-index 00000000..cbe6fd8e
---- /dev/null
-+++ b/src/qmaptool/items/IItemTreeWidget.ui
-@@ -0,0 +1,135 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<ui version="4.0">
-+ <class>IItemTreeWidget</class>
-+ <widget class="QWidget" name="IItemTreeWidget">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>258</width>
-+ <height>152</height>
-+ </rect>
-+ </property>
-+ <property name="windowTitle">
-+ <string>Form</string>
-+ </property>
-+ <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0">
-+ <property name="spacing">
-+ <number>0</number>
-+ </property>
-+ <property name="leftMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="topMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="rightMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="bottomMargin">
-+ <number>0</number>
-+ </property>
-+ <item>
-+ <layout class="QHBoxLayout" name="horizontalLayout_3">
-+ <property name="spacing">
-+ <number>3</number>
-+ </property>
-+ <item>
-+ <widget class="QToolButton" name="toolFiles">
-+ <property name="toolTip">
-+ <string>Add map files to list</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/PathBlue.png</normaloff>:/icons/32x32/PathBlue.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolDelFile">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Remove selected file from the list.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/DeleteOne.png</normaloff>:/icons/32x32/DeleteOne.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolDelFiles">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Clear complete list of map files.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/DeleteMultiple.png</normaloff>:/icons/32x32/DeleteMultiple.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolReloadFile">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Reload the currently selected map.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/Reload.png</normaloff>:/icons/32x32/Reload.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <spacer name="horizontalSpacer_3">
-+ <property name="orientation">
-+ <enum>Qt::Horizontal</enum>
-+ </property>
-+ <property name="sizeHint" stdset="0">
-+ <size>
-+ <width>40</width>
-+ <height>20</height>
-+ </size>
-+ </property>
-+ </spacer>
-+ </item>
-+ </layout>
-+ </item>
-+ <item>
-+ <widget class="QTreeWidget" name="treeFiles">
-+ <attribute name="headerVisible">
-+ <bool>false</bool>
-+ </attribute>
-+ <column>
-+ <property name="text">
-+ <string notr="true">1</string>
-+ </property>
-+ </column>
-+ </widget>
-+ </item>
-+ </layout>
-+ </widget>
-+ <resources>
-+ <include location="../resources.qrc"/>
-+ </resources>
-+ <connections/>
-+</ui>
-diff --git a/src/qmaptool/locale/qmaptool.ts b/src/qmaptool/locale/qmaptool.ts
-new file mode 100644
-index 00000000..025b1390
---- /dev/null
-+++ b/src/qmaptool/locale/qmaptool.ts
-@@ -0,0 +1,1675 @@
-+<?xml version="1.0" encoding="utf-8"?>
-+<!DOCTYPE TS>
-+<TS version="2.1">
-+<context>
-+ <name>CCanvas</name>
-+ <message>
-+ <location filename="../canvas/CCanvas.cpp" line="89"/>
-+ <source>No map view available.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CCommandProcessor</name>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="31"/>
-+ <source>Print debug output to console.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="34"/>
-+ <source>Print debug output to logfile (temp. path).</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="37"/>
-+ <source>Do not show splash screen.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="40"/>
-+ <source>File with QMapTool configuration.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="40"/>
-+ <source>file</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CDialogRefPoint</name>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="39"/>
-+ <source>bad coordinate</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="58"/>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="64"/>
-+ <source>Error</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="58"/>
-+ <source>Bad value for X pixel.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="64"/>
-+ <source>Bad value for Y pixel.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CDrawContextPixel</name>
-+ <message>
-+ <location filename="../canvas/CDrawContextPixel.cpp" line="73"/>
-+ <source>Failed to load</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGdalFile</name>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="52"/>
-+ <location filename="../helpers/CGdalFile.cpp" line="65"/>
-+ <location filename="../helpers/CGdalFile.cpp" line="95"/>
-+ <source>Error...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="52"/>
-+ <location filename="../helpers/CGdalFile.cpp" line="65"/>
-+ <source>Failed to load file: %1</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="95"/>
-+ <source>File must be 8 bit palette or gray indexed.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="179"/>
-+ <source>(color table)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="183"/>
-+ <source>(RGB)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="187"/>
-+ <source>(RGBA)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="191"/>
-+ <source>(unknown)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGridPlacer</name>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="34"/>
-+ <source>Select one of the corners and place the marker at the corresponding grid crossing on the map. All 4 corners have to be placed.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="160"/>
-+ <source>Point 1 - not set</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="164"/>
-+ <source>Point 1 - ok</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="169"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="174"/>
-+ <source>Point 1 - bad</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="185"/>
-+ <source>Point 2 - ok</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="190"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="195"/>
-+ <source>Point 2 - bad</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="207"/>
-+ <source>Point 3 - ok</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="212"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="217"/>
-+ <source>Point 3 - bad</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="229"/>
-+ <source>Point 4 - ok</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="234"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="239"/>
-+ <source>Point 4 - bad</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="181"/>
-+ <source>Point 2 - not set</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="203"/>
-+ <source>Point 3 - not set</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="225"/>
-+ <source>Point 4 - not set</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGridSelArea</name>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridSelArea.cpp" line="30"/>
-+ <source>Select the area to be covered by the calculated reference points. Simply grab the corners of the selection rectangle with a left click and place them where you want with a second click.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGridSetRef</name>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridSetRef.cpp" line="37"/>
-+ <source>Valid coordinate formats: If the projection is lat/lon all values have to be in degree, e.g. &quot;48.2&quot; or &quot;12.4&quot;. For all other projections values are either in multiple of meter or feet. If you are doing it wrong the entry field will turn red.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CItemListWidget</name>
-+ <message>
-+ <location filename="../items/CItemListWidget.cpp" line="103"/>
-+ <source>Select files...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayCutMap</name>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="222"/>
-+ <source>Delete mask...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="222"/>
-+ <source>Are you sure to delete complete mask?</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="239"/>
-+ <source>Save mask...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="287"/>
-+ <source>Load mask...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="301"/>
-+ <source>Failed...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="301"/>
-+ <source>Not a shape file.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayGridTool</name>
-+ <message>
-+ <location filename="../overlay/COverlayGridTool.cpp" line="34"/>
-+ <source>Before you proceed with &apos;ok&apos;:
-+Please cross check all data once again. A bad reference coordinate will ruin all the work. Also cross check if the selected area contains as many reference points as possible at the border. You can easily delete points outside the map in the Reference Tool. But it&apos;s much more effort to set additional points in case you miss some. When you are done press &apos;ok&apos; to transfer the derived reference points to the Reference Tool.
-+
-+The next step will be to use the Reference Tool to adjust the position of all reference points to the real grid position on the map.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayRefMap</name>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="42"/>
-+ <source>If you used the Grid Tool you have to fine tune the reference points by placing them as much as possible on the grid crossing. Be aware that if you over scale you get jumping points by rounding effects. Be precise but do not make religion out of the task.
-+If your mouse focus is on the map you can use the N and B keys to jump forward an backward in the reference point list.
-+The is also the option to fine tune the reference points in auto-mode. In this mode the next reference point is selected automatically right after you placed the current one. This is very convenient for a large number of reference points.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="614"/>
-+ <source>Save reference points...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="653"/>
-+ <source>Load reference points...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="694"/>
-+ <source>Delete all reference points...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="694"/>
-+ <source>Are you sure to delete all reference points in the list?</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="729"/>
-+ <source>Delete...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="729"/>
-+ <source>Delete all selected reference points?</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayRefMapPoint</name>
-+ <message>
-+ <location filename="../overlay/refmap/COverlayRefMapPoint.cpp" line="43"/>
-+ <source>bad coordinate</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CProjWizard</name>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="62"/>
-+ <source>north</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="63"/>
-+ <source>south</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="227"/>
-+ <source>Error...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="227"/>
-+ <source>The value
-+&apos;%1&apos;
-+is not a valid coordinate system definition:
-+%2</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CSetupExtTools</name>
-+ <message>
-+ <location filename="../setup/CSetupExtTools.cpp" line="63"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="64"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="65"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="66"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="67"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="68"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;not found&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CSetupExtTools.cpp" line="80"/>
-+ <source>Select %1 binary...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CShell</name>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="41"/>
-+ <source>Execution of external program `%1` failed: </source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="45"/>
-+ <source>Process cannot be started.
-+</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="46"/>
-+ <source>Make sure the required packages are installed, `%1` exists and is executable.
-+</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="50"/>
-+ <source>External process crashed.
-+</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="54"/>
-+ <source>An unknown error occurred.
-+</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="146"/>
-+ <source>!!! failed !!!
-+</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="161"/>
-+ <source>
-+Canceled by user&apos;s request.
-+</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="191"/>
-+ <source>!!! done !!!
-+</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolAddOverview</name>
-+ <message>
-+ <location filename="../tool/CToolAddOverview.cpp" line="30"/>
-+ <source>Add Overviews</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolAddOverview.cpp" line="32"/>
-+ <source>Raster map files consume quite some memory if a larger area is displayed. Pre-calculated overview levels help to speed up loading and displaying the map. These overviews can be stored within the map file as well as an external file. GDAL can remove internally stored overviews, however it will not free the used space in the file. Therefore it&apos;s size will remain large. If you do not like that use the external option.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolCutMap</name>
-+ <message>
-+ <location filename="../tool/CToolCutMap.cpp" line="30"/>
-+ <source>Cut Map</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolCutMap.cpp" line="32"/>
-+ <source>Paper maps usually have a border you don&apos;t want to have. To combine maps seamlessly you have to cut that border, replacing it by transparent pixel. This tool allows you to define a cut line and it will add an alpha channel for transparency to your map.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolExport</name>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="30"/>
-+ <source>Export Maps</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="33"/>
-+ <source>To use the maps on your device you have to export them to the proprietary format supported by the device. Depending on the device this can vary from a single layer map to a map stack with maps of different scale.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="41"/>
-+ <source>Note: This tool will use all files in the list as a input. This will only work if all files have the same projection.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="136"/>
-+ <source>Select filename...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolGrid</name>
-+ <message>
-+ <location filename="../tool/CToolGrid.cpp" line="37"/>
-+ <source>By placing 4 reference points at the corners of a grid square and referencing them by their top left corner, the width and height, all the other grid points can be estimated.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolPalettize</name>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="30"/>
-+ <source>Add Color Palette</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="34"/>
-+ <source>Usually you use RGBA color while referencing a map because the large color space allows you to scale and rotate the map without any loss of quality. But it results into rather large files. The file size can be optimized by using a color palette instead of the RGBA color space. The impact on quality is low as long as you do not want to scale or rotate the map. If you want to combine files with a color palette all files need to have the same palette.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="46"/>
-+ <source>Note: This tool will use all files in the list as a combined input to derive an optimal palette. This will only work if all files have the same projection and scale.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="109"/>
-+ <source>Select filename...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolRefMap</name>
-+ <message>
-+ <location filename="../tool/CToolRefMap.cpp" line="34"/>
-+ <source>Reference Map</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolRefMap.cpp" line="36"/>
-+ <source>A scan of a paper map can be converted to a referenced raster map if you place at least three reference points on the map. The more points the better the result. If your map has a grid you can place points on that grid with the grid tool.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IAbout</name>
-+ <message>
-+ <location filename="../IAbout.ui" line="14"/>
-+ <source>About...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="26"/>
-+ <source>&lt;b&gt;QMapTool&lt;/b&gt;, Version</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="39"/>
-+ <location filename="../IAbout.ui" line="77"/>
-+ <location filename="../IAbout.ui" line="91"/>
-+ <location filename="../IAbout.ui" line="105"/>
-+ <source>TextLabel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="70"/>
-+ <source>Qt</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="84"/>
-+ <source>GDAL</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="98"/>
-+ <source>Proj4</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="121"/>
-+ <source>This software is licensed under GPL3 or any later version</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="128"/>
-+ <source>© 2017 Oliver Eichler (oliver.eichler@gmx.de)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>ICoordFormatSetup</name>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="14"/>
-+ <source>Coordinate Format...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="24"/>
-+ <source>N48° 53&apos; 39.6&quot; E13° 31&apos; 6.78&quot;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="31"/>
-+ <source>N48.8943° E013.51855°</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="38"/>
-+ <source>N48° 53.660 E013° 31.113</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="53"/>
-+ <source>&lt;b&gt;Note:&lt;/b&gt; For some GUI elements changing the units will not take effect until you restart QMapTool.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IDialogRefPoint</name>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="14"/>
-+ <source>Dialog</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="25"/>
-+ <source>Coord. Map File [pixel]</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="32"/>
-+ <source>x</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="42"/>
-+ <source>y</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="49"/>
-+ <source>Coord. lat/lon WGS84 [°]</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="59"/>
-+ <source>Bad position format. Must be:
-+&quot;[N|S] ddd mm.sss [W|E] ddd mm.sss&quot;
-+or
-+&quot;[N|S] ddd.ddd [W|E] ddd.ddd&quot;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IGridPlacer</name>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridPlacer.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridPlacer.ui" line="150"/>
-+ <source>Reset</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridPlacer.ui" line="224"/>
-+ <source>Set Area</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IGridSelArea</name>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSelArea.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSelArea.ui" line="35"/>
-+ <source>TextLabel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IGridSetRef</name>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="35"/>
-+ <source>Grid Projection:</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="47"/>
-+ <source>...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="60"/>
-+ <source>TextLabel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="72"/>
-+ <source>Easting</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="82"/>
-+ <source>Horiz. Spacing</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="92"/>
-+ <source>Northing</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="102"/>
-+ <source>Vert. Spacing</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IItemListWidget</name>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="40"/>
-+ <source>Add map files to list</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="43"/>
-+ <location filename="../items/IItemListWidget.ui" line="60"/>
-+ <location filename="../items/IItemListWidget.ui" line="77"/>
-+ <location filename="../items/IItemListWidget.ui" line="94"/>
-+ <source>...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="57"/>
-+ <source>Remove selected file from the list.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="74"/>
-+ <source>Clear complete list of map files.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="91"/>
-+ <source>Reload the currently selected map.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IMainWindow</name>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="14"/>
-+ <source>MainWindow</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="32"/>
-+ <source>Setup</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="41"/>
-+ <source>View</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="47"/>
-+ <source>Window</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="52"/>
-+ <source>?</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="67"/>
-+ <source>Tools</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="100"/>
-+ <source>Shell</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="119"/>
-+ <source>About</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="128"/>
-+ <source>Ext. Tools</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="131"/>
-+ <source>Setup paths to external tools, like gdalwarp etc.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="143"/>
-+ <location filename="../IMainWindow.ui" line="146"/>
-+ <source>Flip Mouse Wheel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="155"/>
-+ <location filename="../IMainWindow.ui" line="158"/>
-+ <source>Setup Units</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="167"/>
-+ <source>Setup Coord. Format</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="170"/>
-+ <source>Change the format coordinates are displayed</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="181"/>
-+ <source>Show Tool Help</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IOverlayCutMap</name>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="35"/>
-+ <source>Just move the map and zoom.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="58"/>
-+ <source>Add point to mask.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="61"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="84"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="107"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="137"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="158"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="175"/>
-+ <source>...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="81"/>
-+ <source>Move point of mask.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="104"/>
-+ <source>Remove point from mask.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="134"/>
-+ <source>Remove complete cut mask.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="155"/>
-+ <source>Load cut mask from shape file.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="172"/>
-+ <source>Save cut mask to shape file.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IOverlayGridTool</name>
-+ <message>
-+ <location filename="../overlay/IOverlayGridTool.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayGridTool.ui" line="145"/>
-+ <source>do not translate</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IOverlayRefMap</name>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="40"/>
-+ <source>Just move the map and zoom.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="63"/>
-+ <source>Add reference point.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="66"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="89"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="112"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="135"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="165"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="179"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="200"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="217"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="244"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="326"/>
-+ <source>...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="86"/>
-+ <source>Move reference point.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="109"/>
-+ <source>Remove single reference point.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="132"/>
-+ <source>Move reference points with auto mode. This will pickup the next point after you moved a reference point.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="162"/>
-+ <source>Remove all reference points.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="176"/>
-+ <source>Switch to the Grid Tool.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="197"/>
-+ <source>Load reference points from GCP file.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="214"/>
-+ <source>Save reference points into GCP file.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="241"/>
-+ <source>Sort list of reference points.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="281"/>
-+ <source>(x, y)[pixel]</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="286"/>
-+ <source>(lat, lon)[°]</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="294"/>
-+ <source>TextLabel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="304"/>
-+ <source>Final Map Projection:</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="316"/>
-+ <source>Enter a valid projection string. Valid strings are &quot;+proj...&quot; or &quot;+init=epsg:...&quot;.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="323"/>
-+ <source>Start projection wizard.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="343"/>
-+ <source>Delete</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IProjWizard</name>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="14"/>
-+ <source>Proj4 Wizard</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="29"/>
-+ <source>Mercator</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="38"/>
-+ <source>UTM</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="45"/>
-+ <source>zone</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="82"/>
-+ <source>user defined</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="94"/>
-+ <source>Datum</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="104"/>
-+ <source>World Mercator (OSM)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="124"/>
-+ <source>Result:</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="138"/>
-+ <source>UPS North (North Pole)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="145"/>
-+ <source>UPS South (South Pole)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="152"/>
-+ <source>Projection</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>ISetupExtTools</name>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="14"/>
-+ <source>Setup Ext. Tools</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="22"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="64"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="99"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="173"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="194"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="257"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;not found&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="32"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="53"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="74"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="88"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="135"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="149"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="183"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="211"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="225"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="239"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="264"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="275"/>
-+ <source>...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="112"/>
-+ <source>gdal_translate:</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="43"/>
-+ <source>gdalbuildvrt</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="166"/>
-+ <source>gdaladdo:</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="125"/>
-+ <source>gdalwarp:</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="29"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="132"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="180"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="208"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="222"/>
-+ <source>Setup user defined path.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="201"/>
-+ <source>qmt_rgb2pct</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="50"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="71"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="85"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="146"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="236"/>
-+ <source>Reset user defined path setup.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="250"/>
-+ <source>qmt_map2jnx</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="288"/>
-+ <source>&lt;b&gt;Note:&lt;/b&gt; Usually QMapTool should detect all external tools by itself. If it does not, it&apos;s a bad setup and you should fix the PATH variable of your system. You can setup the paths manually, too, if you know what you are doing. But please keep in mind that GDAL needs a proper environment setup to function properly. If it&apos;s not setup properly you might get results but these can be off grid.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>ITimeZoneSetup</name>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="14"/>
-+ <source>Setup Time Zone ...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="22"/>
-+ <source>UTC</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="32"/>
-+ <source>Local</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="42"/>
-+ <source>Automatic</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="75"/>
-+ <source>Print date/time in </source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="82"/>
-+ <source>long format, or</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="92"/>
-+ <source>short format</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolAddOverview</name>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="59"/>
-+ <source>do not translate</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="119"/>
-+ <source>:2</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="126"/>
-+ <source>:4</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="133"/>
-+ <source>:8</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="140"/>
-+ <source>:16</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="147"/>
-+ <source>:32</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="154"/>
-+ <source>:64</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="164"/>
-+ <source>Remove all overview levels from map file.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="167"/>
-+ <source>Remove</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="174"/>
-+ <source>Do not copy the overviews into the file itself. Add them as external file.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="177"/>
-+ <source>Overview as external file</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="207"/>
-+ <source>Start</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="221"/>
-+ <source>Cancel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="232"/>
-+ <source>For all files</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="257"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolCutMap</name>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="59"/>
-+ <source>do not translate</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="114"/>
-+ <source>Output filename suffix</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="133"/>
-+ <source>_cut</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="148"/>
-+ <source>Create overviews for result.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="176"/>
-+ <source>Start</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="190"/>
-+ <source>Cancel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="201"/>
-+ <source>For all files</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="226"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdalwarp&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="236"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolExport</name>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="59"/>
-+ <location filename="../tool/IToolExport.ui" line="72"/>
-+ <source>do not translate</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="83"/>
-+ <source>Garmin BirdsEye (*.jnx)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="88"/>
-+ <source>TwoNav Raster (*.rmap)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="101"/>
-+ <source>not implemented yet</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="112"/>
-+ <source>Target File</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="130"/>
-+ <source>Start</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="144"/>
-+ <source>Cancel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="173"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;qmt_map2jnx&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="184"/>
-+ <source>Target Filename</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolExportJnx</name>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="35"/>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="81"/>
-+ <source>BirdsEye</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="50"/>
-+ <source>Product ID</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="57"/>
-+ <source>Copyright notice</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="64"/>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="95"/>
-+ <source>None</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="71"/>
-+ <source>Product name</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="88"/>
-+ <source>Description</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="105"/>
-+ <source>JPEG</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="133"/>
-+ <source>Quality</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="140"/>
-+ <source>Chroma subsampling</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="148"/>
-+ <source>411</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="153"/>
-+ <source>422</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="158"/>
-+ <source>444</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="169"/>
-+ <source>Device</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="184"/>
-+ <source>Z-Order</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolGrid</name>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="56"/>
-+ <source>Grid Tool</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="65"/>
-+ <source>do not translate</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="99"/>
-+ <source>Ok</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="110"/>
-+ <source>Cancel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="134"/>
-+ <source>Reset</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolOverviewGroupBox</name>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="14"/>
-+ <source>GroupBox</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="71"/>
-+ <source>:2</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="78"/>
-+ <source>:4</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="85"/>
-+ <source>:8</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="92"/>
-+ <source>:16</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="99"/>
-+ <source>:32</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="106"/>
-+ <source>:64</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="119"/>
-+ <source>Do not copy the overviews into the file itself. Add them as external file.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="122"/>
-+ <source>Overview as external file</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolPalettize</name>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="65"/>
-+ <location filename="../tool/IToolPalettize.ui" line="78"/>
-+ <source>do not translate</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="96"/>
-+ <source>Single files, filename suffix</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="109"/>
-+ <source>_8bit</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="123"/>
-+ <source>Combined file, filename:</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="135"/>
-+ <source>Embed result into *.vrt file.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="142"/>
-+ <source>Create overviews for result.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="170"/>
-+ <source>Start</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="184"/>
-+ <source>Cancel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="213"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="223"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdal_translate&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="233"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;qmt_rgb2pct&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="247"/>
-+ <source>Select filename</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolRefMap</name>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="59"/>
-+ <source>do not translate</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="113"/>
-+ <source>Output filename suffix</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="132"/>
-+ <source>_ref</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="144"/>
-+ <source>Embed result into *.vrt file.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="151"/>
-+ <source>Create overviews for result.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="179"/>
-+ <source>Start</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="193"/>
-+ <source>Cancel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="204"/>
-+ <source>For all files</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="229"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdalwarp&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="239"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdal_translate&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="249"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IUnit</name>
-+ <message>
-+ <location filename="../units/IUnit.cpp" line="740"/>
-+ <location filename="../units/IUnit.cpp" line="746"/>
-+ <source>Error</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnit.cpp" line="740"/>
-+ <source>Bad position format. Must be: &quot;[N|S] ddd mm.sss [W|E] ddd mm.sss&quot; or &quot;[N|S] ddd.ddd [W|E] ddd.ddd&quot;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnit.cpp" line="746"/>
-+ <source>Position values out of bounds. </source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IUnitsSetup</name>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="14"/>
-+ <source>Setup units...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="24"/>
-+ <source>Nautical</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="31"/>
-+ <source>Imperial</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="38"/>
-+ <source>Metric</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="53"/>
-+ <source>&lt;b&gt;Note:&lt;/b&gt; For some GUI elements changing the units will not take effect until you restart QMapTool.</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+</TS>
-diff --git a/src/qmaptool/locale/qmaptool_de.ts b/src/qmaptool/locale/qmaptool_de.ts
-new file mode 100644
-index 00000000..b3a43ef9
---- /dev/null
-+++ b/src/qmaptool/locale/qmaptool_de.ts
-@@ -0,0 +1,1712 @@
-+<?xml version="1.0" encoding="utf-8"?>
-+<!DOCTYPE TS>
-+<TS version="2.0" language="de_DE">
-+<context>
-+ <name>CCanvas</name>
-+ <message>
-+ <location filename="../canvas/CCanvas.cpp" line="89"/>
-+ <source>No map view available.</source>
-+ <translation>Keine Kartenansicht verfügbar.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CCommandProcessor</name>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="31"/>
-+ <source>Print debug output to console.</source>
-+ <translation>Debuginformation in der Konsole ausgeben.</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="34"/>
-+ <source>Print debug output to logfile (temp. path).</source>
-+ <translation>Debuginformation in eine Datei schreiben (temp. Pfad).</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="37"/>
-+ <source>Do not show splash screen.</source>
-+ <translation>Das Anfangsbild nicht zeigen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="40"/>
-+ <source>File with QMapTool configuration.</source>
-+ <translation>Eine Datei mit einer QMapTool-Konfiguration.</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="40"/>
-+ <source>file</source>
-+ <translation>Datei</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CDialogRefPoint</name>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="39"/>
-+ <source>bad coordinate</source>
-+ <translation>ungültige Koordinate</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="58"/>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="64"/>
-+ <source>Error</source>
-+ <translation>Fehler</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="58"/>
-+ <source>Bad value for X pixel.</source>
-+ <translation>Ungültiger Wert fur den X Wert des Bildpunktes.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="64"/>
-+ <source>Bad value for Y pixel.</source>
-+ <translation>Ungültiger Wert fur den Y Wert des Bildpunktes.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CDrawContextPixel</name>
-+ <message>
-+ <source>Error...</source>
-+ <translation>Fehler...</translation>
-+ </message>
-+ <message>
-+ <source>Failed to load file: %1</source>
-+ <translation>Datei laden fehlgeschlagen: %1</translation>
-+ </message>
-+ <message>
-+ <source>File must be 8 bit palette or gray indexed.</source>
-+ <translation>Die Datei muss eine 8 Bit Farbpalette haben oder einen Graustufenindex.</translation>
-+ </message>
-+ <message>
-+ <source>(color table)</source>
-+ <translation>(Farbtabelle)</translation>
-+ </message>
-+ <message>
-+ <source>(unknown)</source>
-+ <translation>(unbekannt)</translation>
-+ </message>
-+ <message>
-+ <location filename="../canvas/CDrawContextPixel.cpp" line="73"/>
-+ <source>Failed to load</source>
-+ <translation>Datei laden fehlgeschlagen</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGdalFile</name>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="52"/>
-+ <location filename="../helpers/CGdalFile.cpp" line="65"/>
-+ <location filename="../helpers/CGdalFile.cpp" line="95"/>
-+ <source>Error...</source>
-+ <translation>Fehler...</translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="52"/>
-+ <location filename="../helpers/CGdalFile.cpp" line="65"/>
-+ <source>Failed to load file: %1</source>
-+ <translation>Datei laden fehlgeschlagen: %1</translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="95"/>
-+ <source>File must be 8 bit palette or gray indexed.</source>
-+ <translation>Die Datei muss eine 8 Bit Farbpalette haben oder einen Graustufenindex.</translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="179"/>
-+ <source>(color table)</source>
-+ <translation>(Farbtabelle)</translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="183"/>
-+ <source>(RGB)</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="187"/>
-+ <source>(RGBA)</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="191"/>
-+ <source>(unknown)</source>
-+ <translation>(unbekannt)</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGridPlacer</name>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="34"/>
-+ <source>Select one of the corners and place the marker at the corresponding grid crossing on the map. All 4 corners have to be placed.</source>
-+ <translation>Wählen Sie eine Ecke aus und platzieren Sie die Markierung auf dem jeweiligen Gitterpunkt der Karte. Alle 4 Ecken müssen gesetzt werden.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="160"/>
-+ <source>Point 1 - not set</source>
-+ <translation>Punkt 1 - nicht gesetzt</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="164"/>
-+ <source>Point 1 - ok</source>
-+ <translation>Punkt 1 - ok</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="169"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="174"/>
-+ <source>Point 1 - bad</source>
-+ <translation>Punkt 1 - falsch</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="185"/>
-+ <source>Point 2 - ok</source>
-+ <translation>Punkt 2 - ok</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="190"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="195"/>
-+ <source>Point 2 - bad</source>
-+ <translation>Punkt 2 - falsch</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="207"/>
-+ <source>Point 3 - ok</source>
-+ <translation>Punkt 3 - ok</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="212"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="217"/>
-+ <source>Point 3 - bad</source>
-+ <translation>Punkt 3 - falsch</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="229"/>
-+ <source>Point 4 - ok</source>
-+ <translation>Punkt 4 - ok</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="234"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="239"/>
-+ <source>Point 4 - bad</source>
-+ <translation>Punkt 4 - falsch</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="181"/>
-+ <source>Point 2 - not set</source>
-+ <translation>Punkt 2 - nicht gesetzt</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="203"/>
-+ <source>Point 3 - not set</source>
-+ <translation>Punkt 3 - nicht gesetzt</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="225"/>
-+ <source>Point 4 - not set</source>
-+ <translation>Punkt 4 - nicht gesetzt</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGridSelArea</name>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridSelArea.cpp" line="30"/>
-+ <source>Select the area to be covered by the calculated reference points. Simply grab the corners of the selection rectangle with a left click and place them where you want with a second click.</source>
-+ <translation>Wählen Sie das Gebiet aus, für das Referenzpunkte berechnet werden sollen. Klicken Sie dazu einfach auf die Ecken des Auswahlrechtecks mit der linken Maustaste und platzieren die Ecke wo Sie wollen mit einem zweiten Klick.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGridSetRef</name>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridSetRef.cpp" line="37"/>
-+ <source>Valid coordinate formats: If the projection is lat/lon all values have to be in degree, e.g. &quot;48.2&quot; or &quot;12.4&quot;. For all other projections values are either in multiple of meter or feet. If you are doing it wrong the entry field will turn red.</source>
-+ <translation>Gültige Koordinatenformate: Wenn die Projektion lat/lon Werte benötigt, müssen alle Eingaben in Grad sein, z.B. &quot;48.2&quot; oder &quot;12.4&quot;. Für alle anderen Projektionen sind die Eingaben entweder in Meter oder in Fuß. Wenn etwas falsch ist, werden die Eingabefelder rot.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CItemListWidget</name>
-+ <message>
-+ <location filename="../items/CItemListWidget.cpp" line="103"/>
-+ <source>Select files...</source>
-+ <translation>Dateien auswählen...</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayCutMap</name>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="222"/>
-+ <source>Delete mask...</source>
-+ <translation>Maske löschen...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="222"/>
-+ <source>Are you sure to delete complete mask?</source>
-+ <translation>Wollen Sie wirklich die gesamte Maske löschen?</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="239"/>
-+ <source>Save mask...</source>
-+ <translation>Maske speichern...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="287"/>
-+ <source>Load mask...</source>
-+ <translation>Maske laden...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="301"/>
-+ <source>Failed...</source>
-+ <translation>Fehlgeschlagen...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="301"/>
-+ <source>Not a shape file.</source>
-+ <translation>Keine Shape-Datei.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayGridTool</name>
-+ <message>
-+ <location filename="../overlay/COverlayGridTool.cpp" line="34"/>
-+ <source>Before you proceed with &apos;ok&apos;:
-+Please cross check all data once again. A bad reference coordinate will ruin all the work. Also cross check if the selected area contains as many reference points as possible at the border. You can easily delete points outside the map in the Reference Tool. But it&apos;s much more effort to set additional points in case you miss some. When you are done press &apos;ok&apos; to transfer the derived reference points to the Reference Tool.
-+
-+The next step will be to use the Reference Tool to adjust the position of all reference points to the real grid position on the map.</source>
-+ <translation>Bevor Sie mit &apos;ok&apos; fortfahren:
-+Bitte überprüfen Sie alle Eingaben erneut. Ein falsche Referenzkoordinate ruiniert die ganze Arbeit. Überprüfen Sie bitte auch, ob das ausgewählte Gebiet an den Grenzen so viele Referenzpunkte wie möglich beinhaltet. Punkte außerhalb der Karte lassen sich recht einfach löschen. Neue Punkte hinzufügen, sollten welche fehlen, ist wesentlich aufwändiger. Wenn Sie fertig sind drücken Sie &apos;ok&apos;, um die berechneten Punkte in das Referenzwerkzeug zu übertragen.
-+
-+Im nächsten Schritte benutzen Sie das Referenzwerkzeug, um die Positionen von allen Referenzpunkten auf die tatsächlichen Gitterpunkte der Karte zu verschieben. </translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayRefMap</name>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="42"/>
-+ <source>If you used the Grid Tool you have to fine tune the reference points by placing them as much as possible on the grid crossing. Be aware that if you over scale you get jumping points by rounding effects. Be precise but do not make religion out of the task.
-+If your mouse focus is on the map you can use the N and B keys to jump forward an backward in the reference point list.
-+The is also the option to fine tune the reference points in auto-mode. In this mode the next reference point is selected automatically right after you placed the current one. This is very convenient for a large number of reference points.</source>
-+ <translation>Wenn Sie das Gitterwerkzeug benutzt haben, müssen Sie die Punkte noch justieren, indem Sie sie auf die Gitterpunkte verschieben. Seien Sie sich bewusst, dass wenn Sie besonders nahe heranzoomen, die Punkte auf Grund von Rundungseffekten springen können. Seien sie beim Positionieren exakt, aber machen Sie daraus keine Religion.
-+
-+Wenn ihr Mausfokus auf der Karte ist, können Sie die N und B Tasten benützen, um sich in der Referenzpunktliste vor und zurück zu bewegen.
-+Es gibt außerdem die Option, die Referenzpunkte im Automode zu justieren. In diesem Modus wird der nächste Referenzpunkt automatisch ausgewählt, nachdem Sie den aktuellen Punkt platziert haben. Diese Funktion ist sehr praktisch, wenn Sie eine große Anzahl an Punkten bearbeiten wollen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="614"/>
-+ <source>Save reference points...</source>
-+ <translation>Referenzpunkte speichern...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="653"/>
-+ <source>Load reference points...</source>
-+ <translation>Referenzpunkte laden...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="694"/>
-+ <source>Delete all reference points...</source>
-+ <translation>Alle Referenzpunkte löschen...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="694"/>
-+ <source>Are you sure to delete all reference points in the list?</source>
-+ <translation>Sind Sie sicher, dass Sie alle Referenzpunkte aus der Liste löschen wollen?</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="729"/>
-+ <source>Delete...</source>
-+ <translation>Löschen...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="729"/>
-+ <source>Delete all selected reference points?</source>
-+ <translation>Alle ausgewählten Referenzpunkte löschen?</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayRefMapPoint</name>
-+ <message>
-+ <location filename="../overlay/refmap/COverlayRefMapPoint.cpp" line="43"/>
-+ <source>bad coordinate</source>
-+ <translation>ungültige Koordinate</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CProjWizard</name>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="62"/>
-+ <source>north</source>
-+ <translation>Nord</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="63"/>
-+ <source>south</source>
-+ <translation>Süd</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="227"/>
-+ <source>Error...</source>
-+ <translation>Fehler...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="227"/>
-+ <source>The value
-+&apos;%1&apos;
-+is not a valid coordinate system definition:
-+%2</source>
-+ <translation>Die Eingabe
-+&apos;%1&apos;
-+ist keine gültige Koordinatensystemdefinition:
-+%2</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CSetupExtTools</name>
-+ <message>
-+ <location filename="../setup/CSetupExtTools.cpp" line="63"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="64"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="65"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="66"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="67"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="68"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;not found&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;nicht gefunden&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CSetupExtTools.cpp" line="80"/>
-+ <source>Select %1 binary...</source>
-+ <translation>Programm %1 auswählen...</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CShell</name>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="41"/>
-+ <source>Execution of external program `%1` failed: </source>
-+ <translation>Ausführen der externen Anwendung &apos;%1&apos; fehlgeschlagen:</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="45"/>
-+ <source>Process cannot be started.
-+</source>
-+ <translation>Der Prozess kann nicht gestartet werden.</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="46"/>
-+ <source>Make sure the required packages are installed, `%1` exists and is executable.
-+</source>
-+ <translation>Stellen Sie sicher, dass alle benötigten Pakete installiert sind, &apos;%1&apos; vorhanden und ausführbar ist.</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="50"/>
-+ <source>External process crashed.
-+</source>
-+ <translation>Der externe Prozess ist abgestürzt.</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="54"/>
-+ <source>An unknown error occurred.
-+</source>
-+ <translation>Ein unbekannter Fehler ist aufgetreten.</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="146"/>
-+ <source>!!! failed !!!
-+</source>
-+ <translation>!!! fehlgeschlagen !!!</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="161"/>
-+ <source>
-+Canceled by user&apos;s request.
-+</source>
-+ <translation>
-+Durch den Benutzer abgebrochen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="191"/>
-+ <source>!!! done !!!
-+</source>
-+ <translation>!!! fertig !!!</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolAddOverview</name>
-+ <message>
-+ <location filename="../tool/CToolAddOverview.cpp" line="30"/>
-+ <source>Add Overviews</source>
-+ <translation>Übersichten hinzufügen</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolAddOverview.cpp" line="32"/>
-+ <source>Raster map files consume quite some memory if a larger area is displayed. Pre-calculated overview levels help to speed up loading and displaying the map. These overviews can be stored within the map file as well as an external file. GDAL can remove internally stored overviews, however it will not free the used space in the file. Therefore it&apos;s size will remain large. If you do not like that use the external option.</source>
-+ <translation>Rasterkarten benötigen recht viel Speicher, wenn ein größeres Gebiet angezeigt werden soll. Vorberechnete Übersichtsebenen helfen dabei, die Karte schnell zu laden und anzuzeigen. Diese Übersichtsebenen können in der Kartendatei oder als externe Datei gespeichert werden. GDAL kann zwar interne Übersichtsebenen entfernen, gibt dabei aber leider den Speicher nicht frei. Deswegen wird die Datei groß bleiben. Wenn Sie das nicht wünschen, dann sollten Sie die Option zur Erstellung einer externen Datei verwenden.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolCutMap</name>
-+ <message>
-+ <location filename="../tool/CToolCutMap.cpp" line="30"/>
-+ <source>Cut Map</source>
-+ <translation>Karte freistellen</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolCutMap.cpp" line="32"/>
-+ <source>Paper maps usually have a border you don&apos;t want to have. To combine maps seamlessly you have to cut that border, replacing it by transparent pixel. This tool allows you to define a cut line and it will add an alpha channel for transparency to your map.</source>
-+ <translation>Papierkarten haben üblicherweise einen Rand, den man nicht dabei haben will. Um Karten blattschnittfrei zu kombinieren, muss man diesen Rand ausschneiden und durch transparente Bildpunkte ersetzen. Dieses Werkzeug ermöglicht es Ihnen, eine Schnittmaske zu erstellen, um damit einen Alphakanal mit den transparenten Bildpunkten zu erstellen. </translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolExport</name>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="30"/>
-+ <source>Export Maps</source>
-+ <translation>Karten exportieren</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="33"/>
-+ <source>To use the maps on your device you have to export them to the proprietary format supported by the device. Depending on the device this can vary from a single layer map to a map stack with maps of different scale.</source>
-+ <translation>Wenn Sie die Karten auf ihrem Gerät benützen wollen, müssen Sie diese in das jeweilige geschlossene Format. welches vom Gerät verwendet wird, exportieren. Abhängig vom Gerät kann das eine Karte mit einer einzelnen Auflösungsbene sein, oder eine mit mehreren Ebenen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="41"/>
-+ <source>Note: This tool will use all files in the list as a input. This will only work if all files have the same projection.</source>
-+ <translation>Hinweis: Dieses Werkzeug verwendet alle Dateien in der Liste als Eingabe. Das funktioniert nur, wenn alle Karten die selbe Projektion verwenden.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="136"/>
-+ <source>Select filename...</source>
-+ <translation>Dateinamen auswählen...</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolGrid</name>
-+ <message>
-+ <location filename="../tool/CToolGrid.cpp" line="37"/>
-+ <source>By placing 4 reference points at the corners of a grid square and referencing them by their top left corner, the width and height, all the other grid points can be estimated.</source>
-+ <translation>Indem Sie 4 Referenzpunkte in den Ecken eines Gitterquadrates setzen und diese über die obere linke Ecke und die Breite und Höhe referenzieren, können alle anderen Gitterpunkte ungefähr berechnet werden.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolPalettize</name>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="30"/>
-+ <source>Add Color Palette</source>
-+ <translation>Farbtabelle erzeugen</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="34"/>
-+ <source>Usually you use RGBA color while referencing a map because the large color space allows you to scale and rotate the map without any loss of quality. But it results into rather large files. The file size can be optimized by using a color palette instead of the RGBA color space. The impact on quality is low as long as you do not want to scale or rotate the map. If you want to combine files with a color palette all files need to have the same palette.</source>
-+ <translation>Üblicherweise benützt man RGBA Farben während man eine Karte referenziert, weil der große Farbraum einem erlaubt, die Karte ohne Qualitätseinbuße zu drehen und zu skalieren. Leider wird deswegen auch die Datei sehr groß. Die Größe kann optimiert werden, wenn man eine Farbpalette anstelle von RGBA verwendet. Die Qualitätseinbußen sind gering, solange man die Karte nicht drehen oder skalieren möchte. Wenn Sie mehrer Karten zusammenfügen wolle, müssen alle dieselbe Palette benützen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="46"/>
-+ <source>Note: This tool will use all files in the list as a combined input to derive an optimal palette. This will only work if all files have the same projection and scale.</source>
-+ <translation>Anmerkung: Dieses Werkzeug benützt alle Dateien in der Liste als gemeinsame Eingabe, um eine optimale Palette zu berechnen. Das kann nur funktionieren, wenn alle Dateien die gleiche Projektion und Skalierung haben.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="109"/>
-+ <source>Select filename...</source>
-+ <translation>Dateinamen auswählen...</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolRefMap</name>
-+ <message>
-+ <location filename="../tool/CToolRefMap.cpp" line="34"/>
-+ <source>Reference Map</source>
-+ <translation>Karte referenzieren</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolRefMap.cpp" line="36"/>
-+ <source>A scan of a paper map can be converted to a referenced raster map if you place at least three reference points on the map. The more points the better the result. If your map has a grid you can place points on that grid with the grid tool.</source>
-+ <translation>Eine gescannte Papierkarte kann in eine referenzierte Rasterkarte umgewandelt werden, indem Sie mindestens 3 Referenzpunkte auf der Karte angeben. Je mehr Punkte Sie setzen, desto besser. Wenn ihre Karte eine Gitter besitzt, können Sie Punkte auf dem Gitter mit dem Gitterwerkzeug setzen.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IAbout</name>
-+ <message>
-+ <location filename="../IAbout.ui" line="14"/>
-+ <source>About...</source>
-+ <translation>Über...</translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="26"/>
-+ <source>&lt;b&gt;QMapTool&lt;/b&gt;, Version</source>
-+ <translation>&lt;b&gt;QMapTool&lt;/b&gt;, Version</translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="39"/>
-+ <location filename="../IAbout.ui" line="77"/>
-+ <location filename="../IAbout.ui" line="91"/>
-+ <location filename="../IAbout.ui" line="105"/>
-+ <source>TextLabel</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="70"/>
-+ <source>Qt</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="84"/>
-+ <source>GDAL</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="98"/>
-+ <source>Proj4</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="121"/>
-+ <source>This software is licensed under GPL3 or any later version</source>
-+ <translation>Diese Software steht unter der GPL3 Lizenz, oder einer neueren Version</translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="128"/>
-+ <source>© 2017 Oliver Eichler (oliver.eichler@gmx.de)</source>
-+ <translation></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>ICoordFormatSetup</name>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="14"/>
-+ <source>Coordinate Format...</source>
-+ <translation>Koordinatenformat...</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="24"/>
-+ <source>N48° 53&apos; 39.6&quot; E13° 31&apos; 6.78&quot;</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="31"/>
-+ <source>N48.8943° E013.51855°</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="38"/>
-+ <source>N48° 53.660 E013° 31.113</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="53"/>
-+ <source>&lt;b&gt;Note:&lt;/b&gt; For some GUI elements changing the units will not take effect until you restart QMapTool.</source>
-+ <translation>&lt;b&gt;Anmerkung:&lt;/b&gt; Bei einigen GUI Elementen wird die Änderung erst mit einem Neustart von QMapTool übernommen.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IDialogRefPoint</name>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="14"/>
-+ <source>Dialog</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="25"/>
-+ <source>Coord. Map File [pixel]</source>
-+ <translation>Koord. Karte [pixel]</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="32"/>
-+ <source>x</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="42"/>
-+ <source>y</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="49"/>
-+ <source>Coord. lat/lon WGS84 [°]</source>
-+ <translation>Koord. lat/lon WGS84 [°]</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="59"/>
-+ <source>Bad position format. Must be:
-+&quot;[N|S] ddd mm.sss [W|E] ddd mm.sss&quot;
-+or
-+&quot;[N|S] ddd.ddd [W|E] ddd.ddd&quot;</source>
-+ <translation>Falsches Format. Entweder:
-+&quot;[N|S] ddd mm.sss [W|E] ddd mm.sss&quot;
-+oder
-+&quot;[N|S] ddd.ddd [W|E] ddd.ddd&quot;</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IGridPlacer</name>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridPlacer.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridPlacer.ui" line="150"/>
-+ <source>Reset</source>
-+ <translation>Zurücksetzen</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridPlacer.ui" line="224"/>
-+ <source>Set Area</source>
-+ <translation>Abdeckung</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IGridSelArea</name>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSelArea.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSelArea.ui" line="35"/>
-+ <source>TextLabel</source>
-+ <translation></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IGridSetRef</name>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="35"/>
-+ <source>Grid Projection:</source>
-+ <translation>Gitterprojektion:</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="47"/>
-+ <source>...</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="60"/>
-+ <source>TextLabel</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="72"/>
-+ <source>Easting</source>
-+ <translation>Ostwert</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="82"/>
-+ <source>Horiz. Spacing</source>
-+ <translation>horiz. Abstand</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="92"/>
-+ <source>Northing</source>
-+ <translation>Nordwert</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="102"/>
-+ <source>Vert. Spacing</source>
-+ <translation>vert. Abstand</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IItemListWidget</name>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="40"/>
-+ <source>Add map files to list</source>
-+ <translation>Kartendateien zur Liste hinzufügen</translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="43"/>
-+ <location filename="../items/IItemListWidget.ui" line="60"/>
-+ <location filename="../items/IItemListWidget.ui" line="77"/>
-+ <location filename="../items/IItemListWidget.ui" line="94"/>
-+ <source>...</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="57"/>
-+ <source>Remove selected file from the list.</source>
-+ <translation>Ausgewählte Dateien aus der Liste entfernen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="74"/>
-+ <source>Clear complete list of map files.</source>
-+ <translation>Die komplette Kartendateiliste löschen. </translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="91"/>
-+ <source>Reload the currently selected map.</source>
-+ <translation>Die aktuell ausgewählte Karte erneut laden.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IMainWindow</name>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="14"/>
-+ <source>MainWindow</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="32"/>
-+ <source>Setup</source>
-+ <translation>Einrichten</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="41"/>
-+ <source>View</source>
-+ <translation>Ansicht</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="47"/>
-+ <source>Window</source>
-+ <translation>Fenster</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="52"/>
-+ <source>?</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="67"/>
-+ <source>Tools</source>
-+ <translation>Werkzeuge</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="100"/>
-+ <source>Shell</source>
-+ <translation>Shell</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="119"/>
-+ <source>About</source>
-+ <translation>Über</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="128"/>
-+ <source>Ext. Tools</source>
-+ <translation>Ext. Werkzeuge</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="131"/>
-+ <source>Setup paths to external tools, like gdalwarp etc.</source>
-+ <translation>Pfade zu den externen Werkzeugen, wie z.B. gdalwarp, einrichten.</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="143"/>
-+ <location filename="../IMainWindow.ui" line="146"/>
-+ <source>Flip Mouse Wheel</source>
-+ <translation>Mausrad umdrehen</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="155"/>
-+ <location filename="../IMainWindow.ui" line="158"/>
-+ <source>Setup Units</source>
-+ <translation>Einheiten einrichten</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="167"/>
-+ <source>Setup Coord. Format</source>
-+ <translation>Koordinatenformat einrichten</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="170"/>
-+ <source>Change the format coordinates are displayed</source>
-+ <translation>Das Format, in dem die Koordinaten angezeigt werden, ändern</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="181"/>
-+ <source>Show Tool Help</source>
-+ <translation>Hilfstexte anzeigen</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IOverlayCutMap</name>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="35"/>
-+ <source>Just move the map and zoom.</source>
-+ <translation>Die Karte verschieben und zoomen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="58"/>
-+ <source>Add point to mask.</source>
-+ <translation>Punkte zur Maske hinzufügen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="61"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="84"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="107"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="137"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="158"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="175"/>
-+ <source>...</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="81"/>
-+ <source>Move point of mask.</source>
-+ <translation>Maskenpunkte verschieben.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="104"/>
-+ <source>Remove point from mask.</source>
-+ <translation>Punkte aus der Maske entfernen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="134"/>
-+ <source>Remove complete cut mask.</source>
-+ <translation>Die komplette Freistellmaske entfernen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="155"/>
-+ <source>Load cut mask from shape file.</source>
-+ <translation>Freistellmaske aus einer Shapedatei laden.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="172"/>
-+ <source>Save cut mask to shape file.</source>
-+ <translation>Freistellmaske in einer Shapedatei speichern.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IOverlayGridTool</name>
-+ <message>
-+ <location filename="../overlay/IOverlayGridTool.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayGridTool.ui" line="145"/>
-+ <source>do not translate</source>
-+ <translation></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IOverlayRefMap</name>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="40"/>
-+ <source>Just move the map and zoom.</source>
-+ <translation>Die Karte verschieben und zoomen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="63"/>
-+ <source>Add reference point.</source>
-+ <translation>Referenzpunkte hinzufügen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="66"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="89"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="112"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="135"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="165"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="179"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="200"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="217"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="244"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="326"/>
-+ <source>...</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="86"/>
-+ <source>Move reference point.</source>
-+ <translation>Referenzpunkte verschieben.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="109"/>
-+ <source>Remove single reference point.</source>
-+ <translation>Referenzpunkte löschen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="132"/>
-+ <source>Move reference points with auto mode. This will pickup the next point after you moved a reference point.</source>
-+ <translation>Referenzpunkte im Automode verschieben. Nachdem der aktuelle Punkt verschoben wurde, wird automatisch der Nächste genommen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="162"/>
-+ <source>Remove all reference points.</source>
-+ <translation>Alle Referenzpunkte löschen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="176"/>
-+ <source>Switch to the Grid Tool.</source>
-+ <translation>Auf das Gitterwerkzeug umschalten.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="197"/>
-+ <source>Load reference points from GCP file.</source>
-+ <translation>Referenzpunkte aus einer GCP Datei lesen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="214"/>
-+ <source>Save reference points into GCP file.</source>
-+ <translation>Referenzpunkte in eine GCP Datei speichern.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="241"/>
-+ <source>Sort list of reference points.</source>
-+ <translation>Die Liste der Referenzpunkte sortieren.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="281"/>
-+ <source>(x, y)[pixel]</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="286"/>
-+ <source>(lat, lon)[°]</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="294"/>
-+ <source>TextLabel</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="304"/>
-+ <source>Final Map Projection:</source>
-+ <translation>Endgültige Kartenprojektion:</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="316"/>
-+ <source>Enter a valid projection string. Valid strings are &quot;+proj...&quot; or &quot;+init=epsg:...&quot;.</source>
-+ <translation>Geben Sie einen gültigen Projektionstext ein. Gültige Formen sind &quot;+proj=...&quot; oder &quot;+init=...&quot;.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="323"/>
-+ <source>Start projection wizard.</source>
-+ <translation>Den Projektionsassistenten öffnen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="343"/>
-+ <source>Delete</source>
-+ <translation>Löschen</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IProjWizard</name>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="14"/>
-+ <source>Proj4 Wizard</source>
-+ <translation>Proj4 Assistent</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="29"/>
-+ <source>Mercator</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="38"/>
-+ <source>UTM</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="45"/>
-+ <source>zone</source>
-+ <translation>Zone</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="82"/>
-+ <source>user defined</source>
-+ <translation>benutzerdefiniert</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="94"/>
-+ <source>Datum</source>
-+ <translation>Datum</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="104"/>
-+ <source>World Mercator (OSM)</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="124"/>
-+ <source>Result:</source>
-+ <translation>Ergebnis:</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="138"/>
-+ <source>UPS North (North Pole)</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="145"/>
-+ <source>UPS South (South Pole)</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="152"/>
-+ <source>Projection</source>
-+ <translation>Projektion</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>ISetupExtTools</name>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="14"/>
-+ <source>Setup Ext. Tools</source>
-+ <translation>Externe Werkzeuge einstellen</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="22"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="64"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="99"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="173"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="194"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="257"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;not found&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;nicht gefunden&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="32"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="53"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="74"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="88"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="135"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="149"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="183"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="211"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="225"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="239"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="264"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="275"/>
-+ <source>...</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="112"/>
-+ <source>gdal_translate:</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="43"/>
-+ <source>gdalbuildvrt</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="166"/>
-+ <source>gdaladdo:</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="125"/>
-+ <source>gdalwarp:</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="29"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="132"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="180"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="208"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="222"/>
-+ <source>Setup user defined path.</source>
-+ <translation>Benutzerdefinierten Pfad einstellen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="201"/>
-+ <source>qmt_rgb2pct</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="50"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="71"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="85"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="146"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="236"/>
-+ <source>Reset user defined path setup.</source>
-+ <translation>Benutzerdefinierten Pfad zurücksetzen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="250"/>
-+ <source>qmt_map2jnx</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="288"/>
-+ <source>&lt;b&gt;Note:&lt;/b&gt; Usually QMapTool should detect all external tools by itself. If it does not, it&apos;s a bad setup and you should fix the PATH variable of your system. You can setup the paths manually, too, if you know what you are doing. But please keep in mind that GDAL needs a proper environment setup to function properly. If it&apos;s not setup properly you might get results but these can be off grid.</source>
-+ <translation>&lt;b&gt;Anmerkung:&lt;/b&gt; Normalerweise sollte QMapTool alle externen Werkzeuge selber finden. Wenn das nicht gelingt, liegt es in der Regel an einer schlechten Einstellung und Sie sollten die PATH Variable ihres Systems überprüfen. Man kann die Werkzeugpfade auch selber setzen. Vorausgesetzt, man weiß was man macht. Bitte bedenken Sie, dass GDAL eine ordentlich aufgesetzte Umgebung benötigt, um fachgerecht zu funktionieren. Wenn dem nicht so ist, können durchaus Ergebnisse erzielt werden, diese können aber verschoben sein.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>ITimeZoneSetup</name>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="14"/>
-+ <source>Setup Time Zone ...</source>
-+ <translation>Zeitzone einstellen...</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="22"/>
-+ <source>UTC</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="32"/>
-+ <source>Local</source>
-+ <translation>Lokal</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="42"/>
-+ <source>Automatic</source>
-+ <translation>Automatisch</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="75"/>
-+ <source>Print date/time in </source>
-+ <translation>Datum/Zeit anzeigen im</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="82"/>
-+ <source>long format, or</source>
-+ <translation>langen Format</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="92"/>
-+ <source>short format</source>
-+ <translation>kurzen Format</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolAddOverview</name>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="59"/>
-+ <source>do not translate</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="119"/>
-+ <source>:2</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="126"/>
-+ <source>:4</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="133"/>
-+ <source>:8</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="140"/>
-+ <source>:16</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="147"/>
-+ <source>:32</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="154"/>
-+ <source>:64</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="164"/>
-+ <source>Remove all overview levels from map file.</source>
-+ <translation>Alle Übersichten aus der Kartendatei entfernen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="167"/>
-+ <source>Remove</source>
-+ <translation>Löschen</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="174"/>
-+ <source>Do not copy the overviews into the file itself. Add them as external file.</source>
-+ <translation>Die Übersichten nicht in der Datei selbst anlegen. Als extra Datei hinzufügen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="177"/>
-+ <source>Overview as external file</source>
-+ <translation>Übersichten als externe Datei</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="207"/>
-+ <source>Start</source>
-+ <translation>Start</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="221"/>
-+ <source>Cancel</source>
-+ <translation>Abbrechen</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="232"/>
-+ <source>For all files</source>
-+ <translation>Für alle Dateien</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="257"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;gdaladdo&quot;nicht gefunden. Bitte überprüfen Sie die Einstellungen!&lt;/b&gt;</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolCutMap</name>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="59"/>
-+ <source>do not translate</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="114"/>
-+ <source>Output filename suffix</source>
-+ <translation>Suffix der Ausgabedatei</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="133"/>
-+ <source>_cut</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="148"/>
-+ <source>Create overviews for result.</source>
-+ <translation>Übersichten für das Ergebnis erzeugen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="176"/>
-+ <source>Start</source>
-+ <translation>Start</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="190"/>
-+ <source>Cancel</source>
-+ <translation>Abbrechen</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="201"/>
-+ <source>For all files</source>
-+ <translation>Für alle Dateien</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="226"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdalwarp&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;gdalwarp&quot;nicht gefunden. Bitte überprüfen Sie die Einstellungen!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="236"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;gdaladdo&quot;nicht gefunden. Bitte überprüfen Sie die Einstellungen!&lt;/b&gt;</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolExport</name>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="59"/>
-+ <location filename="../tool/IToolExport.ui" line="72"/>
-+ <source>do not translate</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="83"/>
-+ <source>Garmin BirdsEye (*.jnx)</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="88"/>
-+ <source>TwoNav Raster (*.rmap)</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="101"/>
-+ <source>not implemented yet</source>
-+ <translation>noch nicht eingebaut</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="112"/>
-+ <source>Target File</source>
-+ <translation>Zieldatei</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="130"/>
-+ <source>Start</source>
-+ <translation>Start</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="144"/>
-+ <source>Cancel</source>
-+ <translation>Abbrechen</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="173"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;qmt_map2jnx&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;qmt_map2jnx&quot;nicht gefunden. Bitte überprüfen Sie die Einstellungen!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="184"/>
-+ <source>Target Filename</source>
-+ <translation>Dateiname der Zieldatei</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolExportJnx</name>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="35"/>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="81"/>
-+ <source>BirdsEye</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="50"/>
-+ <source>Product ID</source>
-+ <translation>Produkt ID</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="57"/>
-+ <source>Copyright notice</source>
-+ <translation>Urheberhinweis</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="64"/>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="95"/>
-+ <source>None</source>
-+ <translation>Nichts</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="71"/>
-+ <source>Product name</source>
-+ <translation>Produktname</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="88"/>
-+ <source>Description</source>
-+ <translation>Beschreibung</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="105"/>
-+ <source>JPEG</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="133"/>
-+ <source>Quality</source>
-+ <translation>Qualität
-+</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="140"/>
-+ <source>Chroma subsampling</source>
-+ <translation>Halbttonunterabtastung</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="148"/>
-+ <source>411</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="153"/>
-+ <source>422</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="158"/>
-+ <source>444</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="169"/>
-+ <source>Device</source>
-+ <translation>Gerät</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="184"/>
-+ <source>Z-Order</source>
-+ <translation>Reihenfolge (Z-Achse)</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolGrid</name>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="56"/>
-+ <source>Grid Tool</source>
-+ <translation>Gitterwerkzeug</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="65"/>
-+ <source>do not translate</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="99"/>
-+ <source>Ok</source>
-+ <translation>OK</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="110"/>
-+ <source>Cancel</source>
-+ <translation>Abbrechen</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="134"/>
-+ <source>Reset</source>
-+ <translation>Zurücksetzen</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolOverviewGroupBox</name>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="14"/>
-+ <source>GroupBox</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="71"/>
-+ <source>:2</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="78"/>
-+ <source>:4</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="85"/>
-+ <source>:8</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="92"/>
-+ <source>:16</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="99"/>
-+ <source>:32</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="106"/>
-+ <source>:64</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="119"/>
-+ <source>Do not copy the overviews into the file itself. Add them as external file.</source>
-+ <translation>Die Übersichten nicht in der Datei selber anlegen. Als extra Datei hinzufügen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="122"/>
-+ <source>Overview as external file</source>
-+ <translation>Übersichten als externe Datei</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolPalettize</name>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="65"/>
-+ <location filename="../tool/IToolPalettize.ui" line="78"/>
-+ <source>do not translate</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="96"/>
-+ <source>Single files, filename suffix</source>
-+ <translation>Einzelne Dateien, Dateinamensuffix</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="109"/>
-+ <source>_8bit</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="123"/>
-+ <source>Combined file, filename:</source>
-+ <translation>In einer Datei zusammenfassen, Dateiname:</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="135"/>
-+ <source>Embed result into *.vrt file.</source>
-+ <translation>Ergebnis in eine *.vrt Datei einbetten.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="142"/>
-+ <source>Create overviews for result.</source>
-+ <translation>Übersichten für das Ergebnis erzeugen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="170"/>
-+ <source>Start</source>
-+ <translation>Start</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="184"/>
-+ <source>Cancel</source>
-+ <translation>Abbrechen</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="213"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;gdaladdo&quot;nicht gefunden. Bitte überprüfen Sie die Einstellungen!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="223"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdal_translate&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;gdal_translate&quot;nicht gefunden. Bitte überprüfen Sie die Einstellungen!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="233"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;qmt_rgb2pct&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;qmt_rgb2pct&quot;nicht gefunden. Bitte überprüfen Sie die Einstellungen!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="247"/>
-+ <source>Select filename</source>
-+ <translation>Dateinamen auswählen</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolRefMap</name>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="59"/>
-+ <source>do not translate</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="113"/>
-+ <source>Output filename suffix</source>
-+ <translation>Suffix der Ausgabedatei</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="132"/>
-+ <source>_ref</source>
-+ <translation></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="144"/>
-+ <source>Embed result into *.vrt file.</source>
-+ <translation>Ergebnis in eine *.vrt Datei einbetten.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="151"/>
-+ <source>Create overviews for result.</source>
-+ <translation>Übersichten für das Ergebnis erzeugen.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="179"/>
-+ <source>Start</source>
-+ <translation>Start</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="193"/>
-+ <source>Cancel</source>
-+ <translation>Abbrechen</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="204"/>
-+ <source>For all files</source>
-+ <translation>Für alle Dateien</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="229"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdalwarp&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;gdalwarp&quot;nicht gefunden. Bitte überprüfen Sie die Einstellungen!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="239"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdal_translate&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;gdal_translate&quot;nicht gefunden. Bitte überprüfen Sie die Einstellungen!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="249"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;gdaladdo&quot;nicht gefunden. Bitte überprüfen Sie die Einstellungen!&lt;/b&gt;</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IUnit</name>
-+ <message>
-+ <location filename="../units/IUnit.cpp" line="740"/>
-+ <location filename="../units/IUnit.cpp" line="746"/>
-+ <source>Error</source>
-+ <translation>Fehler</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnit.cpp" line="740"/>
-+ <source>Bad position format. Must be: &quot;[N|S] ddd mm.sss [W|E] ddd mm.sss&quot; or &quot;[N|S] ddd.ddd [W|E] ddd.ddd&quot;</source>
-+ <translation>Falsches Format. Entweder:
-+&quot;[N|S] ddd mm.sss [W|E] ddd mm.sss&quot;
-+oder
-+&quot;[N|S] ddd.ddd [W|E] ddd.ddd&quot;</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnit.cpp" line="746"/>
-+ <source>Position values out of bounds. </source>
-+ <translation>Positionswerte außerhalb der Grenzen. </translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IUnitsSetup</name>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="14"/>
-+ <source>Setup units...</source>
-+ <translation>Einheiten einrichten...</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="24"/>
-+ <source>Nautical</source>
-+ <translation>nautisch</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="31"/>
-+ <source>Imperial</source>
-+ <translation>imperial</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="38"/>
-+ <source>Metric</source>
-+ <translation>metrisch</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="53"/>
-+ <source>&lt;b&gt;Note:&lt;/b&gt; For some GUI elements changing the units will not take effect until you restart QMapTool.</source>
-+ <translation>&lt;b&gt;Anmerkung:&lt;/b&gt; Bei einigen GUI Elementen wird die Änderung erst mit einem Neustart von QMapTool übernommen.</translation>
-+ </message>
-+</context>
-+</TS>
-diff --git a/src/qmaptool/locale/qmaptool_es.ts b/src/qmaptool/locale/qmaptool_es.ts
-new file mode 100644
-index 00000000..4b6a5cb3
---- /dev/null
-+++ b/src/qmaptool/locale/qmaptool_es.ts
-@@ -0,0 +1,1715 @@
-+<?xml version="1.0" encoding="utf-8"?>
-+<!DOCTYPE TS>
-+<TS version="2.1">
-+<context>
-+ <name>CCanvas</name>
-+ <message>
-+ <location filename="../canvas/CCanvas.cpp" line="89"/>
-+ <source>No map view available.</source>
-+ <translation>Vista de mapa no disponible.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CCommandProcessor</name>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="31"/>
-+ <source>Print debug output to console.</source>
-+ <translation>Mostrar salida de depuración en la consola.</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="34"/>
-+ <source>Print debug output to logfile (temp. path).</source>
-+ <translation>Mostrar salida de depuración en archivo log (Carpeta temporal).</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="37"/>
-+ <source>Do not show splash screen.</source>
-+ <translation>No mostrar pantalla de bienvenida.</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="40"/>
-+ <source>File with QMapTool configuration.</source>
-+ <translation>Archivo con la configuración de QMapTool.</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CCommandProcessor.cpp" line="40"/>
-+ <source>file</source>
-+ <translation>archivo</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CDialogRefPoint</name>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="39"/>
-+ <source>bad coordinate</source>
-+ <translation>Coordenada incorrecta</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="58"/>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="64"/>
-+ <source>Error</source>
-+ <translation>Error</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="58"/>
-+ <source>Bad value for X pixel.</source>
-+ <translation>Valor incorrecto para el pixel X.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CDialogRefPoint.cpp" line="64"/>
-+ <source>Bad value for Y pixel.</source>
-+ <translation>Valor incorrecto para el pixel Y.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CDrawContextPixel</name>
-+ <message>
-+ <source>Error...</source>
-+ <translation type="vanished">Error...</translation>
-+ </message>
-+ <message>
-+ <source>Failed to load file: %1</source>
-+ <translation type="vanished">Fallo al cargar el archivo: %1</translation>
-+ </message>
-+ <message>
-+ <source>File must be 8 bit palette or gray indexed.</source>
-+ <translation type="vanished">El archivo debe de tener una paleta superior a 8 bits o gris indexado.</translation>
-+ </message>
-+ <message>
-+ <source>(color table)</source>
-+ <translation type="vanished">(tabla de color)</translation>
-+ </message>
-+ <message>
-+ <source>(RGB)</source>
-+ <translation type="vanished">(RGB)</translation>
-+ </message>
-+ <message>
-+ <source>(RGBA)</source>
-+ <translation type="vanished">(RGBA)</translation>
-+ </message>
-+ <message>
-+ <source>(unknown)</source>
-+ <translation type="obsolete">(desconocido)</translation>
-+ </message>
-+ <message>
-+ <location filename="../canvas/CDrawContextPixel.cpp" line="73"/>
-+ <source>Failed to load</source>
-+ <translation>Fallo al cargar</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGdalFile</name>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="52"/>
-+ <location filename="../helpers/CGdalFile.cpp" line="65"/>
-+ <location filename="../helpers/CGdalFile.cpp" line="95"/>
-+ <source>Error...</source>
-+ <translation type="unfinished">Error...</translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="52"/>
-+ <location filename="../helpers/CGdalFile.cpp" line="65"/>
-+ <source>Failed to load file: %1</source>
-+ <translation type="unfinished">Fallo al cargar el archivo: %1</translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="95"/>
-+ <source>File must be 8 bit palette or gray indexed.</source>
-+ <translation type="unfinished">El archivo debe de tener una paleta superior a 8 bits o gris indexado.</translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="179"/>
-+ <source>(color table)</source>
-+ <translation type="unfinished">(tabla de color)</translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="183"/>
-+ <source>(RGB)</source>
-+ <translation type="unfinished">(RGB)</translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="187"/>
-+ <source>(RGBA)</source>
-+ <translation type="unfinished">(RGBA)</translation>
-+ </message>
-+ <message>
-+ <location filename="../helpers/CGdalFile.cpp" line="191"/>
-+ <source>(unknown)</source>
-+ <translation type="unfinished">(desconocido)</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGridPlacer</name>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="34"/>
-+ <source>Select one of the corners and place the marker at the corresponding grid crossing on the map. All 4 corners have to be placed.</source>
-+ <translation>Seleccionar una de las esquinas y colocar el marcador en el cruce de cuadrícula correspondiente en el mapa. Las 4 esquinas deben de estar colocadas.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="160"/>
-+ <source>Point 1 - not set</source>
-+ <translation>Punto 1 - no establecido</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="164"/>
-+ <source>Point 1 - ok</source>
-+ <translation>Punto 1 - ok</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="169"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="174"/>
-+ <source>Point 1 - bad</source>
-+ <translation>Punto 1 - error</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="185"/>
-+ <source>Point 2 - ok</source>
-+ <translation>Punto 2 - ok</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="190"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="195"/>
-+ <source>Point 2 - bad</source>
-+ <translation>Punto 2 - error</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="207"/>
-+ <source>Point 3 - ok</source>
-+ <translation>Punto 3 - ok</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="212"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="217"/>
-+ <source>Point 3 - bad</source>
-+ <translation>Punto 3 - error</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="229"/>
-+ <source>Point 4 - ok</source>
-+ <translation>Punto 4 - ok</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="234"/>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="239"/>
-+ <source>Point 4 - bad</source>
-+ <translation>Punto 4 - error</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="181"/>
-+ <source>Point 2 - not set</source>
-+ <translation>Punto 2 - no establecido</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="203"/>
-+ <source>Point 3 - not set</source>
-+ <translation>Punto 3 - no establecido</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridPlacer.cpp" line="225"/>
-+ <source>Point 4 - not set</source>
-+ <translation>Punto 4 - no establecido</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGridSelArea</name>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridSelArea.cpp" line="30"/>
-+ <source>Select the area to be covered by the calculated reference points. Simply grab the corners of the selection rectangle with a left click and place them where you want with a second click.</source>
-+ <translation>Seleccionar el área cubierta por los puntos de referencia calculados. Coger las esquinas de la selección rectangular con un clic izquierdo y soltarlas en el nuevo emplazamiento con un segundo clic.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CGridSetRef</name>
-+ <message>
-+ <location filename="../overlay/gridtool/CGridSetRef.cpp" line="37"/>
-+ <source>Valid coordinate formats: If the projection is lat/lon all values have to be in degree, e.g. &quot;48.2&quot; or &quot;12.4&quot;. For all other projections values are either in multiple of meter or feet. If you are doing it wrong the entry field will turn red.</source>
-+ <translation>Formatos de coordenadas válidos: si la proyección es lat / lon, todos los valores deben estar en grados, p. &quot;48,2&quot; o &quot;12,4&quot;. Para el resto de las proyecciones, los valores están en múltiplos de metro o pies. Si te equivocas, el campo de entrada se pone rojo.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CItemListWidget</name>
-+ <message>
-+ <location filename="../items/CItemListWidget.cpp" line="103"/>
-+ <source>Select files...</source>
-+ <translation>Seleccionar archivos...</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayCutMap</name>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="222"/>
-+ <source>Delete mask...</source>
-+ <translation>Borrar máscara...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="222"/>
-+ <source>Are you sure to delete complete mask?</source>
-+ <translation>¿Estás seguro de eliminar la máscara completa?</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="239"/>
-+ <source>Save mask...</source>
-+ <translation>Guardar máscara...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="287"/>
-+ <source>Load mask...</source>
-+ <translation>Cargar máscara...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="301"/>
-+ <source>Failed...</source>
-+ <translation>Fallo...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayCutMap.cpp" line="301"/>
-+ <source>Not a shape file.</source>
-+ <translation>No es un archivo shape.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayGridTool</name>
-+ <message>
-+ <location filename="../overlay/COverlayGridTool.cpp" line="34"/>
-+ <source>Before you proceed with &apos;ok&apos;:
-+Please cross check all data once again. A bad reference coordinate will ruin all the work. Also cross check if the selected area contains as many reference points as possible at the border. You can easily delete points outside the map in the Reference Tool. But it&apos;s much more effort to set additional points in case you miss some. When you are done press &apos;ok&apos; to transfer the derived reference points to the Reference Tool.
-+
-+The next step will be to use the Reference Tool to adjust the position of all reference points to the real grid position on the map.</source>
-+ <translation>Antes de continuar pulsando &apos;ok&apos;:
-+Verificar los datos una vez más. Una coordenada errónea en la referencia arruinará todo el trabajo. Verificar también si el área seleccionada contiene tantos puntos como sea posible en el borde. Puedes eliminar puntos fácilmente fuera del mapa en la Herramienta de Referencia, pero es mas trabajoso establecer puntos adicionales en caso de que se pierda alguno. Cuando hayas terminado, pulsar &apos;ok&apos; para transferir los puntos a la Herramienta de Referencia.
-+
-+El siguiente paso será usar la herramienta de referencia para ajustar la posición de todos los puntos a la posición de la cuadrícula real del mapa.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayRefMap</name>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="42"/>
-+ <source>If you used the Grid Tool you have to fine tune the reference points by placing them as much as possible on the grid crossing. Be aware that if you over scale you get jumping points by rounding effects. Be precise but do not make religion out of the task.
-+If your mouse focus is on the map you can use the N and B keys to jump forward an backward in the reference point list.
-+The is also the option to fine tune the reference points in auto-mode. In this mode the next reference point is selected automatically right after you placed the current one. This is very convenient for a large number of reference points.</source>
-+ <translation>Si se utilizó la Herramienta de Cuadrícula, hay que ajustar los puntos de referencia colocándolos en el cruce de la cuadrícula lo máximo posible. Ten en cuenta que si sobre escalas obtendrás puntos con valores redondeados, se necesita precisión, pero tampoco es necesario exagerar.
-+Si el mapa esta en el primer plano del foco del ratón, puedes usar las teclas N y B para avanzar y retroceder en la lista de puntos de referencia.
-+También es la opción para ajustar los puntos de referencia en modo automático. En este modo, el siguiente punto de referencia se selecciona automáticamente justo después de que coloques el actual, muy conveniente cuando los puntos son muchos.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="614"/>
-+ <source>Save reference points...</source>
-+ <translation>Guardar puntos de referencia...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="653"/>
-+ <source>Load reference points...</source>
-+ <translation>Cargar puntos de referencia...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="694"/>
-+ <source>Delete all reference points...</source>
-+ <translation>Borrar todos los puntos de referencia...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="694"/>
-+ <source>Are you sure to delete all reference points in the list?</source>
-+ <translation>¿Estás seguro de borrar todos los puntos de la lista?</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="729"/>
-+ <source>Delete...</source>
-+ <translation>Borrar...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/COverlayRefMap.cpp" line="729"/>
-+ <source>Delete all selected reference points?</source>
-+ <translation>¿Borrar los puntos seleccionados?</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>COverlayRefMapPoint</name>
-+ <message>
-+ <location filename="../overlay/refmap/COverlayRefMapPoint.cpp" line="43"/>
-+ <source>bad coordinate</source>
-+ <translation>Coordenada errónea</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CProjWizard</name>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="62"/>
-+ <source>north</source>
-+ <translation>Norte</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="63"/>
-+ <source>south</source>
-+ <translation>Sur</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="227"/>
-+ <source>Error...</source>
-+ <translation>Error...</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/CProjWizard.cpp" line="227"/>
-+ <source>The value
-+&apos;%1&apos;
-+is not a valid coordinate system definition:
-+%2</source>
-+ <translation>El valor
-+&apos;%1&apos;
-+No es una definición válida del sistema de coordenadas:
-+%2</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CSetupExtTools</name>
-+ <message>
-+ <location filename="../setup/CSetupExtTools.cpp" line="63"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="64"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="65"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="66"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="67"/>
-+ <location filename="../setup/CSetupExtTools.cpp" line="68"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;not found&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;no encontrado&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/CSetupExtTools.cpp" line="80"/>
-+ <source>Select %1 binary...</source>
-+ <translation>Seleccionar %1 binario</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CShell</name>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="41"/>
-+ <source>Execution of external program `%1` failed: </source>
-+ <translation>La ejecución del programa externo `%1` falló:</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="45"/>
-+ <source>Process cannot be started.
-+</source>
-+ <translation>El proceso no se puede iniciar.
-+</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="46"/>
-+ <source>Make sure the required packages are installed, `%1` exists and is executable.
-+</source>
-+ <translation>Asegúrate de que los paquetes requeridos están instalados, `%1` existe y es ejecutable.</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="50"/>
-+ <source>External process crashed.
-+</source>
-+ <translation>Proceso externo bloqueado.</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="54"/>
-+ <source>An unknown error occurred.
-+</source>
-+ <translation>Ha ocurrido un error desconocido</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="146"/>
-+ <source>!!! failed !!!
-+</source>
-+ <translation>!!! falló !!!</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="161"/>
-+ <source>
-+Canceled by user&apos;s request.
-+</source>
-+ <translation>Cancelado por el usuario.</translation>
-+ </message>
-+ <message>
-+ <location filename="../shell/CShell.cpp" line="191"/>
-+ <source>!!! done !!!
-+</source>
-+ <translation>¡¡¡ hecho !!!</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolAddOverview</name>
-+ <message>
-+ <location filename="../tool/CToolAddOverview.cpp" line="30"/>
-+ <source>Add Overviews</source>
-+ <translation>Añadir niveles de zoom</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolAddOverview.cpp" line="32"/>
-+ <source>Raster map files consume quite some memory if a larger area is displayed. Pre-calculated overview levels help to speed up loading and displaying the map. These overviews can be stored within the map file as well as an external file. GDAL can remove internally stored overviews, however it will not free the used space in the file. Therefore it&apos;s size will remain large. If you do not like that use the external option.</source>
-+ <translation>Cuando el área es muy grande los archivos de los mapas raster son muy pesados. Los distintos niveles de zoom aceleran la carga y visualización. Se pueden almacenar en el mismo archivo que el mapa o en otro distinto. GDAL puede eliminar los niveles de zoom almacenados internamente pero el tamaño del archivo seguirá siendo el mismo, no así cuando se almacenan en archivo externo.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolCutMap</name>
-+ <message>
-+ <location filename="../tool/CToolCutMap.cpp" line="30"/>
-+ <source>Cut Map</source>
-+ <translation>Cortar Mapa</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolCutMap.cpp" line="32"/>
-+ <source>Paper maps usually have a border you don&apos;t want to have. To combine maps seamlessly you have to cut that border, replacing it by transparent pixel. This tool allows you to define a cut line and it will add an alpha channel for transparency to your map.</source>
-+ <translation>Los mapas en papel suelen tener un marco en blanco innecesario. Para unir mapas a la perfección, es necesario eliminar ese borde y reemplazarlo por un píxel transparente. Esta herramienta te permite definir una línea de corte y agregar un canal alfa para la transparencia del mapa.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolExport</name>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="30"/>
-+ <source>Export Maps</source>
-+ <translation>Exportar Mapas</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="33"/>
-+ <source>To use the maps on your device you have to export them to the proprietary format supported by the device. Depending on the device this can vary from a single layer map to a map stack with maps of different scale.</source>
-+ <translation>Para poder ver los mapas en tu dispositivo hay que exportarlos a un formato que este admita, puede ser necesario un mapa multicapa con distintos niveles de zoom o de una sola capa.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="41"/>
-+ <source>Note: This tool will use all files in the list as a input. This will only work if all files have the same projection.</source>
-+ <translation>Nota: Esta herramienta usa todos los archivos de la lista. Es necesario que todos tengan la misma proyección.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolExport.cpp" line="136"/>
-+ <source>Select filename...</source>
-+ <translation>Seleccionar nombre de archivo...</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolGrid</name>
-+ <message>
-+ <location filename="../tool/CToolGrid.cpp" line="37"/>
-+ <source>By placing 4 reference points at the corners of a grid square and referencing them by their top left corner, the width and height, all the other grid points can be estimated.</source>
-+ <translation>Al poner los 4 puntos de referencia en las esquinas de un cuadrado de la cuadrícula y referenciarlos en ancho y alto por su esquina superior izquierda, todos los otros puntos se pueden estimar.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolPalettize</name>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="30"/>
-+ <source>Add Color Palette</source>
-+ <translation>Añadir Paleta de Color</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="34"/>
-+ <source>Usually you use RGBA color while referencing a map because the large color space allows you to scale and rotate the map without any loss of quality. But it results into rather large files. The file size can be optimized by using a color palette instead of the RGBA color space. The impact on quality is low as long as you do not want to scale or rotate the map. If you want to combine files with a color palette all files need to have the same palette.</source>
-+ <translation>Por lo general, se utiliza color RGBA al referenciar un mapa, ya que el gran espacio de color permite escalar y rotar sin pérdida de calidad, pero los archivos resultan ser muy grandes, se puede optimizar utilizando una paleta de colores en lugar del espacio de color RGBA. El impacto en la calidad es bajo siempre y cuando no quieras escalar o rotar. Si quieres combinar archivos con paleta de colores, todos deben de tener la misma.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="46"/>
-+ <source>Note: This tool will use all files in the list as a combined input to derive an optimal palette. This will only work if all files have the same projection and scale.</source>
-+ <translation>Nota: Esta herramienta utilizará los archivos de la lista para obtener una paleta óptima. Solo funcionará si todos los archivos tienen la misma proyección y escala.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolPalettize.cpp" line="109"/>
-+ <source>Select filename...</source>
-+ <translation>Seleccionar nombre de archivo...</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>CToolRefMap</name>
-+ <message>
-+ <location filename="../tool/CToolRefMap.cpp" line="34"/>
-+ <source>Reference Map</source>
-+ <translation>Referenciar Mapa</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/CToolRefMap.cpp" line="36"/>
-+ <source>A scan of a paper map can be converted to a referenced raster map if you place at least three reference points on the map. The more points the better the result. If your map has a grid you can place points on that grid with the grid tool.</source>
-+ <translation>Un mapa de papel escaneado se puede convertir en un mapa ráster referenciado poniendo al menos tres puntos de referencia en el mapa. Cuantos más puntos, mejor es el resultado. Si el mapa tiene una cuadrícula, se pueden poner puntos en esa cuadrícula con la herramienta de cuadrícula.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IAbout</name>
-+ <message>
-+ <location filename="../IAbout.ui" line="14"/>
-+ <source>About...</source>
-+ <translation>Acerca de...</translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="26"/>
-+ <source>&lt;b&gt;QMapTool&lt;/b&gt;, Version</source>
-+ <translation>&lt;b&gt;QMapTool&lt;/b&gt;, Versión</translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="39"/>
-+ <location filename="../IAbout.ui" line="77"/>
-+ <location filename="../IAbout.ui" line="91"/>
-+ <location filename="../IAbout.ui" line="105"/>
-+ <source>TextLabel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="70"/>
-+ <source>Qt</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="84"/>
-+ <source>GDAL</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="98"/>
-+ <source>Proj4</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="121"/>
-+ <source>This software is licensed under GPL3 or any later version</source>
-+ <translation>Este programa está bajo licencia GPL3 o posterior</translation>
-+ </message>
-+ <message>
-+ <location filename="../IAbout.ui" line="128"/>
-+ <source>© 2017 Oliver Eichler (oliver.eichler@gmx.de)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>ICoordFormatSetup</name>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="14"/>
-+ <source>Coordinate Format...</source>
-+ <translation>Formato de Coordenadas...</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="24"/>
-+ <source>N48° 53&apos; 39.6&quot; E13° 31&apos; 6.78&quot;</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="31"/>
-+ <source>N48.8943° E013.51855°</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="38"/>
-+ <source>N48° 53.660 E013° 31.113</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ICoordFormatSetup.ui" line="53"/>
-+ <source>&lt;b&gt;Note:&lt;/b&gt; For some GUI elements changing the units will not take effect until you restart QMapTool.</source>
-+ <translation>&lt;b&gt;Nota:&lt;/b&gt; El cambio de las unidades de algunos elementos no se producirá hasta el reinicio de QMapTool.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IDialogRefPoint</name>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="14"/>
-+ <source>Dialog</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="25"/>
-+ <source>Coord. Map File [pixel]</source>
-+ <translation>Coord. archivo Map [pixel]</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="32"/>
-+ <source>x</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="42"/>
-+ <source>y</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="49"/>
-+ <source>Coord. lat/lon WGS84 [°]</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IDialogRefPoint.ui" line="59"/>
-+ <source>Bad position format. Must be:
-+&quot;[N|S] ddd mm.sss [W|E] ddd mm.sss&quot;
-+or
-+&quot;[N|S] ddd.ddd [W|E] ddd.ddd&quot;</source>
-+ <translation>Formato de posición incorrecto. Debe ser:
-+&quot;[N|S] ddd mm.sss [W|E] ddd mm.sss&quot;
-+o
-+&quot;[N|S] ddd.ddd [W|E] ddd.ddd&quot;</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IGridPlacer</name>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridPlacer.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridPlacer.ui" line="150"/>
-+ <source>Reset</source>
-+ <translation>Reiniciar</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridPlacer.ui" line="224"/>
-+ <source>Set Area</source>
-+ <translation>Establecer área</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IGridSelArea</name>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSelArea.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSelArea.ui" line="35"/>
-+ <source>TextLabel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IGridSetRef</name>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="35"/>
-+ <source>Grid Projection:</source>
-+ <translation>Proyección de la Cuadrícula:</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="47"/>
-+ <source>...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="60"/>
-+ <source>TextLabel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="72"/>
-+ <source>Easting</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="82"/>
-+ <source>Horiz. Spacing</source>
-+ <translation>Espaciado horizontal</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="92"/>
-+ <source>Northing</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/gridtool/IGridSetRef.ui" line="102"/>
-+ <source>Vert. Spacing</source>
-+ <translation>Espaciado vertical</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IItemListWidget</name>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="40"/>
-+ <source>Add map files to list</source>
-+ <translation>Añadir archivos de mapa a la lista</translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="43"/>
-+ <location filename="../items/IItemListWidget.ui" line="60"/>
-+ <location filename="../items/IItemListWidget.ui" line="77"/>
-+ <location filename="../items/IItemListWidget.ui" line="94"/>
-+ <source>...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="57"/>
-+ <source>Remove selected file from the list.</source>
-+ <translation>Borrar archivo seleccionado de la lista.</translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="74"/>
-+ <source>Clear complete list of map files.</source>
-+ <translation>Borrar lista completa de archivos de mapa.</translation>
-+ </message>
-+ <message>
-+ <location filename="../items/IItemListWidget.ui" line="91"/>
-+ <source>Reload the currently selected map.</source>
-+ <translation>Recargar mapa seleccionado.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IMainWindow</name>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="14"/>
-+ <source>MainWindow</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="32"/>
-+ <source>Setup</source>
-+ <translation>Configuración</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="41"/>
-+ <source>View</source>
-+ <translation>Ver</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="47"/>
-+ <source>Window</source>
-+ <translation>Ventana</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="52"/>
-+ <source>?</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="67"/>
-+ <source>Tools</source>
-+ <translation>Herramientas</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="100"/>
-+ <source>Shell</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="119"/>
-+ <source>About</source>
-+ <translation>Acerca de</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="128"/>
-+ <source>Ext. Tools</source>
-+ <translation>Herramientas ext.</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="131"/>
-+ <source>Setup paths to external tools, like gdalwarp etc.</source>
-+ <translation>Configurar rutas de las herramientas ext.</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="143"/>
-+ <location filename="../IMainWindow.ui" line="146"/>
-+ <source>Flip Mouse Wheel</source>
-+ <translation>Invertir rueda del ratón</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="155"/>
-+ <location filename="../IMainWindow.ui" line="158"/>
-+ <source>Setup Units</source>
-+ <translation>Configurar unidades</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="167"/>
-+ <source>Setup Coord. Format</source>
-+ <translation>Configurar formato de coordenadas</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="170"/>
-+ <source>Change the format coordinates are displayed</source>
-+ <translation>Cambiar formato de coordenadas mostrado.</translation>
-+ </message>
-+ <message>
-+ <location filename="../IMainWindow.ui" line="181"/>
-+ <source>Show Tool Help</source>
-+ <translation>Mostrar ayuda de la herramienta</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IOverlayCutMap</name>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="35"/>
-+ <source>Just move the map and zoom.</source>
-+ <translation>Solo mueve el mapa y zoom</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="58"/>
-+ <source>Add point to mask.</source>
-+ <translation>Añadir punto a la máscara.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="61"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="84"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="107"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="137"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="158"/>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="175"/>
-+ <source>...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="81"/>
-+ <source>Move point of mask.</source>
-+ <translation>Mover punto de la máscara.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="104"/>
-+ <source>Remove point from mask.</source>
-+ <translation>Borrar punto de la máscara.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="134"/>
-+ <source>Remove complete cut mask.</source>
-+ <translation>Borrar máscara de corte completa.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="155"/>
-+ <source>Load cut mask from shape file.</source>
-+ <translation>Cargar máscara de corte desde archivo Shape.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayCutMap.ui" line="172"/>
-+ <source>Save cut mask to shape file.</source>
-+ <translation>Guardar máscara de corte en archivo Shape.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IOverlayGridTool</name>
-+ <message>
-+ <location filename="../overlay/IOverlayGridTool.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayGridTool.ui" line="145"/>
-+ <source>do not translate</source>
-+ <translation>No traducir</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IOverlayRefMap</name>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="40"/>
-+ <source>Just move the map and zoom.</source>
-+ <translation>Solo mover mapa y zoom.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="63"/>
-+ <source>Add reference point.</source>
-+ <translation>Añadir punto de referencia.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="66"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="89"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="112"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="135"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="165"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="179"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="200"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="217"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="244"/>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="326"/>
-+ <source>...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="86"/>
-+ <source>Move reference point.</source>
-+ <translation>Mover punto de referencia.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="109"/>
-+ <source>Remove single reference point.</source>
-+ <translation>Borrar un punto de referencia.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="132"/>
-+ <source>Move reference points with auto mode. This will pickup the next point after you moved a reference point.</source>
-+ <translation>Mover puntos de referencia con modo auto, captará el siguiente tras el desplazamiento del anterior.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="162"/>
-+ <source>Remove all reference points.</source>
-+ <translation>Borrar todos los puntos de referencia.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="176"/>
-+ <source>Switch to the Grid Tool.</source>
-+ <translation>Cambiar a la Herramienta de cuadrícula.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="197"/>
-+ <source>Load reference points from GCP file.</source>
-+ <translation>Cargar puntos de referencia desde archivo GCP.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="214"/>
-+ <source>Save reference points into GCP file.</source>
-+ <translation>Guardar puntos de referencia en archivo GCP.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="241"/>
-+ <source>Sort list of reference points.</source>
-+ <translation>Ordenar lista de puntos de referencia</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="281"/>
-+ <source>(x, y)[pixel]</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="286"/>
-+ <source>(lat, lon)[°]</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="294"/>
-+ <source>TextLabel</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="304"/>
-+ <source>Final Map Projection:</source>
-+ <translation>Proyección final del mapa:</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="316"/>
-+ <source>Enter a valid projection string. Valid strings are &quot;+proj...&quot; or &quot;+init=epsg:...&quot;.</source>
-+ <translation>Introducir una cadena de proyección válida. Las cadenas válidas son &quot;+proj...&quot; o &quot;+init=epsg:...&quot;.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="323"/>
-+ <source>Start projection wizard.</source>
-+ <translation>Iniciar asistente de proyección.</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/IOverlayRefMap.ui" line="343"/>
-+ <source>Delete</source>
-+ <translation>Borrar</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IProjWizard</name>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="14"/>
-+ <source>Proj4 Wizard</source>
-+ <translation>Asistente de Proj4</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="29"/>
-+ <source>Mercator</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="38"/>
-+ <source>UTM</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="45"/>
-+ <source>zone</source>
-+ <translation>zona</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="82"/>
-+ <source>user defined</source>
-+ <translation>definida por el usuario</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="94"/>
-+ <source>Datum</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="104"/>
-+ <source>World Mercator (OSM)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="124"/>
-+ <source>Result:</source>
-+ <translation>Resultado:</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="138"/>
-+ <source>UPS North (North Pole)</source>
-+ <translation>UPS Norte (Polo Norte)</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="145"/>
-+ <source>UPS South (South Pole)</source>
-+ <translation>UPS Sur (Polo Sur)</translation>
-+ </message>
-+ <message>
-+ <location filename="../overlay/refmap/IProjWizard.ui" line="152"/>
-+ <source>Projection</source>
-+ <translation>Proyección</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>ISetupExtTools</name>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="14"/>
-+ <source>Setup Ext. Tools</source>
-+ <translation>Configurar Herramientas Ext.</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="22"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="64"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="99"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="173"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="194"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="257"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;not found&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;no encontrado&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="32"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="53"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="74"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="88"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="135"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="149"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="183"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="211"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="225"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="239"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="264"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="275"/>
-+ <source>...</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="112"/>
-+ <source>gdal_translate:</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="43"/>
-+ <source>gdalbuildvrt</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="166"/>
-+ <source>gdaladdo:</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="125"/>
-+ <source>gdalwarp:</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="29"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="132"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="180"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="208"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="222"/>
-+ <source>Setup user defined path.</source>
-+ <translation>Configurar ruta definida por el usuario.</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="201"/>
-+ <source>qmt_rgb2pct</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="50"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="71"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="85"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="146"/>
-+ <location filename="../setup/ISetupExtTools.ui" line="236"/>
-+ <source>Reset user defined path setup.</source>
-+ <translation>Reiniciar la configuración de la ruta definida por el usuario.</translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="250"/>
-+ <source>qmt_map2jnx</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../setup/ISetupExtTools.ui" line="288"/>
-+ <source>&lt;b&gt;Note:&lt;/b&gt; Usually QMapTool should detect all external tools by itself. If it does not, it&apos;s a bad setup and you should fix the PATH variable of your system. You can setup the paths manually, too, if you know what you are doing. But please keep in mind that GDAL needs a proper environment setup to function properly. If it&apos;s not setup properly you might get results but these can be off grid.</source>
-+ <translation>&lt;b&gt;Nota:&lt;/b&gt; QMapTool debería detectar todas las herramientas externas automáticamente, si no es así, es debido a una configuración errónea y hay que corregir la variable PATH del sistema. También se pueden configurar las rutas manualmente, si se sabe lo que se está haciendo, pero ten en cuenta que GDAL necesita una configuración del entorno adecuada para funcionar correctamente. Si no es correcta se pueden obtener resultados, pero pueden ser incorrectos.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>ITimeZoneSetup</name>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="14"/>
-+ <source>Setup Time Zone ...</source>
-+ <translation>Configurar Zona Horaria...</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="22"/>
-+ <source>UTC</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="32"/>
-+ <source>Local</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="42"/>
-+ <source>Automatic</source>
-+ <translation>Automática</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="75"/>
-+ <source>Print date/time in </source>
-+ <translation>Mostrar fecha y hora en </translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="82"/>
-+ <source>long format, or</source>
-+ <translation>formato largo o</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/ITimeZoneSetup.ui" line="92"/>
-+ <source>short format</source>
-+ <translation>formato corto</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolAddOverview</name>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="59"/>
-+ <source>do not translate</source>
-+ <translation>no traducir</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="119"/>
-+ <source>:2</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="126"/>
-+ <source>:4</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="133"/>
-+ <source>:8</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="140"/>
-+ <source>:16</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="147"/>
-+ <source>:32</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="154"/>
-+ <source>:64</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="164"/>
-+ <source>Remove all overview levels from map file.</source>
-+ <translation>Borrar los niveles de zoom del archivo del mapa.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="167"/>
-+ <source>Remove</source>
-+ <translation>Borrar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="174"/>
-+ <source>Do not copy the overviews into the file itself. Add them as external file.</source>
-+ <translation>No copiar los niveles de zoom en el mismo archivo, hacerlo en uno externo.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="177"/>
-+ <source>Overview as external file</source>
-+ <translation>Niveles de zoom en archivo externo</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="207"/>
-+ <source>Start</source>
-+ <translation>Iniciar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="221"/>
-+ <source>Cancel</source>
-+ <translation>Cancelar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="232"/>
-+ <source>For all files</source>
-+ <translation>Para todos los archivos</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolAddOverview.ui" line="257"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;Gdaladdo&quot; no encontrado. ¡Comprobar la configuración!&lt;/b&gt;</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolCutMap</name>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="59"/>
-+ <source>do not translate</source>
-+ <translation>no traducir</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="114"/>
-+ <source>Output filename suffix</source>
-+ <translation>Sufijo del nombre de archivo resultante</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="133"/>
-+ <source>_cut</source>
-+ <translation>_cortar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="148"/>
-+ <source>Create overviews for result.</source>
-+ <translation>Crear niveles de zoom.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="176"/>
-+ <source>Start</source>
-+ <translation>Iniciar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="190"/>
-+ <source>Cancel</source>
-+ <translation>Cancelar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="201"/>
-+ <source>For all files</source>
-+ <translation>Para todos los archivos</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="226"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdalwarp&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>lt;b style=&apos;color: red;&apos;&gt; &quot;Gdalwarp&quot;no encontrado. ¡Comprobar la configuración!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolCutMap.ui" line="236"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt; &quot;Gdaladdo&quot;no encontrado ¡Comprobar la configuración!&lt;/b&gt;</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolExport</name>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="59"/>
-+ <location filename="../tool/IToolExport.ui" line="72"/>
-+ <source>do not translate</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="83"/>
-+ <source>Garmin BirdsEye (*.jnx)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="88"/>
-+ <source>TwoNav Raster (*.rmap)</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="101"/>
-+ <source>not implemented yet</source>
-+ <translation>Todavía no implementado</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="112"/>
-+ <source>Target File</source>
-+ <translation>Archivo de destino</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="130"/>
-+ <source>Start</source>
-+ <translation>Iniciar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="144"/>
-+ <source>Cancel</source>
-+ <translation>Cancelar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="173"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;qmt_map2jnx&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;qmt_map2jnx&quot; No encontrado. ¡Comprobar la configuración!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolExport.ui" line="184"/>
-+ <source>Target Filename</source>
-+ <translation>Nombre del archivo de destino</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolExportJnx</name>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="35"/>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="81"/>
-+ <source>BirdsEye</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="50"/>
-+ <source>Product ID</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="57"/>
-+ <source>Copyright notice</source>
-+ <translation>Aviso de copyright</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="64"/>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="95"/>
-+ <source>None</source>
-+ <translation>Ninguno</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="71"/>
-+ <source>Product name</source>
-+ <translation>Nombre del producto</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="88"/>
-+ <source>Description</source>
-+ <translation type="unfinished">Descripción</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="105"/>
-+ <source>JPEG</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="133"/>
-+ <source>Quality</source>
-+ <translation>Calidad</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="140"/>
-+ <source>Chroma subsampling</source>
-+ <translation>Submuestreo de Chroma</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="148"/>
-+ <source>411</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="153"/>
-+ <source>422</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="158"/>
-+ <source>444</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="169"/>
-+ <source>Device</source>
-+ <translation>Dispositivo</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/export/IToolExportJnx.ui" line="184"/>
-+ <source>Z-Order</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolGrid</name>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="56"/>
-+ <source>Grid Tool</source>
-+ <translation>Herramienta Cuadrícula</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="65"/>
-+ <source>do not translate</source>
-+ <translation>no traducir</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="99"/>
-+ <source>Ok</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="110"/>
-+ <source>Cancel</source>
-+ <translation>Cancelar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolGrid.ui" line="134"/>
-+ <source>Reset</source>
-+ <translation>Reiniciar</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolOverviewGroupBox</name>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="14"/>
-+ <source>GroupBox</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="71"/>
-+ <source>:2</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="78"/>
-+ <source>:4</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="85"/>
-+ <source>:8</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="92"/>
-+ <source>:16</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="99"/>
-+ <source>:32</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="106"/>
-+ <source>:64</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="119"/>
-+ <source>Do not copy the overviews into the file itself. Add them as external file.</source>
-+ <translation>No copiar los niveles de zoom en el mismo archivo, hacerlo en uno externo.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolOverviewGroupBox.ui" line="122"/>
-+ <source>Overview as external file</source>
-+ <translation>Niveles de zoom en archivo externo</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolPalettize</name>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="65"/>
-+ <location filename="../tool/IToolPalettize.ui" line="78"/>
-+ <source>do not translate</source>
-+ <translation>no traducir</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="96"/>
-+ <source>Single files, filename suffix</source>
-+ <translation>Archivos individuales, sufijo del nombre</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="109"/>
-+ <source>_8bit</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="123"/>
-+ <source>Combined file, filename:</source>
-+ <translation>Archivo combinado, nombre:</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="135"/>
-+ <source>Embed result into *.vrt file.</source>
-+ <translation>Insertar el resultado en un archivo *.vrt.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="142"/>
-+ <source>Create overviews for result.</source>
-+ <translation>Crear niveles de zoom.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="170"/>
-+ <source>Start</source>
-+ <translation>Iniciar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="184"/>
-+ <source>Cancel</source>
-+ <translation>Cancelar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="213"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;Gdaladdo&quot; no encontrado. ¡Comprobar la configuración!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="223"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdal_translate&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;Gdal_translate&quot; no encontrado. ¡Comprobar la configuración!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="233"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;qmt_rgb2pct&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;Qmt_rgb2pct&quot; no encontrado. ¡Comprobar la configuración!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolPalettize.ui" line="247"/>
-+ <source>Select filename</source>
-+ <translation>Seleccionar nombre de archivo</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IToolRefMap</name>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="14"/>
-+ <source>Form</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="59"/>
-+ <source>do not translate</source>
-+ <translation>no traducir</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="113"/>
-+ <source>Output filename suffix</source>
-+ <translation>Sufijo del nombre de archivo</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="132"/>
-+ <source>_ref</source>
-+ <translation type="unfinished"></translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="144"/>
-+ <source>Embed result into *.vrt file.</source>
-+ <translation>Insertar resultado en archivo *.vrt.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="151"/>
-+ <source>Create overviews for result.</source>
-+ <translation>Crear niveles de zoom.</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="179"/>
-+ <source>Start</source>
-+ <translation>Iniciar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="193"/>
-+ <source>Cancel</source>
-+ <translation>Cancelar</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="204"/>
-+ <source>For all files</source>
-+ <translation>Para todos los archivos</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="229"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdalwarp&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;Gdalwarp&quot; no encontrado. ¡Comprobar la configuración!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="239"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdal_translate&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;Gdal_translate&quot; no encontrado. ¡Comprobar la configuración!&lt;/b&gt;</translation>
-+ </message>
-+ <message>
-+ <location filename="../tool/IToolRefMap.ui" line="249"/>
-+ <source>&lt;b style=&apos;color: red;&apos;&gt;No &quot;gdaladdo&quot; found. Please check setup!&lt;/b&gt;</source>
-+ <translation>&lt;b style=&apos;color: red;&apos;&gt;&quot;Gdaladdo&quot; no encontrado. ¡Comprobar la configuración!&lt;/b&gt;</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IUnit</name>
-+ <message>
-+ <location filename="../units/IUnit.cpp" line="740"/>
-+ <location filename="../units/IUnit.cpp" line="746"/>
-+ <source>Error</source>
-+ <translation>Error</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnit.cpp" line="740"/>
-+ <source>Bad position format. Must be: &quot;[N|S] ddd mm.sss [W|E] ddd mm.sss&quot; or &quot;[N|S] ddd.ddd [W|E] ddd.ddd&quot;</source>
-+ <translation>Formato de posición incorrecto. Debe ser: &quot;[N|S] ddd mm.sss [W|E] ddd mm.sss&quot; or &quot;[N|S] ddd.ddd [W|E] ddd.ddd&quot;</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnit.cpp" line="746"/>
-+ <source>Position values out of bounds. </source>
-+ <translation>Valores de posición fuera de los límites.</translation>
-+ </message>
-+</context>
-+<context>
-+ <name>IUnitsSetup</name>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="14"/>
-+ <source>Setup units...</source>
-+ <translation>Configurar unidades...</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="24"/>
-+ <source>Nautical</source>
-+ <translation>Náutico</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="31"/>
-+ <source>Imperial</source>
-+ <translation>Imperial</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="38"/>
-+ <source>Metric</source>
-+ <translation>Métrico</translation>
-+ </message>
-+ <message>
-+ <location filename="../units/IUnitsSetup.ui" line="53"/>
-+ <source>&lt;b&gt;Note:&lt;/b&gt; For some GUI elements changing the units will not take effect until you restart QMapTool.</source>
-+ <translation>&lt;b&gt;Nota:&lt;/b&gt; El cambio de las unidades de algunos elementos no se producirá hasta el reinicio de QMapTool.</translation>
-+ </message>
-+</context>
-+</TS>
-diff --git a/src/qmaptool/main.cpp b/src/qmaptool/main.cpp
-new file mode 100644
-index 00000000..2d23b037
---- /dev/null
-+++ b/src/qmaptool/main.cpp
-@@ -0,0 +1,76 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "CMainWindow.h"
-+#include "CSingleInstanceProxy.h"
-+#include "setup/IAppSetup.h"
-+#include "version.h"
-+
-+#include <QApplication>
-+#include <QtWidgets>
-+
-+int main(int argc, char ** argv)
-+{
-+ QApplication app(argc, argv);
-+
-+ QCoreApplication::setApplicationName("QMapTool");
-+ QCoreApplication::setOrganizationName("QLandkarte");
-+ QCoreApplication::setOrganizationDomain("qlandkarte.org");
-+
-+ IAppSetup& env = IAppSetup::createInstance(qApp);
-+ env.processArguments();
-+ env.initLogHandler();
-+ env.initQMapTool();
-+
-+ // make sure this is the one and only instance on the system
-+ CSingleInstanceProxy s(qlOpts->arguments);
-+
-+ QSplashScreen *splash = nullptr;
-+ if (!qlOpts->nosplash)
-+ {
-+ QPixmap pic(":/pic/splash.png");
-+ QPainter p(&pic);
-+ QFont f = p.font();
-+ f.setBold(true);
-+
-+ p.setPen(Qt::black);
-+ p.setFont(f);
-+ p.drawText(260,195,"QMapTool, V " VER_STR);
-+
-+ splash = new QSplashScreen(pic);
-+#ifdef Q_OS_MAC
-+ // remove the splash screen flag on OS-X as workaround for the reported bug
-+ // https://bugreports.qt.io/browse/QTBUG-49576
-+ splash->setWindowFlags(splash->windowFlags() & (~Qt::SplashScreen));
-+#endif
-+ splash->show();
-+ }
-+
-+ CMainWindow w;
-+ w.show();
-+
-+ if(nullptr != splash)
-+ {
-+ splash->finish(&w);
-+ delete splash;
-+ }
-+
-+ return app.exec();
-+}
-+
-+
-diff --git a/src/qmaptool/overlay/COverlayCutMap.cpp b/src/qmaptool/overlay/COverlayCutMap.cpp
-new file mode 100644
-index 00000000..ec64e12a
---- /dev/null
-+++ b/src/qmaptool/overlay/COverlayCutMap.cpp
-@@ -0,0 +1,644 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/IDrawContext.h"
-+#include "helpers/CDraw.h"
-+#include "helpers/CSettings.h"
-+#include "items/CItemCutMap.h"
-+#include "overlay/COverlayCutMap.h"
-+
-+#include <functional>
-+#include <QtWidgets>
-+using std::bind;
-+
-+static inline qreal sqr(qreal a)
-+{
-+ return a*a;
-+}
-+
-+static inline qreal sqrlen(const QPointF &a)
-+{
-+ return sqr(a.x()) + sqr(a.y());
-+}
-+
-+
-+COverlayCutMap::COverlayCutMap(CItemCutMap *item, QStackedWidget *stackedWidget)
-+ : IOverlay(stackedWidget)
-+ , context(item->getDrawContext())
-+{
-+ setupUi(this);
-+
-+ QFileInfo fi(item->getFilename());
-+ shapeFilename = fi.completeBaseName() + ".shp";
-+
-+ connect(toolNone, &QToolButton::clicked, this, bind(&COverlayCutMap::slotSetMode, this, eModeNone, std::placeholders::_1));
-+ connect(toolPointMove, &QToolButton::clicked, this, bind(&COverlayCutMap::slotSetMode, this, eModePointMove, std::placeholders::_1));
-+ connect(toolPointAdd, &QToolButton::clicked, this, bind(&COverlayCutMap::slotSetMode, this, eModePointAdd, std::placeholders::_1));
-+ connect(toolPointDel, &QToolButton::clicked, this, bind(&COverlayCutMap::slotSetMode, this, eModePointDel, std::placeholders::_1));
-+ connect(toolPointDelAll, &QToolButton::clicked, this, &COverlayCutMap::slotResetMask);
-+ connect(toolLoadShape, &QToolButton::clicked, this, &COverlayCutMap::slotLoadShape);
-+ connect(toolSaveShape, &QToolButton::clicked, this, &COverlayCutMap::slotSaveShape);
-+}
-+
-+void COverlayCutMap::saveSettings(QSettings& cfg)
-+{
-+ cfg.setValue("region", region);
-+}
-+
-+void COverlayCutMap::loadSettings(QSettings& cfg)
-+{
-+ region = (cfg.value("region", QPolygonF()).value<QPolygonF>());
-+
-+ updateGui();
-+}
-+
-+
-+bool COverlayCutMap::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ if(region.isEmpty())
-+ {
-+ return true;
-+ }
-+
-+ QPolygonF shape = region;
-+ context->convertMap2Screen(shape);
-+
-+ if(shape.size() > 2)
-+ {
-+ QPainterPath path;
-+
-+ QRectF rectMap = context->getMapArea();
-+ context->convertMap2Screen(rectMap);
-+
-+ path.addRect(rectMap);
-+ path.addPolygon(shape);
-+
-+ p.setPen(QPen(Qt::darkBlue,1));
-+
-+ p.setBrush((idxFocus1 == NOIDX) ? Qt::BDiagPattern : Qt::NoBrush);
-+ p.drawPath(path);
-+ }
-+
-+ QRectF dot1(0,0,5,5);
-+ QRectF dot2(0,0,7,7);
-+ const QPointF& pt1 = idxFocus1 != NOIDX ? shape[idxFocus1] : NOPOINTF;
-+ const QPointF& pt2 = idxFocus2 != NOIDX ? shape[idxFocus2] : NOPOINTF;
-+
-+ // draw black dots for each point in region
-+ p.setPen(QPen(Qt::black, 1));
-+ p.setBrush(Qt::black);
-+ for(const QPointF& pt : shape)
-+ {
-+ if(pt == pt1)
-+ {
-+ continue;
-+ }
-+ dot1.moveCenter(pt);
-+ p.drawRect(dot1);
-+ }
-+
-+ // if just one dot is selected draw crosshair
-+ if((idxFocus2 == NOIDX) && (idxFocus1 != NOIDX))
-+ {
-+ CDraw::drawCrossHairDot(p, pt1);
-+ }
-+ else if((idxFocus2 != NOIDX) && (idxFocus1 == NOIDX))
-+ {
-+ CDraw::drawCrossHairDot(p, pt2);
-+ }
-+ // if both points are selected highlight segment
-+ else if((idxFocus2 != NOIDX) && (idxFocus1 != NOIDX))
-+ {
-+ p.setPen(QPen(Qt::red, 2));
-+ p.setBrush(Qt::red);
-+
-+ dot2.moveCenter(pt1);
-+ p.drawRect(dot2);
-+ dot2.moveCenter(pt2);
-+ p.drawRect(dot2);
-+ p.drawLine(pt1, pt2);
-+ }
-+ return true;
-+}
-+
-+void COverlayCutMap::mouseMoveEventFx(QMouseEvent *e)
-+{
-+ QPointF pt = e->pos();
-+ context->convertScreen2Map(pt);
-+
-+ switch(mode)
-+ {
-+ case eModePointMove:
-+ mouseMovePointMove(pt);
-+ break;
-+
-+ case eModePointAdd:
-+ mouseMovePointAdd(pt);
-+ break;
-+
-+ case eModePointDel:
-+ mouseMovePointDel(pt);
-+ break;
-+
-+ default:
-+ return;
-+ }
-+
-+ updateGui();
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+}
-+
-+void COverlayCutMap::mouseReleaseEventFx(QMouseEvent *e)
-+{
-+ QPointF pt = e->pos();
-+ context->convertScreen2Map(pt);
-+
-+ Qt::MouseButton button = e->button();
-+
-+ switch(mode)
-+ {
-+ case eModePointMove:
-+ mouseReleasePointMove(pt, button);
-+ break;
-+
-+ case eModePointAdd:
-+ mouseReleasePointAdd(pt, button);
-+ break;
-+
-+ case eModePointDel:
-+ mouseReleasePointDel(pt, button);
-+ break;
-+
-+ default:
-+ return;
-+ }
-+
-+ updateGui();
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+}
-+
-+QCursor COverlayCutMap::getCursorFx()
-+{
-+ switch(mode)
-+ {
-+ case eModePointAdd:
-+ return QCursor(QPixmap(":/cursors/cursorPointAdd.png"), 0, 0);
-+
-+ case eModePointDel:
-+ return QCursor(QPixmap(":/cursors/cursorPointDel.png"), 0, 0);
-+
-+ case eModePointMove:
-+ return QCursor(QPixmap(":/cursors/cursorPointMove.png"), 0, 0);
-+ }
-+
-+ return Qt::ArrowCursor;
-+}
-+
-+void COverlayCutMap::slotSetMode(mode_e m, bool on)
-+{
-+ if(on)
-+ {
-+ mode = m;
-+ }
-+}
-+
-+void COverlayCutMap::slotResetMask()
-+{
-+ int res = QMessageBox::question(this, tr("Delete mask..."), tr("Are you sure to delete complete mask?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
-+ if(res != QMessageBox::Yes)
-+ {
-+ return;
-+ }
-+
-+ mouseReset();
-+ region.clear();
-+ storeToHistory(region);
-+ updateGui();
-+}
-+
-+void COverlayCutMap::slotSaveShape()
-+{
-+ SETTINGS;
-+ QString path = cfg.value("Path/shapeInput", QDir::homePath()).toString();
-+
-+ QString filename = QFileDialog::getSaveFileName(&CMainWindow::self(), tr("Save mask..."), path + "/" + shapeFilename, "Shape file (*.shp)");
-+ if(filename.isEmpty())
-+ {
-+ return;
-+ }
-+ cfg.setValue("Path/shapeInput", QFileInfo(shapeFilename).absolutePath());
-+
-+ if(region.isEmpty())
-+ {
-+ return;
-+ }
-+ shapeFilename = filename;
-+ saveShape(filename);
-+}
-+
-+void COverlayCutMap::saveShape(const QString& filename)
-+{
-+ const QPolygonF& line = region;
-+
-+ QFile file(filename);
-+ file.open(QIODevice::WriteOnly);
-+ QTextStream out(&file);
-+
-+ out << "id,WKT" << endl;
-+ out << "1,\"POLYGON((";
-+
-+ bool first = true;
-+ for(const QPointF& pt : line)
-+ {
-+ QPointF pt1 = pt;
-+ context->convertMap2Coord(pt1);
-+
-+ if(!first)
-+ {
-+ out << ", ";
-+ }
-+ first = false;
-+
-+ out << qRound(pt1.x()) << " " << qRound(pt1.y());
-+ }
-+ out << "))\"" << endl;
-+}
-+
-+void COverlayCutMap::slotLoadShape()
-+{
-+ SETTINGS;
-+ QString path = cfg.value("Path/shapeInput", QDir::homePath()).toString();
-+
-+ QString filename = QFileDialog::getOpenFileName(&CMainWindow::self(), tr("Load mask..."), path, "Shape file (*.shp)");
-+ if(filename.isEmpty())
-+ {
-+ return;
-+ }
-+ cfg.setValue("Path/shapeInput", QFileInfo(filename).absolutePath());
-+
-+ QFile file(filename);
-+ file.open(QIODevice::ReadOnly);
-+ QTextStream in(&file);
-+
-+ QString line = in.readLine().simplified();
-+ if(line != "id,WKT")
-+ {
-+ QMessageBox::warning(&CMainWindow::self(), tr("Failed..."), tr("Not a shape file."), QMessageBox::Abort);
-+ return;
-+ }
-+
-+ while(!in.atEnd())
-+ {
-+ QString line = in.readLine().simplified();
-+ if(line.startsWith("1,\"POLYGON(("))
-+ {
-+ region.clear();
-+
-+ line = line.mid(12);
-+ QTextStream in2(&line, QIODevice::ReadOnly);
-+
-+ while(!in2.atEnd())
-+ {
-+ qreal x, y;
-+ in2 >> x >> y;
-+
-+ QPointF pt(x,y);
-+ context->convertCoord2Map(pt);
-+
-+ region << pt;
-+
-+ QString str;
-+ in2 >> str;
-+ if(str != ",")
-+ {
-+ break;
-+ }
-+ }
-+ }
-+ }
-+
-+ updateGui();
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+ emit sigChanged();
-+}
-+
-+void COverlayCutMap::mouseReset()
-+{
-+ addPoint = false;
-+ movePoint = false;
-+ idxFocus1 = NOIDX;
-+ idxFocus1 = NOIDX;
-+}
-+
-+void COverlayCutMap::abortStep()
-+{
-+ if(addPoint)
-+ {
-+ restoreFromHistory(region);
-+ addPoint = false;
-+ idxFocus1 = NOIDX;
-+ idxFocus2 = NOIDX;
-+ }
-+ else if(movePoint)
-+ {
-+ restoreFromHistory(region);
-+ movePoint = false;
-+ idxFocus1 = NOIDX;
-+ }
-+
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+}
-+
-+void COverlayCutMap::restoreFromHistory(QPolygonF& line)
-+{
-+ line = history[idxHistory];
-+ emit sigChanged();
-+}
-+
-+void COverlayCutMap::storeToHistory(const QPolygonF& line)
-+{
-+ // crop history if necessary
-+ if(idxHistory != NOIDX)
-+ {
-+ while(history.size() > (idxHistory + 1))
-+ {
-+ history.pop_back();
-+ }
-+ }
-+
-+ history << line;
-+ idxHistory = history.size() - 1;
-+
-+ emit sigChanged();
-+}
-+
-+void COverlayCutMap::isCloseTo(QPointF pt, QPolygonF line, qint32& idx) const
-+{
-+ idx = NOIDX;
-+
-+ context->convertMap2Screen(pt);
-+ context->convertMap2Screen(line);
-+
-+ if(line.isEmpty())
-+ {
-+ return;
-+ }
-+
-+ qint32 min = 30;
-+ const int N = region.size();
-+ for(int i = 0; i < N; i++)
-+ {
-+ qint32 d = (pt - line[i]).manhattanLength();
-+ if(d < min)
-+ {
-+ min = d;
-+ idx = i;
-+ }
-+ }
-+}
-+
-+void COverlayCutMap::isCloseToLine(QPointF pt, QPolygonF line, qint32& idx1, qint32& idx2) const
-+{
-+ idx1 = NOIDX;
-+ idx2 = NOIDX;
-+
-+ context->convertMap2Screen(pt);
-+ context->convertMap2Screen(line);
-+
-+ const int count = line.size();
-+ if(count < 2)
-+ {
-+ return;
-+ }
-+
-+ QPointF b = line[0];
-+ QPointF dbq = b - pt;
-+ qreal dist = 30*30;
-+
-+ for (qint32 i = 1; i < count; ++i)
-+ {
-+ const QPointF a = b;
-+ const QPointF daq = dbq;
-+ b = line[i];
-+ dbq = b - pt;
-+
-+ const QPointF dab = a - b;
-+
-+ const qreal inv_sqrlen = 1./sqrlen(dab);
-+ const qreal t = (dab.x()*daq.x() + dab.y()*daq.y())*inv_sqrlen;
-+ if (t < 0.)
-+ {
-+ continue;
-+ }
-+ qreal current_dist;
-+ if (t <= 1.)
-+ {
-+ current_dist = sqr(dab.x()*dbq.y() - dab.y()*dbq.x())*inv_sqrlen;
-+ }
-+ else//t>1.
-+ {
-+ current_dist = sqrlen(dbq);
-+ }
-+
-+ if (current_dist < dist)
-+ {
-+ dist = current_dist;
-+ idx1 = i - 1;
-+ idx2 = i;
-+ }
-+ }
-+}
-+
-+
-+void COverlayCutMap::mouseMovePointAdd(const QPointF &pt)
-+{
-+ if(region.isEmpty())
-+ {
-+ return;
-+ }
-+
-+ if(addPoint)
-+ {
-+ region[idxFocus1] = pt;
-+ }
-+ else
-+ {
-+ // find line segment close to cursor
-+ isCloseToLine(pt, region, idxFocus1, idxFocus2);
-+ }
-+}
-+
-+void COverlayCutMap::mouseReleasePointAdd(const QPointF &pt, Qt::MouseButton button)
-+{
-+ if(button == Qt::LeftButton)
-+ {
-+ if(addPoint)
-+ {
-+ // if isPoint is true the line has been appended/prepended
-+ // in this case go on with adding another point
-+ if(idxFocus1 == (region.size() - 1))
-+ {
-+ idxFocus1++;
-+ }
-+ // store current state of line to undo/redo history
-+ storeToHistory(region);
-+ region.insert(idxFocus1, pt);
-+ }
-+ else if(idxFocus1 != NOIDX)
-+ {
-+ // add a new point to line segment
-+ idxFocus2 = NOIDX;
-+ idxFocus1++;
-+ region.insert(idxFocus1, pt);
-+ addPoint = true;
-+ CCanvas::setOverrideCursor(Qt::BlankCursor, "COverlayCutMap::mouseReleasePointAdd");
-+ }
-+ else if(region.isEmpty())
-+ {
-+ region.append(pt);
-+ storeToHistory(region);
-+ region.append(pt);
-+ region.append(pt);
-+ idxFocus1 = 1;
-+ addPoint = true;
-+ CCanvas::setOverrideCursor(Qt::BlankCursor, "COverlayCutMap::mouseReleasePointAdd");
-+ }
-+ }
-+ else if(button == Qt::RightButton)
-+ {
-+ CCanvas::restoreOverrideCursor("COverlayCutMap::mouseReleasePointAdd");
-+ if(!addPoint)
-+ {
-+ toolNone->click();
-+ }
-+ abortStep();
-+ }
-+}
-+
-+void COverlayCutMap::mouseMovePointDel(const QPointF &pt)
-+{
-+ isCloseTo(pt, region, idxFocus1);
-+}
-+
-+void COverlayCutMap::mouseReleasePointDel(const QPointF &pt, Qt::MouseButton button)
-+{
-+ if((idxFocus1 != NOIDX) && (button == Qt::LeftButton))
-+ {
-+ //special case first or last point.
-+ if((idxFocus1 == 0) || (idxFocus1 == (region.size() - 1)))
-+ {
-+ if(region.size() > 2)
-+ {
-+ // more than one point set
-+ region.pop_back();
-+ region.pop_front();
-+ }
-+ else
-+ {
-+ // remove last point
-+ region.clear();
-+ }
-+
-+ // close polygon area by appending the first point
-+ if(!region.isEmpty())
-+ {
-+ region << region.first();
-+ }
-+ }
-+ else
-+ {
-+ region.remove(idxFocus1);
-+ }
-+ storeToHistory(region);
-+ }
-+ else if(button == Qt::RightButton)
-+ {
-+ CCanvas::restoreOverrideCursor("COverlayCutMap::mouseReleasePointDel");
-+ toolNone->click();
-+ }
-+ idxFocus1 = NOIDX;
-+}
-+
-+void COverlayCutMap::mouseMovePointMove(const QPointF &pt)
-+{
-+ if(movePoint)
-+ {
-+ if((idxFocus1 == 0) || (idxFocus1 == (region.size() - 1)))
-+ {
-+ region.first() = pt;
-+ region.last() = pt;
-+ }
-+ else
-+ {
-+ region[idxFocus1] = pt;
-+ }
-+ }
-+ else
-+ {
-+ // no point selected yet, find point to highlight
-+ isCloseTo(pt, region, idxFocus1);
-+ }
-+}
-+
-+void COverlayCutMap::mouseReleasePointMove(const QPointF &pt, Qt::MouseButton button)
-+{
-+ if(button == Qt::LeftButton)
-+ {
-+ if(movePoint)
-+ {
-+ // terminate moving the point
-+ movePoint = false;
-+ // store new state of line to undo/redo history
-+ storeToHistory(region);
-+ CCanvas::restoreOverrideCursor("COverlayCutMap::mouseReleasePointAdd");
-+ }
-+ else if(idxFocus1 != NOIDX)
-+ {
-+ if((idxFocus1 == 0) || (idxFocus1 == (region.size() - 1)))
-+ {
-+ region.first() = pt;
-+ region.last() = pt;
-+ }
-+ else
-+ {
-+ region[idxFocus1] = pt;
-+ }
-+
-+ movePoint = true;
-+ CCanvas::setOverrideCursor(Qt::BlankCursor, "COverlayCutMap::mouseReleasePointMove");
-+ }
-+ }
-+ else if(button == Qt::RightButton)
-+ {
-+ CCanvas::restoreOverrideCursor("COverlayCutMap::mouseReleasePointMove");
-+ if(!movePoint)
-+ {
-+ toolNone->click();
-+ }
-+ abortStep();
-+ }
-+}
-+
-+void COverlayCutMap::updateGui()
-+{
-+ bool enable = !region.isEmpty();
-+ toolPointMove->setEnabled(enable);
-+ toolPointDel->setEnabled(enable);
-+ toolPointDelAll->setEnabled(enable);
-+ toolSaveShape->setEnabled(enable);
-+}
-diff --git a/src/qmaptool/overlay/COverlayCutMap.h b/src/qmaptool/overlay/COverlayCutMap.h
-new file mode 100644
-index 00000000..8938f006
---- /dev/null
-+++ b/src/qmaptool/overlay/COverlayCutMap.h
-@@ -0,0 +1,105 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef COVERLAYCUTMAP_H
-+#define COVERLAYCUTMAP_H
-+
-+#include "canvas/CCanvas.h"
-+#include "overlay/IOverlay.h"
-+#include "ui_IOverlayCutMap.h"
-+#include "units/IUnit.h"
-+
-+
-+class QStackedWidget;
-+class IDrawContext;
-+class QSettings;
-+class CItemCutMap;
-+
-+class COverlayCutMap : public IOverlay, private Ui::IOverlayCutMap
-+{
-+ Q_OBJECT
-+public:
-+ COverlayCutMap(CItemCutMap *item, QStackedWidget * stackedWidget);
-+ virtual ~COverlayCutMap() = default;
-+
-+ void saveSettings(QSettings& cfg);
-+ void loadSettings(QSettings& cfg);
-+
-+ bool drawFx(QPainter& p, CCanvas::redraw_e needsRedraw);
-+ void mouseMoveEventFx(QMouseEvent *e);
-+ void mouseReleaseEventFx(QMouseEvent *e);
-+ QCursor getCursorFx();
-+
-+ void abortStep();
-+
-+ enum mode_e
-+ {
-+ eModeNone
-+ ,eModePointMove
-+ ,eModePointAdd
-+ ,eModePointDel
-+ };
-+
-+ void saveShape(const QString& filename);
-+
-+ bool isOk() const
-+ {
-+ return !region.isEmpty();
-+ }
-+
-+private slots:
-+ void slotSetMode(mode_e m, bool on);
-+ void slotResetMask();
-+ void slotSaveShape();
-+ void slotLoadShape();
-+
-+private:
-+ void restoreFromHistory(QPolygonF& line);
-+ void storeToHistory(const QPolygonF& line);
-+ void isCloseTo(QPointF pt, QPolygonF line, qint32& idx) const;
-+ void isCloseToLine(QPointF pt, QPolygonF line, qint32 &idx1, qint32 &idx2) const;
-+ void mouseReset();
-+
-+ void mouseMovePointAdd(const QPointF &pt);
-+ void mouseMovePointDel(const QPointF &pt);
-+ void mouseMovePointMove(const QPointF &pt);
-+
-+ void mouseReleasePointAdd(const QPointF &pt, Qt::MouseButton button);
-+ void mouseReleasePointDel(const QPointF &pt, Qt::MouseButton button);
-+ void mouseReleasePointMove(const QPointF &pt, Qt::MouseButton button);
-+
-+ void updateGui();
-+
-+ IDrawContext* context;
-+
-+ mode_e mode = eModeNone;
-+ QPolygonF region;
-+
-+ qint32 idxFocus1 = NOIDX;
-+ qint32 idxFocus2 = NOIDX;
-+ bool addPoint = false;
-+ bool movePoint = false;
-+
-+ QList<QPolygonF> history;
-+ qint32 idxHistory = NOIDX;
-+
-+ QString shapeFilename;
-+};
-+
-+#endif //COVERLAYCUTMAP_H
-+
-diff --git a/src/qmaptool/overlay/COverlayGridTool.cpp b/src/qmaptool/overlay/COverlayGridTool.cpp
-new file mode 100644
-index 00000000..7a0fa26e
---- /dev/null
-+++ b/src/qmaptool/overlay/COverlayGridTool.cpp
-@@ -0,0 +1,348 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/IDrawContext.h"
-+#include "CMainWindow.h"
-+#include "helpers/CSettings.h"
-+#include "items/CItemRefMap.h"
-+#include "overlay/COverlayGridTool.h"
-+#include "overlay/refmap/COverlayRefMapPoint.h"
-+#include "overlay/refmap/CProjWizard.h"
-+
-+#include <proj_api.h>
-+#include <QtWidgets>
-+
-+COverlayGridTool::COverlayGridTool(QWidget *parent)
-+ : QWidget(parent)
-+{
-+ setupUi(this);
-+ labelFinal->setText(tr("Before you proceed with 'ok':\n"
-+ "Please cross check all data once again. A bad reference coordinate will ruin "
-+ "all the work. Also cross check if the selected area contains as many reference "
-+ "points as possible at the border. You can easily delete points outside the map "
-+ "in the Reference Tool. But it's much more effort to set additional points in "
-+ "case you miss some. When you are done press 'ok' to transfer the derived "
-+ "reference points to the Reference Tool.\n\n"
-+ "The next step will be to use the Reference Tool to adjust the position of all "
-+ "reference points to the real grid position on the map."));
-+
-+ connect(CMainWindow::self().showToolHelp(), &QAction::toggled, labelFinal, &QLabel::setVisible);
-+
-+ QButtonGroup * group = new QButtonGroup(this);
-+ group->addButton(radioSetRef);
-+ group->addButton(radioGridPlacer);
-+ group->addButton(radioSelectArea);
-+
-+
-+ connect(radioSetRef, &QRadioButton::toggled, widgetSetRef, &QFrame::setEnabled);
-+ connect(radioGridPlacer, &QRadioButton::toggled, widgetGridPlacer, &CGridPlacer::setEnabled);
-+ connect(radioSelectArea, &QRadioButton::toggled, widgetSelectArea, &QLabel::setEnabled);
-+
-+
-+ connect(widgetSetRef, &CGridSetRef::sigChanged, this, &COverlayGridTool::slotCalculate);
-+ connect(widgetSetRef, &CGridSetRef::sigChanged, this, &COverlayGridTool::slotCheckInput);
-+
-+ connect(widgetGridPlacer, &CGridPlacer::sigChanged, this, &COverlayGridTool::slotCheckInput);
-+ connect(widgetGridPlacer, &CGridPlacer::sigSetArea, this, &COverlayGridTool::slotSetArea);
-+ connect(widgetGridPlacer, &CGridPlacer::sigChanged, this, &COverlayGridTool::slotCalculate);
-+
-+ connect(widgetSelectArea, &CGridSelArea::sigChanged, this, &COverlayGridTool::slotCalculate);
-+ connect(widgetSelectArea, &CGridSelArea::sigChanged, this, &COverlayGridTool::slotCheckInput);
-+}
-+
-+void COverlayGridTool::slotReset()
-+{
-+ widgetSetRef->slotReset();
-+ widgetGridPlacer->slotReset();
-+ widgetSelectArea->slotReset();
-+
-+ radioSetRef->setChecked(true);
-+
-+ SETTINGS;
-+ cfg.beginGroup("GridTool");
-+ cfg.remove("");
-+ cfg.endGroup();
-+ cfg.sync();
-+}
-+
-+void COverlayGridTool::registerItem(CItemRefMap * item)
-+{
-+ this->item = item;
-+ if(item != nullptr)
-+ {
-+ context = item->getDrawContext();
-+ if(context == nullptr)
-+ {
-+ this->item = nullptr;
-+ }
-+ }
-+ else
-+ {
-+ context = nullptr;
-+ }
-+
-+
-+ widgetGridPlacer->registerItem(this->item);
-+ widgetSelectArea->registerItem(this->item);
-+
-+ radioSetRef->setChecked(true);
-+
-+ SETTINGS;
-+ cfg.beginGroup("GridTool");
-+ if(this->item != nullptr)
-+ {
-+ widgetSetRef->loadSettings(cfg);
-+ widgetGridPlacer->loadSettings(cfg);
-+ widgetSelectArea->loadSettings(cfg);
-+ }
-+ else
-+ {
-+ cfg.remove("");
-+
-+ widgetSetRef->saveSettings(cfg);
-+ widgetGridPlacer->saveSettings(cfg);
-+ widgetSelectArea->saveSettings(cfg);
-+ }
-+ cfg.endGroup();
-+
-+ slotCheckInput();
-+}
-+
-+
-+void COverlayGridTool::slotCheckInput()
-+{
-+ bool group1Ok = widgetSetRef->isOk();
-+ radioGridPlacer->setEnabled(group1Ok);
-+
-+ bool group2Ok = widgetGridPlacer->isOk();
-+ radioSelectArea->setEnabled(group2Ok&& group1Ok);
-+
-+ const QPointF& p1 = widgetGridPlacer->getPoint(0);
-+ const QPointF& p2 = widgetGridPlacer->getPoint(1);
-+ const QPointF& p3 = widgetGridPlacer->getPoint(2);
-+ const QPointF& p4 = widgetGridPlacer->getPoint(3);
-+ const QRectF& area = widgetSelectArea->getArea();
-+
-+ bool group3Ok = true;
-+ group3Ok &= !area.isEmpty();
-+ group3Ok &= area.isValid();
-+ group3Ok &= !area.isNull();
-+ group3Ok &= area.contains(p1);
-+ group3Ok &= area.contains(p2);
-+ group3Ok &= area.contains(p3);
-+ group3Ok &= area.contains(p4);
-+
-+ labelFinal->setEnabled(group1Ok && group2Ok && group3Ok);
-+
-+ emit sigChanged(group1Ok && group2Ok && group3Ok);
-+}
-+
-+bool COverlayGridTool::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ if(radioSelectArea->isEnabled())
-+ {
-+ widgetSelectArea->drawFx(p, needsRedraw);
-+
-+ QRectF dot1(0,0,7,7);
-+ p.setPen(QPen(Qt::white, 1));
-+ p.setBrush(Qt::darkGreen);
-+
-+ for(COverlayRefMapPoint * point : refPoints)
-+ {
-+ QPointF pt = point->getPtPtx();
-+ context->convertMap2Screen(pt);
-+ dot1.moveCenter(pt);
-+ p.drawRect(dot1);
-+ }
-+ }
-+
-+ widgetGridPlacer->drawFx(p, needsRedraw);
-+ return false;
-+}
-+
-+void COverlayGridTool::mouseMoveEventFx(QMouseEvent *e)
-+{
-+ if(radioGridPlacer->isChecked())
-+ {
-+ widgetGridPlacer->mouseMoveEventFx(e);
-+ }
-+ else if(radioSelectArea->isChecked())
-+ {
-+ widgetSelectArea->mouseMoveEventFx(e);
-+ }
-+}
-+
-+void COverlayGridTool::mouseReleaseEventFx(QMouseEvent *e)
-+{
-+ if(radioGridPlacer->isChecked())
-+ {
-+ widgetGridPlacer->mouseReleaseEventFx(e);
-+ }
-+ else if(radioSelectArea->isChecked())
-+ {
-+ widgetSelectArea->mouseReleaseEventFx(e);
-+ }
-+}
-+
-+void COverlayGridTool::leaveEventFx(QEvent *e)
-+{
-+ if(radioGridPlacer->isChecked())
-+ {
-+ widgetGridPlacer->leaveEventFx(e);
-+ }
-+ else if(radioSelectArea->isChecked())
-+ {
-+ widgetSelectArea->leaveEventFx(e);
-+ }
-+}
-+
-+QCursor COverlayGridTool::getCursorFx()
-+{
-+ if(radioGridPlacer->isChecked())
-+ {
-+ return widgetGridPlacer->getCursorFx();
-+ }
-+ else if(radioSelectArea->isChecked())
-+ {
-+ return widgetSelectArea->getCursorFx();
-+ }
-+ else
-+ {
-+ return Qt::ArrowCursor;
-+ }
-+}
-+
-+
-+void COverlayGridTool::slotSetArea(const QRectF& rect)
-+{
-+ qreal hspace = rect.width() / 2;
-+ qreal vspace = rect.height() / 2;
-+ QRectF area = rect;
-+
-+ area.setTopLeft(rect.topLeft() - QPointF(hspace, vspace));
-+ area.setBottomRight(rect.bottomRight() + QPointF(hspace, vspace));
-+
-+ widgetSelectArea->slotSetArea(area);
-+ radioSelectArea->setChecked(true);
-+}
-+
-+void COverlayGridTool::slotCalculate()
-+{
-+ if(!radioSelectArea->isEnabled())
-+ {
-+ return;
-+ }
-+
-+ qDeleteAll(refPoints);
-+ refPoints.clear();
-+
-+ projPJ pjsrc = pj_init_plus(widgetSetRef->getProjection().toLatin1());
-+ if(pjsrc == nullptr)
-+ {
-+ return;
-+ }
-+
-+ projPJ pjtar = pj_init_plus("+proj=longlat +datum=WGS84 +no_defs");
-+ if(pjtar == nullptr)
-+ {
-+ pj_free(pjsrc);
-+ return;
-+ }
-+
-+ const QRectF& area = widgetSelectArea->getArea();
-+
-+ const QPointF& ptTopLeft = widgetGridPlacer->getPoint(0);
-+ const QPointF& ptTopRight = widgetGridPlacer->getPoint(1);
-+ const QPointF& ptBottomRight = widgetGridPlacer->getPoint(2);
-+ const QPointF& ptBottomLeft = widgetGridPlacer->getPoint(3);
-+
-+ qreal dx11 = ptTopRight.x() - ptTopLeft.x();
-+ qreal dy11 = ptTopRight.y() - ptTopLeft.y();
-+ qreal dx12 = ptBottomRight.x() - ptBottomLeft.x();
-+ qreal dy12 = ptBottomRight.y() - ptBottomLeft.y();
-+ qreal dx1 = (dx11 + dx12) / 2;
-+ qreal dy1 = (dy11 + dy12) / 2;
-+
-+ qreal alpha = qAtan(dy1/dx1);
-+ qreal distx = qSqrt(dx1*dx1 + dy1*dy1);
-+
-+ qreal dx21 = ptBottomLeft.x() - ptTopLeft.x();
-+ qreal dy21 = ptBottomLeft.y() - ptTopLeft.y();
-+ qreal dx22 = ptBottomRight.x() - ptTopRight.x();
-+ qreal dy22 = ptBottomRight.y() - ptTopRight.y();
-+ qreal dx2 = (dx21 + dx22) / 2;
-+ qreal dy2 = (dy21 + dy22) / 2;
-+
-+ qreal disty = qSqrt(dx2*dx2 + dy2*dy2);
-+
-+ QMatrix translationMatrix(1, 0, 0, 1, ptTopLeft.x(), ptTopLeft.y());
-+ QMatrix rotationMatrix(qCos(alpha), qSin(alpha), -qSin(alpha), qCos(alpha), 0, 0);
-+ QMatrix scalingMatrix(distx, 0, 0, disty, 0, 0);
-+
-+ // forward matrix index -> map pixel coord
-+ QMatrix mxFwd = scalingMatrix * rotationMatrix * translationMatrix;
-+ // backward matrix map pixel coord -> index
-+ QMatrix mxBwd = mxFwd.inverted();
-+
-+ QPointF tl = mxBwd.map(area.topLeft());
-+ QPointF br = mxBwd.map(area.bottomRight());
-+
-+ int xMin = qCeil(tl.x()) - 1;
-+ int yMin = qCeil(tl.y()) - 1;
-+
-+ int xMax = qCeil(br.x()) + 1;
-+ int yMax = qCeil(br.y()) + 1;
-+
-+ qreal lonRef = widgetSetRef->getEasting();
-+ qreal latRef = widgetSetRef->getNorthing();
-+ qreal dLon = widgetSetRef->getHorizSpacing();
-+ qreal dLat = widgetSetRef->getVertSpacing();
-+
-+ bool isLonLat = pj_is_latlong(pjsrc);
-+
-+ for(int y = yMin; y < yMax; y++)
-+ {
-+ for(int x = xMin; x < xMax; x++)
-+ {
-+ QPointF ptPtx = mxFwd.map(QPointF(x,y));
-+ if(area.contains(ptPtx))
-+ {
-+ ptPtx.rx() = qRound(ptPtx.x());
-+ ptPtx.ry() = qRound(ptPtx.y());
-+
-+ qreal lat = latRef - y * dLat;
-+ qreal lon = lonRef + x * dLon;
-+
-+ if(isLonLat)
-+ {
-+ lon *= DEG_TO_RAD;
-+ lat *= DEG_TO_RAD;
-+ }
-+
-+ pj_transform(pjsrc, pjtar, 1, 0, &lon, &lat, 0);
-+ lon *= RAD_TO_DEG;
-+ lat *= RAD_TO_DEG;
-+
-+ refPoints << new COverlayRefMapPoint(0, QPointF(lon,lat), ptPtx, nullptr);
-+ }
-+ }
-+ }
-+
-+ pj_free(pjsrc);
-+ pj_free(pjtar);
-+}
-diff --git a/src/qmaptool/overlay/COverlayGridTool.h b/src/qmaptool/overlay/COverlayGridTool.h
-new file mode 100644
-index 00000000..f50b22f1
---- /dev/null
-+++ b/src/qmaptool/overlay/COverlayGridTool.h
-@@ -0,0 +1,68 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef COVERLAYGRIDTOOL_H
-+#define COVERLAYGRIDTOOL_H
-+
-+#include "canvas/CCanvas.h"
-+#include "ui_IOverlayGridTool.h"
-+
-+class CItemRefMap;
-+class COverlayRefMapPoint;
-+
-+class COverlayGridTool : public QWidget, private Ui::IOverlayGridTool
-+{
-+ Q_OBJECT
-+public:
-+ COverlayGridTool(QWidget * parent);
-+ virtual ~COverlayGridTool() = default;
-+
-+ bool drawFx(QPainter& p, CCanvas::redraw_e needsRedraw);
-+ void mouseMoveEventFx(QMouseEvent *e);
-+ void mouseReleaseEventFx(QMouseEvent *e);
-+ void leaveEventFx(QEvent *e);
-+ QCursor getCursorFx();
-+
-+ void registerItem(CItemRefMap * item);
-+
-+ QList<COverlayRefMapPoint*>& getRefPoints()
-+ {
-+ return refPoints;
-+ }
-+
-+signals:
-+ void sigChanged(bool ok);
-+
-+public slots:
-+ void slotReset();
-+
-+private slots:
-+ void slotCheckInput();
-+ void slotSetArea(const QRectF& rect);
-+ void slotCalculate();
-+
-+private:
-+
-+ CItemRefMap * item = nullptr;
-+ const IDrawContext * context = nullptr;
-+
-+ QList<COverlayRefMapPoint*> refPoints;
-+};
-+
-+#endif //COVERLAYGRIDTOOL_H
-+
-diff --git a/src/qmaptool/overlay/COverlayRefMap.cpp b/src/qmaptool/overlay/COverlayRefMap.cpp
-new file mode 100644
-index 00000000..0afc882c
---- /dev/null
-+++ b/src/qmaptool/overlay/COverlayRefMap.cpp
-@@ -0,0 +1,747 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/IDrawContext.h"
-+#include "helpers/CDraw.h"
-+#include "helpers/CSettings.h"
-+#include "items/CItemRefMap.h"
-+#include "overlay/COverlayRefMap.h"
-+#include "overlay/refmap/CDialogRefPoint.h"
-+#include "overlay/refmap/COverlayRefMapPoint.h"
-+#include "overlay/refmap/CProjWizard.h"
-+
-+#include <functional>
-+#include <QtWidgets>
-+using std::bind;
-+
-+COverlayRefMap::COverlayRefMap(CItemRefMap *item, QStackedWidget *stackedWidget)
-+ : IOverlay(stackedWidget)
-+ , context(item->getDrawContext())
-+ , item(item)
-+{
-+ setupUi(this);
-+
-+ QFileInfo fi(item->getFilename());
-+ gcpFilename = fi.completeBaseName() + ".gcp";
-+
-+ labelHelp->setText(tr("If you used the Grid Tool you have to fine tune the reference points by placing them "
-+ "as much as possible on the grid crossing. Be aware that if you over scale you get "
-+ "jumping points by rounding effects. Be precise but do not make religion out "
-+ "of the task.\nIf your mouse focus is on the map you can use the N and B keys to "
-+ "jump forward an backward in the reference point list. "
-+ "\nThe is also the option to fine tune the reference points in auto-mode. In this "
-+ "mode the next reference point is selected automatically right after you placed the "
-+ "current one. This is very convenient for a large number of reference points."));
-+
-+ labelHelp->setVisible(CMainWindow::self().showToolHelp()->isChecked());
-+ connect(CMainWindow::self().showToolHelp(), &QAction::toggled, labelHelp, &QLabel::setVisible);
-+
-+ treeWidget->addAction(actionDelRefPoint);
-+
-+ connect(toolNone, &QToolButton::clicked, this, bind(&COverlayRefMap::slotSetMode, this, eModeNone, std::placeholders::_1));
-+ connect(toolRefMove, &QToolButton::clicked, this, bind(&COverlayRefMap::slotSetMode, this, eModePointMove, std::placeholders::_1));
-+ connect(toolRefAdd, &QToolButton::clicked, this, bind(&COverlayRefMap::slotSetMode, this, eModePointAdd, std::placeholders::_1));
-+ connect(toolRefDel, &QToolButton::clicked, this, bind(&COverlayRefMap::slotSetMode, this, eModePointDel, std::placeholders::_1));
-+ connect(toolRefMoveAuto, &QToolButton::clicked, this, bind(&COverlayRefMap::slotSetMode, this, eModePointMoveAuto, std::placeholders::_1));
-+ connect(toolRefDelAll, &QToolButton::clicked, this, &COverlayRefMap::slotResetRef);
-+ connect(toolLoadGcp, &QToolButton::clicked, this, &COverlayRefMap::slotLoadGcp);
-+ connect(toolSaveGcp, &QToolButton::clicked, this, &COverlayRefMap::slotSaveGcp);
-+ connect(toolProjection, &QToolButton::clicked, this, &COverlayRefMap::slotProjWizard);
-+ connect(toolGridTool, &QToolButton::clicked, this, &COverlayRefMap::slotGridTool);
-+ connect(toolSort, &QToolButton::clicked, this, &COverlayRefMap::slotSortRefPoints);
-+ connect(treeWidget, &QTreeWidget::itemSelectionChanged, this, &COverlayRefMap::slotSelectionChanged);
-+ connect(actionDelRefPoint, &QAction::triggered, this, &COverlayRefMap::slotDelRefPoints);
-+}
-+
-+void COverlayRefMap::saveSettings(QSettings& cfg)
-+{
-+ QByteArray buffer;
-+ QDataStream stream(&buffer, QIODevice::WriteOnly);
-+ stream.setByteOrder(QDataStream::LittleEndian);
-+ stream.setVersion(QDataStream::Qt_5_4);
-+
-+ const int N = treeWidget->topLevelItemCount();
-+ stream << N;
-+ for(int n = 0; n < N; n++)
-+ {
-+ COverlayRefMapPoint * item = dynamic_cast<COverlayRefMapPoint*>(treeWidget->topLevelItem(n));
-+ if(item != nullptr)
-+ {
-+ stream << item->getPtPtx() << item->getPtRef();
-+ }
-+ }
-+
-+ cfg.beginGroup("grid");
-+ cfg.setValue("points", buffer);
-+ cfg.setValue("projection", lineProjection->text());
-+ cfg.endGroup();
-+}
-+
-+void COverlayRefMap::loadSettings(QSettings& cfg)
-+{
-+ QByteArray buffer;
-+ cfg.beginGroup("grid");
-+ buffer = cfg.value("points", buffer).toByteArray();
-+ lineProjection->setText(cfg.value("projection", "").toString());
-+ lineProjection->setCursorPosition(0);
-+ cfg.endGroup();
-+
-+ QDataStream stream(&buffer, QIODevice::ReadOnly);
-+ stream.setByteOrder(QDataStream::LittleEndian);
-+ stream.setVersion(QDataStream::Qt_5_4);
-+
-+
-+ int N;
-+ stream >> N;
-+ for(int n = 0; n < N; n++)
-+ {
-+ QPointF ptPtx;
-+ QPointF ptRef;
-+ stream >> ptPtx >> ptRef;
-+ new COverlayRefMapPoint(n+1, ptRef, ptPtx, treeWidget);
-+ }
-+
-+ updateGui();
-+ slotSortRefPoints();
-+ emit sigChanged();
-+}
-+
-+void COverlayRefMap::slotSortRefPoints()
-+{
-+ treeWidget->sortItems(0, Qt::AscendingOrder);
-+ const int N = treeWidget->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ COverlayRefMapPoint * point = dynamic_cast<COverlayRefMapPoint*>(treeWidget->topLevelItem(n));
-+ if(point == nullptr)
-+ {
-+ continue;
-+ }
-+
-+ point->setIndex(n);
-+ }
-+
-+ treeWidget->header()->resizeSections(QHeaderView::ResizeToContents);
-+}
-+
-+void COverlayRefMap::addRefPoints(QList<COverlayRefMapPoint*>& points)
-+{
-+ // it's faster to use a bulk add
-+ QList<QTreeWidgetItem*> items;
-+ for(QTreeWidgetItem * item : points)
-+ {
-+ items << item;
-+ }
-+ treeWidget->addTopLevelItems(items);
-+
-+ // as the tree widget owns the items now, the list has to be cleared
-+ points.clear();
-+ // reflect changes on the GUI
-+ updateGui();
-+
-+ emit sigChanged();
-+}
-+
-+QString COverlayRefMap::getMapProjection() const
-+{
-+ return lineProjection->text();
-+}
-+
-+const QList<COverlayRefMapPoint*> COverlayRefMap::getRefPoints() const
-+{
-+ QList<COverlayRefMapPoint*> points;
-+
-+ const int N = treeWidget->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ COverlayRefMapPoint * item = dynamic_cast<COverlayRefMapPoint*>(treeWidget->topLevelItem(n));
-+ if(item != nullptr)
-+ {
-+ points << item;
-+ }
-+ }
-+
-+ return points;
-+}
-+
-+bool COverlayRefMap::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ QRectF dot1(0,0,5,5);
-+ const int N = treeWidget->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ COverlayRefMapPoint * item = dynamic_cast<COverlayRefMapPoint*>(treeWidget->topLevelItem(n));
-+ if(item != nullptr)
-+ {
-+ if(item->isSelected())
-+ {
-+ p.setPen(QPen(Qt::red, 1));
-+ p.setBrush(Qt::red);
-+ }
-+ else
-+ {
-+ p.setPen(QPen(Qt::black, 1));
-+ p.setBrush(Qt::black);
-+ }
-+
-+ QPointF pt = item->getPtPtx();
-+ if((pt - ptFocus1).manhattanLength() > 30)
-+ {
-+ context->convertMap2Screen(pt);
-+ dot1.moveCenter(pt);
-+ p.drawRect(dot1);
-+ }
-+ }
-+ }
-+
-+ QPointF pt = NOPOINTF;
-+ if(ptFocus2 != NOPOINTF)
-+ {
-+ pt = ptFocus2;
-+ }
-+ else if(ptFocus1 != NOPOINTF)
-+ {
-+ pt = ptFocus1;
-+ }
-+
-+
-+ if(pt != NOPOINTF)
-+ {
-+ context->convertMap2Screen(pt);
-+
-+ if(movePoint)
-+ {
-+ QPointF pt1 = ptFocus1;
-+ context->convertMap2Screen(pt1);
-+
-+ p.setPen(QPen(Qt::red, 1));
-+ p.setBrush(Qt::red);
-+ p.drawLine(pt1, pt);
-+ dot1.moveCenter(pt1);
-+ p.drawRect(dot1);
-+ }
-+
-+ CDraw::drawCrossHairDot(p, pt);
-+ }
-+
-+
-+ return true;
-+}
-+
-+QPointF COverlayRefMap::isCloseTo(QPointF pt)
-+{
-+ qint32 min = 30;
-+ COverlayRefMapPoint * selItem = nullptr;
-+
-+ context->convertMap2Screen(pt);
-+
-+ const int N = treeWidget->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ COverlayRefMapPoint * item = dynamic_cast<COverlayRefMapPoint*>(treeWidget->topLevelItem(n));
-+ if(item == nullptr)
-+ {
-+ continue;
-+ }
-+
-+ QPointF ptx = item->getPtPtx();
-+ context->convertMap2Screen(ptx);
-+
-+ qint32 d = (pt - ptx).manhattanLength();
-+ if(d < min)
-+ {
-+ min = d;
-+ selItem = item;
-+ }
-+ }
-+
-+ if(selItem != nullptr)
-+ {
-+ treeWidget->setCurrentItem(selItem);
-+ return selItem->getPtPtx();
-+ }
-+ else
-+ {
-+ return NOPOINTF;
-+ }
-+}
-+
-+
-+void COverlayRefMap::mouseMoveEventFx(QMouseEvent *e)
-+{
-+ QPointF pt = e->pos();
-+ context->convertScreen2Map(pt);
-+
-+ switch(mode)
-+ {
-+ case eModePointMove:
-+ case eModePointMoveAuto:
-+ mouseMovePointMove(pt);
-+ break;
-+
-+ case eModePointAdd:
-+ mouseMovePointAdd(pt);
-+ break;
-+
-+ case eModePointDel:
-+ mouseMovePointDel(pt);
-+ break;
-+ }
-+
-+ updateGui();
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+}
-+
-+void COverlayRefMap::mouseReleaseEventFx(QMouseEvent *e)
-+{
-+ QPointF pt = e->pos();
-+ context->convertScreen2Map(pt);
-+
-+ Qt::MouseButton button = e->button();
-+
-+ switch(mode)
-+ {
-+ case eModePointMove:
-+ case eModePointMoveAuto:
-+ mouseReleasePointMove(pt, button);
-+ break;
-+
-+ case eModePointAdd:
-+ mouseReleasePointAdd(pt, button);
-+ break;
-+
-+ case eModePointDel:
-+ mouseReleasePointDel(pt, button);
-+ break;
-+ }
-+
-+ updateGui();
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+}
-+
-+void COverlayRefMap::mouseMovePointAdd(const QPointF &pt)
-+{
-+ ptFocus1 = pt;
-+}
-+
-+void COverlayRefMap::mouseMovePointDel(const QPointF &pt)
-+{
-+ ptFocus1 = isCloseTo(pt);
-+}
-+
-+void COverlayRefMap::mouseMovePointMove(const QPointF &pt)
-+{
-+ if(movePoint)
-+ {
-+ ptFocus2 = pt;
-+ }
-+ else
-+ {
-+ ptFocus1 = isCloseTo(pt);
-+ }
-+}
-+
-+void COverlayRefMap::mouseReleasePointAdd(const QPointF &pt, Qt::MouseButton button)
-+{
-+ if(button == Qt::LeftButton)
-+ {
-+ QPointF ptPtx = pt;
-+ QPointF ptRef = NOPOINTF;
-+ // ask for coordinate
-+ CDialogRefPoint dlg(ptPtx, ptRef, this);
-+ int res = dlg.exec();
-+ if(res == QDialog::Accepted)
-+ {
-+ new COverlayRefMapPoint(treeWidget->topLevelItemCount() + 1, ptRef, ptPtx, treeWidget);
-+ emit sigChanged();
-+ }
-+ }
-+ else if(button == Qt::RightButton)
-+ {
-+ abortStep();
-+ toolNone->click();
-+ CCanvas::restoreOverrideCursor("CRefMapGrid::mouseReleasePointAdd");
-+ }
-+}
-+
-+void COverlayRefMap::mouseReleasePointDel(const QPointF &pt, Qt::MouseButton button)
-+{
-+ if(button == Qt::LeftButton)
-+ {
-+ if(ptFocus1 == NOPOINTF)
-+ {
-+ return;
-+ }
-+
-+ const int N = treeWidget->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ COverlayRefMapPoint * item = dynamic_cast<COverlayRefMapPoint*>(treeWidget->topLevelItem(n));
-+ if(item == nullptr)
-+ {
-+ continue;
-+ }
-+
-+ if(item->getPtPtx() == ptFocus1)
-+ {
-+ delete item;
-+ abortStep();
-+ emit sigChanged();
-+ return;
-+ }
-+ }
-+ }
-+ else if(button == Qt::RightButton)
-+ {
-+ CCanvas::restoreOverrideCursor("CRefMapGrid::mouseReleasePointDel");
-+ toolNone->click();
-+ abortStep();
-+ }
-+}
-+
-+void COverlayRefMap::mouseReleasePointMove(const QPointF &pt, Qt::MouseButton button)
-+{
-+ if(button == Qt::LeftButton)
-+ {
-+ if(movePoint)
-+ {
-+ const int N = treeWidget->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ COverlayRefMapPoint * item = dynamic_cast<COverlayRefMapPoint*>(treeWidget->topLevelItem(n));
-+ if(item == nullptr)
-+ {
-+ continue;
-+ }
-+
-+ if(item->getPtPtx() == ptFocus1)
-+ {
-+ item->setPtPtx(pt);
-+ break;
-+ }
-+ }
-+
-+ switch(mode)
-+ {
-+ case eModePointMove:
-+ {
-+ abortStep();
-+ CCanvas::restoreOverrideCursor("CRefMapGrid::mouseReleasePointMove");
-+ break;
-+ }
-+
-+ case eModePointMoveAuto:
-+ {
-+ int idx = treeWidget->indexOfTopLevelItem(treeWidget->currentItem()) + 1;
-+ if(idx >= treeWidget->topLevelItemCount())
-+ {
-+ abortStep();
-+ CCanvas::restoreOverrideCursor("CRefMapGrid::mouseReleasePointMove");
-+ }
-+ else
-+ {
-+ COverlayRefMapPoint * point = dynamic_cast<COverlayRefMapPoint*>(treeWidget->topLevelItem(idx));
-+ if(point == nullptr)
-+ {
-+ return;
-+ }
-+ treeWidget->setCurrentItem(point);
-+ treeWidget->scrollToItem(point);
-+
-+ QPointF pt1 = point->getPtPtx();
-+ ptFocus1 = pt1;
-+ ptFocus2 = pt;
-+ context->convertMap2Screen(pt1);
-+
-+ QPointF pt2 = context->getCanvas()->rect().center();
-+ context->move(pt2 - pt1);
-+ context->triggerCompleteUpdate(CCanvas::eRedrawAll);
-+ }
-+ break;
-+ }
-+ }
-+ }
-+ else
-+ {
-+ if(ptFocus1 != NOPOINTF)
-+ {
-+ ptFocus2 = pt;
-+ movePoint = true;
-+ CCanvas::setOverrideCursor(Qt::BlankCursor, "CRefMapGrid::mouseReleasePointMove");
-+ }
-+ }
-+ }
-+ else if(button == Qt::RightButton)
-+ {
-+ if(!movePoint)
-+ {
-+ toolNone->click();
-+ }
-+ abortStep();
-+ CCanvas::restoreOverrideCursor("CRefMapGrid::mouseReleasePointMove");
-+ }
-+}
-+
-+
-+bool COverlayRefMap::keyPressEventFx(QKeyEvent *e)
-+{
-+ QTreeWidgetItem * item = treeWidget->currentItem();
-+ if(item == nullptr)
-+ {
-+ return false;
-+ }
-+
-+ int idx = treeWidget->indexOfTopLevelItem(item);
-+
-+ switch(e->key())
-+ {
-+ case Qt::Key_N:
-+ {
-+ ++idx;
-+ idx = qMin(idx, treeWidget->topLevelItemCount() - 1);
-+ break;
-+ }
-+
-+ case Qt::Key_B:
-+ {
-+ --idx;
-+ idx = qMax(idx, 0);
-+ break;
-+ }
-+
-+ default:
-+ return false;
-+ }
-+
-+
-+ if(movePoint)
-+ {
-+ switch(mode)
-+ {
-+ case eModePointMove:
-+ return false;
-+
-+ case eModePointMoveAuto:
-+ abortStep();
-+ CCanvas::restoreOverrideCursor("CRefMapGrid::mouseReleasePointMove");
-+ break;
-+ }
-+ }
-+
-+ COverlayRefMapPoint * point = dynamic_cast<COverlayRefMapPoint*>(treeWidget->topLevelItem(idx));
-+ if(point == nullptr)
-+ {
-+ return false;
-+ }
-+ treeWidget->setCurrentItem(point);
-+ treeWidget->scrollToItem(point);
-+
-+ QPointF pt1 = point->getPtPtx();
-+ QPointF pt2 = context->getCanvas()->rect().center();
-+ context->convertMap2Screen(pt1);
-+ context->move(pt2 - pt1);
-+
-+ context->triggerCompleteUpdate(CCanvas::eRedrawAll);
-+
-+ return true;
-+}
-+
-+QCursor COverlayRefMap::getCursorFx()
-+{
-+ switch(mode)
-+ {
-+ case COverlayRefMap::eModePointAdd:
-+ return Qt::BlankCursor;
-+
-+ case COverlayRefMap::eModePointDel:
-+ return QCursor(QPixmap(":/cursors/cursorPointDel.png"), 0, 0);
-+
-+ case COverlayRefMap::eModePointMoveAuto:
-+ case COverlayRefMap::eModePointMove:
-+ return QCursor(QPixmap(":/cursors/cursorPointMove.png"), 0, 0);
-+ }
-+
-+ return Qt::ArrowCursor;
-+}
-+
-+void COverlayRefMap::updateGui()
-+{
-+ bool isEmpty = treeWidget->topLevelItemCount() == 0;
-+ toolRefDel->setDisabled(isEmpty);
-+ toolRefMove->setDisabled(isEmpty);
-+ toolRefDelAll->setDisabled(isEmpty);
-+ toolRefMoveAuto->setDisabled(isEmpty);
-+ toolSaveGcp->setDisabled(isEmpty);
-+}
-+
-+void COverlayRefMap::abortStep()
-+{
-+ movePoint = false;
-+ ptFocus1 = NOPOINTF;
-+ ptFocus2 = NOPOINTF;
-+
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+}
-+
-+void COverlayRefMap::slotSetMode(mode_e m, bool on)
-+{
-+ if(on)
-+ {
-+ mode = m;
-+ }
-+}
-+
-+void COverlayRefMap::slotSaveGcp()
-+{
-+ SETTINGS;
-+ QString path = cfg.value("Path/gcpInput", QDir::homePath()).toString();
-+
-+ QString filename = QFileDialog::getSaveFileName(0, tr("Save reference points..."), path + "/" + gcpFilename, "Ref. points (*.gcp)");
-+ if(filename.isEmpty())
-+ {
-+ return;
-+ }
-+ cfg.setValue("Path/gcpInput", QFileInfo(filename).absolutePath());
-+
-+ gcpFilename = filename;
-+
-+ QFile file(filename);
-+ file.open(QIODevice::WriteOnly);
-+ QTextStream out(&file);
-+ out.setRealNumberPrecision(10);
-+
-+ out << "#V1.0" << endl;
-+ out << "#gcpproj: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" << endl;
-+
-+ const int N = treeWidget->topLevelItemCount();
-+ for(int n = 0; n < N; n++)
-+ {
-+ COverlayRefMapPoint * pt = dynamic_cast<COverlayRefMapPoint*>(treeWidget->topLevelItem(n));
-+ if(pt == nullptr)
-+ {
-+ continue;
-+ }
-+ const QPointF& ptx = pt->getPtPtx();
-+ const QPointF& ref = pt->getPtRef();
-+
-+ out << "-gcp " << ptx.x() << " " << ptx.y() << " " << ref.y() << " " << ref.x() << endl;
-+ }
-+
-+ file.close();
-+}
-+
-+void COverlayRefMap::slotLoadGcp()
-+{
-+ SETTINGS;
-+ QString path = cfg.value("Path/gcpInput", QDir::homePath()).toString();
-+
-+ QString filename = QFileDialog::getOpenFileName(0, tr("Load reference points..."), path, "Ref. points (*.gcp)");
-+ if(filename.isEmpty())
-+ {
-+ return;
-+ }
-+ cfg.setValue("Path/gcpInput", QFileInfo(filename).absolutePath());
-+
-+ QFile file(filename);
-+ file.open(QIODevice::ReadOnly);
-+ QString line = file.readLine();
-+ if(line.trimmed() == "#V1.0")
-+ {
-+ QRegExp re1("^-gcp\\s(-{0,1}[0-9]+)\\s(-{0,1}[0-9]+)\\s(-{0,1}[0-9\\.]+)\\s(-{0,1}[0-9\\.]+).*$");
-+ QRegExp re2("^-a_srs\\s(.*)$");
-+ QRegExp re3("^#gcpproj:\\s(.*)$");
-+
-+ qint32 cnt = 1;
-+ while(1)
-+ {
-+ if(re1.exactMatch(line))
-+ {
-+ QPointF ptPtx(re1.cap(1).toDouble(),re1.cap(2).toDouble());
-+ QPointF ptRef(re1.cap(4).toDouble(),re1.cap(3).toDouble());
-+ new COverlayRefMapPoint(cnt++, ptRef, ptPtx, treeWidget);
-+ }
-+
-+ if (file.atEnd())
-+ {
-+ break;
-+ }
-+ line = file.readLine();
-+ }
-+ }
-+
-+ updateGui();
-+
-+ emit sigChanged();
-+}
-+
-+void COverlayRefMap::slotResetRef()
-+{
-+ int res = QMessageBox::question(this, tr("Delete all reference points..."), tr("Are you sure to delete all reference points in the list?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
-+ if(res != QMessageBox::Yes)
-+ {
-+ return;
-+ }
-+ treeWidget->clear();
-+ updateGui();
-+
-+ emit sigChanged();
-+}
-+
-+void COverlayRefMap::slotProjWizard()
-+{
-+ CProjWizard dlg(*lineProjection, this);
-+ dlg.exec();
-+ lineProjection->setCursorPosition(0);
-+
-+ emit sigChanged();
-+}
-+
-+void COverlayRefMap::slotGridTool()
-+{
-+ CMainWindow::self().startGridTool(item);
-+}
-+
-+void COverlayRefMap::slotSelectionChanged()
-+{
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+}
-+
-+void COverlayRefMap::slotDelRefPoints()
-+{
-+ const QList<QTreeWidgetItem*>items = treeWidget->selectedItems();
-+ if(items.count() > 1)
-+ {
-+ int res = QMessageBox::question(this, tr("Delete..."), tr("Delete all selected reference points?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
-+ if(res != QMessageBox::Yes)
-+ {
-+ return;
-+ }
-+ }
-+
-+ qDeleteAll(items);
-+
-+ emit sigChanged();
-+}
-+
-+bool COverlayRefMap::isOk() const
-+{
-+ bool ok = true;
-+ ok &= (treeWidget->topLevelItemCount() > 2);
-+ ok &= CProjWizard::validProjStr(lineProjection->text());
-+ return ok;
-+}
-diff --git a/src/qmaptool/overlay/COverlayRefMap.h b/src/qmaptool/overlay/COverlayRefMap.h
-new file mode 100644
-index 00000000..03391000
---- /dev/null
-+++ b/src/qmaptool/overlay/COverlayRefMap.h
-@@ -0,0 +1,103 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef COVERLAYREFMAP_H
-+#define COVERLAYREFMAP_H
-+
-+#include "overlay/IOverlay.h"
-+#include "ui_IOverlayRefMap.h"
-+#include "units/IUnit.h"
-+
-+class QStackedWidget;
-+class IDrawContext;
-+class QSettings;
-+class CItemRefMap;
-+class COverlayRefMapPoint;
-+
-+class COverlayRefMap : public IOverlay, private Ui::IOverlayRefMap
-+{
-+ Q_OBJECT
-+public:
-+ COverlayRefMap(CItemRefMap *item, QStackedWidget * stackedWidget);
-+ virtual ~COverlayRefMap() = default;
-+
-+ void saveSettings(QSettings& cfg);
-+ void loadSettings(QSettings& cfg);
-+
-+ void addRefPoints(QList<COverlayRefMapPoint*>& points);
-+ QString getMapProjection() const;
-+ const QList<COverlayRefMapPoint *> getRefPoints() const;
-+
-+ bool drawFx(QPainter& p, CCanvas::redraw_e needsRedraw);
-+ void mouseMoveEventFx(QMouseEvent *e);
-+ void mouseReleaseEventFx(QMouseEvent *e);
-+ bool keyPressEventFx(QKeyEvent *e);
-+ QCursor getCursorFx();
-+
-+ void abortStep();
-+
-+ enum mode_e
-+ {
-+ eModeNone
-+ ,eModePointMove
-+ ,eModePointAdd
-+ ,eModePointDel
-+ ,eModePointMoveAuto
-+ };
-+
-+ bool isOk() const;
-+
-+private slots:
-+ void slotSetMode(mode_e m, bool on);
-+ void slotSaveGcp();
-+ void slotLoadGcp();
-+ void slotResetRef();
-+ void slotProjWizard();
-+ void slotGridTool();
-+ void slotSelectionChanged();
-+ void slotDelRefPoints();
-+ void slotSortRefPoints();
-+
-+
-+private:
-+ void updateGui();
-+ QPointF isCloseTo(QPointF pt);
-+
-+ void mouseMovePointAdd(const QPointF &pt);
-+ void mouseMovePointDel(const QPointF &pt);
-+ void mouseMovePointMove(const QPointF &pt);
-+
-+ void mouseReleasePointAdd(const QPointF &pt, Qt::MouseButton button);
-+ void mouseReleasePointDel(const QPointF &pt, Qt::MouseButton button);
-+ void mouseReleasePointMove(const QPointF &pt, Qt::MouseButton button);
-+
-+ IDrawContext* context;
-+ CItemRefMap * item;
-+
-+ mode_e mode = eModeNone;
-+
-+ QPointF ptFocus1 = NOPOINTF;
-+ QPointF ptFocus2 = NOPOINTF;
-+ bool movePoint = false;
-+
-+ QString gcpFilename;
-+};
-+
-+#endif //COVERLAYREFMAP_H
-+
-+
-diff --git a/src/qmaptool/overlay/IOverlay.cpp b/src/qmaptool/overlay/IOverlay.cpp
-new file mode 100644
-index 00000000..148d1c10
---- /dev/null
-+++ b/src/qmaptool/overlay/IOverlay.cpp
-@@ -0,0 +1,36 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "overlay/IOverlay.h"
-+
-+#include <QtWidgets>
-+
-+IOverlay::IOverlay(QStackedWidget *parent)
-+ : QWidget(parent)
-+ , stackedWidget(parent)
-+{
-+ stackedWidget->addWidget(this);
-+}
-+
-+
-+void IOverlay::toFront()
-+{
-+ stackedWidget->setCurrentWidget(this);
-+}
-+
-+
-diff --git a/src/qmaptool/overlay/IOverlay.h b/src/qmaptool/overlay/IOverlay.h
-new file mode 100644
-index 00000000..d7e968ec
---- /dev/null
-+++ b/src/qmaptool/overlay/IOverlay.h
-@@ -0,0 +1,43 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef IOVERLAY_H
-+#define IOVERLAY_H
-+
-+#include <QWidget>
-+
-+class QStackedWidget;
-+
-+class IOverlay : public QWidget
-+{
-+ Q_OBJECT
-+public:
-+ IOverlay(QStackedWidget * parent);
-+ virtual ~IOverlay() = default;
-+
-+ void toFront();
-+
-+signals:
-+ void sigChanged();
-+
-+protected:
-+ QStackedWidget * stackedWidget;
-+};
-+
-+#endif //IOVERLAY_H
-+
-diff --git a/src/qmaptool/overlay/IOverlayCutMap.ui b/src/qmaptool/overlay/IOverlayCutMap.ui
-new file mode 100644
-index 00000000..e7a69766
---- /dev/null
-+++ b/src/qmaptool/overlay/IOverlayCutMap.ui
-@@ -0,0 +1,202 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<ui version="4.0">
-+ <class>IOverlayCutMap</class>
-+ <widget class="QWidget" name="IOverlayCutMap">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>254</width>
-+ <height>25</height>
-+ </rect>
-+ </property>
-+ <property name="windowTitle">
-+ <string>Form</string>
-+ </property>
-+ <layout class="QHBoxLayout" name="horizontalLayout">
-+ <property name="spacing">
-+ <number>3</number>
-+ </property>
-+ <property name="leftMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="topMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="rightMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="bottomMargin">
-+ <number>0</number>
-+ </property>
-+ <item>
-+ <widget class="QToolButton" name="toolNone">
-+ <property name="toolTip">
-+ <string>Just move the map and zoom.</string>
-+ </property>
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/MoveArrow.png</normaloff>:/icons/32x32/MoveArrow.png</iconset>
-+ </property>
-+ <property name="checkable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="checked">
-+ <bool>true</bool>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolPointAdd">
-+ <property name="toolTip">
-+ <string>Add point to mask.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/PointAdd.png</normaloff>:/icons/32x32/PointAdd.png</iconset>
-+ </property>
-+ <property name="checkable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolPointMove">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Move point of mask.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/PointMove.png</normaloff>:/icons/32x32/PointMove.png</iconset>
-+ </property>
-+ <property name="checkable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolPointDel">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Remove point from mask.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/PointDel.png</normaloff>:/icons/32x32/PointDel.png</iconset>
-+ </property>
-+ <property name="checkable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="Line" name="line">
-+ <property name="orientation">
-+ <enum>Qt::Vertical</enum>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolPointDelAll">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Remove complete cut mask.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/PointDelAll.png</normaloff>:/icons/32x32/PointDelAll.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="Line" name="line_2">
-+ <property name="orientation">
-+ <enum>Qt::Vertical</enum>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolLoadShape">
-+ <property name="toolTip">
-+ <string>Load cut mask from shape file.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/LoadShape.png</normaloff>:/icons/32x32/LoadShape.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolSaveShape">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Save cut mask to shape file.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/SaveShape.png</normaloff>:/icons/32x32/SaveShape.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <spacer name="horizontalSpacer">
-+ <property name="orientation">
-+ <enum>Qt::Horizontal</enum>
-+ </property>
-+ <property name="sizeHint" stdset="0">
-+ <size>
-+ <width>40</width>
-+ <height>20</height>
-+ </size>
-+ </property>
-+ </spacer>
-+ </item>
-+ </layout>
-+ </widget>
-+ <resources>
-+ <include location="../resources.qrc"/>
-+ </resources>
-+ <connections/>
-+</ui>
-diff --git a/src/qmaptool/overlay/IOverlayGridTool.ui b/src/qmaptool/overlay/IOverlayGridTool.ui
-new file mode 100644
-index 00000000..7e8c1ab3
---- /dev/null
-+++ b/src/qmaptool/overlay/IOverlayGridTool.ui
-@@ -0,0 +1,184 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<ui version="4.0">
-+ <class>IOverlayGridTool</class>
-+ <widget class="QWidget" name="IOverlayGridTool">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>400</width>
-+ <height>462</height>
-+ </rect>
-+ </property>
-+ <property name="windowTitle">
-+ <string>Form</string>
-+ </property>
-+ <layout class="QGridLayout" name="gridLayout_2">
-+ <property name="leftMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="topMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="rightMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="bottomMargin">
-+ <number>0</number>
-+ </property>
-+ <item row="0" column="0">
-+ <layout class="QVBoxLayout" name="verticalLayout_3">
-+ <item>
-+ <widget class="QRadioButton" name="radioSetRef">
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="checked">
-+ <bool>true</bool>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <spacer name="verticalSpacer_3">
-+ <property name="orientation">
-+ <enum>Qt::Vertical</enum>
-+ </property>
-+ <property name="sizeHint" stdset="0">
-+ <size>
-+ <width>20</width>
-+ <height>40</height>
-+ </size>
-+ </property>
-+ </spacer>
-+ </item>
-+ </layout>
-+ </item>
-+ <item row="1" column="0">
-+ <layout class="QVBoxLayout" name="verticalLayout">
-+ <item>
-+ <widget class="QRadioButton" name="radioGridPlacer">
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <spacer name="verticalSpacer">
-+ <property name="orientation">
-+ <enum>Qt::Vertical</enum>
-+ </property>
-+ <property name="sizeHint" stdset="0">
-+ <size>
-+ <width>20</width>
-+ <height>40</height>
-+ </size>
-+ </property>
-+ </spacer>
-+ </item>
-+ </layout>
-+ </item>
-+ <item row="1" column="1">
-+ <widget class="CGridPlacer" name="widgetGridPlacer" native="true">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="2" column="0">
-+ <layout class="QVBoxLayout" name="verticalLayout_2">
-+ <item>
-+ <widget class="QRadioButton" name="radioSelectArea">
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <spacer name="verticalSpacer_2">
-+ <property name="orientation">
-+ <enum>Qt::Vertical</enum>
-+ </property>
-+ <property name="sizeHint" stdset="0">
-+ <size>
-+ <width>20</width>
-+ <height>40</height>
-+ </size>
-+ </property>
-+ </spacer>
-+ </item>
-+ </layout>
-+ </item>
-+ <item row="2" column="1">
-+ <widget class="CGridSelArea" name="widgetSelectArea" native="true">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="3" column="1">
-+ <widget class="QLabel" name="labelFinal">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="text">
-+ <string>do not translate</string>
-+ </property>
-+ <property name="wordWrap">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="0" column="1">
-+ <widget class="CGridSetRef" name="widgetSetRef" native="true"/>
-+ </item>
-+ </layout>
-+ </widget>
-+ <customwidgets>
-+ <customwidget>
-+ <class>CGridPlacer</class>
-+ <extends>QWidget</extends>
-+ <header>overlay/gridtool/CGridPlacer.h</header>
-+ <container>1</container>
-+ </customwidget>
-+ <customwidget>
-+ <class>CGridSelArea</class>
-+ <extends>QWidget</extends>
-+ <header>overlay/gridtool/CGridSelArea.h</header>
-+ <container>1</container>
-+ </customwidget>
-+ <customwidget>
-+ <class>CGridSetRef</class>
-+ <extends>QWidget</extends>
-+ <header>overlay/gridtool/CGridSetRef.h</header>
-+ <container>1</container>
-+ </customwidget>
-+ </customwidgets>
-+ <tabstops>
-+ <tabstop>radioSetRef</tabstop>
-+ <tabstop>radioGridPlacer</tabstop>
-+ <tabstop>radioSelectArea</tabstop>
-+ </tabstops>
-+ <resources/>
-+ <connections/>
-+</ui>
-diff --git a/src/qmaptool/overlay/IOverlayRefMap.ui b/src/qmaptool/overlay/IOverlayRefMap.ui
-new file mode 100644
-index 00000000..9001fe66
---- /dev/null
-+++ b/src/qmaptool/overlay/IOverlayRefMap.ui
-@@ -0,0 +1,351 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<ui version="4.0">
-+ <class>IOverlayRefMap</class>
-+ <widget class="QWidget" name="IOverlayRefMap">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>400</width>
-+ <height>376</height>
-+ </rect>
-+ </property>
-+ <property name="windowTitle">
-+ <string>Form</string>
-+ </property>
-+ <layout class="QVBoxLayout" name="verticalLayout">
-+ <property name="spacing">
-+ <number>3</number>
-+ </property>
-+ <property name="leftMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="topMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="rightMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="bottomMargin">
-+ <number>3</number>
-+ </property>
-+ <item>
-+ <layout class="QHBoxLayout" name="horizontalLayout">
-+ <property name="spacing">
-+ <number>3</number>
-+ </property>
-+ <item>
-+ <widget class="QToolButton" name="toolNone">
-+ <property name="toolTip">
-+ <string>Just move the map and zoom.</string>
-+ </property>
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/MoveArrow.png</normaloff>:/icons/32x32/MoveArrow.png</iconset>
-+ </property>
-+ <property name="checkable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="checked">
-+ <bool>true</bool>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolRefAdd">
-+ <property name="toolTip">
-+ <string>Add reference point.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/RefAdd.png</normaloff>:/icons/32x32/RefAdd.png</iconset>
-+ </property>
-+ <property name="checkable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolRefMove">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Move reference point.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/RefMove.png</normaloff>:/icons/32x32/RefMove.png</iconset>
-+ </property>
-+ <property name="checkable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolRefDel">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Remove single reference point.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/RefDel.png</normaloff>:/icons/32x32/RefDel.png</iconset>
-+ </property>
-+ <property name="checkable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolRefMoveAuto">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Move reference points with auto mode. This will pickup the next point after you moved a reference point.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/RefMoveAuto.png</normaloff>:/icons/32x32/RefMoveAuto.png</iconset>
-+ </property>
-+ <property name="checkable">
-+ <bool>true</bool>
-+ </property>
-+ <property name="autoExclusive">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="Line" name="line_2">
-+ <property name="orientation">
-+ <enum>Qt::Vertical</enum>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolRefDelAll">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Remove all reference points.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/RefDelAll.png</normaloff>:/icons/32x32/RefDelAll.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolGridTool">
-+ <property name="toolTip">
-+ <string>Switch to the Grid Tool.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/GridTool.png</normaloff>:/icons/32x32/GridTool.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="Line" name="line">
-+ <property name="orientation">
-+ <enum>Qt::Vertical</enum>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolLoadGcp">
-+ <property name="toolTip">
-+ <string>Load reference points from GCP file.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/LoadGcp.png</normaloff>:/icons/32x32/LoadGcp.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolSaveGcp">
-+ <property name="enabled">
-+ <bool>false</bool>
-+ </property>
-+ <property name="toolTip">
-+ <string>Save reference points into GCP file.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/SaveGcp.png</normaloff>:/icons/32x32/SaveGcp.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <spacer name="horizontalSpacer">
-+ <property name="orientation">
-+ <enum>Qt::Horizontal</enum>
-+ </property>
-+ <property name="sizeHint" stdset="0">
-+ <size>
-+ <width>40</width>
-+ <height>20</height>
-+ </size>
-+ </property>
-+ </spacer>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolSort">
-+ <property name="toolTip">
-+ <string>Sort list of reference points.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/Sort.png</normaloff>:/icons/32x32/Sort.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ </layout>
-+ </item>
-+ <item>
-+ <widget class="QTreeWidget" name="treeWidget">
-+ <property name="contextMenuPolicy">
-+ <enum>Qt::ActionsContextMenu</enum>
-+ </property>
-+ <property name="selectionMode">
-+ <enum>QAbstractItemView::ExtendedSelection</enum>
-+ </property>
-+ <property name="selectionBehavior">
-+ <enum>QAbstractItemView::SelectRows</enum>
-+ </property>
-+ <property name="rootIsDecorated">
-+ <bool>false</bool>
-+ </property>
-+ <property name="itemsExpandable">
-+ <bool>false</bool>
-+ </property>
-+ <property name="expandsOnDoubleClick">
-+ <bool>false</bool>
-+ </property>
-+ <column>
-+ <property name="text">
-+ <string notr="true">#</string>
-+ </property>
-+ </column>
-+ <column>
-+ <property name="text">
-+ <string>(x, y)[pixel]</string>
-+ </property>
-+ </column>
-+ <column>
-+ <property name="text">
-+ <string>(lat, lon)[°]</string>
-+ </property>
-+ </column>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QLabel" name="labelHelp">
-+ <property name="text">
-+ <string>TextLabel</string>
-+ </property>
-+ <property name="wordWrap">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QLabel" name="label">
-+ <property name="text">
-+ <string>Final Map Projection:</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <layout class="QHBoxLayout" name="horizontalLayout_2">
-+ <property name="spacing">
-+ <number>3</number>
-+ </property>
-+ <item>
-+ <widget class="QLineEdit" name="lineProjection">
-+ <property name="toolTip">
-+ <string>Enter a valid projection string. Valid strings are &quot;+proj...&quot; or &quot;+init=epsg:...&quot;.</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolProjection">
-+ <property name="toolTip">
-+ <string>Start projection wizard.</string>
-+ </property>
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/GridWizard.png</normaloff>:/icons/32x32/GridWizard.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ </layout>
-+ </item>
-+ </layout>
-+ <action name="actionDelRefPoint">
-+ <property name="icon">
-+ <iconset resource="../resources.qrc">
-+ <normaloff>:/icons/32x32/DeleteMultiple.png</normaloff>:/icons/32x32/DeleteMultiple.png</iconset>
-+ </property>
-+ <property name="text">
-+ <string>Delete</string>
-+ </property>
-+ </action>
-+ </widget>
-+ <resources>
-+ <include location="../resources.qrc"/>
-+ </resources>
-+ <connections/>
-+</ui>
-diff --git a/src/qmaptool/overlay/gridtool/CGridPlacer.cpp b/src/qmaptool/overlay/gridtool/CGridPlacer.cpp
-new file mode 100644
-index 00000000..62b211c3
---- /dev/null
-+++ b/src/qmaptool/overlay/gridtool/CGridPlacer.cpp
-@@ -0,0 +1,274 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/IDrawContext.h"
-+#include "items/CItemRefMap.h"
-+#include "overlay/gridtool/CGridPlacer.h"
-+#include "overlay/gridtool/CGridPoint.h"
-+
-+#include <functional>
-+#include <QtWidgets>
-+using std::bind;
-+
-+
-+CGridPlacer::CGridPlacer(QWidget *parent)
-+ : QWidget(parent)
-+{
-+ setupUi(this);
-+
-+ labelHelp->setText(tr("Select one of the corners and place the marker at "
-+ "the corresponding grid crossing on the map. All "
-+ "4 corners have to be placed."));
-+
-+ QButtonGroup * group = new QButtonGroup(this);
-+ group->addButton(radioPoint1);
-+ group->addButton(radioPoint2);
-+ group->addButton(radioPoint3);
-+ group->addButton(radioPoint4);
-+
-+ connect(radioPoint1, &QToolButton::toggled, this, bind(&CGridPlacer::slotSetPoint, this, 0, std::placeholders::_1));
-+ connect(radioPoint2, &QToolButton::toggled, this, bind(&CGridPlacer::slotSetPoint, this, 1, std::placeholders::_1));
-+ connect(radioPoint3, &QToolButton::toggled, this, bind(&CGridPlacer::slotSetPoint, this, 2, std::placeholders::_1));
-+ connect(radioPoint4, &QToolButton::toggled, this, bind(&CGridPlacer::slotSetPoint, this, 3, std::placeholders::_1));
-+ connect(pushReset, &QPushButton::clicked, this, &CGridPlacer::slotReset);
-+ connect(pushSetArea, &QPushButton::clicked, this, &CGridPlacer::slotSetArea);
-+}
-+
-+void CGridPlacer::registerItem(CItemRefMap * item)
-+{
-+ this->item = item;
-+
-+ if(item != nullptr)
-+ {
-+ points = QVector<CGridPoint>(4);
-+
-+ for(CGridPoint& point : points)
-+ {
-+ point.registerItem(item);
-+ }
-+
-+ radioPoint1->setChecked(true);
-+ }
-+}
-+
-+void CGridPlacer::saveSettings(QSettings& cfg)
-+{
-+ cfg.beginGroup("Points");
-+ for(int i = 0; i < points.size(); i++)
-+ {
-+ const QPointF& pt = points[i].getPoint();
-+ if(pt != NOPOINTF)
-+ {
-+ cfg.setValue(QString::number(i), pt);
-+ }
-+ }
-+ cfg.endGroup();
-+}
-+
-+void CGridPlacer::loadSettings(QSettings& cfg)
-+{
-+ cfg.beginGroup("Points");
-+ for(int i = 0; i < points.size(); i++)
-+ {
-+ QPointF pt = cfg.value(QString::number(i), NOPOINTF).toPointF();
-+ points[i].setPoint(pt);
-+ }
-+ cfg.endGroup();
-+ updateStatus();
-+}
-+
-+bool CGridPlacer::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ for(CGridPoint& point : points)
-+ {
-+ point.drawFx(p, needsRedraw);
-+ }
-+
-+ return true;
-+}
-+
-+void CGridPlacer::mouseMoveEventFx(QMouseEvent *e)
-+{
-+ points[idx].mouseMoveEventFx(e);
-+}
-+
-+void CGridPlacer::mouseReleaseEventFx(QMouseEvent *e)
-+{
-+ points[idx].mouseReleaseEventFx(e);
-+ updateStatus();
-+}
-+
-+void CGridPlacer::leaveEventFx(QEvent *e)
-+{
-+ points[idx].leaveEventFx(e);
-+}
-+
-+QCursor CGridPlacer::getCursorFx()
-+{
-+ return points[idx].getCursorFx();
-+}
-+
-+void CGridPlacer::slotSetPoint(qint32 i, bool on)
-+{
-+ if(on)
-+ {
-+ idx = i;
-+ }
-+}
-+
-+void CGridPlacer::slotReset()
-+{
-+ for(CGridPoint& point : points)
-+ {
-+ point.setPoint(NOPOINTF);
-+ }
-+
-+ updateStatus();
-+
-+ item->getDrawContext()->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+}
-+
-+void CGridPlacer::updateStatus()
-+{
-+ /// @todo optimize this
-+
-+ const QPointF& pt1 = points[0].getPoint();
-+ const QPointF& pt2 = points[1].getPoint();
-+ const QPointF& pt3 = points[2].getPoint();
-+ const QPointF& pt4 = points[3].getPoint();
-+
-+ statusIsOk = true;
-+
-+ if(pt1 == NOPOINTF)
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint1->setText(tr("Point 1 - not set"));
-+ }
-+ else
-+ {
-+ labelStatusPoint1->setText("<b style='color: green'>" + tr("Point 1 - ok") + "</b>");
-+
-+ if((pt2 != NOPOINTF) && (pt2.x() < pt1.x()))
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint1->setText("<b style='color: red'>" + tr("Point 1 - bad") + "</b>");
-+ }
-+ if((pt4 != NOPOINTF) && (pt4.y() < pt1.y()))
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint1->setText("<b style='color: red'>" + tr("Point 1 - bad") + "</b>");
-+ }
-+ }
-+
-+ if(pt2 == NOPOINTF)
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint2->setText(tr("Point 2 - not set"));
-+ }
-+ else
-+ {
-+ labelStatusPoint2->setText("<b style='color: green'>" + tr("Point 2 - ok") + "</b>");
-+
-+ if((pt1 != NOPOINTF) && (pt1.x() > pt2.x()))
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint2->setText("<b style='color: red'>" + tr("Point 2 - bad") + "</b>");
-+ }
-+ if((pt3 != NOPOINTF) && (pt3.y() < pt2.y()))
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint2->setText("<b style='color: red'>" + tr("Point 2 - bad") + "</b>");
-+ }
-+ }
-+
-+
-+ if(pt3 == NOPOINTF)
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint3->setText(tr("Point 3 - not set"));
-+ }
-+ else
-+ {
-+ labelStatusPoint3->setText("<b style='color: green'>" + tr("Point 3 - ok") + "</b>");
-+
-+ if((pt4 != NOPOINTF) && (pt4.x() > pt3.x()))
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint3->setText("<b style='color: red'>" + tr("Point 3 - bad") + "</b>");
-+ }
-+ if((pt2 != NOPOINTF) && (pt2.y() > pt3.y()))
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint3->setText("<b style='color: red'>" + tr("Point 3 - bad") + "</b>");
-+ }
-+ }
-+
-+
-+ if(pt4 == NOPOINTF)
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint4->setText(tr("Point 4 - not set"));
-+ }
-+ else
-+ {
-+ labelStatusPoint4->setText("<b style='color: green'>" + tr("Point 4 - ok") + "</b>");
-+
-+ if((pt3 != NOPOINTF) && (pt3.x() < pt4.x()))
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint4->setText("<b style='color: red'>" + tr("Point 4 - bad") + "</b>");
-+ }
-+ if((pt1 != NOPOINTF) && (pt1.y() > pt4.y()))
-+ {
-+ statusIsOk = false;
-+ labelStatusPoint4->setText("<b style='color: red'>" + tr("Point 4 - bad") + "</b>");
-+ }
-+ }
-+
-+ pushSetArea->setEnabled(statusIsOk);
-+
-+ emit sigChanged();
-+}
-+
-+
-+void CGridPlacer::slotSetArea() const
-+{
-+ qreal bottom = -NOFLOAT;
-+ qreal top = NOFLOAT;
-+ qreal left = NOFLOAT;
-+ qreal right = -NOFLOAT;
-+
-+ for(const CGridPoint& point : points)
-+ {
-+ const QPointF& pt = point.getPoint();
-+
-+ top = qMin(pt.y(), top);
-+ bottom = qMax(pt.y(), bottom);
-+ left = qMin(pt.x(), left);
-+ right = qMax(pt.x(), right);
-+ }
-+
-+ QRectF r(0,0,1,1);
-+ r.setLeft(left);
-+ r.setRight(right);
-+ r.setTop(top);
-+ r.setBottom(bottom);
-+
-+
-+ emit sigSetArea(r);
-+}
-diff --git a/src/qmaptool/overlay/gridtool/CGridPlacer.h b/src/qmaptool/overlay/gridtool/CGridPlacer.h
-new file mode 100644
-index 00000000..8d321041
---- /dev/null
-+++ b/src/qmaptool/overlay/gridtool/CGridPlacer.h
-@@ -0,0 +1,85 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CGRIDPLACER_H
-+#define CGRIDPLACER_H
-+
-+#include "canvas/CCanvas.h"
-+#include "overlay/gridtool/CGridPoint.h"
-+
-+#include "ui_IGridPlacer.h"
-+
-+class CItemRefMap;
-+class QSettings;
-+
-+class CGridPlacer : public QWidget, private Ui::IGridPlacer
-+{
-+ Q_OBJECT
-+public:
-+ CGridPlacer(QWidget * parent);
-+ virtual ~CGridPlacer() = default;
-+
-+ void registerItem(CItemRefMap * item);
-+
-+ void saveSettings(QSettings& cfg);
-+ void loadSettings(QSettings& cfg);
-+
-+ bool drawFx(QPainter& p, CCanvas::redraw_e needsRedraw);
-+ void mouseMoveEventFx(QMouseEvent *e);
-+ void mouseReleaseEventFx(QMouseEvent *e);
-+ void leaveEventFx(QEvent *e);
-+ QCursor getCursorFx();
-+
-+ bool isOk() const
-+ {
-+ return statusIsOk;
-+ }
-+
-+ const QPointF& getPoint(int idx) const
-+ {
-+ if(idx < points.count())
-+ {
-+ return points[idx].getPoint();
-+ }
-+ return NOPOINTF;
-+ }
-+
-+signals:
-+ void sigChanged();
-+ void sigSetArea(const QRectF& area) const;
-+
-+public slots:
-+ void slotReset();
-+
-+private slots:
-+ void slotSetPoint(qint32 i, bool on);
-+ void slotSetArea() const;
-+
-+private:
-+ void updateStatus();
-+ CItemRefMap * item = nullptr;
-+
-+ qint32 idx = 0;
-+
-+ QVector<CGridPoint> points;
-+
-+ bool statusIsOk = false;
-+};
-+
-+#endif //CGRIDPLACER_H
-+
-diff --git a/src/qmaptool/overlay/gridtool/CGridPoint.cpp b/src/qmaptool/overlay/gridtool/CGridPoint.cpp
-new file mode 100644
-index 00000000..b1a1cf6e
---- /dev/null
-+++ b/src/qmaptool/overlay/gridtool/CGridPoint.cpp
-@@ -0,0 +1,184 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/IDrawContext.h"
-+#include "helpers/CDraw.h"
-+#include "items/CItemRefMap.h"
-+#include "overlay/gridtool/CGridPoint.h"
-+
-+#include <QtWidgets>
-+
-+CGridPoint::CGridPoint()
-+{
-+}
-+
-+void CGridPoint::registerItem(CItemRefMap * item)
-+{
-+ this->item = item;
-+
-+ if(item != nullptr)
-+ {
-+ context = item->getDrawContext();
-+ if(context == nullptr)
-+ {
-+ this->item = nullptr;
-+ }
-+ }
-+ else
-+ {
-+ context = nullptr;
-+ }
-+}
-+
-+bool CGridPoint::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ if(ptFocus1 != NOPOINTF)
-+ {
-+ QPointF pt = ptFocus1;
-+ context->convertMap2Screen(pt);
-+ CDraw::drawCrossHairDot(p, pt);
-+ }
-+
-+ if(ptPoint != NOPOINTF)
-+ {
-+ QPointF pt = ptPoint;
-+ context->convertMap2Screen(pt);
-+
-+ QRectF dot1(0,0,7,7);
-+ dot1.moveCenter(pt);
-+
-+ if(state == eStateHighlight)
-+ {
-+ p.setPen(QPen(QColor("#ffaa00"), 2));
-+ p.setBrush(QColor("#ffaa00"));
-+ }
-+ else
-+ {
-+ p.setPen(QPen(Qt::white, 1));
-+ p.setBrush(QColor("#ffaa00"));
-+ }
-+
-+ p.drawRect(dot1);
-+ }
-+
-+ return true;
-+}
-+
-+void CGridPoint::mouseMoveEventFx(QMouseEvent *e)
-+{
-+ QPointF pt = e->pos();
-+
-+
-+ switch(state)
-+ {
-+ case eStateMove:
-+ case eStateNotSet:
-+ context->convertScreen2Map(pt);
-+ ptFocus1 = pt;
-+ break;
-+
-+ case eStateSet:
-+ {
-+ QPointF point = ptPoint;
-+ context->convertMap2Screen(point);
-+ if((point - pt).manhattanLength() < 30)
-+ {
-+ state = eStateHighlight;
-+ }
-+ break;
-+ }
-+
-+ case eStateHighlight:
-+ {
-+ QPointF point = ptPoint;
-+ context->convertMap2Screen(point);
-+ if((point - pt).manhattanLength() >= 30)
-+ {
-+ state = eStateSet;
-+ }
-+ break;
-+ }
-+ }
-+
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+}
-+
-+void CGridPoint::mouseReleaseEventFx(QMouseEvent *e)
-+{
-+ switch(state)
-+ {
-+ case eStateMove:
-+ case eStateNotSet:
-+ ptPoint = ptFocus1;
-+ ptFocus1 = NOPOINTF;
-+ state = eStateSet;
-+ CCanvas::restoreOverrideCursor("CGridPoint::mouseReleaseEventFx");
-+ break;
-+
-+ case eStateSet:
-+ break;
-+
-+ case eStateHighlight:
-+ ptFocus1 = ptPoint;
-+ ptPoint = NOPOINTF;
-+ state = eStateMove;
-+ CCanvas::setOverrideCursor(Qt::BlankCursor, "CGridPoint::mouseReleaseEventFx");
-+ break;
-+ }
-+
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+}
-+
-+void CGridPoint::leaveEventFx(QEvent *e)
-+{
-+ ptFocus1 = NOPOINTF;
-+
-+ switch(state)
-+ {
-+ case eStateNotSet:
-+ case eStateSet:
-+ break;
-+
-+ case eStateHighlight:
-+ case eStateMove:
-+ state = eStateSet;
-+ break;
-+ }
-+
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+}
-+
-+QCursor CGridPoint::getCursorFx()
-+{
-+ switch(state)
-+ {
-+ case eStateNotSet:
-+ return Qt::BlankCursor;
-+
-+ case eStateSet:
-+ return Qt::ArrowCursor;
-+
-+ case eStateHighlight:
-+ return Qt::ArrowCursor;
-+
-+ case eStateMove:
-+ return Qt::BlankCursor;
-+ }
-+
-+ return Qt::ArrowCursor;
-+}
-diff --git a/src/qmaptool/overlay/gridtool/CGridPoint.h b/src/qmaptool/overlay/gridtool/CGridPoint.h
-new file mode 100644
-index 00000000..5db2d868
---- /dev/null
-+++ b/src/qmaptool/overlay/gridtool/CGridPoint.h
-@@ -0,0 +1,70 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CGRIDPOINT_H
-+#define CGRIDPOINT_H
-+
-+#include "canvas/CCanvas.h"
-+#include "units/IUnit.h"
-+
-+class CItemRefMap;
-+class IDrawContext;
-+
-+class CGridPoint
-+{
-+public:
-+ CGridPoint();
-+ virtual ~CGridPoint() = default;
-+
-+ void registerItem(CItemRefMap * item);
-+
-+ bool drawFx(QPainter& p, CCanvas::redraw_e needsRedraw);
-+ void mouseMoveEventFx(QMouseEvent *e);
-+ void mouseReleaseEventFx(QMouseEvent *e);
-+ void leaveEventFx(QEvent *e);
-+ QCursor getCursorFx();
-+
-+ const QPointF& getPoint() const
-+ {
-+ return ptPoint;
-+ }
-+
-+ void setPoint(const QPointF& pt)
-+ {
-+ ptPoint = pt;
-+ state = pt == NOPOINTF ? eStateNotSet : eStateSet;
-+ }
-+
-+private:
-+ enum state_e
-+ {
-+ eStateNotSet
-+ ,eStateSet
-+ ,eStateHighlight
-+ ,eStateMove
-+ };
-+
-+ state_e state = eStateNotSet;
-+ CItemRefMap * item = nullptr;
-+ const IDrawContext * context = nullptr;
-+ QPointF ptPoint = NOPOINTF;
-+ QPointF ptFocus1 = NOPOINTF;
-+};
-+
-+#endif //CGRIDPOINT_H
-+
-diff --git a/src/qmaptool/overlay/gridtool/CGridSelArea.cpp b/src/qmaptool/overlay/gridtool/CGridSelArea.cpp
-new file mode 100644
-index 00000000..d929633d
---- /dev/null
-+++ b/src/qmaptool/overlay/gridtool/CGridSelArea.cpp
-@@ -0,0 +1,240 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "canvas/IDrawContext.h"
-+#include "helpers/CDraw.h"
-+#include "items/CItemRefMap.h"
-+#include "overlay/gridtool/CGridSelArea.h"
-+
-+#include <QtWidgets>
-+
-+CGridSelArea::CGridSelArea(QWidget *parent)
-+ : QWidget(parent)
-+{
-+ setupUi(this);
-+ labelHelp->setText(tr("Select the area to be covered by the calculated reference points. Simply grab "
-+ "the corners of the selection rectangle with a left click and place them where "
-+ "you want with a second click."));
-+}
-+
-+
-+void CGridSelArea::registerItem(CItemRefMap * item)
-+{
-+ this->item = item;
-+
-+ if(item != nullptr)
-+ {
-+ context = item->getDrawContext();
-+ if(context == nullptr)
-+ {
-+ this->item = nullptr;
-+ }
-+ }
-+ else
-+ {
-+ context = nullptr;
-+ }
-+}
-+
-+void CGridSelArea::saveSettings(QSettings& cfg)
-+{
-+ cfg.setValue("area", area);
-+}
-+
-+void CGridSelArea::loadSettings(QSettings& cfg)
-+{
-+ area = cfg.value("area", QRectF()).toRectF();
-+ emit sigChanged();
-+}
-+
-+bool CGridSelArea::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw)
-+{
-+ if(area.isEmpty())
-+ {
-+ return false;
-+ }
-+
-+ QRectF rect = area;
-+ context->convertMap2Screen(rect);
-+
-+ rectTopLeft.moveTopLeft(rect.topLeft());
-+ rectTopRight.moveTopRight(rect.topRight());
-+ rectBottomLeft.moveBottomLeft(rect.bottomLeft());
-+ rectBottomRight.moveBottomRight(rect.bottomRight());
-+
-+ CDraw::drawRectangle(p, rectTopLeft, Qt::black, Qt::lightGray);
-+ CDraw::drawRectangle(p, rectTopRight, Qt::black, Qt::lightGray);
-+ CDraw::drawRectangle(p, rectBottomLeft, Qt::black, Qt::lightGray);
-+ CDraw::drawRectangle(p, rectBottomRight, Qt::black, Qt::lightGray);
-+
-+ p.setBrush(Qt::red);
-+ switch(corner)
-+ {
-+ case eCornerTopLeft:
-+ CDraw::drawRectangle(p, rectTopLeft, Qt::black, Qt::red);
-+ break;
-+
-+ case eCornerTopRight:
-+ CDraw::drawRectangle(p, rectTopRight, Qt::black, Qt::red);
-+ break;
-+
-+ case eCornerBottomLeft:
-+ CDraw::drawRectangle(p, rectBottomLeft, Qt::black, Qt::red);
-+ break;
-+
-+ case eCornerBottomRight:
-+ CDraw::drawRectangle(p, rectBottomRight, Qt::black, Qt::red);
-+ break;
-+ }
-+
-+ CDraw::drawRectangle(p, rect, QPen(Qt::black), Qt::NoBrush);
-+
-+ return true;
-+}
-+
-+void CGridSelArea::mouseMoveEventFx(QMouseEvent *e)
-+{
-+ switch(state)
-+ {
-+ case eStateIdle:
-+ {
-+ corner_e _corner = corner;
-+ QPoint pos = e->pos();
-+ if(rectTopLeft.contains(pos))
-+ {
-+ offset = pos - rectTopLeft.topLeft();
-+ corner = eCornerTopLeft;
-+ }
-+ else if(rectTopRight.contains(pos))
-+ {
-+ offset = pos - rectTopRight.topRight();
-+ corner = eCornerTopRight;
-+ }
-+ else if(rectBottomLeft.contains(pos))
-+ {
-+ offset = pos - rectBottomLeft.bottomLeft();
-+ corner = eCornerBottomLeft;
-+ }
-+ else if(rectBottomRight.contains(pos))
-+ {
-+ offset = pos - rectBottomRight.bottomRight();
-+ corner = eCornerBottomRight;
-+ }
-+ else
-+ {
-+ corner = eCornerNone;
-+ }
-+
-+ if(corner != _corner)
-+ {
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+ }
-+
-+ break;
-+ }
-+
-+ case eStateMove:
-+ {
-+ QPointF pos = e->pos() - offset;
-+ context->convertScreen2Map(pos);
-+
-+ switch(corner)
-+ {
-+ case eCornerTopLeft:
-+ area.setTopLeft(pos);
-+ break;
-+
-+ case eCornerTopRight:
-+ area.setTopRight(pos);
-+ break;
-+
-+ case eCornerBottomLeft:
-+ area.setBottomLeft(pos);
-+ break;
-+
-+ case eCornerBottomRight:
-+ area.setBottomRight(pos);
-+ break;
-+ }
-+
-+ emit sigChanged();
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+ break;
-+ }
-+ }
-+}
-+
-+void CGridSelArea::mouseReleaseEventFx(QMouseEvent *e)
-+{
-+ if(e->button() == Qt::LeftButton)
-+ {
-+ switch(state)
-+ {
-+ case eStateIdle:
-+ {
-+ if(corner != eCornerNone)
-+ {
-+ areaSave = area;
-+ state = eStateMove;
-+ }
-+ break;
-+ }
-+
-+ case eStateMove:
-+ {
-+ corner = eCornerNone;
-+ state = eStateIdle;
-+ break;
-+ }
-+ }
-+ }
-+ else
-+ {
-+ area = areaSave;
-+ state = eStateIdle;
-+ corner = eCornerNone;
-+ }
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+ emit sigChanged();
-+}
-+
-+void CGridSelArea::leaveEventFx(QEvent *e)
-+{
-+}
-+
-+QCursor CGridSelArea::getCursorFx()
-+{
-+ return Qt::ArrowCursor;
-+}
-+
-+
-+void CGridSelArea::slotSetArea(const QRectF& rect)
-+{
-+ area = rect;
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+ emit sigChanged();
-+}
-+
-+void CGridSelArea::slotReset()
-+{
-+ area = QRectF();
-+ state = eStateIdle;
-+ corner = eCornerNone;
-+ context->triggerCompleteUpdate(CCanvas::eRedrawOverlay);
-+ emit sigChanged();
-+}
-diff --git a/src/qmaptool/overlay/gridtool/CGridSelArea.h b/src/qmaptool/overlay/gridtool/CGridSelArea.h
-new file mode 100644
-index 00000000..1505c106
---- /dev/null
-+++ b/src/qmaptool/overlay/gridtool/CGridSelArea.h
-@@ -0,0 +1,97 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CGRIDSELAREA_H
-+#define CGRIDSELAREA_H
-+
-+#include "canvas/CCanvas.h"
-+#include "ui_IGridSelArea.h"
-+
-+class CItemRefMap;
-+class QSettings;
-+class IDrawContext;
-+
-+
-+class CGridSelArea : public QWidget, private Ui::IGridSelArea
-+{
-+ Q_OBJECT
-+public:
-+ CGridSelArea(QWidget * parent);
-+ virtual ~CGridSelArea() = default;
-+
-+ void registerItem(CItemRefMap * item);
-+
-+ void saveSettings(QSettings& cfg);
-+ void loadSettings(QSettings& cfg);
-+
-+ bool drawFx(QPainter& p, CCanvas::redraw_e needsRedraw);
-+ void mouseMoveEventFx(QMouseEvent *e);
-+ void mouseReleaseEventFx(QMouseEvent *e);
-+ void leaveEventFx(QEvent *e);
-+ QCursor getCursorFx();
-+
-+ const QRectF& getArea() const
-+ {
-+ return area;
-+ }
-+
-+public slots:
-+ void slotSetArea(const QRectF& rect);
-+ void slotReset();
-+
-+
-+signals:
-+ void sigChanged();
-+
-+private:
-+ CItemRefMap * item = nullptr;
-+ const IDrawContext * context = nullptr;
-+
-+ QRectF area;
-+ QRectF areaSave;
-+ QPointF offset;
-+
-+ QRectF rectTopLeft {0, 0, 20, 20};
-+ QRectF rectTopRight {0, 0, 20, 20};
-+ QRectF rectBottomLeft {0, 0, 20, 20};
-+ QRectF rectBottomRight {0, 0, 20, 20};
-+
-+ enum state_e
-+ {
-+ eStateIdle
-+ ,eStateMove
-+ };
-+
-+ state_e state = eStateIdle;
-+
-+ enum corner_e
-+ {
-+ eCornerNone
-+ , eCornerTopLeft
-+ , eCornerTopRight
-+ , eCornerBottomLeft
-+ , eCornerBottomRight
-+ , eCornerPrint
-+ , eCornerImage
-+ };
-+
-+ corner_e corner = eCornerNone;
-+};
-+
-+#endif //CGRIDSELAREA_H
-+
-diff --git a/src/qmaptool/overlay/gridtool/CGridSetRef.cpp b/src/qmaptool/overlay/gridtool/CGridSetRef.cpp
-new file mode 100644
-index 00000000..c027cf15
---- /dev/null
-+++ b/src/qmaptool/overlay/gridtool/CGridSetRef.cpp
-@@ -0,0 +1,105 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "CMainWindow.h"
-+#include "overlay/gridtool/CGridSetRef.h"
-+#include "overlay/refmap/CProjWizard.h"
-+
-+#include <QtWidgets>
-+
-+CGridSetRef::CGridSetRef(QWidget *parent)
-+ : QWidget(parent)
-+{
-+ setupUi(this);
-+
-+ connect(toolGridProj, &QToolButton::clicked, this, &CGridSetRef::slotSetupGridProj);
-+ connect(lineEasting, &QLineEdit::textChanged, this, &CGridSetRef::sigChanged);
-+ connect(lineNorthing, &QLineEdit::textChanged, this, &CGridSetRef::sigChanged);
-+ connect(lineHorizSpacing, &QLineEdit::textChanged, this, &CGridSetRef::sigChanged);
-+ connect(lineVertSpacing, &QLineEdit::textChanged, this, &CGridSetRef::sigChanged);
-+ connect(lineGridProj, &QLineEdit::textChanged, this, &CGridSetRef::sigChanged);
-+
-+ labelHelp->setText(tr("Valid coordinate formats: If the projection is lat/lon all values have to be in degree, e.g. \"48.2\" or \"12.4\". "
-+ "For all other projections values are either in multiple of meter or feet. If you are doing it wrong the entry field "
-+ "will turn red."
-+ ));
-+ connect(CMainWindow::self().showToolHelp(), &QAction::toggled, labelHelp, &QLabel::setVisible);
-+}
-+
-+void CGridSetRef::saveSettings(QSettings& cfg)
-+{
-+ cfg.setValue("proj", lineGridProj->text());
-+ cfg.setValue("easting", lineEasting->text().toDouble());
-+ cfg.setValue("northing", lineNorthing->text().toDouble());
-+ cfg.setValue("horizSpacing", lineHorizSpacing->text().toDouble());
-+ cfg.setValue("vertSpacing", lineVertSpacing->text().toDouble());
-+}
-+
-+void CGridSetRef::loadSettings(QSettings& cfg)
-+{
-+ lineGridProj->setText(cfg.value("proj","").toString());
-+ lineEasting->setText(cfg.value("easting","").toString());
-+ lineNorthing->setText(cfg.value("northing","").toString());
-+ lineHorizSpacing->setText(cfg.value("horizSpacing","").toString());
-+ lineVertSpacing->setText(cfg.value("vertSpacing","").toString());
-+ lineGridProj->setCursorPosition(0);
-+}
-+
-+
-+bool CGridSetRef::isOk()
-+{
-+ bool allOk = true;
-+
-+ bool ok = CProjWizard::validProjStr(lineGridProj->text());
-+ markWidget(lineGridProj, ok);
-+ allOk &= ok;
-+
-+ ok &= lineEasting->text().toDouble(&ok) != 0;
-+ markWidget(lineEasting, ok);
-+ allOk &= ok;
-+
-+ ok &= lineNorthing->text().toDouble(&ok) != 0;
-+ markWidget(lineNorthing, ok);
-+ allOk &= ok;
-+
-+ ok &= lineHorizSpacing->text().toDouble(&ok) != 0;
-+ markWidget(lineHorizSpacing, ok);
-+ allOk &= ok;
-+
-+ ok &= lineVertSpacing->text().toDouble(&ok) != 0;
-+ markWidget(lineVertSpacing, ok);
-+ allOk &= ok;
-+
-+ return allOk;
-+}
-+
-+void CGridSetRef::slotSetupGridProj()
-+{
-+ CProjWizard dlg(*lineGridProj, this);
-+ dlg.exec();
-+ lineGridProj->setCursorPosition(0);
-+}
-+
-+void CGridSetRef::slotReset()
-+{
-+ lineGridProj->clear();
-+ lineEasting->clear();
-+ lineNorthing->clear();
-+ lineHorizSpacing->clear();
-+ lineVertSpacing->clear();
-+}
-diff --git a/src/qmaptool/overlay/gridtool/CGridSetRef.h b/src/qmaptool/overlay/gridtool/CGridSetRef.h
-new file mode 100644
-index 00000000..7956b0d3
---- /dev/null
-+++ b/src/qmaptool/overlay/gridtool/CGridSetRef.h
-@@ -0,0 +1,86 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CGRIDSETREF_H
-+#define CGRIDSETREF_H
-+
-+#include "ui_IGridSetRef.h"
-+
-+class QSettings;
-+
-+class CGridSetRef : public QWidget, private Ui::IGridSetRef
-+{
-+ Q_OBJECT
-+public:
-+ CGridSetRef(QWidget * parent);
-+ virtual ~CGridSetRef() = default;
-+
-+ void saveSettings(QSettings& cfg);
-+ void loadSettings(QSettings& cfg);
-+
-+ bool isOk();
-+
-+ QString getProjection() const
-+ {
-+ return lineGridProj->text();
-+ }
-+
-+ qreal getEasting() const
-+ {
-+ return lineEasting->text().toDouble();
-+ }
-+
-+ qreal getNorthing() const
-+ {
-+ return lineNorthing->text().toDouble();
-+ }
-+
-+ qreal getHorizSpacing() const
-+ {
-+ return lineHorizSpacing->text().toDouble();
-+ }
-+
-+ qreal getVertSpacing() const
-+ {
-+ return lineVertSpacing->text().toDouble();
-+ }
-+
-+signals:
-+ void sigChanged();
-+
-+public slots:
-+ void slotReset();
-+
-+private slots:
-+ void slotSetupGridProj();
-+
-+private:
-+ template<typename T>
-+ void markWidget(T * w, bool isOk)
-+ {
-+ QPalette pal = T(this).palette();
-+ if(!isOk)
-+ {
-+ pal.setColor(QPalette::Base, "#ffaa7f");
-+ }
-+ w->setPalette(pal);
-+ }
-+};
-+
-+#endif //CGRIDSETREF_H
-+
-diff --git a/src/qmaptool/overlay/gridtool/IGridPlacer.ui b/src/qmaptool/overlay/gridtool/IGridPlacer.ui
-new file mode 100644
-index 00000000..833585ad
---- /dev/null
-+++ b/src/qmaptool/overlay/gridtool/IGridPlacer.ui
-@@ -0,0 +1,248 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<ui version="4.0">
-+ <class>IGridPlacer</class>
-+ <widget class="QWidget" name="IGridPlacer">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>254</width>
-+ <height>224</height>
-+ </rect>
-+ </property>
-+ <property name="windowTitle">
-+ <string>Form</string>
-+ </property>
-+ <layout class="QVBoxLayout" name="verticalLayout" stretch="0">
-+ <property name="spacing">
-+ <number>0</number>
-+ </property>
-+ <property name="leftMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="topMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="rightMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="bottomMargin">
-+ <number>0</number>
-+ </property>
-+ <item>
-+ <layout class="QGridLayout" name="gridLayout">
-+ <item row="1" column="1">
-+ <widget class="QRadioButton" name="radioPoint1">
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="checked">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="3" column="1">
-+ <widget class="QRadioButton" name="radioPoint4">
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="text">
-+ <string/>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="1" column="2">
-+ <widget class="QLabel" name="label_4">
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="pixmap">
-+ <pixmap resource="../../resources.qrc">:/pic/line_3px_horizontal.png</pixmap>
-+ </property>
-+ <property name="alignment">
-+ <set>Qt::AlignCenter</set>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="3" column="3">
-+ <widget class="QRadioButton" name="radioPoint3">
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="text">
-+ <string/>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="2" column="3">
-+ <widget class="QLabel" name="label_3">
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="pixmap">
-+ <pixmap resource="../../resources.qrc">:/pic/line_3px_vertical.png</pixmap>
-+ </property>
-+ <property name="alignment">
-+ <set>Qt::AlignCenter</set>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="1" column="3">
-+ <widget class="QRadioButton" name="radioPoint2">
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="text">
-+ <string/>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="2" column="1">
-+ <widget class="QLabel" name="label">
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="pixmap">
-+ <pixmap resource="../../resources.qrc">:/pic/line_3px_vertical.png</pixmap>
-+ </property>
-+ <property name="alignment">
-+ <set>Qt::AlignCenter</set>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="2" column="4">
-+ <spacer name="horizontalSpacer">
-+ <property name="orientation">
-+ <enum>Qt::Horizontal</enum>
-+ </property>
-+ <property name="sizeHint" stdset="0">
-+ <size>
-+ <width>40</width>
-+ <height>20</height>
-+ </size>
-+ </property>
-+ </spacer>
-+ </item>
-+ <item row="2" column="2">
-+ <widget class="QPushButton" name="pushReset">
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="text">
-+ <string>Reset</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="3" column="2">
-+ <widget class="QLabel" name="label_5">
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="pixmap">
-+ <pixmap resource="../../resources.qrc">:/pic/line_3px_horizontal.png</pixmap>
-+ </property>
-+ <property name="alignment">
-+ <set>Qt::AlignCenter</set>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="2" column="5">
-+ <layout class="QVBoxLayout" name="verticalLayout_2">
-+ <item>
-+ <widget class="QLabel" name="labelStatusPoint1">
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="text">
-+ <string/>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QLabel" name="labelStatusPoint2">
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="text">
-+ <string/>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QLabel" name="labelStatusPoint3">
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="text">
-+ <string/>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QLabel" name="labelStatusPoint4">
-+ <property name="sizePolicy">
-+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
-+ <horstretch>0</horstretch>
-+ <verstretch>0</verstretch>
-+ </sizepolicy>
-+ </property>
-+ <property name="text">
-+ <string/>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <widget class="QPushButton" name="pushSetArea">
-+ <property name="text">
-+ <string>Set Area</string>
-+ </property>
-+ </widget>
-+ </item>
-+ </layout>
-+ </item>
-+ <item row="0" column="0" colspan="6">
-+ <widget class="QLabel" name="labelHelp">
-+ <property name="text">
-+ <string/>
-+ </property>
-+ <property name="wordWrap">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ </layout>
-+ </item>
-+ </layout>
-+ </widget>
-+ <resources>
-+ <include location="../../resources.qrc"/>
-+ </resources>
-+ <connections/>
-+</ui>
-diff --git a/src/qmaptool/overlay/gridtool/IGridSelArea.ui b/src/qmaptool/overlay/gridtool/IGridSelArea.ui
-new file mode 100644
-index 00000000..dd3f4a04
---- /dev/null
-+++ b/src/qmaptool/overlay/gridtool/IGridSelArea.ui
-@@ -0,0 +1,49 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<ui version="4.0">
-+ <class>IGridSelArea</class>
-+ <widget class="QWidget" name="IGridSelArea">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>400</width>
-+ <height>300</height>
-+ </rect>
-+ </property>
-+ <property name="windowTitle">
-+ <string>Form</string>
-+ </property>
-+ <layout class="QVBoxLayout" name="verticalLayout">
-+ <property name="spacing">
-+ <number>0</number>
-+ </property>
-+ <property name="leftMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="topMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="rightMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="bottomMargin">
-+ <number>0</number>
-+ </property>
-+ <item>
-+ <widget class="QLabel" name="labelHelp">
-+ <property name="text">
-+ <string>TextLabel</string>
-+ </property>
-+ <property name="alignment">
-+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-+ </property>
-+ <property name="wordWrap">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ </layout>
-+ </widget>
-+ <resources/>
-+ <connections/>
-+</ui>
-diff --git a/src/qmaptool/overlay/gridtool/IGridSetRef.ui b/src/qmaptool/overlay/gridtool/IGridSetRef.ui
-new file mode 100644
-index 00000000..68fe4d31
---- /dev/null
-+++ b/src/qmaptool/overlay/gridtool/IGridSetRef.ui
-@@ -0,0 +1,117 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<ui version="4.0">
-+ <class>IGridSetRef</class>
-+ <widget class="QWidget" name="IGridSetRef">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>400</width>
-+ <height>133</height>
-+ </rect>
-+ </property>
-+ <property name="windowTitle">
-+ <string>Form</string>
-+ </property>
-+ <layout class="QVBoxLayout" name="verticalLayout">
-+ <property name="spacing">
-+ <number>3</number>
-+ </property>
-+ <property name="leftMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="topMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="rightMargin">
-+ <number>0</number>
-+ </property>
-+ <property name="bottomMargin">
-+ <number>0</number>
-+ </property>
-+ <item>
-+ <widget class="QLabel" name="label">
-+ <property name="text">
-+ <string>Grid Projection:</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <layout class="QHBoxLayout" name="horizontalLayout">
-+ <item>
-+ <widget class="QLineEdit" name="lineGridProj"/>
-+ </item>
-+ <item>
-+ <widget class="QToolButton" name="toolGridProj">
-+ <property name="text">
-+ <string>...</string>
-+ </property>
-+ <property name="icon">
-+ <iconset resource="../../resources.qrc">
-+ <normaloff>:/icons/32x32/GridWizard.png</normaloff>:/icons/32x32/GridWizard.png</iconset>
-+ </property>
-+ </widget>
-+ </item>
-+ </layout>
-+ </item>
-+ <item>
-+ <widget class="QLabel" name="labelHelp">
-+ <property name="text">
-+ <string>TextLabel</string>
-+ </property>
-+ <property name="wordWrap">
-+ <bool>true</bool>
-+ </property>
-+ </widget>
-+ </item>
-+ <item>
-+ <layout class="QGridLayout" name="gridLayout">
-+ <item row="0" column="0">
-+ <widget class="QLabel" name="label_2">
-+ <property name="text">
-+ <string>Easting</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="0" column="1">
-+ <widget class="QLineEdit" name="lineEasting"/>
-+ </item>
-+ <item row="0" column="2">
-+ <widget class="QLabel" name="label_3">
-+ <property name="text">
-+ <string>Horiz. Spacing</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="0" column="3">
-+ <widget class="QLineEdit" name="lineHorizSpacing"/>
-+ </item>
-+ <item row="1" column="0">
-+ <widget class="QLabel" name="label_4">
-+ <property name="text">
-+ <string>Northing</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="1" column="1">
-+ <widget class="QLineEdit" name="lineNorthing"/>
-+ </item>
-+ <item row="1" column="2">
-+ <widget class="QLabel" name="labelVertSpacing">
-+ <property name="text">
-+ <string>Vert. Spacing</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="1" column="3">
-+ <widget class="QLineEdit" name="lineVertSpacing"/>
-+ </item>
-+ </layout>
-+ </item>
-+ </layout>
-+ </widget>
-+ <resources>
-+ <include location="../../resources.qrc"/>
-+ </resources>
-+ <connections/>
-+</ui>
-diff --git a/src/qmaptool/overlay/refmap/CDialogRefPoint.cpp b/src/qmaptool/overlay/refmap/CDialogRefPoint.cpp
-new file mode 100644
-index 00000000..895ef920
---- /dev/null
-+++ b/src/qmaptool/overlay/refmap/CDialogRefPoint.cpp
-@@ -0,0 +1,74 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "overlay/refmap/CDialogRefPoint.h"
-+#include "units/IUnit.h"
-+
-+#include <QtWidgets>
-+
-+CDialogRefPoint::CDialogRefPoint(QPointF& ptPtx, QPointF& ptRef, QWidget *parent)
-+ : QDialog(parent)
-+ , ptPtx(ptPtx)
-+ , ptRef(ptRef)
-+{
-+ setupUi(this);
-+ connect(lineCoord, &QLineEdit::textEdited, this, &CDialogRefPoint::slotEditPosition);
-+
-+ lineX->setText(QString::number(qRound(ptPtx.x())));
-+ lineY->setText(QString::number(qRound(ptPtx.y())));
-+ if(ptRef != NOPOINTF)
-+ {
-+ QString str;
-+ if(IUnit::degToStr(ptRef.x(), ptRef.y(), str))
-+ {
-+ str = tr("bad coordinate");
-+ }
-+ lineCoord->setText(str);
-+ }
-+
-+ labelWarning->hide();
-+}
-+
-+void CDialogRefPoint::slotEditPosition(const QString& str)
-+{
-+ labelWarning->setVisible(!IUnit::isValidCoordString(str));
-+}
-+
-+void CDialogRefPoint::accept()
-+{
-+ bool ok;
-+ ptPtx.setX(lineX->text().toInt(&ok));
-+ if(!ok)
-+ {
-+ QMessageBox::warning(this, tr("Error"), tr("Bad value for X pixel."), QMessageBox::Ok);
-+ return;
-+ }
-+ ptPtx.setY(lineY->text().toInt(&ok));
-+ if(!ok)
-+ {
-+ QMessageBox::warning(this, tr("Error"), tr("Bad value for Y pixel."), QMessageBox::Ok);
-+ return;
-+ }
-+
-+ if(!IUnit::strToDeg(lineCoord->text(), ptRef.rx(), ptRef.ry()))
-+ {
-+ return;
-+ }
-+
-+ QDialog::accept();
-+}
-diff --git a/src/qmaptool/overlay/refmap/CDialogRefPoint.h b/src/qmaptool/overlay/refmap/CDialogRefPoint.h
-new file mode 100644
-index 00000000..67bc5df5
---- /dev/null
-+++ b/src/qmaptool/overlay/refmap/CDialogRefPoint.h
-@@ -0,0 +1,46 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CDIALOGREFPOINT_H
-+#define CDIALOGREFPOINT_H
-+
-+#include "ui_IDialogRefPoint.h"
-+#include <QDialog>
-+
-+class QPointF;
-+
-+class CDialogRefPoint : public QDialog, private Ui::IDialogRefPoint
-+{
-+ Q_OBJECT
-+public:
-+ CDialogRefPoint(QPointF& ptPtx, QPointF& ptRef, QWidget * parent);
-+ virtual ~CDialogRefPoint() = default;
-+
-+public slots:
-+ void accept() override;
-+
-+private slots:
-+ void slotEditPosition(const QString& str);
-+
-+private:
-+ QPointF& ptPtx;
-+ QPointF& ptRef;
-+};
-+
-+#endif //CDIALOGREFPOINT_H
-+
-diff --git a/src/qmaptool/overlay/refmap/COverlayRefMapPoint.cpp b/src/qmaptool/overlay/refmap/COverlayRefMapPoint.cpp
-new file mode 100644
-index 00000000..eae52331
---- /dev/null
-+++ b/src/qmaptool/overlay/refmap/COverlayRefMapPoint.cpp
-@@ -0,0 +1,52 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "overlay/refmap/COverlayRefMapPoint.h"
-+#include "units/IUnit.h"
-+
-+COverlayRefMapPoint::COverlayRefMapPoint(qint32 cnt, const QPointF &ptRef, const QPointF &ptPtx, QTreeWidget *parent)
-+ : QTreeWidgetItem(parent)
-+{
-+ setText(eColumnCnt, QString::number(cnt));
-+ setPtPtx(ptPtx);
-+ setPtRef(ptRef);
-+}
-+
-+void COverlayRefMapPoint::setPtPtx(const QPointF& pt)
-+{
-+ ptPtx.rx() = qRound(pt.x());
-+ ptPtx.ry() = qRound(pt.y());
-+ setText(eColumnXY, QString("%1, %2").arg(ptPtx.x()).arg(ptPtx.y()));
-+}
-+
-+void COverlayRefMapPoint::setPtRef(const QPointF& pt)
-+{
-+ ptRef = pt;
-+ QString str;
-+ if(!IUnit::self().degToStr(ptRef.x(), ptRef.y(), str))
-+ {
-+ str = tr("bad coordinate");
-+ }
-+ setText(eColumnLonLat, str);
-+}
-+
-+void COverlayRefMapPoint::setIndex(int n)
-+{
-+ setText(eColumnCnt, QString::number(n));
-+}
-+
-diff --git a/src/qmaptool/overlay/refmap/COverlayRefMapPoint.h b/src/qmaptool/overlay/refmap/COverlayRefMapPoint.h
-new file mode 100644
-index 00000000..53bced7c
---- /dev/null
-+++ b/src/qmaptool/overlay/refmap/COverlayRefMapPoint.h
-@@ -0,0 +1,67 @@
-+/**********************************************************************************************
-+ Copyright (C) 2017 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef COVERLAYREFMAPPOINT_H
-+#define COVERLAYREFMAPPOINT_H
-+
-+#include <QCoreApplication>
-+#include <QTreeWidgetItem>
-+
-+class COverlayRefMapPoint : public QTreeWidgetItem
-+{
-+ Q_DECLARE_TR_FUNCTIONS(COverlayRefMapPoint)
-+public:
-+ COverlayRefMapPoint(qint32 cnt, const QPointF& ptRef, const QPointF& ptPtx, QTreeWidget * parent);
-+ virtual ~COverlayRefMapPoint() = default;
-+
-+ enum column_e
-+ {
-+ eColumnCnt
-+ , eColumnXY
-+ , eColumnLonLat
-+ };
-+
-+ void setPtPtx(const QPointF& pt);
-+ void setPtRef(const QPointF& pt);
-+ void setIndex(int n);
-+
-+ const QPointF& getPtPtx() const
-+ {
-+ return ptPtx;
-+ }
-+
-+ const QPointF& getPtRef() const
-+ {
-+ return ptRef;
-+ }
-+
-+ bool operator<(const QTreeWidgetItem& p) const override
-+ {
-+ const COverlayRefMapPoint& pt = dynamic_cast<const COverlayRefMapPoint&>(p);
-+ qreal v1 = ptPtx.y() * 1000000000 + ptPtx.x();
-+ qreal v2 = pt.ptPtx.y() * 1000000000 + pt.ptPtx.x();
-+ return v1 < v2;
-+ }
-+
-+private:
-+ QPointF ptRef;
-+ QPointF ptPtx;
-+};
-+
-+#endif //COVERLAYREFMAPPOINT_H
-+
-diff --git a/src/qmaptool/overlay/refmap/CProjWizard.cpp b/src/qmaptool/overlay/refmap/CProjWizard.cpp
-new file mode 100644
-index 00000000..2f325932
---- /dev/null
-+++ b/src/qmaptool/overlay/refmap/CProjWizard.cpp
-@@ -0,0 +1,237 @@
-+/**********************************************************************************************
-+ Copyright (C) 2014 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#include "CMainWindow.h"
-+#include "helpers/mitab.h"
-+#include "overlay/refmap/CProjWizard.h"
-+
-+#include <proj_api.h>
-+#include <QtWidgets>
-+
-+struct mitab_entry_t
-+{
-+ QString name;
-+ int idx;
-+};
-+
-+static bool mitabLessThan(const mitab_entry_t &s1, const mitab_entry_t &s2)
-+{
-+ return s1.name < s2.name;
-+}
-+
-+CProjWizard::CProjWizard(QLineEdit &line, QWidget * parent)
-+ : QDialog(parent)
-+ , line(line)
-+{
-+ setupUi(this);
-+ QList<mitab_entry_t> list;
-+ int idx = 0;
-+ const MapInfoDatumInfo * di = asDatumInfoListQL;
-+
-+ while(di->nMapInfoDatumID != -1)
-+ {
-+ mitab_entry_t entry;
-+ entry.name = di->pszOGCDatumName;
-+ entry.idx = idx;
-+ list << entry;
-+ ++di;
-+ ++idx;
-+ }
-+ qSort(list.begin(), list.end(), mitabLessThan);
-+
-+ for(const mitab_entry_t &entry : list)
-+ {
-+ comboDatum->addItem(entry.name, entry.idx);
-+ }
-+
-+ comboHemisphere->addItem(tr("north"), "");
-+ comboHemisphere->addItem(tr("south"), "+south");
-+
-+ connect(radioMercator, &QRadioButton::clicked, this, &CProjWizard::slotChange);
-+ connect(radioWorldMercator, &QRadioButton::clicked, this, &CProjWizard::slotChange);
-+ connect(radioUPSNorth, &QRadioButton::clicked, this, &CProjWizard::slotChange);
-+ connect(radioUPSSouth, &QRadioButton::clicked, this, &CProjWizard::slotChange);
-+ connect(radioUTM, &QRadioButton::clicked, this, &CProjWizard::slotChange);
-+ connect(radioUserDef, &QRadioButton::clicked, this, &CProjWizard::slotChange);
-+ connect(lineUserDef, &QLineEdit::textChanged, this, &CProjWizard::slotChange);
-+
-+ connect(spinUTMZone, static_cast<void (QSpinBox::*)(int) >(&QSpinBox::valueChanged), this, &CProjWizard::slotChange);
-+ connect(comboDatum, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &CProjWizard::slotChange);
-+ connect(comboHemisphere, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &CProjWizard::slotChange);
-+
-+ QString projstr = line.text();
-+ QRegExp re2("\\s*\\+proj=merc \\+a=6378137 \\+b=6378137 \\+lat_ts=0.001 \\+lon_0=0.0 \\+x_0=0.0 \\+y_0=0 \\+k=1.0 \\+units=m \\+nadgrids=@null \\+no_defs");
-+ QRegExp re3("\\s*\\+proj=merc\\s(.*)");
-+ QRegExp re4("\\s*\\+proj=utm \\+zone=([0-9]+)\\s(.*)");
-+
-+ if(re2.exactMatch(projstr))
-+ {
-+ radioWorldMercator->setChecked(true);
-+ }
-+ else if(re3.exactMatch(projstr))
-+ {
-+ radioMercator->setChecked(true);
-+ findDatum(re3.cap(1));
-+ }
-+ else if(re4.exactMatch(projstr))
-+ {
-+ radioUTM->setChecked(true);
-+ spinUTMZone->setValue(re4.cap(1).toInt());
-+
-+ QString datum = re4.cap(2);
-+ if(datum.startsWith("+south "))
-+ {
-+ datum = datum.mid(7);
-+ comboHemisphere->setCurrentIndex(1);
-+ }
-+
-+ findDatum(datum);
-+ }
-+
-+ slotChange();
-+}
-+
-+CProjWizard::~CProjWizard()
-+{
-+}
-+
-+
-+void CProjWizard::findDatum(const QString& str)
-+{
-+ QString cmp;
-+ int idx = 0;
-+ const MapInfoDatumInfo * di = asDatumInfoListQL;
-+
-+ while(di->nMapInfoDatumID != -1)
-+ {
-+ cmp.clear();
-+ if(di->pszOGCDatumName != QString())
-+ {
-+ const MapInfoSpheroidInfo * si = asSpheroidInfoList;
-+ while(si->nMapInfoId != -1)
-+ {
-+ if(si->nMapInfoId == di->nEllipsoid)
-+ {
-+ break;
-+ }
-+ ++si;
-+ }
-+
-+ cmp += QString("+a=%1 +b=%2 ").arg(si->dfA,0,'f',4).arg(si->dfA * (1.0 - (1.0/si->dfInvFlattening)),0,'f',4);
-+ cmp += QString("+towgs84=%1,%2,%3,%4,%5,%6,%7,%8 ").arg(di->dfShiftX).arg(di->dfShiftY).arg(di->dfShiftZ).arg(di->dfDatumParm0).arg(di->dfDatumParm1).arg(di->dfDatumParm2).arg(di->dfDatumParm3).arg(di->dfDatumParm4);
-+ cmp += "+units=m +no_defs";
-+ }
-+
-+ if(cmp == str)
-+ {
-+ comboDatum->setCurrentIndex(comboDatum->findText(di->pszOGCDatumName));
-+ break;
-+ }
-+
-+ ++di;
-+ ++idx;
-+ }
-+}
-+
-+
-+void CProjWizard::slotChange()
-+{
-+ QString str;
-+ if(radioMercator->isChecked())
-+ {
-+ str += "+proj=merc ";
-+ }
-+ else if(radioWorldMercator->isChecked())
-+ {
-+ str += "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.001 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs";
-+ labelResult->setText(str);
-+ return;
-+ }
-+ else if(radioUPSNorth->isChecked())
-+ {
-+ str += "+init=epsg:32661";
-+ }
-+ else if(radioUPSSouth->isChecked())
-+ {
-+ str += "+init=epsg:32761";
-+ }
-+ else if(radioUTM->isChecked())
-+ {
-+ str += QString("+proj=utm +zone=%1 %2 ").arg(spinUTMZone->value()).arg(comboHemisphere->itemData(comboHemisphere->currentIndex()).toString());
-+ }
-+ else if(radioUserDef->isChecked())
-+ {
-+ str += lineUserDef->text() + " ";
-+ }
-+
-+ int idx = comboDatum->itemData(comboDatum->currentIndex()).toInt();
-+ const MapInfoDatumInfo di = asDatumInfoListQL[idx];
-+ if(di.pszOGCDatumName != QString())
-+ {
-+ const MapInfoSpheroidInfo * si = asSpheroidInfoList;
-+ while(si->nMapInfoId != -1)
-+ {
-+ if(si->nMapInfoId == di.nEllipsoid)
-+ {
-+ break;
-+ }
-+ ++si;
-+ }
-+
-+ str += QString("+a=%1 +b=%2 ").arg(si->dfA,0,'f',4).arg(si->dfA * (1.0 - (1.0/si->dfInvFlattening)),0,'f',4);
-+ str += QString("+towgs84=%1,%2,%3,%4,%5,%6,%7,%8 ").arg(di.dfShiftX).arg(di.dfShiftY).arg(di.dfShiftZ).arg(di.dfDatumParm0).arg(di.dfDatumParm1).arg(di.dfDatumParm2).arg(di.dfDatumParm3).arg(di.dfDatumParm4);
-+ str += "+units=m +no_defs";
-+ }
-+
-+ labelResult->setText(str);
-+}
-+
-+
-+void CProjWizard::accept()
-+{
-+ if (CProjWizard::validProjStr(labelResult->text()))
-+ {
-+ line.setText(labelResult->text());
-+ line.setCursorPosition(0);
-+ QDialog::accept();
-+ }
-+}
-+
-+
-+bool CProjWizard::validProjStr(const QString projStr)
-+{
-+ if(projStr.isEmpty())
-+ {
-+ return false;
-+ }
-+
-+ projPJ projCheck = pj_init_plus(projStr.toUtf8().data());
-+
-+ if (!projCheck)
-+ { /* For some reason pj_errno does not work as expected in some versions of Visual Studio, so using pj_get_errno_ref instead */
-+ QMessageBox::warning(&CMainWindow::self(), tr("Error..."),tr("The value\n'%1'\nis not a valid coordinate system definition:\n%2").arg(projStr).arg(pj_strerrno(*pj_get_errno_ref())),QMessageBox::Abort,QMessageBox::Abort);
-+ return false;
-+ }
-+ else
-+ {
-+ pj_free(projCheck);
-+ return true;
-+ }
-+}
-+
-+
-diff --git a/src/qmaptool/overlay/refmap/CProjWizard.h b/src/qmaptool/overlay/refmap/CProjWizard.h
-new file mode 100644
-index 00000000..5cd1f38f
---- /dev/null
-+++ b/src/qmaptool/overlay/refmap/CProjWizard.h
-@@ -0,0 +1,44 @@
-+/**********************************************************************************************
-+ Copyright (C) 2014 Oliver Eichler oliver.eichler@gmx.de
-+
-+ This program is free software: you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation, either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+**********************************************************************************************/
-+
-+#ifndef CPROJWIZARD_H
-+#define CPROJWIZARD_H
-+
-+#include "ui_IProjWizard.h"
-+#include <QDialog>
-+
-+class CProjWizard : public QDialog, private Ui::IProjWizard
-+{
-+ Q_OBJECT
-+public:
-+ CProjWizard(QLineEdit& line, QWidget *parent);
-+ virtual ~CProjWizard();
-+ static bool validProjStr(const QString projStr);
-+
-+public slots:
-+ void accept() override;
-+ void slotChange();
-+
-+private:
-+ void findDatum(const QString& str);
-+
-+ QLineEdit& line;
-+};
-+
-+#endif //CPROJWIZARD_H
-+
-diff --git a/src/qmaptool/overlay/refmap/IDialogRefPoint.ui b/src/qmaptool/overlay/refmap/IDialogRefPoint.ui
-new file mode 100644
-index 00000000..7e1ecd4e
---- /dev/null
-+++ b/src/qmaptool/overlay/refmap/IDialogRefPoint.ui
-@@ -0,0 +1,131 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<ui version="4.0">
-+ <class>IDialogRefPoint</class>
-+ <widget class="QDialog" name="IDialogRefPoint">
-+ <property name="geometry">
-+ <rect>
-+ <x>0</x>
-+ <y>0</y>
-+ <width>510</width>
-+ <height>191</height>
-+ </rect>
-+ </property>
-+ <property name="windowTitle">
-+ <string>Dialog</string>
-+ </property>
-+ <layout class="QVBoxLayout" name="verticalLayout">
-+ <item>
-+ <layout class="QGridLayout" name="gridLayout">
-+ <item row="1" column="2" colspan="3">
-+ <widget class="QLineEdit" name="lineCoord"/>
-+ </item>
-+ <item row="0" column="0">
-+ <widget class="QLabel" name="label">
-+ <property name="text">
-+ <string>Coord. Map File [pixel]</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="0" column="1">
-+ <widget class="QLabel" name="label_4">
-+ <property name="text">
-+ <string>x</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="0" column="2">
-+ <widget class="QLineEdit" name="lineX"/>
-+ </item>
-+ <item row="0" column="3">
-+ <widget class="QLabel" name="label_5">
-+ <property name="text">
-+ <string>y</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="1" column="0">
-+ <widget class="QLabel" name="label_2">
-+ <property name="text">
-+ <string>Coord. lat/lon WGS84 [°]</string>
-+ </property>
-+ </widget>
-+ </item>
-+ <item row="0" column="4">
-+ <widget class="QLineEdit" name="lineY"/>
-+ </item>
-+ <item row="2" column="2" colspan="3">
-+ <widget class="QLabel" name="labelWarning">
-+ <property name="text">
-+ <string>Bad position format. Must be:
-+&quot;[N|S] ddd mm.sss [W|E] ddd mm.sss&quot;
-+or
-