2015-12-04 01:28:48 +00:00
|
|
|
import QtQuick 2.3
|
2015-12-26 21:22:50 +00:00
|
|
|
/*
|
|
|
|
import QtWebView 1.0
|
|
|
|
*/
|
2015-12-04 01:28:48 +00:00
|
|
|
import QtQuick.Controls 1.2
|
|
|
|
import QtQuick.Controls.Styles 1.2
|
|
|
|
import QtQuick.Dialogs 1.2
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
import org.subsurfacedivelog.mobile 1.0
|
2017-01-21 22:42:10 +00:00
|
|
|
import org.kde.kirigami 1.0 as Kirigami
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-01-12 00:15:02 +00:00
|
|
|
Item {
|
2015-12-04 01:28:48 +00:00
|
|
|
id: detailsView
|
2016-04-07 19:07:44 +00:00
|
|
|
property real gridWidth: detailsView.width - 2 * Kirigami.Units.gridUnit
|
2016-02-28 16:04:52 +00:00
|
|
|
property real col1Width: gridWidth * 0.23
|
|
|
|
property real col2Width: gridWidth * 0.37
|
2016-02-08 21:25:29 +00:00
|
|
|
property real col3Width: gridWidth * 0.20
|
|
|
|
property real col4Width: gridWidth * 0.20
|
|
|
|
|
2016-04-07 19:07:44 +00:00
|
|
|
width: diveDetailsPage.width - diveDetailsPage.leftPadding - diveDetailsPage.rightPadding
|
2016-05-03 21:30:56 +00:00
|
|
|
height: mainLayout.implicitHeight + bottomLayout.implicitHeight + Kirigami.Units.iconSizes.large
|
2016-01-12 00:15:02 +00:00
|
|
|
Rectangle {
|
2016-04-02 03:29:06 +00:00
|
|
|
z: 99
|
2016-03-08 20:26:54 +00:00
|
|
|
color: Kirigami.Theme.textColor
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.3
|
2016-03-08 20:26:54 +00:00
|
|
|
width: Kirigami.Units.smallSpacing/4
|
2016-01-12 00:15:02 +00:00
|
|
|
anchors {
|
|
|
|
right: parent.right
|
|
|
|
top: parent.top
|
|
|
|
bottom: parent.bottom
|
2015-12-04 01:28:48 +00:00
|
|
|
}
|
|
|
|
}
|
2016-01-12 00:15:02 +00:00
|
|
|
GridLayout {
|
|
|
|
id: mainLayout
|
|
|
|
anchors {
|
2016-04-02 03:29:06 +00:00
|
|
|
top: parent.top
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
2016-04-19 17:11:07 +00:00
|
|
|
margins: Kirigami.Units.gridUnit
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
|
|
|
columns: 4
|
2016-03-08 20:26:54 +00:00
|
|
|
rowSpacing: Kirigami.Units.smallSpacing * 2
|
|
|
|
columnSpacing: Kirigami.Units.smallSpacing
|
2016-01-12 00:15:02 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Heading {
|
2016-01-12 00:15:02 +00:00
|
|
|
id: detailsViewHeading
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: dive.location
|
|
|
|
font.underline: dive.gps !== ""
|
|
|
|
Layout.columnSpan: 4
|
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2016-04-02 02:39:55 +00:00
|
|
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
2016-01-12 00:15:02 +00:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
2016-01-21 20:22:15 +00:00
|
|
|
if (dive.gps !== "")
|
2016-04-02 12:09:40 +00:00
|
|
|
showMap(dive.gps)
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-26 21:22:50 +00:00
|
|
|
}
|
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-01-12 00:15:02 +00:00
|
|
|
id: dateLabel
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("Date: ")
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-01-20 21:58:04 +00:00
|
|
|
text: dive.date + " " + dive.time
|
2016-02-01 10:29:50 +00:00
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
|
|
|
Layout.columnSpan: 2
|
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-01 10:29:50 +00:00
|
|
|
id: numberText
|
|
|
|
text: "#" + dive.number
|
2016-03-08 20:26:54 +00:00
|
|
|
color: Kirigami.Theme.textColor
|
2016-02-01 10:29:50 +00:00
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2015-12-26 21:22:50 +00:00
|
|
|
}
|
2015-12-07 17:10:55 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-01-12 00:15:02 +00:00
|
|
|
id: depthLabel
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("Depth: ")
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2015-12-04 01:28:48 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-01-12 00:15:02 +00:00
|
|
|
text: dive.depth
|
2016-02-07 20:41:24 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2015-12-04 01:28:48 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("Duration: ")
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-01 10:29:50 +00:00
|
|
|
text: dive.duration
|
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2015-12-04 01:28:48 +00:00
|
|
|
}
|
2015-12-07 17:10:55 +00:00
|
|
|
|
2016-01-12 00:15:02 +00:00
|
|
|
QMLProfile {
|
|
|
|
id: qmlProfile
|
2016-02-15 00:27:41 +00:00
|
|
|
visible: !dive.noDive
|
2016-01-12 00:15:02 +00:00
|
|
|
Layout.fillWidth: true
|
2016-01-13 02:05:06 +00:00
|
|
|
Layout.preferredHeight: Layout.minimumHeight
|
|
|
|
Layout.minimumHeight: width * 0.75
|
2016-01-12 00:15:02 +00:00
|
|
|
Layout.columnSpan: 4
|
2016-01-13 02:05:06 +00:00
|
|
|
clip: false
|
2016-01-12 00:15:02 +00:00
|
|
|
Rectangle {
|
|
|
|
color: "transparent"
|
|
|
|
opacity: 0.6
|
|
|
|
border.width: 1
|
2016-03-08 20:26:54 +00:00
|
|
|
border.color: Kirigami.Theme.textColor;
|
2016-01-12 00:15:02 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-15 00:27:41 +00:00
|
|
|
id: noProfile
|
|
|
|
visible: dive.noDive
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.columnSpan: 4
|
2016-03-08 20:26:54 +00:00
|
|
|
Layout.margins: Kirigami.Units.gridUnit
|
2016-02-15 00:27:41 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("No profile to show")
|
2016-02-15 00:27:41 +00:00
|
|
|
}
|
2016-02-07 20:41:24 +00:00
|
|
|
}
|
|
|
|
GridLayout {
|
|
|
|
id: bottomLayout
|
|
|
|
anchors {
|
2016-04-02 03:29:06 +00:00
|
|
|
top: mainLayout.bottom
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
margins: Math.round(Kirigami.Units.gridUnit / 2)
|
2016-02-07 20:41:24 +00:00
|
|
|
}
|
|
|
|
columns: 4
|
2016-03-08 20:26:54 +00:00
|
|
|
rowSpacing: Kirigami.Units.smallSpacing * 2
|
|
|
|
columnSpacing: Kirigami.Units.smallSpacing
|
2015-12-07 17:10:55 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Heading {
|
2016-01-12 00:15:02 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
level: 3
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("Dive Details")
|
2016-01-12 00:15:02 +00:00
|
|
|
Layout.columnSpan: 4
|
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("Suit:")
|
2016-02-08 20:41:29 +00:00
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col1Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
id: txtSuit
|
|
|
|
text: dive.suit
|
2016-01-12 00:15:02 +00:00
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2016-05-02 14:48:03 +00:00
|
|
|
Layout.fillWidth: true
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("Air Temp:")
|
2016-02-08 20:41:29 +00:00
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col3Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
id: txtAirTemp
|
|
|
|
text: dive.airTemp
|
2016-01-12 00:15:02 +00:00
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col4Width
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("Cylinder:")
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col1Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
id: txtCylinder
|
|
|
|
text: dive.getCylinder
|
2016-01-12 00:15:02 +00:00
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2016-05-02 14:48:03 +00:00
|
|
|
Layout.fillWidth: true
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("Water Temp:")
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col3Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
id: txtWaterTemp
|
|
|
|
text: dive.waterTemp
|
2016-01-12 00:15:02 +00:00
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col4Width
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-07 17:10:55 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2017-02-27 11:14:22 +00:00
|
|
|
text: qsTr("Divemaster:")
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col1Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
id: txtDiveMaster
|
|
|
|
text: dive.divemaster
|
2016-01-27 15:05:31 +00:00
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2016-05-02 14:48:03 +00:00
|
|
|
Layout.fillWidth: true
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("Weight:")
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col3Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
id: txtWeight
|
|
|
|
text: dive.sumWeight
|
2016-01-12 00:15:02 +00:00
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col4Width
|
2016-01-25 17:44:50 +00:00
|
|
|
}
|
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("Buddy:")
|
2016-01-25 17:44:50 +00:00
|
|
|
opacity: 0.6
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col1Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-25 17:44:50 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-01-25 17:44:50 +00:00
|
|
|
id: txtBuddy
|
|
|
|
text: dive.buddy
|
2016-01-27 15:05:31 +00:00
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2016-05-02 14:48:03 +00:00
|
|
|
Layout.fillWidth: true
|
2016-03-30 01:17:58 +00:00
|
|
|
}
|
|
|
|
|
2016-04-01 02:57:12 +00:00
|
|
|
Kirigami.Label {
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("SAC:")
|
2016-03-30 01:17:58 +00:00
|
|
|
opacity: 0.6
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col3Width
|
2016-03-30 01:17:58 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
}
|
2016-04-01 02:57:12 +00:00
|
|
|
Kirigami.Label {
|
2016-03-30 01:17:58 +00:00
|
|
|
id: txtSAC
|
|
|
|
text: dive.sac
|
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2016-05-03 21:30:55 +00:00
|
|
|
width: detailsView.col4Width
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Heading {
|
2016-01-12 00:15:02 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
level: 3
|
2016-05-03 19:24:00 +00:00
|
|
|
text: qsTr("Notes")
|
2016-02-08 20:41:29 +00:00
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2016-01-12 00:15:02 +00:00
|
|
|
Layout.columnSpan: 4
|
|
|
|
}
|
2015-12-07 17:10:55 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-01-12 00:15:02 +00:00
|
|
|
id: txtNotes
|
|
|
|
text: dive.notes
|
|
|
|
focus: true
|
|
|
|
Layout.columnSpan: 4
|
|
|
|
Layout.fillWidth: true
|
|
|
|
//selectByMouse: true
|
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
Layout.columnSpan: 4
|
|
|
|
Layout.fillWidth: true
|
2016-03-08 20:26:54 +00:00
|
|
|
Layout.minimumHeight: Kirigami.Units.gridUnit * 3
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
|
|
|
Component.onCompleted: {
|
2016-03-08 20:26:54 +00:00
|
|
|
qmlProfile.setMargin(Kirigami.Units.smallSpacing)
|
2016-01-12 00:15:02 +00:00
|
|
|
qmlProfile.diveId = model.dive.id;
|
|
|
|
qmlProfile.update();
|
|
|
|
}
|
2015-12-29 17:50:47 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
}
|