From df1a1f7034c6c332f7f71a64ab45955c089cd56b Mon Sep 17 00:00:00 2001 From: Grace Karanja <gracie.karanja89@gmail.com> Date: Fri, 17 Jul 2015 18:28:01 +0300 Subject: QML UI: Implement saving of dives This implements saving of some dive details to the cloud service. When the user closes an open dives, any changed details will be cached, and when they click on the 'Save Changes' button is pressed, the changes will be saved to the cloud. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> --- qt-mobile/DiveList.qml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'qt-mobile/DiveList.qml') diff --git a/qt-mobile/DiveList.qml b/qt-mobile/DiveList.qml index 40507e26a..0f358081d 100644 --- a/qt-mobile/DiveList.qml +++ b/qt-mobile/DiveList.qml @@ -109,7 +109,16 @@ Rectangle { opacity: dive.detailsOpacity text: "Close" - onClicked: dive.state = ''; + onClicked: { + manager.commitChanges( + id, + txtSuit.text, + txtBuddy.text, + txtDiveMaster.text, + txtNotes.text + ) + dive.state = ''; + } } states: State { -- cgit v1.2.3-70-g09d2 From 0c9756c5d786158f25aaf1ad2d9c316be9e2b9e5 Mon Sep 17 00:00:00 2001 From: Grace Karanja <gracie.karanja89@gmail.com> Date: Fri, 17 Jul 2015 19:10:32 +0300 Subject: QML UI: Implement showing of the dive profile on QML Link the QMLProfile class to the DiveList.qml file. The profile is displayed above the dive details. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> --- CMakeLists.txt | 2 +- qt-gui.cpp | 2 ++ qt-mobile/DiveList.qml | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'qt-mobile/DiveList.qml') diff --git a/CMakeLists.txt b/CMakeLists.txt index ab7be1bfc..a3fbb1cb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -458,7 +458,7 @@ endif() # create the executables if(SUBSURFACE_MOBILE) - set(MOBILE_SRC qt-mobile/qmlmanager.cpp qt-models/divelistmodel.cpp) + set(MOBILE_SRC qt-mobile/qmlmanager.cpp qt-mobile/qmlprofile.cpp qt-models/divelistmodel.cpp) add_definitions(-DSUBSURFACE_MOBILE) qt5_add_resources(MOBILE_RESOURCES qt-mobile/mobile-resources.qrc) if(ANDROID) diff --git a/qt-gui.cpp b/qt-gui.cpp index 175e9c27d..fac743a43 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -19,6 +19,7 @@ #include <QQmlContext> #include "qt-mobile/qmlmanager.h" #include "qt-models/divelistmodel.h" +#include "qt-mobile/qmlprofile.h" QObject *qqWindowObject = NULL; #endif @@ -40,6 +41,7 @@ void run_ui() #ifdef SUBSURFACE_MOBILE window->hide(); qmlRegisterType<QMLManager>("org.subsurfacedivelog.mobile", 1, 0, "QMLManager"); + qmlRegisterType<QMLProfile>("org.subsurfacedivelog.mobile", 1, 0, "QMLProfile"); QQmlApplicationEngine engine; DiveListModel diveListModel; QQmlContext *ctxt = engine.rootContext(); diff --git a/qt-mobile/DiveList.qml b/qt-mobile/DiveList.qml index 0f358081d..7fa7a53f0 100644 --- a/qt-mobile/DiveList.qml +++ b/qt-mobile/DiveList.qml @@ -77,6 +77,13 @@ Rectangle { id: editorDetails width: detailsPage.width columns: 2 + Text { } + QMLProfile { + diveId: id + height: 400 + Layout.fillWidth: true + } + Text { text: "Location:"; font.bold: true } TextField { id: txtLocation; text: location; Layout.fillWidth: true } Text { text: "Air Temp:"; font.bold: true } -- cgit v1.2.3-70-g09d2