mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	desktop: hide/unhide tags if dive site was edited
The tags of the dive site were shown/hidden when changing the current dive. Thus the following could happen: 1) User changes to dive with no tags. Tags are hidden. 2) User add image, which creates GPS tag 3) Tag is updated but not shown. Fix this by showing/hiding tags when they are calculated not when switching the dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									ab6cac9799
								
							
						
					
					
						commit
						ce7cc79705
					
				
					 1 changed files with 5 additions and 4 deletions
				
			
		|  | @ -331,6 +331,11 @@ void MainTab::updateDiveSite(struct dive *d) | |||
| 		ui.locationTags->clear(); | ||||
| 		ui.editDiveSiteButton->setEnabled(false); | ||||
| 	} | ||||
| 
 | ||||
| 	if (ui.locationTags->text().isEmpty()) | ||||
| 		ui.locationTags->hide(); | ||||
| 	else | ||||
| 		ui.locationTags->show(); | ||||
| } | ||||
| 
 | ||||
| void MainTab::updateDiveInfo() | ||||
|  | @ -444,10 +449,6 @@ void MainTab::updateDiveInfo() | |||
| 		ui.duration->setText(render_seconds_to_string(current_dive->duration.seconds)); | ||||
| 		ui.depth->setText(get_depth_string(current_dive->maxdepth, true)); | ||||
| 
 | ||||
| 		if(ui.locationTags->text().isEmpty()) | ||||
| 			ui.locationTags->hide(); | ||||
| 		else | ||||
| 			ui.locationTags->show(); | ||||
| 		ui.editDiveSiteButton->setEnabled(!ui.location->text().isEmpty()); | ||||
| 		/* unset the special value text for date and time, just in case someone dove at midnight */ | ||||
| 		ui.dateEdit->setSpecialValueText(QString()); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue