Mobile: simple message and busy spinner while storing downloaded dives

Due to some recent changes processing the downloaded dives and
re-displaying the dive list can take quite a while. So show a small
message and the busy spinner to warn the user.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-10-21 17:16:49 -04:00
parent 84920fd657
commit 9b6ec64853

View file

@ -366,7 +366,12 @@ Kirigami.Page {
}
}
}
Controls.Label {
text: qsTr("Please wait while we record these dives...")
Layout.fillWidth: true
visible: acceptButton.busy
leftPadding: Kirigami.Units.gridUnit * 3 // trust me - that looks better
}
RowLayout {
id: bottomButtons
Controls.Label {
@ -375,10 +380,13 @@ Kirigami.Page {
}
SsrfButton {
id: acceptButton
property bool busy: false
enabled: divesDownloaded
text: qsTr("Accept")
bottomPadding: Kirigami.Units.gridUnit / 2
onClicked: {
busy = true
rootItem.showBusy()
manager.appendTextToLog("Save downloaded dives that were selected")
importModel.recordDives()
manager.saveChangesLocal()
@ -386,6 +394,8 @@ Kirigami.Page {
manager.refreshDiveList()
pageStack.pop();
download.text = qsTr("Download")
busy = false
rootItem.hideBusy()
divesDownloaded = false
}
}