mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Preferences: random fixes
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d9595ad266
commit
8a54a46779
6 changed files with 24 additions and 32 deletions
|
@ -16,23 +16,6 @@ PreferencesUnits::~PreferencesUnits()
|
|||
}
|
||||
|
||||
void PreferencesUnits::refreshSettings()
|
||||
{
|
||||
QSettings s;
|
||||
s.beginGroup("Units");
|
||||
QString unitSystem[] = {"metric", "imperial", "personal"};
|
||||
short unitValue = ui->metric->isChecked() ? METRIC : (ui->imperial->isChecked() ? IMPERIAL : PERSONALIZE);
|
||||
SAVE_OR_REMOVE_SPECIAL("unit_system", default_prefs.unit_system, unitValue, unitSystem[unitValue]);
|
||||
s.setValue("temperature", ui->fahrenheit->isChecked() ? units::FAHRENHEIT : units::CELSIUS);
|
||||
s.setValue("length", ui->feet->isChecked() ? units::FEET : units::METERS);
|
||||
s.setValue("pressure", ui->psi->isChecked() ? units::PSI : units::BAR);
|
||||
s.setValue("volume", ui->cuft->isChecked() ? units::CUFT : units::LITER);
|
||||
s.setValue("weight", ui->lbs->isChecked() ? units::LBS : units::KG);
|
||||
s.setValue("vertical_speed_time", ui->vertical_speed_minutes->isChecked() ? units::MINUTES : units::SECONDS);
|
||||
s.setValue("coordinates", ui->gpsTraditional->isChecked());
|
||||
s.endGroup();
|
||||
}
|
||||
|
||||
void PreferencesUnits::syncSettings()
|
||||
{
|
||||
switch(prefs.unit_system) {
|
||||
case METRIC: ui->metric->setChecked(true); break;
|
||||
|
@ -58,3 +41,20 @@ void PreferencesUnits::syncSettings()
|
|||
ui->vertical_speed_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES);
|
||||
ui->vertical_speed_seconds->setChecked(prefs.units.vertical_speed_time == units::SECONDS);
|
||||
}
|
||||
|
||||
void PreferencesUnits::syncSettings()
|
||||
{
|
||||
QSettings s;
|
||||
s.beginGroup("Units");
|
||||
QString unitSystem[] = {"metric", "imperial", "personal"};
|
||||
short unitValue = ui->metric->isChecked() ? METRIC : (ui->imperial->isChecked() ? IMPERIAL : PERSONALIZE);
|
||||
SAVE_OR_REMOVE_SPECIAL("unit_system", default_prefs.unit_system, unitValue, unitSystem[unitValue]);
|
||||
s.setValue("temperature", ui->fahrenheit->isChecked() ? units::FAHRENHEIT : units::CELSIUS);
|
||||
s.setValue("length", ui->feet->isChecked() ? units::FEET : units::METERS);
|
||||
s.setValue("pressure", ui->psi->isChecked() ? units::PSI : units::BAR);
|
||||
s.setValue("volume", ui->cuft->isChecked() ? units::CUFT : units::LITER);
|
||||
s.setValue("weight", ui->lbs->isChecked() ? units::LBS : units::KG);
|
||||
s.setValue("vertical_speed_time", ui->vertical_speed_minutes->isChecked() ? units::MINUTES : units::SECONDS);
|
||||
s.setValue("coordinates", ui->gpsTraditional->isChecked());
|
||||
s.endGroup();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue