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:
Stefan Fuchs 2018-06-17 20:22:55 +02:00 committed by Dirk Hohndel
parent 2ae3760303
commit 0a3fe87f54

View file

@ -412,10 +412,15 @@ void ShiftImageTimesDialog::updateInvalid()
void ShiftImageTimesDialog::timeEditChanged(const QTime &time)
{
QDateTimeEdit::Section timeEditSection = ui.timeEdit->currentSection();
ui.timeEdit->setEnabled(false);
m_amount = time.hour() * 3600 + time.minute() * 60;
if (ui.backwards->isChecked())
m_amount *= -1;
updateInvalid();
ui.timeEdit->setEnabled(true);
ui.timeEdit->setFocus();
ui.timeEdit->setSelectedSection(timeEditSection);
}
void ShiftImageTimesDialog::timeEditChanged()