2015-05-27 10:34:55 +00:00
|
|
|
import QtQuick 2.3
|
|
|
|
import QtQuick.Controls 1.2
|
|
|
|
import QtQuick.Window 2.2
|
2015-06-04 08:27:38 +00:00
|
|
|
import QtQuick.Dialogs 1.2
|
2015-07-10 08:05:13 +00:00
|
|
|
import QtQuick.Layouts 1.1
|
2015-06-04 10:36:36 +00:00
|
|
|
import org.subsurfacedivelog.mobile 1.0
|
2015-05-27 10:34:55 +00:00
|
|
|
|
|
|
|
ApplicationWindow {
|
2015-07-12 17:42:23 +00:00
|
|
|
title: qsTr("Subsurface mobile")
|
|
|
|
property bool fullscreen: true
|
2015-07-13 00:39:13 +00:00
|
|
|
property alias messageText: message.text
|
2015-07-12 17:42:23 +00:00
|
|
|
visible: true
|
2015-06-04 08:27:38 +00:00
|
|
|
|
2015-07-12 17:56:48 +00:00
|
|
|
StackView {
|
|
|
|
id: stackView
|
2015-07-10 08:05:13 +00:00
|
|
|
anchors.fill: parent
|
2015-07-12 17:56:48 +00:00
|
|
|
focus: true
|
|
|
|
Keys.onReleased: if (event.key == Qt.Key_Back && stackView.depth > 1) {
|
|
|
|
stackView.pop()
|
|
|
|
event.accepted = true;
|
|
|
|
}
|
|
|
|
initialItem: Item {
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
2015-07-10 08:05:13 +00:00
|
|
|
|
2015-07-12 17:56:48 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: awLayout
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: prefsButton.height * 0.1
|
|
|
|
Rectangle {
|
|
|
|
id: topPart
|
|
|
|
Layout.minimumHeight: prefsButton.height * 1.2
|
|
|
|
Layout.fillWidth: true
|
|
|
|
anchors.bottom: detailsPage.top
|
|
|
|
anchors.bottomMargin: prefsButton.height * 0.1
|
2015-07-10 08:05:13 +00:00
|
|
|
|
2015-07-12 17:56:48 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.bottom: topPart.bottom
|
|
|
|
anchors.bottomMargin: prefsButton.height * 0.1
|
|
|
|
anchors.left: topPart.left
|
|
|
|
anchors.leftMargin: prefsButton.height * 0.1
|
|
|
|
Button {
|
|
|
|
id: prefsButton
|
|
|
|
text: "Preferences"
|
|
|
|
onClicked: {
|
|
|
|
stackView.push(prefsWindow)
|
|
|
|
}
|
|
|
|
}
|
2015-06-09 19:20:44 +00:00
|
|
|
|
2015-07-12 17:56:48 +00:00
|
|
|
Button {
|
|
|
|
id: loadDivesButton
|
|
|
|
text: "Load Dives"
|
|
|
|
onClicked: {
|
|
|
|
manager.loadDives();
|
|
|
|
}
|
|
|
|
}
|
2015-07-17 15:28:01 +00:00
|
|
|
|
2015-07-23 11:46:02 +00:00
|
|
|
Button {
|
|
|
|
id: downloadDivesButton
|
|
|
|
text: "Download Dives"
|
|
|
|
onClicked: {
|
|
|
|
downloadDivesWindow.height = parent.height
|
|
|
|
downloadDivesWindow.width = parent.width
|
|
|
|
stackView.push(downloadDivesWindow)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-17 15:28:01 +00:00
|
|
|
Button {
|
|
|
|
id: saveChanges
|
|
|
|
text: "Save Changes"
|
|
|
|
onClicked: {
|
|
|
|
manager.saveChanges();
|
|
|
|
}
|
|
|
|
}
|
2015-07-10 08:05:13 +00:00
|
|
|
}
|
2015-07-12 17:56:48 +00:00
|
|
|
|
2015-07-10 08:05:13 +00:00
|
|
|
}
|
2015-06-10 18:39:43 +00:00
|
|
|
|
2015-07-12 17:56:48 +00:00
|
|
|
Rectangle {
|
|
|
|
id: detailsPage
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
2015-06-10 18:39:43 +00:00
|
|
|
|
2015-07-12 17:56:48 +00:00
|
|
|
DiveList {
|
|
|
|
anchors.fill: detailsPage
|
|
|
|
id: diveDetails
|
|
|
|
}
|
|
|
|
}
|
2015-06-10 18:39:43 +00:00
|
|
|
|
2015-07-13 00:39:13 +00:00
|
|
|
Rectangle {
|
|
|
|
id: messageArea
|
|
|
|
height: childrenRect.height
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: message
|
|
|
|
color: "#000000"
|
|
|
|
text: ""
|
|
|
|
styleColor: "#ff0000"
|
|
|
|
font.pointSize: 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-10 08:05:13 +00:00
|
|
|
}
|
2015-06-09 19:20:44 +00:00
|
|
|
}
|
2015-07-12 17:56:48 +00:00
|
|
|
}
|
2015-07-10 08:40:30 +00:00
|
|
|
|
2015-07-12 17:56:48 +00:00
|
|
|
QMLManager {
|
|
|
|
id: manager
|
2015-06-09 19:20:44 +00:00
|
|
|
}
|
2015-07-12 17:56:48 +00:00
|
|
|
|
|
|
|
Preferences {
|
|
|
|
id: prefsWindow
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
|
2015-07-21 12:00:29 +00:00
|
|
|
DiveDetails {
|
|
|
|
id: detailsWindow
|
|
|
|
visible: false
|
|
|
|
}
|
2015-07-23 11:46:02 +00:00
|
|
|
|
|
|
|
DownloadFromDiveComputer {
|
|
|
|
id: downloadDivesWindow
|
|
|
|
visible: false
|
|
|
|
}
|
2015-05-27 10:34:55 +00:00
|
|
|
}
|