summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-22 19:55:48 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-22 19:58:14 -0700
commitaeac5fcb6d3134e644f78c3390ca6253da86031e (patch)
tree5ef3a50e487d99f2261c2d755889720bfac290f1 /qt-ui/mainwindow.cpp
parenta761a330695df7007349587a599565f328a6998e (diff)
downloadsubsurface-aeac5fcb6d3134e644f78c3390ca6253da86031e.tar.gz
Add refreshProfile member function to MainWindow class
While the whole idea of calling these functions through the MainWindow instance is atrocious, until we change the architecture of all this refreshProfile() is a useful function to have. In order to make this cleaner to implement I allowed an argument to ProfileWidget's replot() which allows picking a specific dive. By defaulting this to 0 we get the previous behavior when calling replot() without an argument. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp12
1 files changed, 8 insertions, 4 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()