diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-05-05 16:07:15 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-05-11 11:40:07 -0700 |
commit | 144de49ad45eb882ecfaf4257c20999e4efd1db1 (patch) | |
tree | 544c72caf217da6c89a6f235b0e561c2378d784e | |
parent | a4ecfb75222d73db6dbe7d66b48c659b138cf8e0 (diff) | |
download | subsurface-144de49ad45eb882ecfaf4257c20999e4efd1db1.tar.gz |
Mobile: add checkbox to force downloading all dives
This has been a feature people have asked for quite frequently. It is
taking up some valuable screen real estate - so the question could
become if there should be a switch to enable / disable it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | core/downloadfromdcthread.cpp | 1 | ||||
-rw-r--r-- | mobile-widgets/qml/DownloadFromDiveComputer.qml | 31 |
2 files changed, 30 insertions, 2 deletions
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index f2a65ac5f..5cd8956dc 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -82,6 +82,7 @@ void DownloadThread::run() internalData->devname = "ftdi"; #endif qDebug() << "Starting download from " << (internalData->bluetooth_mode ? "BT" : internalData->devname); + qDebug() << "downloading" << (internalData->force_download ? "all" : "only new") << "dives"; clear_table(&downloadTable); clear_dive_site_table(&diveSiteTable); diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index 2377db951..f6a323300 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -255,7 +255,7 @@ Kirigami.Page { RowLayout { id: buttonBar Layout.fillWidth: true - Layout.topMargin: Kirigami.Units.smallSpacing * 2 + Layout.topMargin: Kirigami.Units.smallSpacing spacing: Kirigami.Units.smallSpacing SsrfButton { id: download @@ -286,7 +286,9 @@ Kirigami.Page { manager.DC_bluetoothMode = false; manager.DC_devName = connectionString; } - manager.appendTextToLog("DCDownloadThread started for " + manager.DC_vendor + " " + manager.DC_product + " on "+ manager.DC_devName) + 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 downloadThread.start() } @@ -322,6 +324,31 @@ Kirigami.Page { } } + RowLayout { + id: downloadOptions + Layout.fillWidth: true + Layout.topMargin: 0 + spacing: Kirigami.Units.smallSpacing + SsrfCheckBox { + id: forceAll + checked: manager.DC_forceDownload + enabled: forceAllLabel.visible + visible: enabled + height: forceAllLabel.height - Kirigami.Units.smallSpacing; + width: height + onClicked: { + manager.DC_forceDownload = !manager.DC_forceDownload; + } + } + Controls.Label { + id: forceAllLabel + text: qsTr("force downloading all dives") + visible: comboVendor.currentIndex != -1 && comboProduct.currentIndex != -1 && + comboConnection.currentIndex != -1 + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + } + } + ListView { id: dlList Layout.topMargin: Kirigami.Units.smallSpacing * 4 |