mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Implement manual setting of depth
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									74b542ee60
								
							
						
					
					
						commit
						03eef5b0c2
					
				
					 2 changed files with 14 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1132,6 +1132,8 @@ void MainTab::resetPallete()
 | 
			
		|||
	ui.timeEdit->setPalette(p);
 | 
			
		||||
	ui.tagWidget->setPalette(p);
 | 
			
		||||
	ui.diveTripLocation->setPalette(p);
 | 
			
		||||
	ui.duration->setPalette(p);
 | 
			
		||||
	ui.depth->setPalette(p);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define EDIT_TEXT2(what, text)         \
 | 
			
		||||
| 
						 | 
				
			
			@ -1248,9 +1250,18 @@ void MainTab::on_depth_textChanged(const QString &text)
 | 
			
		|||
{
 | 
			
		||||
	if (editMode == IGNORE || acceptingEdit == true)
 | 
			
		||||
		return;
 | 
			
		||||
	displayed_dive.maxdepth.mm = parseLengthToMm(text);
 | 
			
		||||
	// don't replot until we set things up the way we want them
 | 
			
		||||
	MainWindow::instance()->graphics()->setReplot(false);
 | 
			
		||||
	if (!isEditing())
 | 
			
		||||
		enableEdition();
 | 
			
		||||
	displayed_dive.dc.maxdepth.mm = parseLengthToMm(text);
 | 
			
		||||
	displayed_dive.maxdepth = displayed_dive.dc.maxdepth;
 | 
			
		||||
	displayed_dive.dc.meandepth.mm = 0;
 | 
			
		||||
	displayed_dive.dc.samples = 0;
 | 
			
		||||
	DivePlannerPointsModel::instance()->loadFromDive(&displayed_dive);
 | 
			
		||||
	markChangedWidget(ui.depth);
 | 
			
		||||
	qDebug() << "depth text changed to" << displayed_dive.maxdepth.mm << "mm";
 | 
			
		||||
	MainWindow::instance()->graphics()->setReplot(true);
 | 
			
		||||
	MainWindow::instance()->graphics()->plotDive();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void MainTab::on_airtemp_textChanged(const QString &text)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -76,6 +76,7 @@ void DivePlannerPointsModel::loadFromDive(dive *d)
 | 
			
		|||
	duration_t lastrecordedtime = {};
 | 
			
		||||
	duration_t newtime = {};
 | 
			
		||||
	free_dps(&diveplan);
 | 
			
		||||
	clear();
 | 
			
		||||
	diveplan.when = d->when;
 | 
			
		||||
	// is this a "new" dive where we marked manually entered samples?
 | 
			
		||||
	// if yes then the first sample should be marked
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue