mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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
1 changed files with 15 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue