summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-17 14:03:37 +0000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-17 14:03:37 +0000
commit0c3f13d128f366b036a77dfd2d195cbcac8547ba (patch)
tree02586f27258dfd9103796f7cc8236b9895e52322 /qt-ui/maintab.cpp
parent1739042f3431e5b399db0cf49106c98478436a2f (diff)
downloadsubsurface-0c3f13d128f366b036a77dfd2d195cbcac8547ba.tar.gz
Add the ability to modify the cylinder use in the UI
Thanks to Tomaz for writing a first draft of the delegate. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 3cf0a063d..cbd368798 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -103,6 +103,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
connect(ui.weights->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editWeightWidget(QModelIndex)));
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
+ ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::USE, new TankUseDelegate(this));
ui.weights->view()->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate(this));
ui.cylinders->view()->setColumnHidden(CylindersModel::DEPTH, true);
completers.buddy = new QCompleter(&buddyModel, ui.buddy);
@@ -612,6 +613,10 @@ void MainTab::updateDiveInfo(bool clear)
}
editMode = NONE;
ui.cylinders->view()->hideColumn(CylindersModel::DEPTH);
+ if (get_dive_dc(&displayed_dive, dc_number)->dctype == CCR)
+ ui.cylinders->view()->showColumn(CylindersModel::USE);
+ else
+ ui.cylinders->view()->hideColumn(CylindersModel::USE);
}
void MainTab::addCylinder_clicked()