summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mobile-widgets/qml/DownloadFromDiveComputer.qml6
-rw-r--r--mobile-widgets/qmlmanager.cpp5
-rw-r--r--mobile-widgets/qmlmanager.h1
3 files changed, 10 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();
}
}
}
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index b84b83430..13cf0b4fc 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1121,6 +1121,11 @@ void QMLManager::deleteDive(int id)
changesNeedSaving();
}
+void QMLManager::cancelDownloadDC()
+{
+ import_thread_cancelled = true;
+}
+
QString QMLManager::addDive()
{
appendTextToLog("Adding new dive.");
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index 33831d396..8e4f05fa6 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -162,6 +162,7 @@ public slots:
void sendGpsData();
void downloadGpsData();
void populateGpsData();
+ void cancelDownloadDC();
void clearGpsData();
void finishSetup();
void openLocalThenRemote(QString url);