mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	core/settings: change measurements when changing metric/imperial
When switching between imperial/metric it is important to change the single measurements as well (e.g. METER <-> FEET). Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									14db760044
								
							
						
					
					
						commit
						fdff61f6af
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -102,9 +102,23 @@ void qPrefUnits::set_unit_system(unit_system_values value)
 | 
			
		|||
	if (value == METRIC) {
 | 
			
		||||
		prefs.unit_system = METRIC;
 | 
			
		||||
		prefs.units = SI_units;
 | 
			
		||||
 | 
			
		||||
		// make sure all types are updated when changing
 | 
			
		||||
		set_volume(units::VOLUME::LITER);
 | 
			
		||||
		set_weight(units::WEIGHT::KG);
 | 
			
		||||
		set_length(units::LENGTH::METERS);
 | 
			
		||||
		set_pressure(units::PRESSURE::BAR);
 | 
			
		||||
		set_temperature(units::TEMPERATURE::CELSIUS);
 | 
			
		||||
	} else if (value == IMPERIAL) {
 | 
			
		||||
		prefs.unit_system = IMPERIAL;
 | 
			
		||||
		prefs.units = IMPERIAL_units;
 | 
			
		||||
 | 
			
		||||
		// make sure all types are updated when changing
 | 
			
		||||
		set_volume(units::VOLUME::CUFT);
 | 
			
		||||
		set_weight(units::WEIGHT::LBS);
 | 
			
		||||
		set_length(units::LENGTH::FEET);
 | 
			
		||||
		set_pressure(units::PRESSURE::PSI);
 | 
			
		||||
		set_temperature(units::TEMPERATURE::FAHRENHEIT);
 | 
			
		||||
	} else {
 | 
			
		||||
		prefs.unit_system = PERSONALIZE;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue