diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-06-21 15:54:34 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-06-21 17:20:07 -0700 |
commit | 7b7294d1277206f90c366ddc093c452c5eac35d2 (patch) | |
tree | b83a1c75a77900b339ceaf3ee0a0f37ef138f3a1 /mobile-widgets/qml | |
parent | e0f46b033d5f641e8bd78e665cbc9539977fa7cb (diff) | |
download | subsurface-7b7294d1277206f90c366ddc093c452c5eac35d2.tar.gz |
QML UI: DiveList: implement pull down to refresh
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r-- | mobile-widgets/qml/DiveList.qml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index f8c82835a..b97e6fb69 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -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 { |