summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-06-01 16:58:23 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-01 13:24:37 -0700
commitb8092c07a4b4d7715d825641e458be5fa56972d6 (patch)
tree81d7604b2f53fe234d83a09a3645616a681e9ba1 /qt-ui/maintab.cpp
parent82d3f088a40545624f0d1ac61ca990e05325081c (diff)
downloadsubsurface-b8092c07a4b4d7715d825641e458be5fa56972d6.tar.gz
Create a new DiveSite when user clicks on add
Also reorganized a bit of the code, and renamed a few misleading methods. [Dirk Hohndel: remove some C++11 code] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.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 2ecfb6c6d..cc09ed723 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -21,6 +21,8 @@
#include "divepicturemodel.h"
#include "divecomputerextradatamodel.h"
#include "divelocationmodel.h"
+#include "divesite.h"
+
#if defined(FBSUPPORT)
#include "socialnetworks.h"
#endif
@@ -55,7 +57,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.extraData->setModel(extraDataModel);
closeMessage();
- connect(ui.manageDiveSite, SIGNAL(clicked()), this, SLOT(prepareDiveSiteEdit()));
+ connect(ui.addDiveSite, SIGNAL(clicked()), this, SLOT(prepareDiveSiteEdit()));
QAction *action = new QAction(tr("Apply changes"), this);
connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges()));
@@ -231,17 +233,19 @@ void MainTab::setCurrentLocationIndex()
void MainTab::enableGeoLookupEdition()
{
ui.waitingSpinner->stop();
- ui.manageDiveSite->show();
+ ui.addDiveSite->show();
}
void MainTab::disableGeoLookupEdition()
{
ui.waitingSpinner->start();
- ui.manageDiveSite->hide();
+ ui.addDiveSite->hide();
}
void MainTab::prepareDiveSiteEdit() {
- emit requestDiveSiteEdit(displayed_dive.dive_site_uuid);
+ uint32_t dive_site_uuid = LocationInformationModel::instance()->addDiveSite(tr("Unnamed"));
+ displayed_dive.dive_site_uuid = dive_site_uuid;
+ emit requestDiveSiteEdit(dive_site_uuid);
}
void MainTab::toggleTriggeredColumn()