mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
35a3ba0be0
commit
e19d38193d
2 changed files with 14 additions and 0 deletions
|
@ -376,6 +376,15 @@ void PlannerSettingsWidget::decoSacChanged(const double decosac)
|
||||||
plannerModel->setDecoSac(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()
|
void DivePlannerWidget::printDecoPlan()
|
||||||
{
|
{
|
||||||
MainWindow::instance()->printPlan();
|
MainWindow::instance()->printPlan();
|
||||||
|
@ -457,6 +466,8 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
||||||
connect(ui.gflow, SIGNAL(editingFinished()), plannerModel, SLOT(triggerGFLow()));
|
connect(ui.gflow, SIGNAL(editingFinished()), plannerModel, SLOT(triggerGFLow()));
|
||||||
connect(ui.backgasBreaks, SIGNAL(toggled(bool)), this, SLOT(setBackgasBreaks(bool)));
|
connect(ui.backgasBreaks, SIGNAL(toggled(bool)), this, SLOT(setBackgasBreaks(bool)));
|
||||||
connect(ui.rebreathermode, SIGNAL(currentIndexChanged(int)), plannerModel, SLOT(setRebreatherMode(int)));
|
connect(ui.rebreathermode, SIGNAL(currentIndexChanged(int)), plannerModel, SLOT(setRebreatherMode(int)));
|
||||||
|
connect(DivePlannerPointsModel::instance(), SIGNAL(recreationChanged(bool)), this, SLOT(disableDecoElements(bool)));
|
||||||
|
|
||||||
settingsChanged();
|
settingsChanged();
|
||||||
ui.gflow->setValue(prefs.gflow);
|
ui.gflow->setValue(prefs.gflow);
|
||||||
ui.gfhigh->setValue(prefs.gfhigh);
|
ui.gfhigh->setValue(prefs.gfhigh);
|
||||||
|
@ -876,6 +887,7 @@ void DivePlannerPointsModel::setDisplayTransitions(bool value)
|
||||||
void DivePlannerPointsModel::setRecreationalMode(bool value)
|
void DivePlannerPointsModel::setRecreationalMode(bool value)
|
||||||
{
|
{
|
||||||
prefs.recreational_mode = value;
|
prefs.recreational_mode = value;
|
||||||
|
emit recreationChanged(value);
|
||||||
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS -1));
|
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,7 @@ signals:
|
||||||
void planCanceled();
|
void planCanceled();
|
||||||
void cylinderModelEdited();
|
void cylinderModelEdited();
|
||||||
void startTimeChanged(QDateTime);
|
void startTimeChanged(QDateTime);
|
||||||
|
void recreationChanged(bool);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit DivePlannerPointsModel(QObject *parent = 0);
|
explicit DivePlannerPointsModel(QObject *parent = 0);
|
||||||
|
@ -183,6 +184,7 @@ slots:
|
||||||
void setBottomPo2(double po2);
|
void setBottomPo2(double po2);
|
||||||
void setDecoPo2(double po2);
|
void setDecoPo2(double po2);
|
||||||
void setBackgasBreaks(bool dobreaks);
|
void setBackgasBreaks(bool dobreaks);
|
||||||
|
void disableDecoElements(bool value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::plannerSettingsWidget ui;
|
Ui::plannerSettingsWidget ui;
|
||||||
|
|
Loading…
Add table
Reference in a new issue