mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	In dive picture shift time dialog suppress double triggering of timeEdit
In dive picture shift time dialog when pressing the up or down arrow
of the timeEdit widged there is some risk of double triggering because
the function called after this UI action ("updateInvalid()") can have
quite some runtime.
Suppress any potential double triggering by disabling the timeEdit
widget after each change until the code is processed.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
			
			
This commit is contained in:
		
							parent
							
								
									2ae3760303
								
							
						
					
					
						commit
						0a3fe87f54
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -412,10 +412,15 @@ void ShiftImageTimesDialog::updateInvalid() | ||||||
| 
 | 
 | ||||||
| void ShiftImageTimesDialog::timeEditChanged(const QTime &time) | void ShiftImageTimesDialog::timeEditChanged(const QTime &time) | ||||||
| { | { | ||||||
|  | 	QDateTimeEdit::Section timeEditSection = ui.timeEdit->currentSection(); | ||||||
|  | 	ui.timeEdit->setEnabled(false); | ||||||
| 	m_amount = time.hour() * 3600 + time.minute() * 60; | 	m_amount = time.hour() * 3600 + time.minute() * 60; | ||||||
| 	if (ui.backwards->isChecked()) | 	if (ui.backwards->isChecked()) | ||||||
| 		m_amount *= -1; | 		m_amount *= -1; | ||||||
| 	updateInvalid(); | 	updateInvalid(); | ||||||
|  | 	ui.timeEdit->setEnabled(true); | ||||||
|  | 	ui.timeEdit->setFocus(); | ||||||
|  | 	ui.timeEdit->setSelectedSection(timeEditSection); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ShiftImageTimesDialog::timeEditChanged() | void ShiftImageTimesDialog::timeEditChanged() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue