mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
tab-widgets: pass current dive computer to delegates
Don't access the global current_dc, but pass it to the sensor and tank-use delegates, when the current dive or dive computer changes. The same pattern is already realized for the tank and weight models. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
32de8a1387
commit
19baae449d
6 changed files with 48 additions and 33 deletions
|
@ -664,8 +664,9 @@ void MainWindow::on_actionReplanDive_triggered()
|
|||
setApplicationState(ApplicationState::PlanDive);
|
||||
|
||||
disableShortcuts(true);
|
||||
profile->setPlanState(&displayed_dive, 0);
|
||||
plannerWidgets->replanDive();
|
||||
copy_dive(current_dive, &displayed_dive); // Planning works on a copy of the dive (for now).
|
||||
profile->setPlanState(&displayed_dive, dc_number);
|
||||
plannerWidgets->replanDive(dc_number);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionDivePlanner_triggered()
|
||||
|
@ -678,7 +679,7 @@ void MainWindow::on_actionDivePlanner_triggered()
|
|||
|
||||
disableShortcuts(true);
|
||||
profile->setPlanState(&displayed_dive, 0);
|
||||
plannerWidgets->planDive();
|
||||
plannerWidgets->planDive(current_dive);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionAddDive_triggered()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue