mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Get initial depth/duration correct when manually adding dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f1c46927ef
commit
d36f056bde
3 changed files with 16 additions and 0 deletions
desktop-widgets
|
@ -431,6 +431,16 @@ void MainTab::refreshDiveInfo()
|
|||
updateDiveInfo();
|
||||
}
|
||||
|
||||
void MainTab::updateDepthDuration()
|
||||
{
|
||||
ui.depth->setVisible(true);
|
||||
ui.depthLabel->setVisible(true);
|
||||
ui.duration->setVisible(true);
|
||||
ui.durationLabel->setVisible(true);
|
||||
ui.duration->setText(QDateTime::fromTime_t(displayed_dive.duration.seconds).toUTC().toString("h:mm"));
|
||||
ui.depth->setText(get_depth_string(displayed_dive.maxdepth, true));
|
||||
}
|
||||
|
||||
void MainTab::updateDiveInfo(bool clear)
|
||||
{
|
||||
ui.location->refreshDiveSiteCache();
|
||||
|
|
|
@ -66,6 +66,7 @@ slots:
|
|||
void addWeight_clicked();
|
||||
void refreshDiveInfo();
|
||||
void updateDiveInfo(bool clear = false);
|
||||
void updateDepthDuration();
|
||||
void acceptChanges();
|
||||
void rejectChanges();
|
||||
void on_location_diveSiteSelected();
|
||||
|
|
|
@ -986,6 +986,11 @@ void MainWindow::on_actionAddDive_triggered()
|
|||
DivePlannerPointsModel::instance()->createSimpleDive();
|
||||
configureToolbar();
|
||||
graphics()->plotDive();
|
||||
fixup_dc_duration(&displayed_dive.dc);
|
||||
displayed_dive.duration = displayed_dive.dc.duration;
|
||||
|
||||
// now that we have the correct depth and duration, update the dive info
|
||||
information()->updateDepthDuration();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEditDive_triggered()
|
||||
|
|
Loading…
Add table
Reference in a new issue