aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DownloadFromDiveComputer.qml
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-07-19 09:16:47 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-19 21:49:37 +0900
commit619fbaf1e231a8f54e3a7458f1f3081deab1825b (patch)
tree8068f5ddedf3fd82e9bf6616b50bf07d35292f34 /mobile-widgets/qml/DownloadFromDiveComputer.qml
parent915b760d54d072f1d6ad805a3a963dc7c0ec6f70 (diff)
downloadsubsurface-619fbaf1e231a8f54e3a7458f1f3081deab1825b.tar.gz
QML UI: Allow cancel of ongoing download
This commit adds the capability to cancel a running download from DC. The actual cancel is fully handled in the underlying libdivecomputer code. As the user may be interested in the dives downloaded up to the moment of cancel, do not just close the download screen (as it was before this commit). Now, the <quit> button changes to <cancel> when the download is started, and pressing cancel, only cancels the download and does not close the download screen, but presents the so far downloaded data. When no download is running, the <quit> button just quits the screen as before. Fixes: #485 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets/qml/DownloadFromDiveComputer.qml')
-rw-r--r--mobile-widgets/qml/DownloadFromDiveComputer.qml6
1 files changed, 4 insertions, 2 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml
index a9b34f34f..32ea5dfed 100644
--- a/mobile-widgets/qml/DownloadFromDiveComputer.qml
+++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml
@@ -201,14 +201,16 @@ Kirigami.Page {
antialiasing: true
radius: Kirigami.Units.smallSpacing * 2
}
- text: qsTr("Quit")
+ text: progressBar.visible ? qsTr("Cancel") : qsTr("Quit")
contentItem: Text {
text: quitbutton.text
color: subsurfaceTheme.darkerPrimaryTextColor
}
onClicked: {
+ manager.cancelDownloadDC()
+ if (!progressBar.visible)
+ stackView.pop();
manager.appendTextToLog("exit DCDownload screen")
- stackView.pop();
}
}
}