| 
									
										
										
										
											2016-01-07 21:40:15 -08:00
										 |  |  | import QtQuick 2.3 | 
					
						
							|  |  |  | import QtQuick.Window 2.2 | 
					
						
							|  |  |  | import QtQuick.Dialogs 1.2 | 
					
						
							|  |  |  | import QtQuick.Layouts 1.1 | 
					
						
							|  |  |  | import QtQuick.Window 2.2 | 
					
						
							|  |  |  | import org.subsurfacedivelog.mobile 1.0 | 
					
						
							| 
									
										
										
										
											2017-03-31 16:15:14 +02:00
										 |  |  | import org.kde.kirigami 2.0 as Kirigami | 
					
						
							| 
									
										
										
										
											2016-01-07 21:40:15 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-08 21:26:54 +01:00
										 |  |  | Kirigami.ScrollablePage { | 
					
						
							| 
									
										
										
										
											2016-01-07 21:40:15 -08:00
										 |  |  | 	id: gpsListWindow | 
					
						
							| 
									
										
										
										
											2016-03-08 21:26:54 +01:00
										 |  |  | 	width: parent.width - Kirigami.Units.gridUnit | 
					
						
							|  |  |  | 	anchors.margins: Kirigami.Units.gridUnit / 2 | 
					
						
							| 
									
										
										
										
											2016-01-07 21:40:15 -08:00
										 |  |  | 	objectName: "gpsList" | 
					
						
							| 
									
										
										
										
											2016-05-03 21:24:00 +02:00
										 |  |  | 	title: qsTr("GPS Fixes") | 
					
						
							| 
									
										
										
										
											2016-01-07 21:40:15 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	Component { | 
					
						
							|  |  |  | 		id: gpsDelegate | 
					
						
							| 
									
										
										
										
											2016-03-31 21:57:12 -05:00
										 |  |  | 		Kirigami.SwipeListItem { | 
					
						
							| 
									
										
										
										
											2016-01-07 21:40:15 -08:00
										 |  |  | 			id: gpsFix | 
					
						
							|  |  |  | 			enabled: true | 
					
						
							|  |  |  | 			width: parent.width | 
					
						
							| 
									
										
										
										
											2017-04-15 13:32:16 -07:00
										 |  |  | 			GridLayout { | 
					
						
							|  |  |  | 				columns: 4 | 
					
						
							|  |  |  | 				id: timeAndName | 
					
						
							|  |  |  | 				width: parent.width | 
					
						
							|  |  |  | 				Kirigami.Label { | 
					
						
							|  |  |  | 					text: qsTr('Date: ') | 
					
						
							|  |  |  | 					opacity: 0.6 | 
					
						
							|  |  |  | 					font.pointSize: subsurfaceTheme.smallPointSize | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				Kirigami.Label { | 
					
						
							|  |  |  | 					text: date | 
					
						
							|  |  |  | 					Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth) | 
					
						
							|  |  |  | 					font.pointSize: subsurfaceTheme.smallPointSize | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				Kirigami.Label { | 
					
						
							|  |  |  | 					text: qsTr('Name: ') | 
					
						
							|  |  |  | 					opacity: 0.6 | 
					
						
							|  |  |  | 					font.pointSize: subsurfaceTheme.smallPointSize | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				Kirigami.Label { | 
					
						
							|  |  |  | 					text: name | 
					
						
							|  |  |  | 					Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth) | 
					
						
							|  |  |  | 					font.pointSize: subsurfaceTheme.smallPointSize | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				Kirigami.Label { | 
					
						
							|  |  |  | 					text: qsTr('Latitude: ') | 
					
						
							|  |  |  | 					opacity: 0.6 | 
					
						
							|  |  |  | 					font.pointSize: subsurfaceTheme.smallPointSize | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				Kirigami.Label { | 
					
						
							|  |  |  | 					text: latitude | 
					
						
							|  |  |  | 					font.pointSize: subsurfaceTheme.smallPointSize | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				Kirigami.Label { | 
					
						
							|  |  |  | 					text: qsTr('Longitude: ') | 
					
						
							|  |  |  | 					opacity: 0.6 | 
					
						
							|  |  |  | 					font.pointSize: subsurfaceTheme.smallPointSize | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				Kirigami.Label { | 
					
						
							|  |  |  | 					text: longitude | 
					
						
							|  |  |  | 					font.pointSize: subsurfaceTheme.smallPointSize | 
					
						
							| 
									
										
										
										
											2016-01-07 21:40:15 -08:00
										 |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							| 
									
										
										
										
											2016-01-08 21:48:53 -08:00
										 |  |  | 			actions: [ | 
					
						
							| 
									
										
										
										
											2016-03-08 21:26:54 +01:00
										 |  |  | 				Kirigami.Action { | 
					
						
							| 
									
										
										
										
											2016-01-08 23:16:19 -08:00
										 |  |  | 					iconName: "trash-empty" | 
					
						
							| 
									
										
										
										
											2016-01-08 21:48:53 -08:00
										 |  |  | 					onTriggered: { | 
					
						
							|  |  |  | 						print("delete this!") | 
					
						
							| 
									
										
										
										
											2016-01-08 23:18:41 -08:00
										 |  |  | 						manager.deleteGpsFix(when) | 
					
						
							| 
									
										
										
										
											2016-01-08 21:48:53 -08:00
										 |  |  | 					} | 
					
						
							| 
									
										
										
										
											2016-01-08 23:17:48 -08:00
										 |  |  | 				}, | 
					
						
							| 
									
										
										
										
											2016-03-08 21:26:54 +01:00
										 |  |  | 				Kirigami.Action { | 
					
						
							| 
									
										
										
										
											2016-01-08 23:17:48 -08:00
										 |  |  | 					iconName: "gps" | 
					
						
							|  |  |  | 					onTriggered: { | 
					
						
							| 
									
										
										
										
											2016-04-02 07:09:40 -05:00
										 |  |  | 						showMap(latitude + " " + longitude) | 
					
						
							| 
									
										
										
										
											2016-01-08 23:17:48 -08:00
										 |  |  | 					} | 
					
						
							| 
									
										
										
										
											2016-01-08 21:48:53 -08:00
										 |  |  | 				} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			] | 
					
						
							| 
									
										
										
										
											2016-01-07 21:40:15 -08:00
										 |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-08 21:26:54 +01:00
										 |  |  | 	ListView { | 
					
						
							|  |  |  | 		id: gpsListView | 
					
						
							| 
									
										
										
										
											2016-01-07 21:40:15 -08:00
										 |  |  | 		anchors.fill: parent | 
					
						
							| 
									
										
										
										
											2016-03-08 21:26:54 +01: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 | 
					
						
							|  |  |  | 		header: Kirigami.Heading { | 
					
						
							|  |  |  | 			x: Kirigami.Units.gridUnit / 2 | 
					
						
							|  |  |  | 			height: paintedHeight + Kirigami.Units.gridUnit / 2 | 
					
						
							|  |  |  | 			verticalAlignment: Text.AlignBottom | 
					
						
							| 
									
										
										
										
											2016-05-03 21:24:00 +02:00
										 |  |  | 			text: qsTr("List of stored GPS fixes") | 
					
						
							| 
									
										
										
										
											2016-01-07 21:40:15 -08:00
										 |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } |