mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	desktop: update statistics tab when cylinders changed
The cylinder-based statistics where not updated when an undo command edited cylinder data. Do so. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									16a35a8bbe
								
							
						
					
					
						commit
						9298466037
					
				
					 3 changed files with 13 additions and 0 deletions
				
			
		|  | @ -22,6 +22,9 @@ TabDiveStatistics::TabDiveStatistics(QWidget *parent) : TabBase(parent), ui(new | |||
| 	ui->timeLimits->overrideAvgToolTipText(tr("Average length of all selected dives")); | ||||
| 
 | ||||
| 	connect(&diveListNotifier, &DiveListNotifier::divesChanged, this, &TabDiveStatistics::divesChanged); | ||||
| 	connect(&diveListNotifier, &DiveListNotifier::cylinderAdded, this, &TabDiveStatistics::cylinderChanged); | ||||
| 	connect(&diveListNotifier, &DiveListNotifier::cylinderRemoved, this, &TabDiveStatistics::cylinderChanged); | ||||
| 	connect(&diveListNotifier, &DiveListNotifier::cylinderEdited, this, &TabDiveStatistics::cylinderChanged); | ||||
| 
 | ||||
| 	const auto l = findChildren<QLabel *>(QString(), Qt::FindDirectChildrenOnly); | ||||
| 	for (QLabel *label: l) { | ||||
|  | @ -57,6 +60,14 @@ void TabDiveStatistics::divesChanged(const QVector<dive *> &dives, DiveField fie | |||
| 		updateData(); | ||||
| } | ||||
| 
 | ||||
| void TabDiveStatistics::cylinderChanged(dive *d) | ||||
| { | ||||
| 	// If the changed dive is not selected, do nothing
 | ||||
| 	if (!d->selected) | ||||
| 		return; | ||||
| 	updateData(); | ||||
| } | ||||
| 
 | ||||
| void TabDiveStatistics::updateData() | ||||
| { | ||||
| 	stats_t stats_selection; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue