diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-06-27 15:33:44 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-06-27 20:57:11 +0800 |
commit | bdd89f0e7ab179f74051ffec9f3ecebd8443af14 (patch) | |
tree | 1e7b65773206dc0045541d212047010b20de065c /qt-ui | |
parent | 8678e2d57c6e456952dc2d75857f60b0129ed0ff (diff) | |
download | subsurface-bdd89f0e7ab179f74051ffec9f3ecebd8443af14.tar.gz |
Coordinate some mark_divelist_changed() calls
1) Make a call mark_divelist_changed(TRUE) when the user adds new
cylinder or weight entries.
2) Call mark_divelist_changed(FALSE) in
MainWindow::on_actionClose_triggered() so that each time after
a file is closed or a new one is created it does not ask immediately
the user for a save confirmation for the blank file/divelist.
3) Call mark_divelist_changed(TRUE) once a dive's geo location
has changed in GlobeGPS::changeDiveGeoPosition().
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/globe.cpp | 2 | ||||
-rw-r--r-- | qt-ui/maintab.cpp | 2 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index 24806d520..c16af93cf 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -3,6 +3,7 @@ #include "mainwindow.h" #include "ui_mainwindow.h" #include "../dive.h" +#include "../divelist.h" #include "../helpers.h" #include <QDebug> @@ -203,6 +204,7 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U reload(); editingDiveCoords = 0; messageWidget->animatedHide(); + mark_divelist_changed(TRUE); } void GlobeGPS::mousePressEvent(QMouseEvent* event) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 843724374..82550a3f4 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -324,11 +324,13 @@ void MainTab::updateDiveInfo(int dive) void MainTab::addCylinder_clicked() { cylindersModel->add(); + mark_divelist_changed(TRUE); } void MainTab::addWeight_clicked() { weightModel->add(); + mark_divelist_changed(TRUE); } void MainTab::reload() diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 43376f9ac..3f16b50e5 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -166,6 +166,7 @@ void MainWindow::on_actionClose_triggered() ui->ListWidget->reload(DiveTripModel::TREE); ui->globe->reload(); setTitle(MWTF_DEFAULT); + mark_divelist_changed(FALSE); clear_events(); } |