mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
QML UI: process air and water temp when edited
This is a little hacky as it changes the units based on user input - a little crude but works in the typical cases. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
98fb625667
commit
da5d904d34
1 changed files with 17 additions and 2 deletions
|
@ -328,13 +328,28 @@ void QMLManager::commitChanges(QString diveId, QString location, QString gps, QS
|
|||
ds = get_dive_site_by_uuid(create_dive_site(qPrintable(location), d->when));
|
||||
d->dive_site_uuid = ds->uuid;
|
||||
}
|
||||
// now we need to handle the string representations of duration, depth, airtemp and watertemp
|
||||
// now we need to handle the string representations of duration, depth
|
||||
// and do something useful...
|
||||
//
|
||||
// FIXME
|
||||
//
|
||||
// TODO
|
||||
|
||||
if (get_temperature_string(d->airtemp) != airtemp) {
|
||||
diveChanged = true;
|
||||
if (airtemp.contains(tr("C")))
|
||||
prefs.units.temperature = units::CELSIUS;
|
||||
else if (airtemp.contains(tr("F")))
|
||||
prefs.units.temperature = units::FAHRENHEIT;
|
||||
d->airtemp.mkelvin = parseTemperatureToMkelvin(airtemp);
|
||||
}
|
||||
if (get_temperature_string(d->watertemp) != watertemp) {
|
||||
diveChanged = true;
|
||||
if (watertemp.contains(tr("C")))
|
||||
prefs.units.temperature = units::CELSIUS;
|
||||
else if (watertemp.contains(tr("F")))
|
||||
prefs.units.temperature = units::FAHRENHEIT;
|
||||
d->watertemp.mkelvin = parseTemperatureToMkelvin(watertemp);
|
||||
}
|
||||
if (!same_string(d->suit, qPrintable(suit))) {
|
||||
diveChanged = true;
|
||||
free(d->suit);
|
||||
|
|
Loading…
Reference in a new issue