Update ceiling when changing dive mode

Without this patch, the user effectively cannot change the dive mode as
any change is overwritten by replot copying current_dive over
displayed_dive. The way out is not to call replot but only update the deco
ceiling directly.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2015-01-30 11:16:55 +01:00 committed by Dirk Hohndel
parent c70ba77199
commit 1e45858ee6
3 changed files with 7 additions and 1 deletions

View file

@ -1018,7 +1018,7 @@ void MainTab::divetype_Changed(int index)
displayed_dive.dc.divemode = (enum dive_comp_type) index;
update_setpoint_events(&displayed_dive.dc);
markChangedWidget(ui.DiveType);
MainWindow::instance()->graphics()->replot();
MainWindow::instance()->graphics()->recalcCeiling();
}
void MainTab::on_watertemp_textChanged(const QString &text)

View file

@ -648,6 +648,11 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
}
}
void ProfileWidget2::recalcCeiling()
{
diveCeiling->recalc();
}
void ProfileWidget2::settingsChanged()
{
// if we are showing calculated ceilings then we have to replot()

View file

@ -82,6 +82,7 @@ public:
double getFontPrintScale();
void setFontPrintScale(double scale);
void clearHandlers();
void recalcCeiling();
void setToolTipVisibile(bool visible);
State currentState;