From 1e4f744165608d208690531d5ff5da558ccd31d2 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 28 May 2014 15:43:32 -0300 Subject: Fixes showing the Empty Profile when Add / Plan dive is cancelled. for some reason the next selected dive is NULL after cancelling the plan. I'm investigating. This patch fixes the show of the empty profile and it also untangles some parts of the code, keeping the mainwindow where it should belong : the mainwindow. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'qt-ui/mainwindow.cpp') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index ff932d31b..6cf7160b7 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -397,6 +397,15 @@ void MainWindow::removeFakeDiveForAddAndPlan() delete_single_dive(idx); } +void MainWindow::planCanceled() +{ + removeFakeDiveForAddAndPlan(); + showProfile(); + dive_list()->restoreSelection(); + dive_list()->reload(DiveTripModel::CURRENT); + refreshDisplay(); +} + void MainWindow::on_actionDivePlanner_triggered() { if(!plannerStateClean()) -- cgit v1.2.3-70-g09d2