mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Correctly implement Metric / Imperial / Personalize preference
The code so far had completely ignored Metric / Imperial. Turning this into a three way radio box seemed to make much more sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9a65798daf
commit
a98a7a1351
3 changed files with 51 additions and 9 deletions
|
|
@ -376,11 +376,17 @@ void MainWindow::readSettings()
|
|||
|
||||
settings.endGroup();
|
||||
settings.beginGroup("Units");
|
||||
GET_UNIT(v, "length", length, units::FEET, units::METERS);
|
||||
GET_UNIT(v, "pressure", pressure, units::PSI, units::BAR);
|
||||
GET_UNIT(v, "volume", volume, units::CUFT, units::LITER);
|
||||
GET_UNIT(v, "temperature", temperature, units::FAHRENHEIT, units::CELSIUS);
|
||||
GET_UNIT(v, "weight", weight, units::LBS, units::KG);
|
||||
if (settings.value("unit_system").toString() == "metric") {
|
||||
prefs.units = SI_units;
|
||||
} else if (settings.value("unit_system").toString() == "imperial") {
|
||||
prefs.units = IMPERIAL_units;
|
||||
} else {
|
||||
GET_UNIT(v, "length", length, units::FEET, units::METERS);
|
||||
GET_UNIT(v, "pressure", pressure, units::PSI, units::BAR);
|
||||
GET_UNIT(v, "volume", volume, units::CUFT, units::LITER);
|
||||
GET_UNIT(v, "temperature", temperature, units::FAHRENHEIT, units::CELSIUS);
|
||||
GET_UNIT(v, "weight", weight, units::LBS, units::KG);
|
||||
}
|
||||
settings.endGroup();
|
||||
settings.beginGroup("DisplayListColumns");
|
||||
GET_BOOL(v, "CYLINDER", prefs.visible_cols.cylinder);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue