mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	mobile UI: remove duplicate StartPage
This was a merge error in the dive list rewrite and brought in a code block that had moved, which caused issues with correctly switching to the dive list. Calling setupActions() moves to the diveListView (where it really belongs). Instead of messing with the visibility of components of the same page, we now simply switch out the shown page. Fixes #2667 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									0d1510929f
								
							
						
					
					
						commit
						84d45485fd
					
				
					 2 changed files with 18 additions and 33 deletions
				
			
		|  | @ -312,38 +312,22 @@ Kirigami.ScrollablePage { | ||||||
| 		onTriggered: manager.redo() | 		onTriggered: manager.redo() | ||||||
| 	} | 	} | ||||||
| 	property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, deleteAction, mapAction, tripDetailsEdit, undoAction, redoAction ] | 	property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, deleteAction, mapAction, tripDetailsEdit, undoAction, redoAction ] | ||||||
| 	StartPage { |  | ||||||
| 		id: startPage |  | ||||||
| 		anchors.fill: parent |  | ||||||
| 		opacity: (Backend.cloud_verification_status === Enums.CS_NOCLOUD || |  | ||||||
| 			 Backend.cloud_verification_status === Enums.CS_VERIFIED) ? 0 : 1 |  | ||||||
| 		visible: opacity > 0 |  | ||||||
| 		Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } } |  | ||||||
| 		function setupActions() { |  | ||||||
| 			if (Backend.cloud_verification_status === Enums.CS_VERIFIED || |  | ||||||
| 					Backend.cloud_verification_status === Enums.CS_NOCLOUD) { |  | ||||||
| 				page.actions.main = page.downloadFromDCAction |  | ||||||
| 				page.actions.right = page.addDiveAction |  | ||||||
| 				page.actions.left = page.filterToggleAction |  | ||||||
| 				page.contextualActions = contextactions |  | ||||||
| 				page.title = qsTr("Dive list") |  | ||||||
| 				if (diveListView.count === 0) |  | ||||||
| 					showPassiveNotification(qsTr("Please tap the '+' button to add a dive (or download dives from a supported dive computer)"), 3000) |  | ||||||
| 			} else { |  | ||||||
| 				page.actions.main = null |  | ||||||
| 				page.actions.right = null |  | ||||||
| 				page.actions.left = null |  | ||||||
| 				page.contextualActions = null |  | ||||||
| 				page.title = qsTr("Cloud credentials") |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 		onVisibleChanged: { |  | ||||||
| 			setupActions(); |  | ||||||
| 		} |  | ||||||
| 
 | 
 | ||||||
| 		Component.onCompleted: { | 	function setupActions() { | ||||||
| 			manager.finishSetup(); | 		if (Backend.cloud_verification_status === Enums.CS_VERIFIED || Backend.cloud_verification_status === Enums.CS_NOCLOUD) { | ||||||
| 			setupActions(); | 			page.actions.main = page.downloadFromDCAction | ||||||
|  | 			page.actions.right = page.addDiveAction | ||||||
|  | 			page.actions.left = page.filterToggleAction | ||||||
|  | 			page.contextualActions = contextactions | ||||||
|  | 			page.title = qsTr("Dive list") | ||||||
|  | 			if (diveListView.count === 0) | ||||||
|  | 				showPassiveNotification(qsTr("Please tap the '+' button to add a dive (or download dives from a supported dive computer)"), 3000) | ||||||
|  | 		} else { | ||||||
|  | 			page.actions.main = null | ||||||
|  | 			page.actions.right = null | ||||||
|  | 			page.actions.left = null | ||||||
|  | 			page.contextualActions = null | ||||||
|  | 			page.title = qsTr("Cloud credentials") | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | @ -450,6 +434,7 @@ Kirigami.ScrollablePage { | ||||||
| 		Component.onCompleted: { | 		Component.onCompleted: { | ||||||
| 			manager.appendTextToLog("finished setting up the diveListView") | 			manager.appendTextToLog("finished setting up the diveListView") | ||||||
| 		} | 		} | ||||||
|  | 		onVisibleChanged: setupActions() | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	property QtObject downloadFromDCAction: Kirigami.Action { | 	property QtObject downloadFromDCAction: Kirigami.Action { | ||||||
|  |  | ||||||
|  | @ -715,10 +715,10 @@ if you have network connectivity and want to sync your data to cloud storage."), | ||||||
| 		onVisibleChanged: { | 		onVisibleChanged: { | ||||||
| 			if (visible) { | 			if (visible) { | ||||||
| 				pageStack.clear() | 				pageStack.clear() | ||||||
| 				diveList.visible = false | 			} else { | ||||||
|  | 				showDiveList() | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 |  | ||||||
| 		Component.onCompleted: { | 		Component.onCompleted: { | ||||||
| 			if (!visible) { | 			if (!visible) { | ||||||
| 				manager.appendTextToLog("StartPage completed - showing the dive list") | 				manager.appendTextToLog("StartPage completed - showing the dive list") | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue