2017-04-27 20:30:36 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								// SPDX-License-Identifier: GPL-2.0
  
						 
					
						
							
								
									
										
										
										
											2017-10-29 13:44:22 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  QtQuick  2.6  
						 
					
						
							
								
									
										
										
										
											2017-03-31 16:15:14 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  QtQuick . Controls  2.0  
						 
					
						
							
								
									
										
										
										
											2017-07-15 18:11:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  QtQuick . Controls . Material  2.1  
						 
					
						
							
								
									
										
										
										
											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  
						 
					
						
							
								
									
										
										
										
											2017-10-30 11:26:47 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  QtQuick . Layouts  1.2  
						 
					
						
							
								
									
										
										
										
											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  
						 
					
						
							
								
									
										
										
										
											2018-09-27 22:09:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  org . kde . kirigami  2.4  as  Kirigami  
						 
					
						
							
								
									
										
										
										
											2018-06-17 06:05:20 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  QtGraphicalEffects  1.0  
						 
					
						
							
								
									
										
										
										
											2020-02-21 09:54:43 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  QtQuick . Templates  2.0  as  QtQuickTemplates  
						 
					
						
							
								
									
										
										
										
											2015-10-09 01:57:10 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-08 21:26:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Kirigami . ApplicationWindow  {  
						 
					
						
							
								
									
										
										
										
											2015-12-03 23:27:27 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									id: rootItem 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-01 09:34:32 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									title:  qsTr ( "Subsurface-mobile" ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-28 06:50:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									reachableModeEnabled:  false  // while it's a good idea, it seems to confuse more than help
 
							 
						 
					
						
							
								
									
										
											 
										
											
												Mobile QML UI: wideScreen property change
See also 15cdcdbc6. There, we introduced the wideScreen (set to true)
to evade a (cosmetic) bug in (most likely) Kirigami. The top dive
was partially obscured on the start of the app. And by setting the
wideScreen to true, the application header became of a fixed height.
Numerous changes further in Kirigami, we can now set this property to
false. This results in a correctly displayed divelist at the start of
the app, and *also* an application header that correcly hides itself
when scrolling up, and displays itself again when scrolling down. So,
a behavior that is common to, for example, mobile brouwsers.
This all said. I still believe this is a workround for strange behavior.
In fact, we should not need to set this wideScreen property at all,
and Kirigami should behave correct in all cases (true, false, unset
at our end). It behaves correctly when set to true or false, but
still displays a partially hidden top item in the dive list when
unset.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
											 
										 
										
											2018-02-21 09:04:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									wideScreen:  false  // workaround for probably Kirigami bug. See commits.
 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 15:57:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-09 17:53:26 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// ensure we get all information on screen rotation
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Screen.orientationUpdateMask:  Qt . LandscapeOrientation  |  Qt . PortraitOrientation  |  Qt . InvertedLandscapeOrientation  |  Qt . InvertedPortraitOrientation 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 15:57:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// the documentation claims that the ApplicationWindow should pick up the font set on
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// the C++ side. But as a matter of fact, it doesn't, unless you add this line:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									font:  Qt . application . font 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-19 14:16:56 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									background:  Rectangle  {  color:  subsurfaceTheme . backgroundColor  } 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 15:57:02 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 15:02:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// we want to use our own colors for Kirigami, so let's define our colorset
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Kirigami.Theme.inherit:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Kirigami.Theme.colorSet:  Kirigami . Theme . Button 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Kirigami.Theme.backgroundColor:  subsurfaceTheme . backgroundColor 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Kirigami.Theme.textColor:  subsurfaceTheme . textColor 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// next setup the tab bar on top
 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-05 14:28:12 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									pageStack.globalToolBar.style:  Kirigami . ApplicationHeaderStyle . Breadcrumb 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									pageStack.globalToolBar.showNavigationButtons:  ( Kirigami . ApplicationHeaderStyle . ShowBackButton  |  Kirigami . ApplicationHeaderStyle . ShowForwardButton ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 14:17:54 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									pageStack.globalToolBar.minimumHeight:  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									pageStack.globalToolBar.preferredHeight:  Math . round ( Kirigami . Units . gridUnit  *  ( Qt . platform . os  ==  "ios"  ?  2  :  1.5 ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									pageStack.globalToolBar.maximumHeight:  Kirigami . Units . gridUnit  *  2 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-05 14:28:12 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-17 23:22:37 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									property  alias  notificationText:  manager . notificationText 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-06 06:24:51 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									property  alias  pluggedInDeviceName:  manager . pluggedInDeviceName 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-20 20:02:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									property  alias  defaultCylinderIndex:  settingsWindow . defaultCylinderIndex 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-04 16:46:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									property  bool  filterToggle:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									property  string  filterPattern:  "" 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-05 20:23:46 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									property  int  colWidth:  undefined 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-04 16:46:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-10 15:50:08 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// signal that the profile (and possibly other code) listens to so they
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// can redraw if settings are changed
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									signal  settingsChanged ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-17 23:22:37 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									onNotificationTextChanged:  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-01 07:27:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										// once the app is fully initialized and the UI is running, we use passive
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										// notifications to show the notification text, but during initialization
 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-17 13:04:36 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										// we instead dump the information into the textBlock below
 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-01 07:27:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( initialized )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( notificationText  !==  "" )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-17 13:34:21 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												var  actionEnd  =  notificationText . indexOf ( "]" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												if  ( notificationText . startsWith ( "[" )  &&  actionEnd  !==  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													// we have a notification text that starts with our special syntax to indication
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													// an action that the user can take (the actual action is always opening the context drawer
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													// so the action text should always be something that can then be found in the context drawer)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													showPassiveNotification ( notificationText . substring ( actionEnd  +  1 ) ,  5000 ,  notificationText . substring ( 1 , actionEnd ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
																function ( )  {  contextDrawer . open ( )  } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													showPassiveNotification ( notificationText ,  5000 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-01 07:27:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-02 17:14:47 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-13 10:49:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											textBlock . text  =  textBlock . text  +  "\n"  +  notificationText 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-02 17:14:47 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-19 12:42:58 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									visible:  false 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-27 18:36:02 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-20 11:54:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BusyIndicator  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: busy 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										running:  false 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-23 22:44:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										height:  6  *  Kirigami . Units . gridUnit 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										width:  6  *  Kirigami . Units . gridUnit 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										anchors.centerIn:  parent 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-20 11:54:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-11-11 18:50:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									function  showBusy ( msg )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-11 22:03:40 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( msg  !==  undefined  &&  msg  !==  "" ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-03 06:37:35 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											showPassiveNotification ( msg ,  15000 )  // show for 15 seconds
 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-20 11:54:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										busy . running  =  true 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-24 18:51:46 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-20 11:54:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									function  hideBusy ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										busy . running  =  false 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-21 13:44:53 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										// hiding notifications is no longer supported???
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										// hidePassiveNotification()
 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-24 18:51:46 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 21:47:09 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									function  returnTopPage ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-12 14:57:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										for  ( var  i = pageStack . depth ;  i > 1 ;  i -- )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pageStack . pop ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 21:47:09 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-04 15:47:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( pageStack . currentItem  !==  diveList )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											showDiveList ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 21:47:09 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . endEditMode ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-30 20:39:25 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									function  scrollToTop ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										diveList . scrollToTop ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:43:22 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									function  showPage ( page )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-04 15:47:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( page  ===  statistics )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											manager . appendTextToLog ( "switching to statistics page, clearing out stack" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pageStack . clear ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( pageStack . currentItem  ===  statistics )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											manager . appendTextToLog ( "switching away from statistics page, clearing out stack" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pageStack . clear ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:29:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( page  !==  mapPage ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											hackToOpenMap  =  0  // we really want a different page
 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-06 14:15:34 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( globalDrawer . drawerOpen ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											globalDrawer . close ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:43:22 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										var  i = pageIndex ( page ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-22 16:21:15 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( i  ===  - 1 ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:43:22 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											pageStack . push ( page ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-22 16:21:15 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pageStack . currentIndex  =  i 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:43:22 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										manager . appendTextToLog ( "switched to page "  +  page . title ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									function  showMap ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										showPage ( mapPage ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-29 19:19:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-22 16:21:15 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-29 19:19:31 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									function  showDiveList ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:43:22 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										showPage ( diveList ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-02 07:09:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-07 22:33:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									function  pageIndex ( pageToFind )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:43:22 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( pageStack . contentItem  !==  null )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											for  ( var  i  =  0 ;  i  <  pageStack . contentItem . contentChildren . length ;  i ++ )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												if  ( pageStack . contentItem . contentChildren [ i ]  ===  pageToFind ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													return  i 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-07 22:33:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  - 1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-01 22:29:39 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									function  startAddDive ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . state  =  "add" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . dive_id  =  manager . addDive ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . number  =  manager . getNumber ( detailsWindow . dive_id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . date  =  manager . getDate ( detailsWindow . dive_id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . airtemp  =  "" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . watertemp  =  "" 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 10:26:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . buddyModel  =  manager . buddyList 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-20 18:48:36 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . buddyIndex  =  - 1 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-14 17:09:09 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . buddyText  =  "" 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-01 22:29:39 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . depth  =  "" 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-12 14:03:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . diveguideModel  =  manager . diveguideList 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . diveguideIndex  =  - 1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . diveguideText  =  "" 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-01 22:29:39 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . notes  =  "" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . location  =  "" 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-15 05:17:39 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . gps  =  "" 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-01 22:29:39 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . duration  =  "" 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 09:52:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . suitModel  =  manager . suitList 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-20 18:48:36 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . suitIndex  =  - 1 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-14 17:09:09 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . suitText  =  "" 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-01 14:35:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . cylinderModel0  =  manager . cylinderListInit 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . cylinderModel1  =  manager . cylinderListInit 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . cylinderModel2  =  manager . cylinderListInit 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . cylinderModel3  =  manager . cylinderListInit 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . cylinderModel4  =  manager . cylinderListInit 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-16 11:21:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . cylinderIndex0  =  PrefEquipment . default_cylinder  ==  ""  ?  - 1  :  detailsWindow . cylinderModel0 . indexOf ( PrefEquipment . default_cylinder ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-28 15:43:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . usedCyl  =  [ "" , ] 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-01 22:29:39 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . weight  =  "" 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-28 15:43:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										detailsWindow . usedGas  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . startpressure  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										detailsWindow . endpressure  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:29:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										showPage ( detailsWindow ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-01 22:29:39 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-09 18:22:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									contextDrawer:  Kirigami . ContextDrawer  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-21 09:54:43 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										id: contextDrawer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										closePolicy:  QtQuickTemplates . Popup . CloseOnPressOutside 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-09 18:22:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-08 21:26:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									globalDrawer:  Kirigami . GlobalDrawer  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 10:28:14 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										id: globalDrawer 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-05 20:27:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										height:  rootItem . height 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 13:31:44 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										rightPadding:  0 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-05 17:08:48 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										enabled:  ( Backend . cloud_verification_status  ===  Enums . CS_NOCLOUD  || 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-06 14:58:21 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												  Backend . cloud_verification_status  ===  Enums . CS_VERIFIED ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-06-17 06:05:20 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										topContent:  Image  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											source:  "qrc:/qml/icons/dive.jpg" 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-11 09:33:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											// it's a 4x3 image, but clip if it takes too much space (making sure the text fits)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											property  int  myHeight:  Math . min ( Math . max ( rootItem . height  *  0.3 ,  textblock . height  +  Kirigami . Units . largeSpacing ) ,  parent . width  *  0.75 ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-06-17 06:05:20 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Layout.fillWidth:  true 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-11 09:33:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Layout.maximumHeight:  myHeight 
							 
						 
					
						
							
								
									
										
										
										
											2018-06-17 06:05:20 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											sourceSize.width:  parent . width 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-11 09:33:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											fillMode:  Image . PreserveAspectCrop 
							 
						 
					
						
							
								
									
										
										
										
											2018-06-17 06:05:20 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											LinearGradient  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												anchors  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													left:  parent . left 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													right:  parent . right 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													top:  parent . top 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-11 09:33:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												height:  Math . min ( textblock . height  *  2 ,  parent . myHeight ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-06-17 06:05:20 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												start:  Qt . point ( 0 ,  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												end:  Qt . point ( 0 ,  height ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												gradient:  Gradient  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													GradientStop  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														position:  0.0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														color:  Qt . rgba ( 0 ,  0 ,  0 ,  0.8 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													GradientStop  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														position:  1.0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														color:  "transparent" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											ColumnLayout  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												id: textblock 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												anchors  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													left:  parent . left 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													top:  parent . top 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												RowLayout  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													width:  Math . min ( implicitWidth ,  parent . width ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Layout.margins:  Kirigami . Units . smallSpacing 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Image  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														source:  "qrc:/qml/subsurface-mobile-icon.png" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														fillMode:  Image . PreserveAspectCrop 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														sourceSize.width:  Kirigami . Units . iconSizes . large 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														width:  Kirigami . Units . iconSizes . large 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														Layout.margins:  Kirigami . Units . smallSpacing 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Kirigami . Heading  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														Layout.fillWidth:  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														visible:  text . length  >  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														level:  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														color:  "white" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														text:  "Subsurface" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														wrapMode:  Text . NoWrap 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														elide:  Text . ElideRight 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														font.weight:  Font . Normal 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														Layout.margins:  Kirigami . Units . smallSpacing 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2018-06-16 19:53:04 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												RowLayout  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Layout.margins:  Kirigami . Units . smallSpacing 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Kirigami . Heading  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														Layout.fillWidth:  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														visible:  text . length  >  0 
							 
						 
					
						
							
								
									
										
										
										
											2018-06-20 11:50:14 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														level:  3 
							 
						 
					
						
							
								
									
										
										
										
											2018-06-16 19:53:04 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														color:  "white" 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-20 16:35:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														text:  PrefCloudStorage . cloud_storage_email 
							 
						 
					
						
							
								
									
										
										
										
											2018-06-16 19:53:04 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														wrapMode:  Text . NoWrap 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														elide:  Text . ElideRight 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														font.weight:  Font . Normal 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-23 16:21:17 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												RowLayout  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Layout.leftMargin:  Kirigami . Units . smallSpacing 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Layout.topMargin:  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Kirigami . Heading  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														Layout.fillWidth:  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														Layout.topMargin:  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														visible:  text . length  >  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														level:  5 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														color:  "white" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														text:  manager . passwordState 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														wrapMode:  Text . NoWrap 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														elide:  Text . ElideRight 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														font.weight:  Font . Normal 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-13 13:58:32 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												RowLayout  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Layout.leftMargin:  Kirigami . Units . smallSpacing 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Layout.topMargin:  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Kirigami . Heading  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														Layout.fillWidth:  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														Layout.topMargin:  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														visible:  text . length  >  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														level:  5 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														color:  "white" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														text:  manager . syncState 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														wrapMode:  Text . NoWrap 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														elide:  Text . ElideRight 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														font.weight:  Font . Normal 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2018-06-17 06:05:20 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-07 03:08:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-06 11:41:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										resetMenuOnTriggered:  false 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-12 12:09:49 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-04-13 19:57:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										actions:  [ 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-08 21:26:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												icon  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-16 17:28:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													name:  ":/icons/ic_home.svg" 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-03 21:24:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												text:  qsTr ( "Dive list" ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-04 00:26:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												onTriggered:  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-05 17:08:48 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													manager . appendTextToLog ( "requested dive list with credential status "  +  Backend . cloud_verification_status ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 21:47:09 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													returnTopPage ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-03 15:12:09 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													globalDrawer . close ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-04 00:26:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-08 21:26:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												icon  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-16 17:28:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													name:  ":/icons/ic_sync.svg" 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-23 08:22:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												text:  qsTr ( "Dive management" ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 13:36:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-08 14:22:52 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														name:  ":/go-previous-symbolic" 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 13:36:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Back" ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-25 09:38:32 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													onTriggered:  globalDrawer . pop ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 13:36:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-08 21:26:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-16 17:28:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														name:  ":/icons/ic_add.svg" 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-03 21:24:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													text:  qsTr ( "Add dive manually" ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-08 02:33:11 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-06 11:41:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-02 11:04:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														returnTopPage ( )   // otherwise odd things happen with the page stack
 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-01 22:29:39 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														startAddDive ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-08 02:33:11 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-11 12:47:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-04 17:06:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													// this of course assumes a white background - theming means this needs to change again
 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-16 17:28:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														name:  ":/icons/downloadDC-black.svg" 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-11 12:47:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													text:  qsTr ( "Download from DC" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													enabled:  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-06 11:41:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 01:22:44 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														downloadFromDc . dcImportModel . clearTable ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:29:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														showPage ( downloadFromDc ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-11 12:47:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-08 21:26:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-16 17:28:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														name:  ":/icons/cloud_sync.svg" 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-03 21:24:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													text:  qsTr ( "Manual sync with cloud" ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-13 01:03:34 +13:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													visible:  Backend . cloud_verification_status  !==  Enums . CS_NOCLOUD 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-08 02:33:11 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-28 16:20:44 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														detailsWindow . endEditMode ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														manager . saveChangesCloud ( true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-23 10:53:10 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														showPassiveNotification ( qsTr ( "Completed manual sync with cloud\n" )  +  manager . syncState ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-28 16:20:44 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-08 02:33:11 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-01 20:40:12 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-13 01:03:34 +13:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														name:  PrefCloudStorage . cloud_auto_sync  ?   ":/icons/ic_cloud_done.svg"  :  ":/icons/ic_cloud_off.svg" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  ( PrefCloudStorage . cloud_auto_sync  ?  "\u2611 "  :  "\u2610 " )  +  qsTr ( "Auto cloud sync" ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-05 17:08:48 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													visible:  Backend . cloud_verification_status  !==  Enums . CS_NOCLOUD 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-08 02:33:11 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-08 18:47:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														PrefCloudStorage . cloud_auto_sync  =  ! PrefCloudStorage . cloud_auto_sync 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-13 01:03:34 +13:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														manager . setGitLocalOnly ( ! PrefCloudStorage . cloud_auto_sync ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-08 18:47:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														if  ( ! PrefCloudStorage . cloud_auto_sync )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-24 22:09:38 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															showPassiveNotification ( qsTr ( " Turning  off  automatic  sync  to  cloud  causes  all  data  to  only  be  \ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								stored  locally .  This  can  be  very  useful  in  situations  with  limited  or  no  network  access .  Please  choose  'Manual sync with cloud'  \  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if  you  have  network  connectivity  and  want  to  sync  your  data  to  cloud  storage . " ) ,  10000 )  
						 
					
						
							
								
									
										
										
										
											2016-04-03 18:33:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-08 02:33:11 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-29 17:43:56 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-12 06:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														name:  ":/icons/sigma.svg" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Dive summary" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:29:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														showPage ( diveSummaryWindow ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-12 06:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														detailsWindow . endEditMode ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														name:  ":/icons/ic_cloud_upload.svg" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Export" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:29:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														showPage ( exportWindow ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-12 06:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														detailsWindow . endEditMode ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-13 19:57:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-08 21:26:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												icon  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-12 06:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													name:  ":/icons/map-globe.svg" 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-12 06:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												text:  qsTr ( "Location" ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-03 15:18:07 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												visible:  true 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 13:36:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-08 14:22:52 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														name:  ":/go-previous-symbolic" 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 13:36:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Back" ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-25 09:38:32 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													onTriggered:  globalDrawer . pop ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 13:36:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-12 06:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														name:  ":/icons/map-globe.svg" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  mapPage . title 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														showMap ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-13 19:57:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-04 15:47:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-09 20:07:17 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													name:  ":/icons/office-chart-bar-stacked.svg" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-04 15:47:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												text:  qsTr ( "Statistics" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													showPage ( statistics ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-19 16:39:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												icon  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-16 17:28:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													name:  ":/icons/ic_settings.svg" 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-19 16:39:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												text:  qsTr ( "Settings" ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-04 17:06:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												onTriggered:  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-06 11:41:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													globalDrawer . close ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-01 14:35:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													settingsWindow . defaultCylinderModel  =  manager . defaultCylinderListInit 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-16 11:21:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													PrefEquipment . default_cylinder  ===  ""  ?  defaultCylinderIndex  =  "-1"  :  defaultCylinderIndex  =  settingsWindow . defaultCylinderModel . indexOf ( PrefEquipment . default_cylinder ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:29:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													showPage ( settingsWindow ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-04 17:06:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													detailsWindow . endEditMode ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-19 16:39:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-09 10:14:15 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													name:  ":/icons/ic_help_outline.svg" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												text:  qsTr ( "Help" ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 10:40:49 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														name:  ":/go-previous-symbolic" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Back" ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-25 09:38:32 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													onTriggered:  globalDrawer . pop ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-09 10:14:15 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-12 06:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														name:  ":/icons/ic_info_outline.svg" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "About" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:29:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														showPage ( aboutWindow ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-12 06:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														detailsWindow . endEditMode ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 10:40:49 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														name:  ":/icons/ic_help_outline.svg" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Show user manual" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-05 09:59:19 +13:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														Qt . openUrlExternally ( "https://www.subsurface-divelog.org/subsurface-mobile-user-manual/" ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 10:40:49 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-09 10:14:15 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-06 23:40:58 +13:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														name:  ":/icons/recycle.svg" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Contribute to Subsurface" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														Qt . openUrlExternally ( "https://www.subsurface-divelog.org/contribute/" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 10:40:49 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														name:  ":/icons/contact_support.svg" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Ask for support" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														if  ( ! manager . createSupportEmail ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															manager . copyAppLogToClipboard ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															showPassiveNotification ( qsTr ( "failed to open email client, please manually create support email to support@subsurface-divelog.org - the logs have been copied to the clipboard and can be pasted into that email." ) ,  6000 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															globalDrawer . close ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-09 10:14:15 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 10:41:47 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														name:  ":/icons/account_circle.svg" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Reset forgotten Subsurface Cloud password" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														Qt . openUrlExternally ( "https://cloud.subsurface-divelog.org/passwordreset" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-09 10:14:15 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-08 21:26:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												icon  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-16 17:28:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													name:  ":/icons/ic_adb.svg" 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 17:02:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-03 21:24:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												text:  qsTr ( "Developer" ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-12 08:55:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												visible:  PrefDisplay . show_developer 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 13:36:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													icon  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-08 14:22:52 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														name:  ":/go-previous-symbolic" 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 13:36:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Back" ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-25 09:38:32 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													onTriggered:  globalDrawer . pop ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 13:36:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-08 21:26:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-03 21:24:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													text:  qsTr ( "App log" ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-08 02:33:11 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-06 11:41:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:29:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														showPage ( logWindow ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-08 02:33:11 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-29 17:43:56 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-03 05:46:40 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Test busy indicator (toggle)" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														if  ( busy . running )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															hideBusy ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															showBusy ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Test notification text" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														showPassiveNotification ( qsTr ( "Test notification text" ) ,  5000 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-08 21:26:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-03 21:24:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													text:  qsTr ( "Theme information" ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-08 02:33:11 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-06 11:41:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:29:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														showPage ( themetest ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-08 02:33:11 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-04 00:26:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-17 10:30:56 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-17 12:24:59 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													text:  qsTr ( "Enable verbose logging (currently: %1)" ) . arg ( manager . verboseEnabled ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-17 10:30:56 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														showPassiveNotification ( qsTr ( "Not persistent" ) ,  3000 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														manager . verboseEnabled  =  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-06 09:57:57 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Kirigami . Action  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													text:  qsTr ( "Access local cloud cache dirs" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													onTriggered:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														globalDrawer . close ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														showPage ( recoverCache ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-29 17:43:56 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-13 19:57:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										]  // end actions
 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-09 01:57:10 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-29 19:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-18 09:57:01 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									property  double  regularFontsize:  subsurfaceTheme . regularPointSize 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												mobile/UI: correctly scale UI without restart
The fact that the rescaling in the settings gave different results from
what we got after a restart really should have been a dead giveaway that
the code was fundamentally flawed.
With this, if the user picks smaller, regular, or larger they now always
get the same, consistent values for gridUnit and font sizes.
This also gives up on the idea that we can just force the gridUnit to be
smaller to make things work if the font (which drives the gridUnit) is
too big for a screen. That fundamentally cannot work and gives a
horrible UI experience. So instead simply warn the user and continue
with matching font / gridUnit, which will still give a bad experience,
but at least we told the user about it and didn't pretend this was ok or
fixable.
Finally, this gets the factors right when switching from smaller to
larger or back, without stopping at regular on the way.
One odd side effect of this code is that under certain conditions
(number of columns changes) the display window when running mobile on
desktop will resize. That's kind of odd, but as that is not /really/ our
target platform, for now I'd consider it acceptable. But it does deserve
more investigation.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
											 
										 
										
											2021-01-14 04:08:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									FontMetrics  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: fontMetrics 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-18 09:57:01 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										font.pointSize:  regularFontsize 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									onRegularFontsizeChanged:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										manager . appendTextToLog ( "regular font size changed to "  +  regularFontsize ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										rootItem . font . pointSize  =  regularFontsize 
							 
						 
					
						
							
								
									
										
											 
										
											
												mobile/UI: correctly scale UI without restart
The fact that the rescaling in the settings gave different results from
what we got after a restart really should have been a dead giveaway that
the code was fundamentally flawed.
With this, if the user picks smaller, regular, or larger they now always
get the same, consistent values for gridUnit and font sizes.
This also gives up on the idea that we can just force the gridUnit to be
smaller to make things work if the font (which drives the gridUnit) is
too big for a screen. That fundamentally cannot work and gives a
horrible UI experience. So instead simply warn the user and continue
with matching font / gridUnit, which will still give a bad experience,
but at least we told the user about it and didn't pretend this was ok or
fixable.
Finally, this gets the factors right when switching from smaller to
larger or back, without stopping at regular on the way.
One odd side effect of this code is that under certain conditions
(number of columns changes) the display window when running mobile on
desktop will resize. That's kind of odd, but as that is not /really/ our
target platform, for now I'd consider it acceptable. But it does deserve
more investigation.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
											 
										 
										
											2021-01-14 04:08:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-09-13 21:39:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									function  setupUnits ( )  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												mobile/UI: correctly scale UI without restart
The fact that the rescaling in the settings gave different results from
what we got after a restart really should have been a dead giveaway that
the code was fundamentally flawed.
With this, if the user picks smaller, regular, or larger they now always
get the same, consistent values for gridUnit and font sizes.
This also gives up on the idea that we can just force the gridUnit to be
smaller to make things work if the font (which drives the gridUnit) is
too big for a screen. That fundamentally cannot work and gives a
horrible UI experience. So instead simply warn the user and continue
with matching font / gridUnit, which will still give a bad experience,
but at least we told the user about it and didn't pretend this was ok or
fixable.
Finally, this gets the factors right when switching from smaller to
larger or back, without stopping at regular on the way.
One odd side effect of this code is that under certain conditions
(number of columns changes) the display window when running mobile on
desktop will resize. That's kind of odd, but as that is not /really/ our
target platform, for now I'd consider it acceptable. But it does deserve
more investigation.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
											 
										 
										
											2021-01-14 04:08:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										// since Kirigami was initially instantiated, the font size may have
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										// changed, so recalculate the gridUnit
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										var  kirigamiGridUnit  =  fontMetrics . height 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-09-13 21:39:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										// some screens are too narrow for Subsurface-mobile to render well
 
							 
						 
					
						
							
								
									
										
											 
										
											
												mobile/UI: correctly scale UI without restart
The fact that the rescaling in the settings gave different results from
what we got after a restart really should have been a dead giveaway that
the code was fundamentally flawed.
With this, if the user picks smaller, regular, or larger they now always
get the same, consistent values for gridUnit and font sizes.
This also gives up on the idea that we can just force the gridUnit to be
smaller to make things work if the font (which drives the gridUnit) is
too big for a screen. That fundamentally cannot work and gives a
horrible UI experience. So instead simply warn the user and continue
with matching font / gridUnit, which will still give a bad experience,
but at least we told the user about it and didn't pretend this was ok or
fixable.
Finally, this gets the factors right when switching from smaller to
larger or back, without stopping at regular on the way.
One odd side effect of this code is that under certain conditions
(number of columns changes) the display window when running mobile on
desktop will resize. That's kind of odd, but as that is not /really/ our
target platform, for now I'd consider it acceptable. But it does deserve
more investigation.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
											 
										 
										
											2021-01-14 04:08:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										// things don't look greate with fewer than 21 gridUnits in a row
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										var  numColumns  =  Math . max ( Math . floor ( rootItem . width  /  ( 21  *  kirigamiGridUnit ) ) ,  1 ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-08 11:11:45 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( Screen . primaryOrientation  ===  Qt . PortraitOrientation  &&  PrefDisplay . singleColumnPortrait )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											manager . appendTextToLog ( "show only one column in portrait mode" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											numColumns  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-05 20:23:46 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										rootItem . colWidth  =  numColumns  >  1  ?  Math . floor ( rootItem . width  /  numColumns )  :  rootItem . width ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												mobile/UI: correctly scale UI without restart
The fact that the rescaling in the settings gave different results from
what we got after a restart really should have been a dead giveaway that
the code was fundamentally flawed.
With this, if the user picks smaller, regular, or larger they now always
get the same, consistent values for gridUnit and font sizes.
This also gives up on the idea that we can just force the gridUnit to be
smaller to make things work if the font (which drives the gridUnit) is
too big for a screen. That fundamentally cannot work and gives a
horrible UI experience. So instead simply warn the user and continue
with matching font / gridUnit, which will still give a bad experience,
but at least we told the user about it and didn't pretend this was ok or
fixable.
Finally, this gets the factors right when switching from smaller to
larger or back, without stopping at regular on the way.
One odd side effect of this code is that under certain conditions
(number of columns changes) the display window when running mobile on
desktop will resize. That's kind of odd, but as that is not /really/ our
target platform, for now I'd consider it acceptable. But it does deserve
more investigation.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
											 
										 
										
											2021-01-14 04:08:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										// If we can't fit 21 gridUnits into a line, let the user know and suggest using a smaller font
 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-05 20:23:46 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										var  widthInGridUnits  =  Math . floor ( rootItem . colWidth  /  kirigamiGridUnit ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-13 21:39:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( widthInGridUnits  <  21 )  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												mobile/UI: correctly scale UI without restart
The fact that the rescaling in the settings gave different results from
what we got after a restart really should have been a dead giveaway that
the code was fundamentally flawed.
With this, if the user picks smaller, regular, or larger they now always
get the same, consistent values for gridUnit and font sizes.
This also gives up on the idea that we can just force the gridUnit to be
smaller to make things work if the font (which drives the gridUnit) is
too big for a screen. That fundamentally cannot work and gives a
horrible UI experience. So instead simply warn the user and continue
with matching font / gridUnit, which will still give a bad experience,
but at least we told the user about it and didn't pretend this was ok or
fixable.
Finally, this gets the factors right when switching from smaller to
larger or back, without stopping at regular on the way.
One odd side effect of this code is that under certain conditions
(number of columns changes) the display window when running mobile on
desktop will resize. That's kind of odd, but as that is not /really/ our
target platform, for now I'd consider it acceptable. But it does deserve
more investigation.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
											 
										 
										
											2021-01-14 04:08:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											showPassiveNotification ( qsTr ( "Font size likely too big for the display, switching to smaller font suggested" ) ,  3000 ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-13 21:39:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-30 09:16:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										manager . appendTextToLog ( numColumns  +  " columns with column width of "  +  rootItem . colWidth ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										manager . appendTextToLog ( "width in Grid Units "  +  widthInGridUnits  +  " original gridUnit "  +  Kirigami . Units . gridUnit  +  " now "  +  kirigamiGridUnit ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-13 21:39:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( Kirigami . Units . gridUnit  !==  kirigamiGridUnit )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-14 13:47:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											// change our global grid unit and prevent Kirigami from resizing our rootItem
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											var  fixWidth  =  rootItem . width 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											var  fixHeight  =  rootItem . height 
							 
						 
					
						
							
								
									
										
											 
										
											
												mobile/UI: correctly scale UI without restart
The fact that the rescaling in the settings gave different results from
what we got after a restart really should have been a dead giveaway that
the code was fundamentally flawed.
With this, if the user picks smaller, regular, or larger they now always
get the same, consistent values for gridUnit and font sizes.
This also gives up on the idea that we can just force the gridUnit to be
smaller to make things work if the font (which drives the gridUnit) is
too big for a screen. That fundamentally cannot work and gives a
horrible UI experience. So instead simply warn the user and continue
with matching font / gridUnit, which will still give a bad experience,
but at least we told the user about it and didn't pretend this was ok or
fixable.
Finally, this gets the factors right when switching from smaller to
larger or back, without stopping at regular on the way.
One odd side effect of this code is that under certain conditions
(number of columns changes) the display window when running mobile on
desktop will resize. That's kind of odd, but as that is not /really/ our
target platform, for now I'd consider it acceptable. But it does deserve
more investigation.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
											 
										 
										
											2021-01-14 04:08:48 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Kirigami . Units . gridUnit  =  kirigamiGridUnit  *  1.0 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-14 13:47:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											rootItem . width  =  fixWidth 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											rootItem . height  =  fixHeight 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-13 21:39:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-14 13:47:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-08 11:11:45 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										pageStack . defaultColumnWidth  =  rootItem . colWidth 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-14 13:47:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										manager . appendTextToLog ( "Done setting up sizes width "  +  rootItem . width  +  " gridUnit "  +  kirigamiGridUnit ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-13 21:39:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-15 09:22:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									QtObject  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-06 13:26:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										id: screenSizeObject 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-15 09:22:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										property  int  initialWidth:  rootItem . width 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										property  int  initialHeight:  rootItem . height 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-06 13:26:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										property  bool  firstChange:  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										property  int  lastOrientation:  undefined 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-15 09:22:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Component.onCompleted:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// break the binding
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											initialWidth  =  initialWidth  *  1 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-09 17:53:26 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											manager . appendTextToLog ( "[screensetup] screenSizeObject constructor completed, initial width "  +  initialWidth ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-06 13:26:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											setupUnits ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-15 09:22:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-09-13 21:40:30 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									onWidthChanged:  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-09 17:53:26 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										manager . appendTextToLog ( "[screensetup] width changed now "  +  width  +  " x "  +  height  +  " vs screen "  +  Screen . width  +  " x "  +  Screen . height ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-14 13:47:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-09 17:53:26 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( screenSizeObject . lastOrientation  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											manager . appendTextToLog ( "[screensetup] found initial orientation "  +  Screen . orientation ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											screenSizeObject . lastOrientation  =  Screen . orientation 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										manager . appendTextToLog ( "[screensetup] window width changed to "  +  width  +  " orientation "  +  Screen . orientation ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										// on Android devices we often get incorrect size updates during startup from Kirigami and we need to ignore those,
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										// or more specifically, reset the Kirigami sizes when we notice them
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( Screen . orientation  ===  screenSizeObject . lastOrientation )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// not rotation
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( width  >  Screen . width  ||  height  >  Screen . height )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												manager . appendTextToLog ( "[screensetup] received size update that exceeds screen size" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												if  ( screenSizeObject . initialWidth  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													manager . appendTextToLog ( "[screensetup] resetting to initial size "  +  screenSizeObject . initialWidth  +  " x "  +  screenSizeObject . initialHeight ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-06 13:26:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													rootItem . width  =  screenSizeObject . initialWidth 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													rootItem . height  =  screenSizeObject . initialHeight 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-09 17:53:26 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													// we don't have a size that we believe, yet - using Screen size is almost certainly wrong
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													manager . appendTextToLog ( "[screensetup] restricting to screen size "  +  Screen . width  +  " x "  +  Screen . height ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													rootItem . width  =  Screen . width 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													rootItem . heigh  =  Screen . height 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												// this could be a realistic size
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												if  ( screenSizeObject . initialWidth  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													if  ( screenSizeObject . initialHeight  <  height )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														manager . appendTextToLog ( "[screensetup] remembering better height" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														screenSizeObject . initialHeight  =  height 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													if  ( screenSizeObject . initialWidth  <  width )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														manager . appendTextToLog ( "[screensetup] remembering better height" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														screenSizeObject . initialWidth  =  width 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-14 13:47:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													setupUnits ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-28 14:22:00 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-23 13:57:22 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-09 17:53:26 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											manager . appendTextToLog ( "[screensetup] remembering new orientation" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											screenSizeObject . lastOrientation  =  Screen . orientation 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-23 13:57:22 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-13 21:40:30 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-07 16:21:01 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									property  int  hackToOpenMap:  0  /* Otherpage */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/ *   I   r e a l l y   w a n t   a n   e n u m ,   b u t   t h o s e   a r e   p a i n f u l   i n   Q M L ,   s o   l e t ' s   u s e   n u m b e r s 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  0  ( Otherpage )    -  the  last  page  selected  was  a  non - map  page 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  1  ( MapSelected )  -  the  map  page  was  selected  by  the  user 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:29:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 *  2  ( MapForced )    -  the  map  page  was  forced  by  this  hack 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-07 16:21:01 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 * / 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-18 14:37:02 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									pageStack.onCurrentItemChanged:  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-06 18:48:35 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										// This is called whenever the user navigates using the breadcrumbs in the header
 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-18 14:37:02 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-08-08 19:49:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( pageStack . currentItem  ===  null )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-30 09:16:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											manager . appendTextToLog ( "there's no current page" ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-08 19:49:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-06 18:48:35 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											// horrible, insane hack to make picking the mapPage work
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// for some reason I cannot figure out, whenever the mapPage is selected
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// we immediately switch back to the page before it - so force-prevent
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// that undersired behavior
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( pageStack . currentItem . objectName  ===  mapPage . objectName )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												// remember that we actively picked the mapPage
 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-07 16:21:01 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												if  ( hackToOpenMap  !==  2  /* MapForced */  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-30 09:16:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													manager . appendTextToLog ( "pageStack switched to map" ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-07 16:21:01 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													hackToOpenMap  =  1  /* MapSelected */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-30 09:16:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													manager . appendTextToLog ( "pageStack forced back to map" ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-07 16:21:01 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-06 18:48:35 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											}  else  if  ( pageStack . currentItem . objectName  !==  mapPage . objectName  && 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-06 14:58:21 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													   pageStack . lastItem . objectName  ===  mapPage . objectName  && 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													   hackToOpenMap  ===  1  /* MapSelected */ )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-06 18:48:35 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												// if we just picked the mapPage and are suddenly back on a different page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												// force things back to the mapPage
 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-30 09:16:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												manager . appendTextToLog ( "pageStack wrong page, switching back to map" ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-06 18:48:35 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												pageStack . currentIndex  =  pageStack . contentItem . contentChildren . length  -  1 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-07 16:21:01 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												hackToOpenMap  =  2  /* MapForced */ 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-06 18:48:35 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												// if we picked a different page reset the mapPage hack
 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-30 09:16:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												manager . appendTextToLog ( "pageStack switched to "  +  pageStack . currentItem . objectName ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-07 16:21:01 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												hackToOpenMap  =  0  /* Otherpage */ 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-06 18:48:35 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// disable the left swipe to go back when on the map page
 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-12 14:57:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											pageStack . interactive  =  pageStack . currentItem . objectName  !==  mapPage . objectName 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-08 22:28:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-08-08 19:49:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											// is there a better way to reload the map markers instead of doing that
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// every time the map page is shown - e.g. link to the dive list model somehow?
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( pageStack . currentItem . objectName  ===  mapPage . objectName ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												mapPage . reloadMap ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-08 22:28:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-08-08 19:49:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											// In case we land on any page, not being the DiveDetails (which can be
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// in multiple states, such as add, edit or view), just end the edit/add mode
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( pageStack . currentItem . objectName  !==  "DiveDetails"  && 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													( detailsWindow . state  ===  'edit'  ||  detailsWindow . state  ===  'add' ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-18 14:37:02 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												detailsWindow . endEditMode ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-08 19:49:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-18 14:37:02 +01: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 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-01 07:27:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									property  bool  initialized:  manager . initialized 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									onInitializedChanged:  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( initialized )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											hideBusy ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											manager . appendTextToLog ( "initialization completed - showing the dive list" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											showPage ( diveList )  // we want to make sure that gets on the stack
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											diveList . diveListModel  =  diveModel 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-02 15:26:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( Qt . platform . os  ===  "android" )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												manager . appendTextToLog ( "if we got started by a plugged in device, switch to download page -- pluggedInDeviceName = "  +  pluggedInDeviceName ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												if  ( pluggedInDeviceName  !==  "" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													// if we were started with a dive computer plugged in,
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													// immediately switch to download page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													showDownloadForPluggedInDevice ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-01 07:27:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Label  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: textBlock 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  ! initialized 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-19 14:16:56 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										color:  subsurfaceTheme . textColor 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-01 07:27:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										text:  qsTr ( "Subsurface-mobile starting up" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font.pointSize:  subsurfaceTheme . headingPointSize 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										topPadding:  2  *  Kirigami . Units . gridUnit 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										leftPadding:  Kirigami . Units . gridUnit 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-20 08:16:52 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									StartPage  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: startPage 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										anchors.fill:  parent 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-01 07:27:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										visible:  initialized  && 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											 Backend . cloud_verification_status  !==  Enums . CS_NOCLOUD  && 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-05 17:08:48 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											 Backend . cloud_verification_status  !==  Enums . CS_VERIFIED 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-20 08:16:52 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										onVisibleChanged:  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-01 07:27:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											manager . appendTextToLog ( "StartPage visibility changed to "  +  visible ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( ! initialized )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												manager . appendTextToLog ( "not yet initialized, show busy spinner" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												showBusy ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-20 08:16:52 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if  ( visible )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												pageStack . clear ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-01 07:27:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											}  else  if  ( initialized )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-11 16:54:46 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												showDiveList ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-20 08:16:52 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Component.onCompleted:  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-02 15:28:03 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if  ( Screen . manufacturer  +  " "  +  Screen . model  +  " "  +  Screen . name  !==  "  " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												manager . appendTextToLog ( "Running on "  +  Screen . manufacturer  +  " "  +  Screen . model  +  " "  +  Screen . name ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-01 07:27:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											manager . appendTextToLog ( "StartPage completed -- initialized is "  +  initialized ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-20 08:16:52 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-19 11:44:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									DiveList  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: diveList 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-04 15:47:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									StatisticsPage  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: statistics 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-07-20 19:39:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Settings  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: settingsWindow 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-12 10:56:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-07 17:11:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									DeleteAccount  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: deleteAccount 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-11-18 07:42:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									CopySettings  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: settingsCopyWindow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 22:53:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									About  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: aboutWindow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-11-17 19:26:23 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Export  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: exportWindow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 15:00:29 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									DiveDetails  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: detailsWindow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-23 14:46:02 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-21 21:32:40 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									TripDetails  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: tripEditWindow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-19 10:18:26 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Log  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: logWindow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-09 01:57:10 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-11 12:47:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									DownloadFromDiveComputer  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: downloadFromDc 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-08 22:04:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									MapPage  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: mapPage 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-06 09:57:57 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									RecoverCache  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: recoverCache 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-06 13:07:59 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/ *   t h i s   s h o u l d n ' t   b e   e x p o s e d   u n l e s s   s o m e o n e   w i l l   f i n i s h   t h e   w o r k  
						 
					
						
							
								
									
										
										
										
											2019-11-23 21:00:59 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									DivePlannerSetup  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: divePlannerSetupWindow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									DivePlannerEdit  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: divePlannerEditWindow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									DivePlannerView  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: divePlannerViewWindow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									DivePlannerManager  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: divePlannerManagerWindow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-06 13:07:59 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 * / 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-24 10:39:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									DiveSummary  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: diveSummaryWindow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-06 21:53:26 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ThemeTest  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id: themetest 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										visible:  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:46:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									function  showDownloadPage ( vendor ,  product ,  connection )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										manager . appendTextToLog ( "show download page for "  +  vendor  +  " / "  +  product  +  " / "  +  connection ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										downloadFromDc . dcImportModel . clearTable ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( vendor  !==  undefined  &&  product  !==  undefined  &&  connection  !==  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 14:41:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											downloadFromDc . setupUSB  =  true 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-20 14:00:16 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											// set up the correct values on the download page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// setting the currentIndex to -1, first, helps to ensure
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// that the comboBox does get updated in the UI
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( vendor  !==  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												downloadFromDc . vendor  =  - 1 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:46:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												downloadFromDc . vendor  =  vendor 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-20 14:00:16 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( product  !==  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												downloadFromDc . product  =  - 1 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:46:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												downloadFromDc . product  =  product 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-20 14:00:16 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( connection  !==  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												downloadFromDc . connection  =  - 1 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:46:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												downloadFromDc . connection  =  connection 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-20 14:00:16 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 14:41:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											downloadFromDc . setupUSB  =  false 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:46:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 14:41:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:46:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										showPage ( downloadFromDc ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									function  showDownloadForPluggedInDevice ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:51:34 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										// don't add this unless the dive list is already shown
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( pageIndex ( diveList )  ===  - 1 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:46:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										manager . appendTextToLog ( "plugged in device name changed to "  +  pluggedInDeviceName ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* if we recognized the device, we'll pass in a triple of ComboBox indeces as "vendor;product;connection" */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										var  vendorProductConnection  =  pluggedInDeviceName . split ( ';' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( vendorProductConnection . length  ===  3 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											showDownloadPage ( vendorProductConnection [ 0 ] ,  vendorProductConnection [ 1 ] ,  vendorProductConnection [ 2 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											showDownloadPage ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-08-06 06:24:51 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									onPluggedInDeviceNameChanged:  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-06 18:38:52 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( detailsWindow . state  ===  'edit'  ||  detailsWindow . state  ===  'add' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											/* we're in the middle of editing / adding a dive */ 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-30 09:16:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											manager . appendTextToLog ( "Download page requested by Android Intent, but adding/editing dive; no action taken" ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-06 18:38:52 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:46:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											// we want to show the downloads page
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:51:34 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											// note that if Subsurface-mobile was started because a USB device was plugged in, this is run too early;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// we catch this in the function below and instead switch to the download page in the completion signal
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											// handler for the startPage
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-09 10:46:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											showDownloadForPluggedInDevice ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-06 18:38:52 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-06 06:24:51 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-29 14:56:06 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									onClosing:  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-30 09:43:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										// this duplicates the check that is already in the onBackRequested signal handler of the DiveList
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-29 14:56:06 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( globalDrawer . visible )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											globalDrawer . close ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											close . accepted  =  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( contextDrawer . visible )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											contextDrawer . close ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											close . accepted  =  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-27 13:34:55 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}