From 0962b504ce546dfa8b71cc91a2931fcae83275d5 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 26 Dec 2015 21:37:18 -0800 Subject: QML UI: get add dive closer to being useful Now we at least start out with the corret date, time and number. This still isn't functional as a lot of the data aren't used and the way you save the data is completely silly, but it's another step in the right direction. Signed-off-by: Dirk Hohndel --- qt-mobile/qml/main.qml | 4 +++- qt-mobile/qmlmanager.cpp | 4 ++-- qt-mobile/qmlmanager.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'qt-mobile') diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml index eadd220a3..703f4d17f 100644 --- a/qt-mobile/qml/main.qml +++ b/qt-mobile/qml/main.qml @@ -49,8 +49,10 @@ MobileComponents.ApplicationWindow { Action { text: "Add dive manually" onTriggered: { - manager.addDive(); detailsWindow.state = "edit" + detailsWindow.dive_id = manager.addDive(); + detailsWindow.number = manager.getNumber(detailsWindow.dive_id) + detailsWindow.date = manager.getDate(detailsWindow.dive_id) stackView.push(detailsWindow) } } diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 3a62fb342..cdf844492 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -336,10 +336,10 @@ void QMLManager::saveChanges() mark_divelist_changed(false); } -void QMLManager::addDive() +QString QMLManager::addDive() { appendTextToLog("Adding new dive."); - DiveListModel::instance()->startAddDive(); + return DiveListModel::instance()->startAddDive(); } void QMLManager::applyGpsData() diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h index be37f5a74..23b6bd41f 100644 --- a/qt-mobile/qmlmanager.h +++ b/qt-mobile/qmlmanager.h @@ -73,7 +73,7 @@ public slots: void provideAuth(QNetworkReply *reply, QAuthenticator *auth); void commitChanges(QString diveId, QString suit, QString buddy, QString diveMaster, QString notes); void saveChanges(); - void addDive(); + QString addDive(); void applyGpsData(); void sendGpsData(); void clearGpsData(); -- cgit v1.2.3-70-g09d2