mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix layering violations in DivePlannerPointsModel.
Signed-off-by: Michael Keller <mikeller@042.ch>
This commit is contained in:
parent
2d8e343221
commit
14b9074f40
4 changed files with 11 additions and 7 deletions
|
@ -677,7 +677,9 @@ void PlannerWidgets::printDecoPlan()
|
|||
|
||||
void PlannerWidgets::setDiveMode(int mode)
|
||||
{
|
||||
DivePlannerPointsModel::instance()->setDiveMode(mode);
|
||||
planned_dive->get_dc(dcNr)->divemode = (divemode_t)mode;
|
||||
DivePlannerPointsModel::instance()->cylindersChanged();
|
||||
|
||||
plannerWidget.setColumnVisibility(mode);
|
||||
plannerSettingsWidget.setBailoutVisibility(mode);
|
||||
}
|
||||
|
|
|
@ -235,7 +235,10 @@ public slots:
|
|||
void set_ascrate75(int value) { DivePlannerPointsModel::instance()->setAscrate75Display(value); }
|
||||
void set_descrate(int value) { DivePlannerPointsModel::instance()->setDescrateDisplay(value); }
|
||||
|
||||
void set_dive_mode(DIVE_MODE value) { DivePlannerPointsModel::instance()->setDiveMode((int)value); }
|
||||
void set_dive_mode(DIVE_MODE value) {
|
||||
//TODO: Actually change the dive mode in the dive here - this will need untangling to enable access to the dive
|
||||
DivePlannerPointsModel::instance()->cylindersChanged();
|
||||
}
|
||||
void set_planner_deco_mode(DECO_MODE value) { PlannerShared::set_planner_deco_mode((deco_mode)value); }
|
||||
void set_reserve_gas(int value) { PlannerShared::set_reserve_gas(value); }
|
||||
void set_safetystop(bool value) { DivePlannerPointsModel::instance()->setSafetyStop(value); }
|
||||
|
|
|
@ -588,11 +588,10 @@ int DivePlannerPointsModel::gfLow() const
|
|||
return diveplan.gflow;
|
||||
}
|
||||
|
||||
void DivePlannerPointsModel::setDiveMode(int mode)
|
||||
void DivePlannerPointsModel::cylindersChanged()
|
||||
{
|
||||
struct divecomputer *dc = d->get_dc(dcNr);
|
||||
if (dc)
|
||||
dc->divemode = (divemode_t) mode;
|
||||
if (!d)
|
||||
return;
|
||||
|
||||
cylinders.updateDive(d, dcNr);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
|
||||
void loadFromDive(dive *d, int dcNr);
|
||||
void addStop(int millimeters, int seconds);
|
||||
void setDiveMode(int mode);
|
||||
void cylindersChanged();
|
||||
public
|
||||
slots:
|
||||
void addDefaultStop();
|
||||
|
|
Loading…
Add table
Reference in a new issue