mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Show dive import error messages in the import dialog
.. not in the main window. And leave the import dialog open, so that you can either try doing it again, or cancel. This makes it much easier to re-try a failed dive import, and actually makes the failure more obvious too. Todo: - make the "Ok" button change to "Retry" when an error happens - try to see if we can catch the actual status update messages from libdivecomputer and show them too in the import dialog. Right now they are printed out to stderr by the library. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c8f3dc3594
commit
b0ba22a068
3 changed files with 30 additions and 8 deletions
|
@ -18,7 +18,7 @@
|
|||
#define NOT_FROG
|
||||
#endif
|
||||
|
||||
static void error(const char *fmt, ...)
|
||||
static GError *error(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
GError *error;
|
||||
|
@ -28,8 +28,7 @@ static void error(const char *fmt, ...)
|
|||
g_quark_from_string("subsurface"),
|
||||
DIVE_ERROR_PARSE, fmt, args);
|
||||
va_end(args);
|
||||
report_error(error);
|
||||
g_error_free(error);
|
||||
return error;
|
||||
}
|
||||
|
||||
static parser_status_t create_parser(device_data_t *devdata, parser_t **parser)
|
||||
|
@ -512,7 +511,7 @@ static void *pthread_wrapper(void *_data)
|
|||
return (void *)err_string;
|
||||
}
|
||||
|
||||
void do_import(device_data_t *data)
|
||||
GError *do_import(device_data_t *data)
|
||||
{
|
||||
pthread_t pthread;
|
||||
void *retval;
|
||||
|
@ -527,7 +526,8 @@ void do_import(device_data_t *data)
|
|||
if (pthread_join(pthread, &retval) < 0)
|
||||
retval = "Odd pthread error return";
|
||||
if (retval)
|
||||
error(retval, data->name, data->devname);
|
||||
return error(retval, data->name, data->devname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue