summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-11 16:54:46 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-12 07:07:48 -0700
commit84d45485fd9c523142f6ff2ac5c18c3626adf15d (patch)
tree874db93e4168ffc0fc7208d73fd4cf16b2a49512
parent0d1510929f9b958c5b5d307bdea133fbf578fc16 (diff)
downloadsubsurface-84d45485fd9c523142f6ff2ac5c18c3626adf15d.tar.gz
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>
-rw-r--r--mobile-widgets/qml/DiveList.qml47
-rw-r--r--mobile-widgets/qml/main.qml4
2 files changed, 18 insertions, 33 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml
index 8394fafef..a1e34e1c5 100644
--- a/mobile-widgets/qml/DiveList.qml
+++ b/mobile-widgets/qml/DiveList.qml
@@ -312,38 +312,22 @@ Kirigami.ScrollablePage {
onTriggered: manager.redo()
}
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: {
- manager.finishSetup();
- setupActions();
+ 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")
}
}
@@ -450,6 +434,7 @@ Kirigami.ScrollablePage {
Component.onCompleted: {
manager.appendTextToLog("finished setting up the diveListView")
}
+ onVisibleChanged: setupActions()
}
property QtObject downloadFromDCAction: Kirigami.Action {
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index 2c9cd5b68..033bf6014 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -715,10 +715,10 @@ if you have network connectivity and want to sync your data to cloud storage."),
onVisibleChanged: {
if (visible) {
pageStack.clear()
- diveList.visible = false
+ } else {
+ showDiveList()
}
}
-
Component.onCompleted: {
if (!visible) {
manager.appendTextToLog("StartPage completed - showing the dive list")