mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Planner: Fix Editing of Plans in Multi-Divecomputer Dives.
Currently editing of planned dives that have been merged with actual (logged) dives only works if the 'Planned dive' divecomputer is the first divecomputer, and this divecomputer is selected when clicking 'Edit planned dive'. In other cases the profile of the first divecomputer is overlaid with the profile of the planned dive, and the first divecomputer's profile is overwritten when saving the dive plan. Fix this problem. Triggered by @SeppoTakalo's comment (https://github.com/subsurface/subsurface/issues/1913#issuecomment-2075562119): Users don't like that planned dives show up as their own entries in the dive list, so being able to merge them with the actual dive after it has been executed is a good feature - but this wasn't working well until now. Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
parent
a83349015a
commit
528532572f
11 changed files with 114 additions and 106 deletions
|
@ -665,8 +665,8 @@ void MainWindow::on_actionReplanDive_triggered()
|
|||
{
|
||||
if (!plannerStateClean() || !current_dive || !userMayChangeAppState())
|
||||
return;
|
||||
else if (!is_dc_planner(¤t_dive->dc)) {
|
||||
if (QMessageBox::warning(this, tr("Warning"), tr("Trying to replan a dive that's not a planned dive."),
|
||||
else if (!is_dc_planner(get_dive_dc(current_dive, profile->dc))) {
|
||||
if (QMessageBox::warning(this, tr("Warning"), tr("Trying to replan a dive dive profile that is not a dive plan."),
|
||||
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel)
|
||||
return;
|
||||
}
|
||||
|
@ -675,9 +675,9 @@ void MainWindow::on_actionReplanDive_triggered()
|
|||
setApplicationState(ApplicationState::PlanDive);
|
||||
|
||||
disableShortcuts(true);
|
||||
plannerWidgets->prepareReplanDive(current_dive);
|
||||
profile->setPlanState(plannerWidgets->getDive(), profile->dc);
|
||||
plannerWidgets->replanDive(profile->dc);
|
||||
plannerWidgets->prepareReplanDive(current_dive, profile->dc);
|
||||
profile->setPlanState(plannerWidgets->getDive(), plannerWidgets->getDcNr());
|
||||
plannerWidgets->replanDive();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionDivePlanner_triggered()
|
||||
|
@ -689,8 +689,8 @@ void MainWindow::on_actionDivePlanner_triggered()
|
|||
setApplicationState(ApplicationState::PlanDive);
|
||||
|
||||
disableShortcuts(true);
|
||||
plannerWidgets->preparePlanDive(current_dive);
|
||||
profile->setPlanState(plannerWidgets->getDive(), 0);
|
||||
plannerWidgets->preparePlanDive(current_dive, profile->dc);
|
||||
profile->setPlanState(plannerWidgets->getDive(), plannerWidgets->getDcNr());
|
||||
plannerWidgets->planDive();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue