From 86d7f6ace06adf13fe5045a217c4f264356a01df Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 28 May 2014 15:54:04 -0300 Subject: Move code from the Planner that doesn't belongs there. Moved the connections between DivePlannerPointsModel and MainWindow from inside the Planner class to the MainWindow. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'qt-ui/mainwindow.cpp') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 52eb3d115..9a325cef4 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -77,7 +77,8 @@ MainWindow::MainWindow() : QMainWindow(), connect(ui.actionRecent3, SIGNAL(triggered(bool)), this, SLOT(recentFileTriggered(bool))); connect(ui.actionRecent4, SIGNAL(triggered(bool)), this, SLOT(recentFileTriggered(bool))); connect(information(), SIGNAL(addDiveFinished()), ui.newProfile, SLOT(setProfileState())); - + connect(DivePlannerPointsModel::instance(), SIGNAL(planCreated()), MainWindow::instance(), SLOT(planCreated())); + connect(DivePlannerPointsModel::instance(), SIGNAL(planCanceled()), MainWindow::instance(), SLOT(planCanceled())); ui.mainErrorMessage->hide(); initialUiSetup(); readSettings(); @@ -406,6 +407,13 @@ void MainWindow::planCanceled() refreshDisplay(); } +void MainWindow::planCreated() +{ + removeFakeDiveForAddAndPlan(); + showProfile(); + refreshDisplay(); +} + void MainWindow::on_actionDivePlanner_triggered() { if(!plannerStateClean()) -- cgit v1.2.3-70-g09d2