mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop: make time shift dialog show correct times
This got broken in commit 7417f865cd
("cleanup: un-singletonize
ShiftTimesDialog") and no one ever noticed.
We need to intitialize the when variable and set up the initial texts in
order for the time shift dialog to show the correct information. Doing
this in the ButtonClicked member (right before the dialog is destroyed)
makes absolutely no sense.
Fixes #3535
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c88d22462d
commit
7b5381b6de
2 changed files with 7 additions and 11 deletions
|
@ -89,13 +89,6 @@ void ShiftTimesDialog::buttonClicked(QAbstractButton *button)
|
|||
if (amount != 0)
|
||||
Command::shiftTime(getDiveSelection(), amount);
|
||||
}
|
||||
|
||||
ui.timeEdit->setTime(QTime(0, 0, 0, 0));
|
||||
dive *d = first_selected_dive();
|
||||
if (d) {
|
||||
ui.currentTime->setText(get_dive_date_string(d->when));
|
||||
ui.shiftedTime->setText(get_dive_date_string(d->when));
|
||||
}
|
||||
}
|
||||
|
||||
void ShiftTimesDialog::changeTime()
|
||||
|
@ -120,6 +113,12 @@ ShiftTimesDialog::ShiftTimesDialog(QWidget *parent) : QDialog(parent),
|
|||
connect(close, SIGNAL(activated()), this, SLOT(close()));
|
||||
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
|
||||
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
|
||||
dive *d = first_selected_dive();
|
||||
if (d) {
|
||||
when = d->when;
|
||||
ui.currentTime->setText(get_dive_date_string(when));
|
||||
ui.shiftedTime->setText(get_dive_date_string(when));
|
||||
}
|
||||
}
|
||||
|
||||
void ShiftImageTimesDialog::syncCameraClicked()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue