2017-04-27 18:30:36 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2017-07-15 16:20:52 +00:00
|
|
|
import QtQuick 2.6
|
2017-10-29 12:44:22 +00:00
|
|
|
import QtQuick.Controls 2.2 as Controls
|
2016-01-08 05:40:15 +00:00
|
|
|
import QtQuick.Window 2.2
|
|
|
|
import QtQuick.Dialogs 1.2
|
2017-10-30 10:26:47 +00:00
|
|
|
import QtQuick.Layouts 1.2
|
2016-01-08 05:40:15 +00:00
|
|
|
import QtQuick.Window 2.2
|
|
|
|
import org.subsurfacedivelog.mobile 1.0
|
2018-09-27 20:09:26 +00:00
|
|
|
import org.kde.kirigami 2.4 as Kirigami
|
2016-01-08 05:40:15 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.ScrollablePage {
|
2016-01-08 05:40:15 +00:00
|
|
|
id: gpsListWindow
|
|
|
|
objectName: "gpsList"
|
2016-05-03 19:24:00 +00:00
|
|
|
title: qsTr("GPS Fixes")
|
2018-02-16 10:17:20 +00:00
|
|
|
background: Rectangle { color: subsurfaceTheme.backgroundColor }
|
2016-01-08 05:40:15 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: gpsDelegate
|
2016-04-01 02:57:12 +00:00
|
|
|
Kirigami.SwipeListItem {
|
2018-04-16 01:27:02 +00:00
|
|
|
id: listItem
|
2016-01-08 05:40:15 +00:00
|
|
|
enabled: true
|
|
|
|
width: parent.width
|
2018-10-04 07:57:31 +00:00
|
|
|
backgroundColor: subsurfaceTheme.backgroundColor
|
|
|
|
activeBackgroundColor: subsurfaceTheme.primaryColor
|
2017-04-15 20:32:16 +00:00
|
|
|
GridLayout {
|
|
|
|
columns: 4
|
|
|
|
id: timeAndName
|
|
|
|
width: parent.width
|
2017-10-12 12:25:22 +00:00
|
|
|
Controls.Label {
|
2017-04-15 20:32:16 +00:00
|
|
|
text: qsTr('Date: ')
|
2017-07-15 16:20:52 +00:00
|
|
|
color: subsurfaceTheme.textColor
|
2017-04-15 20:32:16 +00:00
|
|
|
opacity: 0.6
|
|
|
|
font.pointSize: subsurfaceTheme.smallPointSize
|
|
|
|
}
|
2017-10-12 12:25:22 +00:00
|
|
|
Controls.Label {
|
2017-04-15 20:32:16 +00:00
|
|
|
text: date
|
2017-07-15 16:20:52 +00:00
|
|
|
color: subsurfaceTheme.textColor
|
2017-04-15 20:32:16 +00:00
|
|
|
Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth)
|
|
|
|
font.pointSize: subsurfaceTheme.smallPointSize
|
|
|
|
}
|
2017-10-12 12:25:22 +00:00
|
|
|
Controls.Label {
|
2017-04-15 20:32:16 +00:00
|
|
|
text: qsTr('Name: ')
|
2017-07-15 16:20:52 +00:00
|
|
|
color: subsurfaceTheme.textColor
|
2017-04-15 20:32:16 +00:00
|
|
|
opacity: 0.6
|
|
|
|
font.pointSize: subsurfaceTheme.smallPointSize
|
|
|
|
}
|
2017-10-12 12:25:22 +00:00
|
|
|
Controls.Label {
|
2017-04-15 20:32:16 +00:00
|
|
|
text: name
|
2017-07-15 16:20:52 +00:00
|
|
|
color: subsurfaceTheme.textColor
|
2017-04-15 20:32:16 +00:00
|
|
|
Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth)
|
|
|
|
font.pointSize: subsurfaceTheme.smallPointSize
|
|
|
|
}
|
2017-10-12 12:25:22 +00:00
|
|
|
Controls.Label {
|
2017-04-15 20:32:16 +00:00
|
|
|
text: qsTr('Latitude: ')
|
2017-07-15 16:20:52 +00:00
|
|
|
color: subsurfaceTheme.textColor
|
2017-04-15 20:32:16 +00:00
|
|
|
opacity: 0.6
|
|
|
|
font.pointSize: subsurfaceTheme.smallPointSize
|
|
|
|
}
|
2017-10-12 12:25:22 +00:00
|
|
|
Controls.Label {
|
2017-04-15 20:32:16 +00:00
|
|
|
text: latitude
|
2017-07-15 16:20:52 +00:00
|
|
|
color: subsurfaceTheme.textColor
|
2017-04-15 20:32:16 +00:00
|
|
|
font.pointSize: subsurfaceTheme.smallPointSize
|
|
|
|
}
|
2017-10-12 12:25:22 +00:00
|
|
|
Controls.Label {
|
2017-04-15 20:32:16 +00:00
|
|
|
text: qsTr('Longitude: ')
|
2017-07-15 16:20:52 +00:00
|
|
|
color: subsurfaceTheme.textColor
|
2017-04-15 20:32:16 +00:00
|
|
|
opacity: 0.6
|
|
|
|
font.pointSize: subsurfaceTheme.smallPointSize
|
|
|
|
}
|
2017-10-12 12:25:22 +00:00
|
|
|
Controls.Label {
|
2017-04-15 20:32:16 +00:00
|
|
|
text: longitude
|
2017-07-15 16:20:52 +00:00
|
|
|
color: subsurfaceTheme.textColor
|
2017-04-15 20:32:16 +00:00
|
|
|
font.pointSize: subsurfaceTheme.smallPointSize
|
2016-01-08 05:40:15 +00:00
|
|
|
}
|
|
|
|
}
|
2016-01-09 05:48:53 +00:00
|
|
|
actions: [
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Action {
|
2018-01-02 16:02:19 +00:00
|
|
|
icon {
|
2018-06-17 13:30:02 +00:00
|
|
|
name: ":/icons/trash-empty.svg"
|
2018-01-02 16:02:19 +00:00
|
|
|
}
|
2016-01-09 05:48:53 +00:00
|
|
|
onTriggered: {
|
|
|
|
print("delete this!")
|
2016-01-09 07:18:41 +00:00
|
|
|
manager.deleteGpsFix(when)
|
2016-01-09 05:48:53 +00:00
|
|
|
}
|
2016-01-09 07:17:48 +00:00
|
|
|
},
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Action {
|
2018-01-02 16:02:19 +00:00
|
|
|
icon {
|
2018-06-17 13:30:02 +00:00
|
|
|
name: ":/icons/gps.svg"
|
2018-01-02 16:02:19 +00:00
|
|
|
}
|
2016-01-09 07:17:48 +00:00
|
|
|
onTriggered: {
|
2018-03-08 20:22:35 +00:00
|
|
|
showMap()
|
|
|
|
mapPage.centerOnLocation(latitude, longitude)
|
2016-01-09 07:17:48 +00:00
|
|
|
}
|
2016-01-09 05:48:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
]
|
2016-01-08 05:40:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
ListView {
|
|
|
|
id: gpsListView
|
2016-01-08 05:40:15 +00:00
|
|
|
anchors.fill: parent
|
2016-03-08 20:26:54 +00:00
|
|
|
model: gpsModel
|
|
|
|
currentIndex: -1
|
|
|
|
delegate: gpsDelegate
|
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
maximumFlickVelocity: parent.height * 5
|
|
|
|
cacheBuffer: Math.max(5000, parent.height * 5)
|
|
|
|
focus: true
|
|
|
|
clip: true
|
2016-01-08 05:40:15 +00:00
|
|
|
}
|
|
|
|
}
|