diff options
-rw-r--r-- | qt-models/diveplannermodel.cpp | 7 | ||||
-rw-r--r-- | qt-models/diveplannermodel.h | 2 | ||||
-rw-r--r-- | qt-ui/diveplanner.cpp | 2 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 4 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 3 |
5 files changed, 8 insertions, 10 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 5dd43c787..bace54e20 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -840,12 +840,7 @@ void DivePlannerPointsModel::createTemporaryPlan() #endif if (recalcQ() && !diveplan_empty(&diveplan)) { plan(&diveplan, &cache, isPlanner(), false); - /* TODO: - * Hook this signal to the mainwindow(s), the call to MainWindow - * can't be here as we are now dealing with QML too. - */ - //MainWindow::instance()->setPlanNotes(displayed_dive.notes); - emit calculatedPlanNotes(displayed_dive.notes); + emit calculatedPlanNotes(); } // throw away the cache free(cache); diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h index 403b86b6d..4d1ef3227 100644 --- a/qt-models/diveplannermodel.h +++ b/qt-models/diveplannermodel.h @@ -97,7 +97,7 @@ signals: void cylinderModelEdited(); void startTimeChanged(QDateTime); void recreationChanged(bool); - void calculatedPlanNotes(const QString& notes); + void calculatedPlanNotes(); private: explicit DivePlannerPointsModel(QObject *parent = 0); diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 7ab0aac86..e2a604b68 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -127,6 +127,8 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg plannerModel, SIGNAL(cylinderModelEdited())); connect(CylindersModel::instance(), SIGNAL(rowsRemoved(QModelIndex, int, int)), plannerModel, SIGNAL(cylinderModelEdited())); + connect(plannerModel, SIGNAL(calculatedPlanNotes()), MainWindow::instance(), SLOT(setPlanNotes())); + ui.tableWidget->setBtnToolTip(tr("Add dive data point")); connect(ui.startTime, SIGNAL(timeChanged(QTime)), plannerModel, SLOT(setStartTime(QTime))); diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 5621269b3..0095aaf97 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -619,9 +619,9 @@ void MainWindow::planCreated() refreshDisplay(); } -void MainWindow::setPlanNotes(const char *notes) +void MainWindow::setPlanNotes() { - plannerDetails()->divePlanOutput()->setHtml(notes); + plannerDetails()->divePlanOutput()->setHtml(displayed_dive.notes); } void MainWindow::printPlan() diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 0cdc2e1c5..68c5baed3 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -88,7 +88,6 @@ public: PlannerDetails *plannerDetails() const; void setLoadedWithFiles(bool filesFromCommandLine); bool filesFromCommandLine() const; - void setPlanNotes(const char *notes); void printPlan(); void checkSurvey(QSettings *s); void setApplicationState(const QByteArray& state); @@ -188,6 +187,8 @@ slots: void planCreated(); void setEnabledToolbar(bool arg1); void enableDiveSiteCreation(); + void setPlanNotes(); + private: Ui::MainWindow ui; |