| 
									
										
										
										
											2015-05-27 13:34:55 +03:00
										 |  |  | import QtQuick 2.3 | 
					
						
							|  |  |  | import QtQuick.Controls 1.2 | 
					
						
							| 
									
										
										
										
											2015-07-26 13:52:46 +02:00
										 |  |  | import QtQuick.Controls.Styles 1.2 | 
					
						
							| 
									
										
										
										
											2015-05-27 13:34:55 +03:00
										 |  |  | import QtQuick.Window 2.2 | 
					
						
							| 
									
										
										
										
											2015-06-04 11:27:38 +03:00
										 |  |  | import QtQuick.Dialogs 1.2 | 
					
						
							| 
									
										
										
										
											2015-07-10 11:05:13 +03:00
										 |  |  | import QtQuick.Layouts 1.1 | 
					
						
							| 
									
										
										
										
											2015-07-30 08:17:09 +02:00
										 |  |  | import QtQuick.Window 2.2 | 
					
						
							| 
									
										
										
										
											2015-06-04 13:36:36 +03:00
										 |  |  | import org.subsurfacedivelog.mobile 1.0 | 
					
						
							| 
									
										
										
										
											2015-10-09 01:57:10 +02:00
										 |  |  | import "qrc:/qml/theme" as Theme | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-27 13:34:55 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | ApplicationWindow { | 
					
						
							| 
									
										
										
										
											2015-07-12 10:42:23 -07:00
										 |  |  | 	title: qsTr("Subsurface mobile") | 
					
						
							|  |  |  | 	property bool fullscreen: true | 
					
						
							| 
									
										
										
										
											2015-07-12 17:39:13 -07:00
										 |  |  | 	property alias messageText: message.text | 
					
						
							| 
									
										
										
										
											2015-07-12 10:42:23 -07:00
										 |  |  | 	visible: true | 
					
						
							| 
									
										
										
										
											2015-06-04 11:27:38 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-10-09 01:57:10 +02:00
										 |  |  | 	Theme.Units { | 
					
						
							|  |  |  | 		id: units | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Theme.Theme { | 
					
						
							|  |  |  | 		id: theme | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-26 12:48:33 +02:00
										 |  |  | 	Menu { | 
					
						
							|  |  |  | 		id: prefsMenu | 
					
						
							|  |  |  | 		title: "Menu" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		MenuItem { | 
					
						
							|  |  |  | 			text: "Preferences" | 
					
						
							|  |  |  | 			onTriggered: { | 
					
						
							|  |  |  | 				stackView.push(prefsWindow) | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		MenuItem { | 
					
						
							|  |  |  | 			text: "Load Dives" | 
					
						
							|  |  |  | 			onTriggered: { | 
					
						
							|  |  |  | 				manager.loadDives(); | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		MenuItem { | 
					
						
							|  |  |  | 			text: "Download Dives" | 
					
						
							|  |  |  | 			onTriggered: { | 
					
						
							|  |  |  | 				stackView.push(downloadDivesWindow) | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2015-08-10 08:35:47 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		MenuItem { | 
					
						
							|  |  |  | 			text: "Add Dive" | 
					
						
							|  |  |  | 			onTriggered: { | 
					
						
							|  |  |  | 				manager.addDive(); | 
					
						
							|  |  |  | 				stackView.push(detailsWindow) | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-26 12:48:33 +02:00
										 |  |  | 		MenuItem { | 
					
						
							|  |  |  | 			text: "Save Changes" | 
					
						
							|  |  |  | 			onTriggered: { | 
					
						
							|  |  |  | 				manager.saveChanges(); | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2015-08-19 10:18:26 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		MenuItem { | 
					
						
							|  |  |  | 			text: "View Log" | 
					
						
							|  |  |  | 			onTriggered: { | 
					
						
							|  |  |  | 				stackView.push(logWindow) | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2015-07-26 12:48:33 +02:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 	StackView { | 
					
						
							|  |  |  | 		id: stackView | 
					
						
							| 
									
										
										
										
											2015-07-10 11:05:13 +03:00
										 |  |  | 		anchors.fill: parent | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07: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 11:05:13 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 			ColumnLayout { | 
					
						
							|  |  |  | 				id: awLayout | 
					
						
							|  |  |  | 				anchors.fill: parent | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 				spacing: units.gridUnit / 2 | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 				Rectangle { | 
					
						
							|  |  |  | 					id: topPart | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 					color: theme.accentColor | 
					
						
							|  |  |  | 					Layout.minimumHeight: units.gridUnit * 2 + units.spacing * 2 | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 					Layout.fillWidth: true | 
					
						
							| 
									
										
										
										
											2015-07-30 10:17:22 +02:00
										 |  |  | 					Layout.margins: 0 | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 					RowLayout { | 
					
						
							|  |  |  | 						anchors.bottom: topPart.bottom | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 						anchors.bottomMargin: units.spacing | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 						anchors.left: topPart.left | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 						anchors.leftMargin: units.spacing | 
					
						
							| 
									
										
										
										
											2015-07-26 12:48:33 +02:00
										 |  |  | 						anchors.right: topPart.right | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 						anchors.rightMargin: units.spacing | 
					
						
							| 
									
										
										
										
											2015-10-09 05:05:23 +02:00
										 |  |  | 						Image { | 
					
						
							|  |  |  | 							source: "qrc:/qml/subsurface-mobile-icon.png" | 
					
						
							|  |  |  | 							Layout.maximumWidth: units.gridUnit * 2 | 
					
						
							|  |  |  | 							Layout.preferredWidth: units.gridUnit * 2 | 
					
						
							|  |  |  | 							Layout.preferredHeight: units.gridUnit * 2 | 
					
						
							|  |  |  | 						} | 
					
						
							| 
									
										
										
										
											2015-07-26 13:50:49 +02:00
										 |  |  | 						Text { | 
					
						
							|  |  |  | 							text: qsTr("Subsurface mobile") | 
					
						
							|  |  |  | 							font.pointSize: 18 | 
					
						
							| 
									
										
										
										
											2015-10-09 05:05:23 +02:00
										 |  |  | 							Layout.fillWidth: false | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 							color: theme.accentTextColor | 
					
						
							| 
									
										
										
										
											2015-07-26 13:50:49 +02:00
										 |  |  | 						} | 
					
						
							| 
									
										
										
										
											2015-10-09 05:05:23 +02:00
										 |  |  | 						Item { | 
					
						
							|  |  |  | 							Layout.fillWidth: true | 
					
						
							|  |  |  | 						} | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 						Button { | 
					
						
							|  |  |  | 							id: prefsButton | 
					
						
							| 
									
										
										
										
											2015-07-26 12:48:33 +02:00
										 |  |  | 							text: "\u22ee" | 
					
						
							|  |  |  | 							anchors.right: parent.right | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 							Layout.preferredWidth: units.gridUnit * 2 | 
					
						
							|  |  |  | 							Layout.preferredHeight: units.gridUnit * 2 | 
					
						
							| 
									
										
										
										
											2015-07-26 13:52:46 +02:00
										 |  |  | 							style: ButtonStyle { | 
					
						
							|  |  |  | 								background: Rectangle { | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 									implicitWidth: units.gridUnit * 2 | 
					
						
							|  |  |  | 									color: theme.accentColor | 
					
						
							| 
									
										
										
										
											2015-07-26 13:52:46 +02:00
										 |  |  | 								} | 
					
						
							|  |  |  | 								label: Text { | 
					
						
							|  |  |  | 									id: txt | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 									color: theme.accentTextColor | 
					
						
							| 
									
										
										
										
											2015-07-26 13:52:46 +02:00
										 |  |  | 									font.pointSize: 18 | 
					
						
							|  |  |  | 									font.bold: true | 
					
						
							|  |  |  | 									text: control.text | 
					
						
							|  |  |  | 									horizontalAlignment: Text.AlignHCenter | 
					
						
							|  |  |  | 								} | 
					
						
							|  |  |  | 							} | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 							onClicked: { | 
					
						
							| 
									
										
										
										
											2015-07-26 12:48:33 +02:00
										 |  |  | 								prefsMenu.popup() | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 							} | 
					
						
							|  |  |  | 						} | 
					
						
							| 
									
										
										
										
											2015-07-17 18:28:01 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-10 11:05:13 +03:00
										 |  |  | 					} | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-10 11:05:13 +03:00
										 |  |  | 				} | 
					
						
							| 
									
										
										
										
											2015-06-10 21:39:43 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 				Rectangle { | 
					
						
							|  |  |  | 					id: detailsPage | 
					
						
							|  |  |  | 					Layout.fillHeight: true | 
					
						
							|  |  |  | 					Layout.fillWidth: true | 
					
						
							| 
									
										
										
										
											2015-06-10 21:39:43 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 					DiveList { | 
					
						
							|  |  |  | 						anchors.fill: detailsPage | 
					
						
							|  |  |  | 						id: diveDetails | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 						color: theme.backgroundColor | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 					} | 
					
						
							|  |  |  | 				} | 
					
						
							| 
									
										
										
										
											2015-06-10 21:39:43 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-12 17:39:13 -07:00
										 |  |  | 				Rectangle { | 
					
						
							|  |  |  | 					id: messageArea | 
					
						
							|  |  |  | 					height: childrenRect.height | 
					
						
							|  |  |  | 					Layout.fillWidth: true | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 					Text { | 
					
						
							|  |  |  | 						id: message | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 						color: theme.textColor | 
					
						
							| 
									
										
										
										
											2015-07-12 17:39:13 -07:00
										 |  |  | 						text: "" | 
					
						
							| 
									
										
										
										
											2015-10-09 02:45:22 +02:00
										 |  |  | 						styleColor: theme.textColor | 
					
						
							| 
									
										
										
										
											2015-07-12 17:39:13 -07:00
										 |  |  | 						font.pointSize: 10 | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-10 11:05:13 +03:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2015-06-09 22:20:44 +03:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2015-07-10 11:40:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 	QMLManager { | 
					
						
							|  |  |  | 		id: manager | 
					
						
							| 
									
										
										
										
											2015-06-09 22:20:44 +03:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2015-07-12 10:56:48 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	Preferences { | 
					
						
							|  |  |  | 		id: prefsWindow | 
					
						
							|  |  |  | 		visible: false | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-21 15:00:29 +03:00
										 |  |  | 	DiveDetails { | 
					
						
							|  |  |  | 		id: detailsWindow | 
					
						
							|  |  |  | 		visible: false | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2015-07-23 14:46:02 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	DownloadFromDiveComputer { | 
					
						
							|  |  |  | 		id: downloadDivesWindow | 
					
						
							|  |  |  | 		visible: false | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2015-08-19 10:18:26 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	Log { | 
					
						
							|  |  |  | 		id: logWindow | 
					
						
							|  |  |  | 		visible: false | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2015-10-09 01:57:10 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	Component.onCompleted: { | 
					
						
							| 
									
										
										
										
											2015-10-09 02:49:21 +02:00
										 |  |  | 		print("units.gridUnit is: " + units.gridUnit); | 
					
						
							| 
									
										
										
										
											2015-10-09 01:57:10 +02:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2015-05-27 13:34:55 +03:00
										 |  |  | } |