mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
planner: set profile to planner state in main window
Remove mainwindow-access from the planner, by setting the profile to planner state in the owner of the profile, viz. the MainWindow. The MainWindow sets the application state to planner, so it seems legit that it also sets the profile state. This removes a further interdependency. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
4d60662531
commit
b4c307c775
2 changed files with 2 additions and 4 deletions
|
@ -540,8 +540,6 @@ PlannerWidgets::PlannerWidgets()
|
|||
void PlannerWidgets::planDive()
|
||||
{
|
||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
||||
|
||||
MainWindow::instance()->graphics->setPlanState(&displayed_dive, 0);
|
||||
dc_number = 0;
|
||||
|
||||
// create a simple starting dive, using the first gas from the just copied cylinders
|
||||
|
@ -569,8 +567,6 @@ void PlannerWidgets::replanDive()
|
|||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
||||
DivePlannerPointsModel::instance()->loadFromDive(&displayed_dive);
|
||||
|
||||
MainWindow::instance()->graphics->setPlanState(&displayed_dive, 0);
|
||||
|
||||
plannerWidget.setReplanButton(true);
|
||||
plannerWidget.setupStartTime(timestampToDateTime(displayed_dive.when));
|
||||
if (displayed_dive.surface_pressure.mbar)
|
||||
|
|
|
@ -771,6 +771,7 @@ void MainWindow::on_actionReplanDive_triggered()
|
|||
// put us in PLAN mode
|
||||
setApplicationState(ApplicationState::PlanDive);
|
||||
|
||||
graphics->setPlanState(&displayed_dive, 0);
|
||||
plannerWidgets->replanDive();
|
||||
}
|
||||
|
||||
|
@ -782,6 +783,7 @@ void MainWindow::on_actionDivePlanner_triggered()
|
|||
// put us in PLAN mode
|
||||
setApplicationState(ApplicationState::PlanDive);
|
||||
|
||||
graphics->setPlanState(&displayed_dive, 0);
|
||||
plannerWidgets->planDive();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue