mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: show progress messages on the download page
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8e0895e429
commit
9111ce01e7
2 changed files with 13 additions and 3 deletions
|
@ -169,9 +169,10 @@ Kirigami.Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.Label {
|
Kirigami.Label {
|
||||||
text: qsTr(" Downloaded dives")
|
text: divesDownloaded ? qsTr(" Downloaded dives") :
|
||||||
|
(manager.progressMessage != "" ? qsTr("Info:") + " " + manager.progressMessage : qsTr(" No dives"))
|
||||||
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
|
|
|
@ -33,6 +33,15 @@ QMLManager *QMLManager::m_instance = NULL;
|
||||||
|
|
||||||
#define NOCLOUD_LOCALSTORAGE format_string("%s/cloudstorage/localrepo[master]", system_default_directory())
|
#define NOCLOUD_LOCALSTORAGE format_string("%s/cloudstorage/localrepo[master]", system_default_directory())
|
||||||
|
|
||||||
|
static void progressCallback(const char *text)
|
||||||
|
{
|
||||||
|
QMLManager *self = QMLManager::instance();
|
||||||
|
if (self) {
|
||||||
|
self->appendTextToLog(QString(text));
|
||||||
|
self->setProgressMessage(QString(text));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void appendTextToLogStandalone(const char *text)
|
static void appendTextToLogStandalone(const char *text)
|
||||||
{
|
{
|
||||||
QMLManager *self = QMLManager::instance();
|
QMLManager *self = QMLManager::instance();
|
||||||
|
@ -93,7 +102,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;
|
progress_callback = &progressCallback;
|
||||||
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
Add a link
Reference in a new issue