aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2015-06-05 10:52:52 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-07 08:04:32 -0700
commit6b81fb49d099f62c30fe52668c3a9bc74e46506f (patch)
treeb5d4a7d79ea8ed29b1eda9f4e774475bb21be83c /qt-ui/maintab.cpp
parent218ad95d7de4da07262ad1244178ca6c8c3b30cf (diff)
downloadsubsurface-6b81fb49d099f62c30fe52668c3a9bc74e46506f.tar.gz
Always send the UUID of the coordinates to the globe
We were relying in the current_dive to display the globe coordinates correctly - but this is not always the case: you can be inserting a new dive site and it isn't yet inside of the dive until the user presses accept. So always pass the uuid of the dive site that we want to display. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index ed7597e3c..68034fb62 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -701,7 +701,8 @@ void MainTab::updateDiveInfo(bool clear)
ui.cylinders->view()->hideColumn(CylindersModel::USE);
ui.location->blockSignals(false);
- emit diveSiteChanged();
+
+ emit diveSiteChanged(displayed_dive.dive_site_uuid);
}
void MainTab::addCylinder_clicked()
@@ -997,7 +998,7 @@ void MainTab::rejectChanges()
DivePictureModel::instance()->updateDivePictures();
// the user could have edited the location and then canceled the edit
// let's get the correct location back in view
- MainWindow::instance()->globe()->centerOnCurrentDive();
+ MainWindow::instance()->globe()->centerOnDiveSite(displayed_dive.dive_site_uuid);
MainWindow::instance()->globe()->reload();
// show the profile and dive info
MainWindow::instance()->graphics()->replot();
@@ -1280,9 +1281,12 @@ void MainTab::on_location_currentIndexChanged(int idx)
struct dive_site *ds_from_dive = get_dive_site_by_uuid(displayed_dive.dive_site_uuid);
if(ds_from_dive && ui.location->currentText() == ds_from_dive->name)
return;
- displayed_dive.dive_site_uuid = get_dive_site(idx)->uuid;
+ ds_from_dive = get_dive_site(idx);
+ displayed_dive.dive_site_uuid = ds_from_dive->uuid;
+
+
markChangedWidget(ui.location);
- emit diveSiteChanged();
+ emit diveSiteChanged(ds_from_dive->uuid);
}
}