mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <dirk@hohndel.org>
This commit is contained in:
parent
e9ba8f0ff6
commit
8bbb3dfe42
3 changed files with 20 additions and 1 deletions
|
@ -814,6 +814,13 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char *
|
|||
return true;
|
||||
}
|
||||
|
||||
static int max_diveid_from_dialog;
|
||||
|
||||
void uemis_set_max_diveid_from_dialog(int diveid)
|
||||
{
|
||||
max_diveid_from_dialog = diveid;
|
||||
}
|
||||
|
||||
static char *uemis_get_divenr(char *deviceidstr)
|
||||
{
|
||||
uint32_t deviceid, maxdiveid = 0;
|
||||
|
@ -831,7 +838,7 @@ static char *uemis_get_divenr(char *deviceidstr)
|
|||
maxdiveid = dc->diveid;
|
||||
}
|
||||
}
|
||||
snprintf(divenr, 10, "%d", maxdiveid);
|
||||
snprintf(divenr, 10, "%d", maxdiveid > max_diveid_from_dialog ? maxdiveid : max_diveid_from_dialog);
|
||||
return strdup(divenr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue