diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index af5d13e21..2ece1975f 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -577,7 +577,7 @@ void MainWindow::enableShortcuts() void MainWindow::showProfile() { enableShortcuts(); - profile->view->setProfileState(current_dive, dc_number); + profile->plotCurrentDive(); setApplicationState(ApplicationState::Default); } @@ -629,7 +629,6 @@ bool MainWindow::plannerStateClean() void MainWindow::refreshProfile() { showProfile(); - profile->plotCurrentDive(); } void MainWindow::planCanceled() diff --git a/desktop-widgets/profilewidget.cpp b/desktop-widgets/profilewidget.cpp index fa264cd70..2de113699 100644 --- a/desktop-widgets/profilewidget.cpp +++ b/desktop-widgets/profilewidget.cpp @@ -197,8 +197,10 @@ void ProfileWidget::plotCurrentDive() ui.profScaled->setDisabled(false); // measuring and scaling ui.profTogglePicture->setDisabled(false); ui.profHR->setDisabled(false); + view->setProfileState(current_dive, dc_number); view->plotDive(current_dive, dc_number); } else { + view->clear(); stack->setCurrentIndex(0); } }