aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-10 07:06:26 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-10 07:07:59 +0900
commitaa4931e8c613f742cb05da77dfdad73c6f3008c9 (patch)
tree596c0158e465931a9539abac643c42139f869d56 /qt-ui/diveplanner.cpp
parent44c9316f14f9be21837583739e8d54e9c6d29569 (diff)
downloadsubsurface-aa4931e8c613f742cb05da77dfdad73c6f3008c9.tar.gz
Show a cylinder widget in the dive planner
This is intended to allow the user to provide the gases / cylinders that she will be diving with. With that information the planner can warn the user about insufficient gases, but more importantly it can show relevant gases in the gas select drop down. Right now the add cylinder button doesn't add a cylinder - that's a problem. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index d7522b505..ba0bc80d7 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -878,7 +878,9 @@ DivePlannerWidget::DivePlannerWidget(QWidget* parent, Qt::WindowFlags f): QWidge
ui.tableWidget->setTitle(tr("Dive Planner Points"));
ui.tableWidget->setModel(DivePlannerPointsModel::instance());
ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::GAS, new AirTypesDelegate(this));
-
+ ui.cylinderTableWidget->setTitle(tr("Available Gases"));
+ ui.cylinderTableWidget->setModel(CylindersModel::instance());
+// connect(ui.cylinderTableWidget, SIGNAL(addButtonClicked()), CylindersModel::instance(), SLOT(add()));
connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop()));
connect(ui.startTime, SIGNAL(timeChanged(QTime)), this, SLOT(startTimeChanged(QTime)));
connect(ui.ATMPressure, SIGNAL(textChanged(QString)), this, SLOT(atmPressureChanged(QString)));
@@ -1190,6 +1192,7 @@ void DivePlannerPointsModel::cancelPlan()
clear();
emit planCanceled();
setPlanMode(NOTHING);
+ CylindersModel::instance()->update();
}
DivePlannerPointsModel::Mode DivePlannerPointsModel::currentMode() const
@@ -1283,4 +1286,5 @@ void DivePlannerPointsModel::createPlan()
clear();
planCreated();
setPlanMode(NOTHING);
+ CylindersModel::instance()->update();
}