diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-05-28 15:43:32 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-28 12:25:36 -0700 |
commit | 1e4f744165608d208690531d5ff5da558ccd31d2 (patch) | |
tree | 75353340237c12c1f617ebc7646d2f7dcf38e6ad /qt-ui/mainwindow.cpp | |
parent | 2f8f632cf6c1b4627b5307b6f325d6e8f6291f82 (diff) | |
download | subsurface-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.cpp | 9 |
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()) |