aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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")