diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/mainwindow.cpp | 12 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 1 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 4 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.h | 2 |
4 files changed, 12 insertions, 7 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 1678cd6d4..eb02ae8c9 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -648,15 +648,19 @@ bool MainWindow::plannerStateClean() return true; } +void MainWindow::refreshProfile() +{ + showProfile(); + graphics()->replot(get_dive(selected_dive)); + DivePictureModel::instance()->updateDivePictures(); +} + void MainWindow::planCanceled() { // while planning we might have modified the displayed_dive // let's refresh what's shown on the profile - showProfile(); - graphics()->replot(); + refreshProfile(); refreshDisplay(false); - graphics()->plotDive(get_dive(selected_dive)); - DivePictureModel::instance()->updateDivePictures(); } void MainWindow::planCreated() diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 9ff2a2041..25c9b3eba 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -189,6 +189,7 @@ slots: void refreshDisplay(bool doRecreateDiveList = true); void recreateDiveList(); void showProfile(); + void refreshProfile(); void editCurrentDive(); void planCanceled(); void planCreated(); diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 514edcfc5..5b7c3832a 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -342,12 +342,12 @@ void ProfileWidget2::setupItemOnScene() replotEnabled = true; } -void ProfileWidget2::replot() +void ProfileWidget2::replot(struct dive *d) { if (!replotEnabled) return; dataModel->clear(); - plotDive(0, true); // simply plot the displayed_dive again + plotDive(d, true); } void ProfileWidget2::setupItemSizes() diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index 1127b8498..7e038edc3 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -109,7 +109,7 @@ slots: // Necessary to call from QAction's signals. void pointsRemoved(const QModelIndex &, int start, int end); void plotPictures(); void setReplot(bool state); - void replot(); + void replot(dive *d = 0); /* this is called for every move on the handlers. maybe we can speed up this a bit? */ void recreatePlannedDive(); |