Skip to content
Merged
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
15 changes: 7 additions & 8 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 @@ -964,8 +964,12 @@ void TemplateListWidget::changeGeorefClicked()
auto* templ = currentTemplate();
if (templ && templ->canChangeTemplateGeoreferenced())
{
auto new_value = !templ->isTemplateGeoreferenced();
if (new_value)
if (!templ->trySetTemplateGeoreferenced(!templ->isTemplateGeoreferenced(), this))
{
QMessageBox::warning(this, tr("Error"), tr("Cannot change the georeferencing state."));
}
georef_action->setChecked(templ->isTemplateGeoreferenced());
if (templ->isTemplateGeoreferenced())
{
// Properly tear down positioning activities
if (move_by_hand_action->isChecked())
Expand All @@ -975,11 +979,6 @@ void TemplateListWidget::changeGeorefClicked()
if (position_action->isChecked())
position_action->trigger();
}
if (!templ->trySetTemplateGeoreferenced(new_value, this))
{
QMessageBox::warning(this, tr("Error"), tr("Cannot change the georeferencing state."));
georef_action->setChecked(templ->isTemplateGeoreferenced());
}
}
}

Expand Down