mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Convert the atmospheric pressure in the Information Tab to an editable field
The Information tab shows the atmospheric pressure. Make this value editable and also ensure that changes to it are undo-able. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
This commit is contained in:
		
							parent
							
								
									ca6aa38139
								
							
						
					
					
						commit
						1bdf00b2b4
					
				
					 19 changed files with 323 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -248,6 +248,27 @@ DiveField EditWaterTemp::fieldId() const
 | 
			
		|||
	return DiveField::WATER_TEMP;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ***** Atmospheric pressure *****
 | 
			
		||||
void EditAtmPress::set(struct dive *d, int value) const
 | 
			
		||||
{
 | 
			
		||||
	d->surface_pressure.mbar = value > 0 ? (uint32_t)value : 0u;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int EditAtmPress::data(struct dive *d) const
 | 
			
		||||
{
 | 
			
		||||
	return (int)d->surface_pressure.mbar;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString EditAtmPress::fieldName() const
 | 
			
		||||
{
 | 
			
		||||
	return tr("Atm. pressure");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
DiveField EditAtmPress::fieldId() const
 | 
			
		||||
{
 | 
			
		||||
	return DiveField::ATM_PRESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ***** Duration *****
 | 
			
		||||
void EditDuration::set(struct dive *d, int value) const
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue