aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-12 16:33:27 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-12 16:33:27 +0900
commit3c8155880aec5ccba3a25f03e37eb5a4ca00946a (patch)
tree50b9b43f3930b7d3139febb6be7956807e4e01d2 /qt-ui/mainwindow.cpp
parent83a7f1f5b46a4cbd33fcd197f2a956f765def871 (diff)
downloadsubsurface-3c8155880aec5ccba3a25f03e37eb5a4ca00946a.tar.gz
Make gas selection for add dive work
This now offers the correct gases for which we have cylinders defined. For both the planner and add dive we still don't end up with the correct cylinders in the resulting dive. But that's for another commit to fix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index be539620b..c111f3926 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -286,8 +286,8 @@ void MainWindow::on_actionAddDive_triggered()
// clear the selection
dive_list()->unselectDives();
disableDcShortcuts();
- DivePlannerPointsModel::instance()->clear();
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
+
// now cheat - create one dive that we use to store the info tab data in
struct dive *dive = alloc_dive();
dive->when = QDateTime::currentMSecsSinceEpoch() / 1000L + gettimezoneoffset();
@@ -297,11 +297,12 @@ void MainWindow::on_actionAddDive_triggered()
// accepting the dive
select_dive(get_divenr(dive));
ui.InfoWidget->updateDiveInfo(selected_dive);
+ ui.InfoWidget->addDiveStarted();
ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner.
ui.infoPane->setCurrentIndex(MAINTAB);
+ DivePlannerPointsModel::instance()->clear();
DivePlannerPointsModel::instance()->createSimpleDive();
refreshDisplay();
- ui.InfoWidget->addDiveStarted();
}
void MainWindow::on_actionRenumber_triggered()