Skip to content

Commit b79daf8

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. The report can be exported as text file.
1 parent 11b068b commit b79daf8

File tree

8 files changed

+569
-3
lines changed

8 files changed

+569
-3
lines changed

code-check-wrapper.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh -e
22

3-
# Copyright 2017, 2018 Kai Pastor
3+
# Copyright 2017, 2018, 2024 Kai Pastor
44
#
55
# This file is part of OpenOrienteering.
66
#
@@ -71,6 +71,7 @@ for I in \
7171
map_coord.cpp \
7272
map_editor.cpp \
7373
map_find_feature.cpp \
74+
map_information_dialog.cpp \
7475
map_printer \
7576
map_widget.cpp \
7677
mapper_proxystyle.cpp \

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
#
@@ -163,6 +163,7 @@ set(Mapper_Common_SRCS
163163
gui/map/map_editor.cpp
164164
gui/map/map_editor_activity.cpp
165165
gui/map/map_find_feature.cpp
166+
gui/map/map_information_dialog.cpp
166167
gui/map/map_widget.cpp
167168
gui/map/rotate_map_dialog.cpp
168169
gui/map/stretch_map_dialog.cpp

src/gui/map/map_editor.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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();
@@ -1027,6 +1029,7 @@ void MapEditorController::createActions()
10271029
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");
10281030
rotate_map_act = newAction("rotatemap", tr("Rotate map..."), this, SLOT(rotateMapClicked()), "tool-rotate.png", tr("Rotate the whole map"), "map_menu.html");
10291031
map_notes_act = newAction("mapnotes", tr("Map notes..."), this, SLOT(mapNotesClicked()), nullptr, QString{}, "map_menu.html");
1032+
map_info_act = newAction("mapinfo", tr("Map information..."), this, SLOT(mapInfoClicked()), "map-information.png", QString{}, "map_menu.html");
10301033

10311034
template_window_act = newCheckAction("templatewindow", tr("Template setup window"), this, SLOT(showTemplateWindow(bool)), "templates.png", tr("Show/Hide the template window"), "templates_menu.html");
10321035
//QAction* template_config_window_act = newCheckAction("templateconfigwindow", tr("Template configurations window"), this, SLOT(showTemplateConfigurationsWindow(bool)), "window-new", tr("Show/Hide the template configurations window"));
@@ -1253,6 +1256,7 @@ void MapEditorController::createMenuAndToolbars()
12531256
map_menu->addAction(scale_map_act);
12541257
map_menu->addAction(rotate_map_act);
12551258
map_menu->addAction(map_notes_act);
1259+
map_menu->addAction(map_info_act);
12561260
map_menu->addSeparator();
12571261
updateMapPartsUI();
12581262
map_menu->addAction(mappart_add_act);
@@ -2282,6 +2286,13 @@ void MapEditorController::mapNotesClicked()
22822286
}
22832287
}
22842288

2289+
void MapEditorController::mapInfoClicked()
2290+
{
2291+
MapInformationDialog dialog(window, map);
2292+
dialog.setWindowModality(Qt::WindowModal);
2293+
dialog.exec();
2294+
}
2295+
22852296
void MapEditorController::createTemplateWindow()
22862297
{
22872298
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
*
@@ -348,6 +348,8 @@ public slots:
348348
void rotateMapClicked();
349349
/** Shows the dialog to enter map notes. */
350350
void mapNotesClicked();
351+
/** Shows the map information. */
352+
void mapInfoClicked();
351353

352354
/** Shows or hides the template setup dock widget. */
353355
void showTemplateWindow(bool show);
@@ -746,6 +748,7 @@ protected slots:
746748
QAction* scale_map_act = {};
747749
QAction* rotate_map_act = {};
748750
QAction* map_notes_act = {};
751+
QAction* map_info_act = {};
749752
QAction* symbol_set_id_act = {};
750753
std::unique_ptr<SymbolReportFeature> symbol_report_feature;
751754

0 commit comments

Comments
 (0)