summaryrefslogtreecommitdiffstats
path: root/qt-ui/locationinformation.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2015-06-03 23:50:36 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-03 21:36:42 -0700
commit612b068e33d0c7510e3bee0fd15aceff1f788841 (patch)
treeec5098b6617b6bf7c64e3f6aebbb51e0653b81bc /qt-ui/locationinformation.cpp
parent4c978eab2e4889054936c75db3fe4c02cba6d386 (diff)
downloadsubsurface-612b068e33d0c7510e3bee0fd15aceff1f788841.tar.gz
Different states for edit / add dive site
When we start the dive site edit dialog, either for add or for edit, we don't save the state, so the reject state didn't know what to do with the dive site. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/locationinformation.cpp')
-rw-r--r--qt-ui/locationinformation.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index cc6405947..198d7f6a0 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -101,6 +101,19 @@ void LocationInformationWidget::acceptChanges()
emit coordinatesChanged();
}
+void LocationInformationWidget::editDiveSite(uint32_t uuid)
+{
+ current_mode = EDIT_DIVE_SITE;
+ setCurrentDiveSiteByUuid(uuid);
+}
+
+void LocationInformationWidget::createDiveSite()
+{
+ uint32_t uid = LocationInformationModel::instance()->addDiveSite(tr("untitled"));
+ current_mode = CREATE_DIVE_SITE;
+ setCurrentDiveSiteByUuid(uid);
+}
+
void LocationInformationWidget::rejectChanges()
{
if (currentDs && dive_site_is_empty(currentDs)) {