mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Add ability to undo shifting of dive time
Adds the ability to undo shifting of dive times. The change is captured at simplewidgets.cpp and an undo command is created. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									824cc90a9a
								
							
						
					
					
						commit
						87ee8e8aef
					
				
					 3 changed files with 50 additions and 1 deletions
				
			
		|  | @ -15,6 +15,7 @@ | |||
| #include "divelistview.h" | ||||
| #include "display.h" | ||||
| #include "profile/profilewidget2.h" | ||||
| #include "undocommands.h" | ||||
| 
 | ||||
| class MinMaxAvgWidgetPrivate { | ||||
| public: | ||||
|  | @ -201,7 +202,16 @@ void ShiftTimesDialog::buttonClicked(QAbstractButton *button) | |||
| 			amount *= -1; | ||||
| 		if (amount != 0) { | ||||
| 			// DANGER, DANGER - this could get our dive_table unsorted...
 | ||||
| 			shift_times(amount); | ||||
| 			int i; | ||||
| 			struct dive *dive; | ||||
| 			QList<int> affectedDives; | ||||
| 			for_each_dive (i, dive) { | ||||
| 				if (!dive->selected) | ||||
| 					continue; | ||||
| 
 | ||||
| 				affectedDives.append(dive->id); | ||||
| 			} | ||||
| 			MainWindow::instance()->undoStack->push(new UndoShiftTime(affectedDives, amount)); | ||||
| 			sort_table(&dive_table); | ||||
| 			mark_divelist_changed(true); | ||||
| 			MainWindow::instance()->dive_list()->rememberSelection(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue