summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r--desktop-widgets/mainwindow.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 6d4c36dc1..12592ece0 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -212,6 +212,7 @@ MainWindow::MainWindow() : QMainWindow(),
connect(information(), SIGNAL(dateTimeChanged()), graphics(), SLOT(dateTimeChanged()));
connect(DivePlannerPointsModel::instance(), SIGNAL(planCreated()), this, SLOT(planCreated()));
connect(DivePlannerPointsModel::instance(), SIGNAL(planCanceled()), this, SLOT(planCanceled()));
+ connect(DivePlannerPointsModel::instance(), SIGNAL(variationsComputed(QString)), this, SLOT(updateVariations(QString)));
connect(plannerDetails->printPlan(), SIGNAL(pressed()), divePlannerWidget(), SLOT(printDecoPlan()));
connect(this, SIGNAL(startDiveSiteEdit()), this, SLOT(on_actionDiveSiteEdit_triggered()));
connect(information(), SIGNAL(diveSiteChanged(struct dive_site *)), mapWidget, SLOT(centerOnDiveSite(struct dive_site *)));
@@ -445,7 +446,6 @@ void MainWindow::enableDisableCloudActions()
PlannerDetails *MainWindow::plannerDetails() const {
return qobject_cast<PlannerDetails*>(applicationState["PlanDive"].bottomRight);
}
-
PlannerSettingsWidget *MainWindow::divePlannerSettingsWidget() {
return qobject_cast<PlannerSettingsWidget*>(applicationState["PlanDive"].bottomLeft);
}
@@ -899,6 +899,14 @@ void MainWindow::setPlanNotes()
plannerDetails()->divePlanOutput()->setHtml(displayed_dive.notes);
}
+void MainWindow::updateVariations(QString variations)
+{
+ QString notes = QString(displayed_dive.notes);
+ free(displayed_dive.notes);
+ displayed_dive.notes = strdup(notes.replace("VARIATIONS", variations).toUtf8().data());
+ plannerDetails()->divePlanOutput()->setHtml(displayed_dive.notes);
+}
+
void MainWindow::printPlan()
{
#ifndef NO_PRINTING