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:
Michael Keller 2023-06-14 12:48:56 +12:00 committed by bstoeger
parent a0cb6ad6d7
commit b0d5b23227

View file

@ -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 */