diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-02 12:49:03 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-02 12:49:03 -0700 |
commit | b0ba22a06879697efa7c429b9df8e13feaa02480 (patch) | |
tree | 7b5391ba66ea08de8e296c7abcd97a0a96fd9fec /libdivecomputer.c | |
parent | c8f3dc3594aa850829ab87ac7d290776dfb846bd (diff) | |
download | subsurface-b0ba22a06879697efa7c429b9df8e13feaa02480.tar.gz |
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>
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r-- | libdivecomputer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c index 14f794e8c..4495b1716 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -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; } /* |