QML UI: DiveList: implement pull down to refresh
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e0f46b033d
commit
7b7294d127
@ -20,6 +20,21 @@ Kirigami.ScrollablePage {
|
||||
property color textColor: subsurfaceTheme.diveListTextColor
|
||||
property int horizontalPadding: Kirigami.Units.gridUnit / 2 - Kirigami.Units.smallSpacing + 1
|
||||
|
||||
supportsRefreshing: true
|
||||
onRefreshingChanged: {
|
||||
if (refreshing) {
|
||||
if (manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL) {
|
||||
console.log("User pulled down dive list - syncing with cloud storage")
|
||||
detailsWindow.endEditMode()
|
||||
manager.saveChangesCloud(true)
|
||||
console.log("done syncing, turn off spinner")
|
||||
refreshing = false
|
||||
} else {
|
||||
console.log("sync with cloud storage requested, but credentialStatus is " + manager.credentialStatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: diveDelegate
|
||||
Kirigami.AbstractListItem {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user