diff options
author | Robert C. Helling <helling@atdotde.de> | 2015-04-26 21:40:36 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-04-26 16:54:29 -0700 |
commit | e19d38193dc30adca60f992b3975625314e5ecc5 (patch) | |
tree | 50aa30cd1d4249352b8484b171f76c29454048e1 /qt-ui/diveplanner.cpp | |
parent | 35a3ba0be01bb8e71baea5ff36433c8398cf91c0 (diff) | |
download | subsurface-e19d38193dc30adca60f992b3975625314e5ecc5.tar.gz |
Disable planner UI elements without function
This disables planner UI elements in recreational mode that have no function
in that mode.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index b21f7f945..a5b6e1e40 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -376,6 +376,15 @@ void PlannerSettingsWidget::decoSacChanged(const double decosac) plannerModel->setDecoSac(decosac); } +void PlannerSettingsWidget::disableDecoElements(bool value) +{ + ui.lastStop->setDisabled(value); + ui.backgasBreaks->setDisabled(value); + ui.bottompo2->setDisabled(value); + ui.decopo2->setDisabled(value); + ui.reserve_gas->setDisabled(!value); +} + void DivePlannerWidget::printDecoPlan() { MainWindow::instance()->printPlan(); @@ -457,6 +466,8 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) connect(ui.gflow, SIGNAL(editingFinished()), plannerModel, SLOT(triggerGFLow())); connect(ui.backgasBreaks, SIGNAL(toggled(bool)), this, SLOT(setBackgasBreaks(bool))); connect(ui.rebreathermode, SIGNAL(currentIndexChanged(int)), plannerModel, SLOT(setRebreatherMode(int))); + connect(DivePlannerPointsModel::instance(), SIGNAL(recreationChanged(bool)), this, SLOT(disableDecoElements(bool))); + settingsChanged(); ui.gflow->setValue(prefs.gflow); ui.gfhigh->setValue(prefs.gfhigh); @@ -876,6 +887,7 @@ void DivePlannerPointsModel::setDisplayTransitions(bool value) void DivePlannerPointsModel::setRecreationalMode(bool value) { prefs.recreational_mode = value; + emit recreationChanged(value); emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS -1)); } |