summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-09-20 07:36:14 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-09-20 07:38:15 -0500
commit5f4aec867e852129a5eb3b507e06d0c80a021b74 (patch)
treefca903e3347dfcf3132a2fafd8ba577f35171da6 /qt-ui
parente04acd4189d4b5307016d3acd1de947c094fcb11 (diff)
downloadsubsurface-5f4aec867e852129a5eb3b507e06d0c80a021b74.tar.gz
When manually adding a dive, start with a simple dive
This is much friendlier than just showing an empty profile. I picked a nice and simple three level dive. 25 minutes at 18m, 15 minutes at 9m, and a safety stop. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/diveplanner.cpp10
-rw-r--r--qt-ui/diveplanner.h1
-rw-r--r--qt-ui/mainwindow.cpp1
3 files changed, 12 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 36cd7f144..87edbbc8a 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -400,6 +400,16 @@ void DivePlannerGraphics::mouseDoubleClickEvent(QMouseEvent* event)
plannerModel->addStop(meters * 1000, minutes * 60, tr("Air"), 0);
}
+void DivePlannerPointsModel::createSimpleDive()
+{
+ plannerModel->addStop(18000, 1 * 60, tr("Air"), 0);
+ plannerModel->addStop(18000, 25 * 60, tr("Air"), 0);
+ plannerModel->addStop(9000, 26 * 60, tr("Air"), 0);
+ plannerModel->addStop(9000, 41 * 60, tr("Air"), 0);
+ plannerModel->addStop(5000, 42 * 60, tr("Air"), 0);
+ plannerModel->addStop(5000, 45 * 60, tr("Air"), 0);
+}
+
void DivePlannerGraphics::prepareSelectGas()
{
currentGasChoice = static_cast<Button*>(sender());
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
index 12b01cdeb..0c91bcdef 100644
--- a/qt-ui/diveplanner.h
+++ b/qt-ui/diveplanner.h
@@ -35,6 +35,7 @@ public:
enum Modes { PLAN, ADD };
void setPlanMode(bool);
bool isPlanner();
+ void createSimpleDive();
/**
* @return the row number.
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index c544dd812..9fa4a35dc 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -274,6 +274,7 @@ void MainWindow::on_actionAddDive_triggered()
ui->InfoWidget->updateDiveInfo(selected_dive);
ui->stackedWidget->setCurrentIndex(1);
ui->infoPane->setCurrentIndex(0);
+ DivePlannerPointsModel::instance()->createSimpleDive();
refreshDisplay();
ui->InfoWidget->addDiveStarted();
}