Skip to content

Commit 5ed9502

Browse files
committed
Map information tool: Information about map properties
The map information tool informs about the number of map objects, templates and undo-/redo-steps. It informs about the number and names of map parts, symbols, colors, and fonts. It shows for each color the symbol(s) using the color. For each symbol in use the tool shows the used color(s) and the number of related objects.
1 parent 5f103ab commit 5ed9502

File tree

7 files changed

+473
-3
lines changed

7 files changed

+473
-3
lines changed

images/map-information.png

3.14 KB
Loading

resources.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
<file>images/view-zoom-out.png</file>
118118
<file>images/window-new.png</file>
119119
<file>images/mapper-icon/Mapper-128.png</file>
120+
<file>images/map-information.png</file>
120121
<file alias="doc/tip-of-the-day/tips.txt">doc/tip-of-the-day/tips_en.txt</file>
121122
</qresource>
122123
<qresource prefix="/" lang="de">

src/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Copyright 2012-2014 Thomas Schöps
3-
# Copyright 2012-2018 Kai Pastor
3+
# Copyright 2012-2024 Kai Pastor
44
#
55
# This file is part of OpenOrienteering.
66
#
@@ -162,6 +162,7 @@ set(Mapper_Common_SRCS
162162
gui/map/map_editor.cpp
163163
gui/map/map_editor_activity.cpp
164164
gui/map/map_find_feature.cpp
165+
gui/map/map_information_dialog.cpp
165166
gui/map/map_widget.cpp
166167
gui/map/rotate_map_dialog.cpp
167168
gui/map/stretch_map_dialog.cpp

src/gui/map/map_editor.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright 2012, 2013 Thomas Schöps
3-
* Copyright 2012-2021 Kai Pastor
3+
* Copyright 2012-2024 Kai Pastor
44
*
55
* This file is part of OpenOrienteering.
66
*
@@ -124,6 +124,7 @@
124124
#include "gui/map/map_dialog_scale.h"
125125
#include "gui/map/map_editor_activity.h"
126126
#include "gui/map/map_find_feature.h"
127+
#include "gui/map/map_information_dialog.h"
127128
#include "gui/map/map_widget.h"
128129
#include "gui/map/rotate_map_dialog.h"
129130
#include "gui/symbols/symbol_replacement.h"
@@ -462,6 +463,7 @@ void MapEditorController::setEditingInProgress(bool value)
462463
scale_map_act->setEnabled(!editing_in_progress);
463464
rotate_map_act->setEnabled(!editing_in_progress);
464465
map_notes_act->setEnabled(!editing_in_progress);
466+
map_info_act->setEnabled(!editing_in_progress);
465467

466468
// Map menu, continued
467469
const int num_parts = map->getNumParts();
@@ -1025,6 +1027,7 @@ void MapEditorController::createActions()
10251027
scale_map_act = newAction("scalemap", tr("Change map scale..."), this, SLOT(scaleMapClicked()), "tool-scale.png", tr("Change the map scale and adjust map objects and symbol sizes"), "map_menu.html");
10261028
rotate_map_act = newAction("rotatemap", tr("Rotate map..."), this, SLOT(rotateMapClicked()), "tool-rotate.png", tr("Rotate the whole map"), "map_menu.html");
10271029
map_notes_act = newAction("mapnotes", tr("Map notes..."), this, SLOT(mapNotesClicked()), nullptr, QString{}, "map_menu.html");
1030+
map_info_act = newAction("mapinfo", tr("Map information..."), this, SLOT(mapInfoClicked()), "map-information.png", QString{}, "map_menu.html");
10281031

10291032
template_window_act = newCheckAction("templatewindow", tr("Template setup window"), this, SLOT(showTemplateWindow(bool)), "templates.png", tr("Show/Hide the template window"), "templates_menu.html");
10301033
//QAction* template_config_window_act = newCheckAction("templateconfigwindow", tr("Template configurations window"), this, SLOT(showTemplateConfigurationsWindow(bool)), "window-new", tr("Show/Hide the template configurations window"));
@@ -1251,6 +1254,7 @@ void MapEditorController::createMenuAndToolbars()
12511254
map_menu->addAction(scale_map_act);
12521255
map_menu->addAction(rotate_map_act);
12531256
map_menu->addAction(map_notes_act);
1257+
map_menu->addAction(map_info_act);
12541258
map_menu->addSeparator();
12551259
updateMapPartsUI();
12561260
map_menu->addAction(mappart_add_act);
@@ -2277,6 +2281,13 @@ void MapEditorController::mapNotesClicked()
22772281
}
22782282
}
22792283

2284+
void MapEditorController::mapInfoClicked()
2285+
{
2286+
MapInformationDialog dialog(window, map);
2287+
dialog.setWindowModality(Qt::WindowModal);
2288+
dialog.exec();
2289+
}
2290+
22802291
void MapEditorController::createTemplateWindow()
22812292
{
22822293
Q_ASSERT(!template_dock_widget);

src/gui/map/map_editor.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright 2012, 2013, 2014 Thomas Schöps
3-
* Copyright 2013-2021 Kai Pastor
3+
* Copyright 2013-2024 Kai Pastor
44
*
55
* This file is part of OpenOrienteering.
66
*
@@ -347,6 +347,8 @@ public slots:
347347
void rotateMapClicked();
348348
/** Shows the dialog to enter map notes. */
349349
void mapNotesClicked();
350+
/** Shows the map information. */
351+
void mapInfoClicked();
350352

351353
/** Shows or hides the template setup dock widget. */
352354
void showTemplateWindow(bool show);
@@ -745,6 +747,7 @@ protected slots:
745747
QAction* scale_map_act = {};
746748
QAction* rotate_map_act = {};
747749
QAction* map_notes_act = {};
750+
QAction* map_info_act = {};
748751
QAction* symbol_set_id_act = {};
749752

750753
QAction* color_window_act = {};

0 commit comments

Comments
 (0)