diff options
Diffstat (limited to 'qt-mobile')
-rw-r--r-- | qt-mobile/DiveDetails.qml | 64 | ||||
-rw-r--r-- | qt-mobile/DiveList.qml | 2 | ||||
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 4 |
3 files changed, 54 insertions, 16 deletions
diff --git a/qt-mobile/DiveDetails.qml b/qt-mobile/DiveDetails.qml index 5dfefdff8..64b7398cc 100644 --- a/qt-mobile/DiveDetails.qml +++ b/qt-mobile/DiveDetails.qml @@ -1,5 +1,6 @@ import QtQuick 2.3 import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.2 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.1 @@ -17,6 +18,8 @@ Item { property string buddy property string divemaster; property string notes; + property string date + property string number onDive_idChanged: { qmlProfile.diveId = dive_id @@ -31,31 +34,62 @@ Item { clip: true ColumnLayout { width: parent.width - RowLayout { - Button { - text: "Back" - onClicked: { - manager.commitChanges( - dive_id, - suit, - buddy, - divemaster, - notes - ) - stackView.pop(); + Rectangle { + id: topBar + color: "#2C4882" + Layout.fillWidth: true + Layout.margins: 0 + height: backButton.height * 1.2 + RowLayout { + Button { + id: backButton + Layout.margins: 0.1 * height + text: "\u2190" + style: ButtonStyle { + background: Rectangle { + color: "#4C68A2" + } + label: Text { + id: txt + color: "white" + font.pointSize: 24 + font.bold: true + text: control.text + } + } + onClicked: { + manager.commitChanges( + dive_id, + suit, + buddy, + divemaster, + notes + ) + stackView.pop(); + } + } + Text { + text: qsTr("Subsurface mobile") + font.pointSize: 18 + font.bold: true + color: "white" } } } - GridLayout { id: editorDetails width: parent.width columns: 2 - Text { } + Text { + Layout.columnSpan: 2 + Layout.alignment: Qt.AlignHCenter + text: "Dive " + number + " (" + date + ")"; font.bold: true + } QMLProfile { + Layout.columnSpan: 2 + Layout.fillWidth: true id: qmlProfile height: 500 - Layout.fillWidth: true } Text { text: "Location:"; font.bold: true } TextField { id: txtLocation; text: location; Layout.fillWidth: true } diff --git a/qt-mobile/DiveList.qml b/qt-mobile/DiveList.qml index 52cdc20f5..acf123011 100644 --- a/qt-mobile/DiveList.qml +++ b/qt-mobile/DiveList.qml @@ -40,6 +40,8 @@ Rectangle { detailsWindow.watertemp = watertemp detailsWindow.divemaster = divemaster detailsWindow.notes = notes + detailsWindow.number = diveNumber + detailsWindow.date = date stackView.push(detailsWindow) } } diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 3e09be7c3..203dcde20 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -11,7 +11,7 @@ static void showMessage(const char *errorString) { - if (!qqWindowObject->setProperty("messageText", QVariant(errorString))) + if (qqWindowObject && !qqWindowObject->setProperty("messageText", QVariant(errorString))) qDebug() << "couldn't set property messageText to" << errorString; } @@ -21,6 +21,8 @@ QMLManager::QMLManager() setCloudUserName(prefs.cloud_storage_email); setCloudPassword(prefs.cloud_storage_password); setSaveCloudPassword(prefs.save_password_local); + if (!same_string(prefs.cloud_storage_email, "") && !same_string(prefs.cloud_storage_password, "")) + loadDives(); } QMLManager::~QMLManager() |