Skip to content

Commit

Permalink
Map information tool: Information about map properties
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dl3sdo committed Aug 7, 2024
1 parent 11b068b commit b79daf8
Show file tree
Hide file tree
Showing 8 changed files with 569 additions and 3 deletions.
3 changes: 2 additions & 1 deletion code-check-wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

# Copyright 2017, 2018 Kai Pastor
# Copyright 2017, 2018, 2024 Kai Pastor
#
# This file is part of OpenOrienteering.
#
Expand Down Expand Up @@ -71,6 +71,7 @@ for I in \
map_coord.cpp \
map_editor.cpp \
map_find_feature.cpp \
map_information_dialog.cpp \
map_printer \
map_widget.cpp \
mapper_proxystyle.cpp \
Expand Down
Binary file added images/map-information.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
<file>images/view-zoom-out.png</file>
<file>images/window-new.png</file>
<file>images/mapper-icon/Mapper-128.png</file>
<file>images/map-information.png</file>
<file alias="doc/tip-of-the-day/tips.txt">doc/tip-of-the-day/tips_en.txt</file>
</qresource>
<qresource prefix="/" lang="de">
Expand Down
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright 2012-2014 Thomas Schöps
# Copyright 2012-2018 Kai Pastor
# Copyright 2012-2024 Kai Pastor
#
# This file is part of OpenOrienteering.
#
Expand Down Expand Up @@ -163,6 +163,7 @@ set(Mapper_Common_SRCS
gui/map/map_editor.cpp
gui/map/map_editor_activity.cpp
gui/map/map_find_feature.cpp
gui/map/map_information_dialog.cpp
gui/map/map_widget.cpp
gui/map/rotate_map_dialog.cpp
gui/map/stretch_map_dialog.cpp
Expand Down
11 changes: 11 additions & 0 deletions src/gui/map/map_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
#include "gui/map/map_dialog_scale.h"
#include "gui/map/map_editor_activity.h"
#include "gui/map/map_find_feature.h"
#include "gui/map/map_information_dialog.h"
#include "gui/map/map_widget.h"
#include "gui/map/rotate_map_dialog.h"
#include "gui/symbols/symbol_replacement.h"
Expand Down Expand Up @@ -462,6 +463,7 @@ void MapEditorController::setEditingInProgress(bool value)
scale_map_act->setEnabled(!editing_in_progress);
rotate_map_act->setEnabled(!editing_in_progress);
map_notes_act->setEnabled(!editing_in_progress);
map_info_act->setEnabled(!editing_in_progress);

// Map menu, continued
const int num_parts = map->getNumParts();
Expand Down Expand Up @@ -1027,6 +1029,7 @@ void MapEditorController::createActions()
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");
rotate_map_act = newAction("rotatemap", tr("Rotate map..."), this, SLOT(rotateMapClicked()), "tool-rotate.png", tr("Rotate the whole map"), "map_menu.html");
map_notes_act = newAction("mapnotes", tr("Map notes..."), this, SLOT(mapNotesClicked()), nullptr, QString{}, "map_menu.html");
map_info_act = newAction("mapinfo", tr("Map information..."), this, SLOT(mapInfoClicked()), "map-information.png", QString{}, "map_menu.html");

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

void MapEditorController::mapInfoClicked()
{
MapInformationDialog dialog(window, map);
dialog.setWindowModality(Qt::WindowModal);
dialog.exec();
}

void MapEditorController::createTemplateWindow()
{
Q_ASSERT(!template_dock_widget);
Expand Down
5 changes: 4 additions & 1 deletion src/gui/map/map_editor.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2012, 2013, 2014 Thomas Schöps
* Copyright 2013-2021 Kai Pastor
* Copyright 2013-2024 Kai Pastor
*
* This file is part of OpenOrienteering.
*
Expand Down Expand Up @@ -348,6 +348,8 @@ public slots:
void rotateMapClicked();
/** Shows the dialog to enter map notes. */
void mapNotesClicked();
/** Shows the map information. */
void mapInfoClicked();

/** Shows or hides the template setup dock widget. */
void showTemplateWindow(bool show);
Expand Down Expand Up @@ -746,6 +748,7 @@ protected slots:
QAction* scale_map_act = {};
QAction* rotate_map_act = {};
QAction* map_notes_act = {};
QAction* map_info_act = {};
QAction* symbol_set_id_act = {};
std::unique_ptr<SymbolReportFeature> symbol_report_feature;

Expand Down
Loading

0 comments on commit b79daf8

Please sign in to comment.