From b60b7c108e27ed60d19932425e82db3eecbd4fde Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 25 Feb 2017 21:00:09 -0800 Subject: Enable manual setting of duration Signed-off-by: Dirk Hohndel --- desktop-widgets/maintab.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/desktop-widgets/maintab.cpp b/desktop-widgets/maintab.cpp index fc0fb0005..d181131a8 100644 --- a/desktop-widgets/maintab.cpp +++ b/desktop-widgets/maintab.cpp @@ -1243,7 +1243,19 @@ void MainTab::on_duration_textChanged(const QString &text) { if (editMode == IGNORE || acceptingEdit == true) return; - qDebug() << "duration text changed"; + // parse this + MainWindow::instance()->graphics()->setReplot(false); + if (!isEditing()) + enableEdition(); + displayed_dive.dc.duration.seconds = parseDurationToSeconds(text); + displayed_dive.duration = displayed_dive.dc.duration; + displayed_dive.dc.meandepth.mm = 0; + displayed_dive.dc.samples = 0; + DivePlannerPointsModel::instance()->loadFromDive(&displayed_dive); + markChangedWidget(ui.duration); + MainWindow::instance()->graphics()->setReplot(true); + MainWindow::instance()->graphics()->plotDive(); + } void MainTab::on_depth_textChanged(const QString &text) -- cgit v1.2.3-70-g09d2