summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-09 12:43:06 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-09 12:50:22 -0700
commitd2a5bf87c4ea5280f552ee6b08554b310b78fdef (patch)
treeabcf7c29100a40e32f9aa1a862611247bc9ec63e /core
parent55df5979941c924ce66b491f54ccbad0c3e7c232 (diff)
downloadsubsurface-d2a5bf87c4ea5280f552ee6b08554b310b78fdef.tar.gz
QML UI: add dev_info data to AppLog
This should make it easier to tell how far we get downloading data from dive computers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r--core/libdivecomputer.c3
-rw-r--r--core/libdivecomputer.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c
index a44e4a1ca..6361a593e 100644
--- a/core/libdivecomputer.c
+++ b/core/libdivecomputer.c
@@ -37,6 +37,7 @@
char *dumpfile_name;
char *logfile_name;
const char *progress_bar_text = "";
+void (*progress_callback)(const char *text) = NULL;
double progress_bar_fraction = 0.0;
static int stoptime, stopdepth, ndl, po2, cns;
@@ -484,6 +485,8 @@ static void dev_info(device_data_t *devdata, const char *fmt, ...)
vsnprintf(buffer, sizeof(buffer), fmt, ap);
va_end(ap);
progress_bar_text = buffer;
+ if (progress_callback)
+ (*progress_callback)(buffer);
}
static int import_dive_number = 0;
diff --git a/core/libdivecomputer.h b/core/libdivecomputer.h
index 83a6bab79..3986b629e 100644
--- a/core/libdivecomputer.h
+++ b/core/libdivecomputer.h
@@ -52,6 +52,7 @@ dc_descriptor_t *get_descriptor(dc_family_t type, unsigned int model);
extern int import_thread_cancelled;
extern const char *progress_bar_text;
+extern void (*progress_callback)(const char *text);
extern double progress_bar_fraction;
extern char *logfile_name;
extern char *dumpfile_name;