core: add additional notification callback

Especially on slower devices with a large dive list the startup time has
become really long. This callback allows us to give the user an idea of
what the app is doing during that time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-04-01 06:55:12 -07:00
parent a37499bccd
commit f58bc91d8b
2 changed files with 10 additions and 0 deletions

View file

@ -1642,6 +1642,15 @@ char *copy_qstring(const QString &s)
return strdup(qPrintable(s));
}
// function to call to allow the UI to show updates for longer running activities
void (*uiNotificationCallback)(QString msg) = nullptr;
void uiNotification(const QString &msg)
{
if (uiNotificationCallback != nullptr)
uiNotificationCallback(msg);
}
// function to call to get changes for a git commit
QString (*changesCallback)() = nullptr;

View file

@ -85,6 +85,7 @@ QString getUserAgent();
QString printGPSCoords(const location_t *loc);
extern QString (*changesCallback)();
void uiNotification(const QString &msg);
#if defined __APPLE__
#define TITLE_OR_TEXT(_t, _m) "", _t + "\n" + _m