From 8bbb3dfe4241b200cc37420ed45d7303a99c8b27 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 20 Apr 2015 22:30:04 -0700 Subject: Uemis downloader: allow continuing download by clicking Retry When we run out of space in the Uemis filesystem we return an error. The user could reasonably unplug the SDA, insert it again and then retry to continue the download (that's what we tell them to do). In that case we need to make sure we start at the correct dive otherwise the same dives keep getting downloaded over and over again. Signed-off-by: Dirk Hohndel --- qt-ui/downloadfromdivecomputer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'qt-ui/downloadfromdivecomputer.cpp') diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index c7a48c46b..04c78b998 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -1,6 +1,9 @@ #include "downloadfromdivecomputer.h" #include "helpers.h" #include "mainwindow.h" +#include "divelistview.h" +#include "display.h" +#include "uemis.h" #include #include @@ -282,6 +285,14 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked() diveImportedModel->clearTable(); clear_table(&downloadTable); } + if (ui.vendor->currentText() == "Uemis") { + if (currentState == ERROR && downloadTable.nr > 0) + // let the uemis code know how far we've gotten + uemis_set_max_diveid_from_dialog(downloadTable.dives[downloadTable.nr - 1]->dc.diveid); + else + // fresh download, so only look at what's in the dive_table + uemis_set_max_diveid_from_dialog(0); + } updateState(DOWNLOADING); // you cannot cancel the dialog, just the download -- cgit v1.2.3-70-g09d2