From 0b72495413e8b060b58b96aa6d6a0ce96baa168c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 15 Mar 2020 12:27:10 -0700 Subject: android/usb: simply restart the download after receiving permission If the user tries to download from a device that he hasn't given the app permission to read from, Android will pop up a dialogue asking for that permission. With this after giving the permission we continue (well, technically, restart) the download which is likely the expected behavior. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DownloadFromDiveComputer.qml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'mobile-widgets/qml/DownloadFromDiveComputer.qml') diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index 8ef4520a2..5a732b73f 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -293,6 +293,24 @@ Kirigami.Page { Layout.fillWidth: true Layout.topMargin: Kirigami.Units.smallSpacing spacing: Kirigami.Units.smallSpacing + + + function doDownload() { + var message = "DCDownloadThread started for " + manager.DC_vendor + " " + manager.DC_product + " on " + manager.DC_devName; + message += " downloading " + (manager.DC_forceDownload ? "all" : "only new" ) + " dives"; + manager.appendTextToLog(message) + progressBar.visible = true + divesDownloaded = false // this allows the progressMessage to be displayed + importModel.startDownload() + } + + Connections { + target: manager + onRestartDownloadSignal: { + buttonBar.doDownload() + } + } + TemplateButton { id: download text: qsTr("Download") @@ -322,12 +340,7 @@ Kirigami.Page { manager.DC_bluetoothMode = false; manager.DC_devName = connectionString; } - var message = "DCDownloadThread started for " + manager.DC_vendor + " " + manager.DC_product + " on " + manager.DC_devName; - message += " downloading " + (manager.DC_forceDownload ? "all" : "only new" ) + " dives"; - manager.appendTextToLog(message) - progressBar.visible = true - divesDownloaded = false // this allows the progressMessage to be displayed - importModel.startDownload() + buttonBar.doDownload() } } TemplateButton { -- cgit v1.2.3-70-g09d2