From aa4931e8c613f742cb05da77dfdad73c6f3008c9 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 10 Nov 2013 07:06:26 +0900 Subject: 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 --- qt-ui/diveplanner.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'qt-ui/diveplanner.cpp') 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(); } -- cgit v1.2.3-70-g09d2