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
				
			
		|  | @ -1,3 +1,4 @@ | ||||||
|  | Desktop: update SAC fields and other statistics when editing cylinders | ||||||
| Desktop: Reconnect the variations checkbox in planner | Desktop: Reconnect the variations checkbox in planner | ||||||
| Desktop: add support for dive mode on CSV import and export | Desktop: add support for dive mode on CSV import and export | ||||||
| Desktop: fix profile display of planned dives with surface segments | Desktop: fix profile display of planned dives with surface segments | ||||||
|  |  | ||||||
|  | @ -22,6 +22,9 @@ TabDiveStatistics::TabDiveStatistics(QWidget *parent) : TabBase(parent), ui(new | ||||||
| 	ui->timeLimits->overrideAvgToolTipText(tr("Average length of all selected dives")); | 	ui->timeLimits->overrideAvgToolTipText(tr("Average length of all selected dives")); | ||||||
| 
 | 
 | ||||||
| 	connect(&diveListNotifier, &DiveListNotifier::divesChanged, this, &TabDiveStatistics::divesChanged); | 	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); | 	const auto l = findChildren<QLabel *>(QString(), Qt::FindDirectChildrenOnly); | ||||||
| 	for (QLabel *label: l) { | 	for (QLabel *label: l) { | ||||||
|  | @ -57,6 +60,14 @@ void TabDiveStatistics::divesChanged(const QVector<dive *> &dives, DiveField fie | ||||||
| 		updateData(); | 		updateData(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void TabDiveStatistics::cylinderChanged(dive *d) | ||||||
|  | { | ||||||
|  | 	// If the changed dive is not selected, do nothing
 | ||||||
|  | 	if (!d->selected) | ||||||
|  | 		return; | ||||||
|  | 	updateData(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void TabDiveStatistics::updateData() | void TabDiveStatistics::updateData() | ||||||
| { | { | ||||||
| 	stats_t stats_selection; | 	stats_t stats_selection; | ||||||
|  |  | ||||||
|  | @ -19,6 +19,7 @@ public: | ||||||
| 
 | 
 | ||||||
| private slots: | private slots: | ||||||
| 	void divesChanged(const QVector<dive *> &dives, DiveField field); | 	void divesChanged(const QVector<dive *> &dives, DiveField field); | ||||||
|  | 	void cylinderChanged(dive *d); | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
| 	Ui::TabDiveStatistics *ui; | 	Ui::TabDiveStatistics *ui; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue