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
|
|
|
|
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
|
|
|
|
2016-01-12 00:15:02 +00:00
|
|
|
Item {
|
2015-12-04 01:28:48 +00:00
|
|
|
id: detailsView
|
2015-12-07 17:10:55 +00:00
|
|
|
property int labelWidth: MobileComponents.Units.gridUnit * 10
|
2016-02-08 21:25:29 +00:00
|
|
|
property real gridWidth: subsurfaceTheme.columnWidth - 2 * MobileComponents.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-02-07 20:41:24 +00:00
|
|
|
width: SubsurfaceTheme.columnWidth
|
|
|
|
height: mainLayout.implicitHeight + bottomLayout.implicitHeight + MobileComponents.Units.iconSizes.large
|
2016-01-12 00:15:02 +00:00
|
|
|
Rectangle {
|
|
|
|
z: 99
|
|
|
|
color: MobileComponents.Theme.textColor
|
|
|
|
opacity: 0.3
|
|
|
|
width: MobileComponents.Units.smallSpacing/4
|
|
|
|
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 {
|
|
|
|
top: parent.top
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
2016-02-28 16:04:52 +00:00
|
|
|
margins: Math.round(MobileComponents.Units.gridUnit / 2)
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
|
|
|
columns: 4
|
|
|
|
rowSpacing: MobileComponents.Units.smallSpacing * 2
|
|
|
|
columnSpacing: MobileComponents.Units.smallSpacing
|
|
|
|
|
|
|
|
MobileComponents.Heading {
|
|
|
|
id: detailsViewHeading
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: dive.location
|
|
|
|
font.underline: dive.gps !== ""
|
|
|
|
Layout.columnSpan: 4
|
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
2016-01-21 20:22:15 +00:00
|
|
|
if (dive.gps !== "")
|
|
|
|
manager.showMap(dive.gps)
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-26 21:22:50 +00:00
|
|
|
}
|
|
|
|
}
|
2016-01-12 00:15:02 +00:00
|
|
|
/*
|
|
|
|
Rectangle {
|
|
|
|
id: mapView
|
|
|
|
width: parent.width
|
|
|
|
height: parents.width * 0.7
|
|
|
|
WebView {
|
|
|
|
id: webView
|
|
|
|
anchors.fill: parent
|
|
|
|
url: "http://www.google.com"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
MobileComponents.Label {
|
|
|
|
id: dateLabel
|
|
|
|
text: "Date: "
|
|
|
|
opacity: 0.6
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
|
|
|
MobileComponents.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
|
|
|
|
}
|
|
|
|
MobileComponents.Label {
|
|
|
|
id: numberText
|
|
|
|
text: "#" + dive.number
|
|
|
|
color: MobileComponents.Theme.textColor
|
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2015-12-26 21:22:50 +00:00
|
|
|
}
|
2015-12-07 17:10:55 +00:00
|
|
|
|
2015-12-04 01:28:48 +00:00
|
|
|
MobileComponents.Label {
|
2016-01-12 00:15:02 +00:00
|
|
|
id: depthLabel
|
|
|
|
text: "Depth: "
|
|
|
|
opacity: 0.6
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2015-12-04 01:28:48 +00:00
|
|
|
}
|
2016-01-12 00:15:02 +00:00
|
|
|
MobileComponents.Label {
|
|
|
|
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
|
|
|
}
|
|
|
|
MobileComponents.Label {
|
2016-01-12 00:15:02 +00:00
|
|
|
text: "Duration: "
|
|
|
|
opacity: 0.6
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2016-02-01 10:29:50 +00:00
|
|
|
MobileComponents.Label {
|
|
|
|
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
|
|
|
|
devicePixelRatio: MobileComponents.Units.devicePixelRatio
|
2016-01-12 00:15:02 +00:00
|
|
|
Rectangle {
|
|
|
|
color: "transparent"
|
|
|
|
opacity: 0.6
|
|
|
|
border.width: 1
|
|
|
|
border.color: MobileComponents.Theme.textColor;
|
|
|
|
anchors.fill: parent
|
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
}
|
2016-02-15 00:27:41 +00:00
|
|
|
MobileComponents.Label {
|
|
|
|
id: noProfile
|
|
|
|
visible: dive.noDive
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.columnSpan: 4
|
|
|
|
Layout.margins: MobileComponents.Units.gridUnit
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2016-02-15 15:27:00 +00:00
|
|
|
text: "No profile to show"
|
2016-02-15 00:27:41 +00:00
|
|
|
}
|
2016-02-07 20:41:24 +00:00
|
|
|
}
|
|
|
|
GridLayout {
|
|
|
|
id: bottomLayout
|
|
|
|
anchors {
|
|
|
|
top: mainLayout.bottom
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
2016-02-28 16:04:52 +00:00
|
|
|
margins: Math.round(MobileComponents.Units.gridUnit / 2)
|
2016-02-07 20:41:24 +00:00
|
|
|
}
|
|
|
|
columns: 4
|
|
|
|
rowSpacing: MobileComponents.Units.smallSpacing * 2
|
|
|
|
columnSpacing: MobileComponents.Units.smallSpacing
|
2015-12-07 17:10:55 +00:00
|
|
|
|
2016-01-12 00:15:02 +00:00
|
|
|
MobileComponents.Heading {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
level: 3
|
|
|
|
text: "Dive Details"
|
|
|
|
Layout.columnSpan: 4
|
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-02-08 20:44:01 +00:00
|
|
|
// first row - here we set up the column widths - total is 90% of width
|
2016-01-12 00:15:02 +00:00
|
|
|
MobileComponents.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
text: "Suit:"
|
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col1Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
|
|
|
MobileComponents.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-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col2Width
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-01-12 00:15:02 +00:00
|
|
|
MobileComponents.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
text: "Air Temp:"
|
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col3Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
|
|
|
MobileComponents.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-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col4Width
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-01-12 00:15:02 +00:00
|
|
|
MobileComponents.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
text: "Cylinder:"
|
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col1Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
|
|
|
MobileComponents.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-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col2Width
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-01-12 00:15:02 +00:00
|
|
|
MobileComponents.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
text: "Water Temp:"
|
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col3Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
|
|
|
MobileComponents.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-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col4Width
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-07 17:10:55 +00:00
|
|
|
|
2016-01-12 00:15:02 +00:00
|
|
|
MobileComponents.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
text: "Dive Master:"
|
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col1Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
|
|
|
MobileComponents.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-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col2Width
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-01-12 00:15:02 +00:00
|
|
|
MobileComponents.Label {
|
2016-02-08 20:41:29 +00:00
|
|
|
text: "Weight:"
|
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2016-01-12 00:15:02 +00:00
|
|
|
opacity: 0.6
|
2016-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col3Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
|
|
|
MobileComponents.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-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col4Width
|
2016-01-25 17:44:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MobileComponents.Label {
|
|
|
|
text: "Buddy:"
|
2016-02-08 20:41:29 +00:00
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2016-01-25 17:44:50 +00:00
|
|
|
opacity: 0.6
|
2016-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col1Width
|
2016-02-08 20:41:29 +00:00
|
|
|
Layout.alignment: Qt.AlignRight
|
2016-01-25 17:44:50 +00:00
|
|
|
}
|
|
|
|
MobileComponents.Label {
|
|
|
|
id: txtBuddy
|
|
|
|
text: dive.buddy
|
|
|
|
Layout.columnSpan: 3
|
2016-01-27 15:05:31 +00:00
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
2016-02-08 21:25:29 +00:00
|
|
|
Layout.maximumWidth: detailsView.col2Width + detailsView.col3Width + detailsView.col4Width
|
2016-01-12 00:15:02 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
|
2016-01-12 00:15:02 +00:00
|
|
|
MobileComponents.Heading {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
level: 3
|
|
|
|
text: "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-01-12 00:15:02 +00:00
|
|
|
MobileComponents.Label {
|
|
|
|
id: txtNotes
|
|
|
|
text: dive.notes
|
|
|
|
focus: true
|
|
|
|
Layout.columnSpan: 4
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
//selectByMouse: true
|
|
|
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
Layout.columnSpan: 4
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.minimumHeight: MobileComponents.Units.gridUnit * 3
|
|
|
|
}
|
|
|
|
Component.onCompleted: {
|
|
|
|
qmlProfile.setMargin(MobileComponents.Units.smallSpacing)
|
|
|
|
qmlProfile.diveId = model.dive.id;
|
|
|
|
qmlProfile.update();
|
|
|
|
}
|
2015-12-29 17:50:47 +00:00
|
|
|
}
|
2015-12-04 01:28:48 +00:00
|
|
|
}
|