mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:03:23 +00:00
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>
This commit is contained in:
parent
55df597994
commit
d2a5bf87c4
3 changed files with 5 additions and 0 deletions
|
@ -37,6 +37,7 @@
|
||||||
char *dumpfile_name;
|
char *dumpfile_name;
|
||||||
char *logfile_name;
|
char *logfile_name;
|
||||||
const char *progress_bar_text = "";
|
const char *progress_bar_text = "";
|
||||||
|
void (*progress_callback)(const char *text) = NULL;
|
||||||
double progress_bar_fraction = 0.0;
|
double progress_bar_fraction = 0.0;
|
||||||
|
|
||||||
static int stoptime, stopdepth, ndl, po2, cns;
|
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);
|
vsnprintf(buffer, sizeof(buffer), fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
progress_bar_text = buffer;
|
progress_bar_text = buffer;
|
||||||
|
if (progress_callback)
|
||||||
|
(*progress_callback)(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int import_dive_number = 0;
|
static int import_dive_number = 0;
|
||||||
|
|
|
@ -52,6 +52,7 @@ dc_descriptor_t *get_descriptor(dc_family_t type, unsigned int model);
|
||||||
|
|
||||||
extern int import_thread_cancelled;
|
extern int import_thread_cancelled;
|
||||||
extern const char *progress_bar_text;
|
extern const char *progress_bar_text;
|
||||||
|
extern void (*progress_callback)(const char *text);
|
||||||
extern double progress_bar_fraction;
|
extern double progress_bar_fraction;
|
||||||
extern char *logfile_name;
|
extern char *logfile_name;
|
||||||
extern char *dumpfile_name;
|
extern char *dumpfile_name;
|
||||||
|
|
|
@ -93,6 +93,7 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
|
||||||
setShowPin(false);
|
setShowPin(false);
|
||||||
// create location manager service
|
// create location manager service
|
||||||
locationProvider = new GpsLocation(&appendTextToLogStandalone, this);
|
locationProvider = new GpsLocation(&appendTextToLogStandalone, this);
|
||||||
|
progress_callback = &appendTextToLogStandalone;
|
||||||
connect(locationProvider, SIGNAL(haveSourceChanged()), this, SLOT(hasLocationSourceChanged()));
|
connect(locationProvider, SIGNAL(haveSourceChanged()), this, SLOT(hasLocationSourceChanged()));
|
||||||
setLocationServiceAvailable(locationProvider->hasLocationsSource());
|
setLocationServiceAvailable(locationProvider->hasLocationsSource());
|
||||||
set_git_update_cb(&gitProgressCB);
|
set_git_update_cb(&gitProgressCB);
|
||||||
|
|
Loading…
Add table
Reference in a new issue