Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/gui/widgets/template_list_widget.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2012, 2013 Thomas Schöps
* Copyright 2012-2020 Kai Pastor
* Copyright 2012-2020, 2025 Kai Pastor
*
* This file is part of OpenOrienteering.
*
Expand Down Expand Up @@ -860,7 +860,6 @@ void TemplateListWidget::importClicked()
prototype->getTransform(transform);

Map template_map;
bool ok = true;
if (qstrcmp(prototype->getTemplateType(), "OgrTemplate") == 0)
{
template_map.importMap(*prototype->templateMap(), Map::MinimalObjectImport);
Expand Down Expand Up @@ -907,12 +906,13 @@ void TemplateListWidget::importClicked()
scale_options.append(tr("Scale by current template scaling (%1 %)").arg(locale().toString(current_scale * 100.0, 'f', 1)));
if (!scale_options.isEmpty())
{
bool ok;
scale_options.prepend(tr("Don't scale"));
QString option = QInputDialog::getItem( window(),
tr("Template import"),
tr("How shall the symbols of the imported template map be scaled?"),
scale_options, 0, false, &ok );
if (option.isEmpty())
if (!ok || option.isEmpty())
return;
else if (option == scale_options[0])
Q_ASSERT(scale == 1.0);
Expand All @@ -922,7 +922,7 @@ void TemplateListWidget::importClicked()
scale = current_scale;
}

if (ok && scale != 1.0)
if (scale != 1.0)
template_map.scaleAllSymbols(scale);
}
else
Expand Down