summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/maintab.cpp7
-rw-r--r--qt-ui/maintab.h5
-rw-r--r--qt-ui/mainwindow.cpp4
-rw-r--r--qt-ui/mainwindow.h3
4 files changed, 13 insertions, 6 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 2f39c17db..571d38b9d 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -49,7 +49,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.extraData->setModel(extraDataModel);
closeMessage();
- connect(ui.manageDiveSite, SIGNAL(clicked()), this, SIGNAL(requestDiveSiteEdit()));
+ connect(ui.manageDiveSite, SIGNAL(clicked()), this, SLOT(prepareDiveSiteEdit()));
QAction *action = new QAction(tr("Apply changes"), this);
connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges()));
@@ -213,6 +213,11 @@ MainTab::~MainTab()
}
}
+void MainTab::prepareDiveSiteEdit() {
+ //TODO: GET THE CORRECT DIVESITE UUID HERE
+ QUuid id = QUuid::createUuid();
+ emit requestDiveSiteEdit(id);
+}
void MainTab::toggleTriggeredColumn()
{
QAction *action = qobject_cast<QAction *>(sender());
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index acbb8f14f..c90b0fb09 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -10,6 +10,7 @@
#include <QTabWidget>
#include <QDialog>
#include <QMap>
+#include <QUuid>
#include "ui_maintab.h"
#include "completionmodels.h"
@@ -55,7 +56,7 @@ public:
signals:
void addDiveFinished();
void dateTimeChanged();
- void requestDiveSiteEdit();
+ void requestDiveSiteEdit(QUuid diveSiteId);
public
slots:
void addCylinder_clicked();
@@ -93,7 +94,7 @@ slots:
void photoDoubleClicked(const QString filePath);
void removeSelectedPhotos();
void updateGpsCoordinates();
-
+ void prepareDiveSiteEdit();
private:
Ui::MainTab ui;
WeightModel *weightModel;
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index a83d0903a..eca4c08f8 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -111,7 +111,7 @@ MainWindow::MainWindow() : QMainWindow(),
connect(DivePlannerPointsModel::instance(), SIGNAL(planCreated()), this, SLOT(planCreated()));
connect(DivePlannerPointsModel::instance(), SIGNAL(planCanceled()), this, SLOT(planCanceled()));
connect(plannerDetails->printPlan(), SIGNAL(pressed()), divePlannerWidget(), SLOT(printDecoPlan()));
- connect(mainTab, SIGNAL(requestDiveSiteEdit()), this, SLOT(enableDiveSiteEdit()));
+ connect(mainTab, SIGNAL(requestDiveSiteEdit(QUuid)), this, SLOT(enableDiveSiteEdit(QUuid)));
connect(locationInformation, SIGNAL(informationManagementEnded()), this, SLOT(setDefaultState()));
#ifdef NO_PRINTING
ui.printPlan->hide();
@@ -214,7 +214,7 @@ LocationInformationWidget *MainWindow::locationInformationWidget() {
return qobject_cast<LocationInformationWidget*>(applicationState["EditDiveSite"].topLeft);
}
-void MainWindow::enableDiveSiteEdit() {
+void MainWindow::enableDiveSiteEdit(QUuid id) {
locationInformationWidget()->setLocationName(current_dive->location);
locationInformationWidget()->setLocationCoords(printGPSCoords(current_dive->latitude.udeg, current_dive->longitude.udeg));
setApplicationState("EditDiveSite");
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 300748371..ef3e8fa18 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -10,6 +10,7 @@
#include <QMainWindow>
#include <QAction>
#include <QUrl>
+#include <QUuid>
#include "ui_mainwindow.h"
@@ -159,7 +160,7 @@ slots:
void on_paste_triggered();
void on_actionFilterTags_triggered();
void on_actionConfigure_Dive_Computer_triggered();
- void enableDiveSiteEdit();
+ void enableDiveSiteEdit(QUuid id);
void setDefaultState();
protected: