aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-05-28 15:43:32 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-28 12:25:36 -0700
commit1e4f744165608d208690531d5ff5da558ccd31d2 (patch)
tree75353340237c12c1f617ebc7646d2f7dcf38e6ad /qt-ui/mainwindow.cpp
parent2f8f632cf6c1b4627b5307b6f325d6e8f6291f82 (diff)
downloadsubsurface-1e4f744165608d208690531d5ff5da558ccd31d2.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp9
1 files changed, 9 insertions, 0 deletions
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())