mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
Properly handle the planner state
This does two independent things: It sets the planner state early enough so the appropriate default profile for the planner is created (without safety stop). Upon cancelling the planner, it resets the profile widget to profile more (rather than planner) as otherwise upon the next change into the planner the planner model is not properly initialized. Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
83e7f537fb
commit
81f35c1ecf
3 changed files with 3 additions and 1 deletions
|
@ -568,6 +568,7 @@ divemode_t PlannerWidgets::getRebreatherMode() const
|
|||
|
||||
void PlannerWidgets::preparePlanDive(const dive *currentDive)
|
||||
{
|
||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
||||
// create a simple starting dive, using the first gas from the just copied cylinders
|
||||
DivePlannerPointsModel::instance()->createSimpleDive(planned_dive.get());
|
||||
|
||||
|
|
|
@ -581,7 +581,7 @@ void MainWindow::enableShortcuts()
|
|||
void MainWindow::showProfile()
|
||||
{
|
||||
enableShortcuts();
|
||||
profile->plotCurrentDive();
|
||||
profile->plotDive(current_dive, profile->dc);
|
||||
setApplicationState(ApplicationState::Default);
|
||||
}
|
||||
|
||||
|
|
|
@ -393,6 +393,7 @@ static void hideAll(const T &container)
|
|||
|
||||
void ProfileWidget2::clear()
|
||||
{
|
||||
currentState = INIT;
|
||||
#ifndef SUBSURFACE_MOBILE
|
||||
clearPictures();
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue