diff options
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index ad950f262..a7d5ee7c6 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -5,7 +5,6 @@ #include "mainwindow.h" #include "maintab.h" #include "tableview.h" -#include "graphicsview-common.h" #include "../dive.h" #include "../divelist.h" @@ -1067,8 +1066,9 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg QTableView *view = ui.cylinderTableWidget->view(); view->setColumnHidden(CylindersModel::START, true); view->setColumnHidden(CylindersModel::END, true); - // disabled as pointless outside of the disabled planner - // view->setColumnHidden(CylindersModel::DEPTH, false); +#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())); @@ -1546,7 +1546,6 @@ void DivePlannerPointsModel::createTemporaryPlan() } char *cache = NULL; tempDive = NULL; - const char *errorString = NULL; struct divedatapoint *dp = NULL; for (int i = 0; i < MAX_CYLINDERS; i++) { cylinder_t *cyl = &stagingDive->cylinder[i]; @@ -1564,7 +1563,7 @@ void DivePlannerPointsModel::createTemporaryPlan() #if DEBUG_PLAN dump_plan(&diveplan); #endif - plan(&diveplan, &cache, &tempDive, isPlanner(), &errorString); + plan(&diveplan, &cache, &tempDive, isPlanner()); if (mode == ADD) { // copy the samples and events, but don't overwrite the cylinders copy_samples(tempDive, current_dive); @@ -1600,13 +1599,15 @@ void DivePlannerPointsModel::createPlan() // to not delete it later. mumble. ;p char *cache = NULL; tempDive = NULL; - const char *errorString = NULL; + + if (!diveplan.dp) + return cancelPlan(); createTemporaryPlan(); - plan(&diveplan, &cache, &tempDive, isPlanner(), &errorString); + plan(&diveplan, &cache, &tempDive, isPlanner()); copy_cylinders(stagingDive, tempDive); int mean[MAX_CYLINDERS], duration[MAX_CYLINDERS]; - per_cylinder_mean_depth(tempDive, select_dc(&tempDive->dc), mean, duration); + per_cylinder_mean_depth(tempDive, select_dc(tempDive), mean, duration); for (int i = 0; i < MAX_CYLINDERS; i++) { cylinder_t *cyl = tempDive->cylinder + i; if (cylinder_none(cyl)) |