From d769c6016fb9fd484cfee90aa58eaac67f0d536a Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 11 Feb 2015 14:53:02 -0200 Subject: Copy the name and the coords when entering the EditDiveSite state Name and coords of the current dive are copied to the edit dive site screen. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 2 ++ qt-ui/simplewidgets.cpp | 10 ++++++++++ qt-ui/simplewidgets.h | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 51b0353be..a83d0903a 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -215,6 +215,8 @@ LocationInformationWidget *MainWindow::locationInformationWidget() { } void MainWindow::enableDiveSiteEdit() { + locationInformationWidget()->setLocationName(current_dive->location); + locationInformationWidget()->setLocationCoords(printGPSCoords(current_dive->latitude.udeg, current_dive->longitude.udeg)); setApplicationState("EditDiveSite"); } diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index 63ec4b4fa..c7dd47c6d 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -665,6 +665,16 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo ui.diveSiteMessage->addAction(action); } +void LocationInformationWidget::setLocationName(const QString& name) +{ + ui.diveSiteName->setText(name); +} + +void LocationInformationWidget::setLocationCoords(const QString& coords) +{ + ui.diveSiteCoordinates->setText(coords); +} + void LocationInformationWidget::acceptChanges() { emit informationManagementEnded(); diff --git a/qt-ui/simplewidgets.h b/qt-ui/simplewidgets.h index 16ed0478c..24af171a7 100644 --- a/qt-ui/simplewidgets.h +++ b/qt-ui/simplewidgets.h @@ -227,6 +227,11 @@ public slots: void rejectChanges(); void showEvent(QShowEvent *); + + /* change that to setLocationSite(QUuid diveSiteUid or something later */ + void setLocationName(const QString& name); + void setLocationCoords(const QString& coords); + signals: void informationManagementEnded(); -- cgit v1.2.3-70-g09d2