diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-05-26 13:28:18 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-26 13:28:18 -0700 |
commit | 9cc8e39d425b7f64c4c5c2a4226ba581550076f6 (patch) | |
tree | c759a26f54e50d46de25f3fa8a6e57c593dede8d /qt-ui/diveplanner.cpp | |
parent | a61c04bb584311fd7ebe397f5e5f5bd159b18b27 (diff) | |
parent | cf3701bbac2f593c6efe046ba15be55bc1360f5b (diff) | |
download | subsurface-9cc8e39d425b7f64c4c5c2a4226ba581550076f6.tar.gz |
Merge branch 'Planner'
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 312a5ffff..c26aa9569 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -59,13 +59,15 @@ void DivePlannerPointsModel::removeSelectedPoints(const QVector<int> &rows) endRemoveRows(); } -void DivePlannerPointsModel::createSimpleDive() +void DivePlannerPointsModel::createSimpleDive(bool planner) { // plannerModel->addStop(0, 0, O2_IN_AIR, 0, 0); plannerModel->addStop(M_OR_FT(15, 45), 1 * 60, O2_IN_AIR, 0, 0, true); plannerModel->addStop(M_OR_FT(15, 45), 40 * 60, O2_IN_AIR, 0, 0, true); - plannerModel->addStop(M_OR_FT(5, 15), 42 * 60, O2_IN_AIR, 0, 0, true); - plannerModel->addStop(M_OR_FT(5, 15), 45 * 60, O2_IN_AIR, 0, 0, true); + if (!planner) { + plannerModel->addStop(M_OR_FT(5, 15), 42 * 60, O2_IN_AIR, 0, 0, true); + plannerModel->addStop(M_OR_FT(5, 15), 45 * 60, O2_IN_AIR, 0, 0, true); + } } void DivePlannerPointsModel::loadFromDive(dive *d) @@ -215,9 +217,7 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg QTableView *view = ui.cylinderTableWidget->view(); view->setColumnHidden(CylindersModel::START, true); view->setColumnHidden(CylindersModel::END, true); -#ifdef ENABLE_PLANNER view->setColumnHidden(CylindersModel::DEPTH, false); -#endif view->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this)); connect(ui.cylinderTableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addCylinder_clicked())); connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop())); @@ -783,7 +783,7 @@ void DivePlannerPointsModel::createTemporaryPlan() #endif if (plannerModel->recalcQ()) plan(&diveplan, &cache, &tempDive, isPlanner()); - if (mode == ADD) { + if (mode == ADD || mode == PLAN) { // copy the samples and events, but don't overwrite the cylinders copy_samples(tempDive, current_dive); copy_events(tempDive, current_dive); |