mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Desselects the trip before dive add / plan, and reselects it on cancel
When we had a trip selected, we ignored that and simply called the DiveAdd functions, but the mainTab code that deal with selections to show one or more dives or trips asked how many trips were selected to the DiveList, and since a trip was selected things go kabum. Fixes #606 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									9d4b8c8218
								
							
						
					
					
						commit
						bebcbfe92a
					
				
					 2 changed files with 7 additions and 0 deletions
				
			
		|  | @ -808,6 +808,8 @@ void MainTab::rejectChanges() | |||
| 	resetPallete(); | ||||
| 	// no harm done to call cancelPlan even if we were not in ADD or PLAN mode...
 | ||||
| 	DivePlannerPointsModel::instance()->cancelPlan(); | ||||
| 	if(lastMode == ADD) | ||||
| 		MainWindow::instance()->dive_list()->restoreSelection(); | ||||
| 
 | ||||
| 	// now make sure that the correct dive is displayed
 | ||||
| 	if (selected_dive >= 0) | ||||
|  |  | |||
|  | @ -470,6 +470,11 @@ void MainWindow::on_actionAddDive_triggered() | |||
| 	if(!plannerStateClean()) | ||||
| 		return; | ||||
| 
 | ||||
| 	if (dive_list()->selectedTrips().count() >= 1){ | ||||
| 		dive_list()->rememberSelection(); | ||||
| 		dive_list()->clearSelection(); | ||||
| 	} | ||||
| 
 | ||||
| 	ui.ListWidget->endSearch(); | ||||
| 	DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue