From 8d03d264807930b110f3f3f62f5fd42887f80e3e Mon Sep 17 00:00:00 2001 From: Grace Karanja Date: Mon, 10 Aug 2015 08:35:47 +0300 Subject: [PATCH] QML UI: Start Add Dive feature Start working on the add dive feature, to enable the user add a new dive using the mobile UI. Signed-off-by: Grace Karanja --- qt-mobile/DiveDetails.qml | 4 ++++ qt-mobile/main.qml | 10 ++++++++++ qt-mobile/qmlmanager.cpp | 6 ++++++ qt-mobile/qmlmanager.h | 1 + 4 files changed, 21 insertions(+) diff --git a/qt-mobile/DiveDetails.qml b/qt-mobile/DiveDetails.qml index 3c5120a85..83eccf372 100644 --- a/qt-mobile/DiveDetails.qml +++ b/qt-mobile/DiveDetails.qml @@ -27,6 +27,10 @@ Item { qmlProfile.update() } + function clearDetails() { + + } + Flickable { id: flick width: parent.width diff --git a/qt-mobile/main.qml b/qt-mobile/main.qml index 24ebb40ed..76d8836ed 100644 --- a/qt-mobile/main.qml +++ b/qt-mobile/main.qml @@ -37,6 +37,16 @@ ApplicationWindow { stackView.push(downloadDivesWindow) } } + + MenuItem { + text: "Add Dive" + onTriggered: { + manager.addDive(); + detailsWindow.clearDetails() + stackView.push(detailsWindow) + } + } + MenuItem { text: "Save Changes" onTriggered: { diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 203dcde20..69282ee90 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -126,6 +126,12 @@ void QMLManager::saveChanges() set_filename(fileName.toUtf8().data(), true); mark_divelist_changed(false); } + +void QMLManager::addDive() +{ + +} + bool QMLManager::saveCloudPassword() const { return m_saveCloudPassword; diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h index 0f1df2b59..4bd8488e8 100644 --- a/qt-mobile/qmlmanager.h +++ b/qt-mobile/qmlmanager.h @@ -28,6 +28,7 @@ public slots: void loadDives(); void commitChanges(QString diveId, QString suit, QString buddy, QString diveMaster, QString notes); void saveChanges(); + void addDive(); private: QString m_cloudUserName; QString m_cloudPassword;