mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Desktop: Add Meaningful Error Messages for libdivecomputer Dump.
Add meaningful error messages when creating a libdivecomputer dump. In particular show if creating a dump is not supported on the dive computer that is used. Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
parent
a0cb6ad6d7
commit
b0d5b23227
1 changed files with 14 additions and 4 deletions
|
@ -1138,13 +1138,23 @@ static const char *do_device_import(device_data_t *data)
|
|||
}
|
||||
|
||||
dc_buffer_free(buffer);
|
||||
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
progress_bar_fraction = 0.0;
|
||||
|
||||
if (rc == DC_STATUS_UNSUPPORTED)
|
||||
return translate("gettextFromC", "Dumping not supported on this device");
|
||||
|
||||
return translate("gettextFromC", "Dive data dumping error");
|
||||
}
|
||||
} else {
|
||||
rc = dc_device_foreach(device, dive_cb, data);
|
||||
}
|
||||
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
progress_bar_fraction = 0.0;
|
||||
return translate("gettextFromC", "Dive data import error");
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
progress_bar_fraction = 0.0;
|
||||
|
||||
return translate("gettextFromC", "Dive data import error");
|
||||
}
|
||||
}
|
||||
|
||||
/* All good */
|
||||
|
|
Loading…
Reference in a new issue