mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
QML UI: if we don't have a current position, update it later
Once we get a new fix we asynchronously update the text. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ca3be8f376
commit
1d95cc4cbf
3 changed files with 13 additions and 1 deletions
|
@ -177,6 +177,12 @@ Item {
|
|||
gpsText = manager.getCurrentPosition()
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: manager
|
||||
onWaitingForPositionChanged: {
|
||||
gpsText = manager.getCurrentPosition()
|
||||
}
|
||||
}
|
||||
|
||||
Controls.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
|
|
|
@ -1297,7 +1297,12 @@ QString QMLManager::getCurrentPosition()
|
|||
if (!hasLocationSource)
|
||||
return tr("Unknown GPS location");
|
||||
|
||||
return locationProvider->currentPosition();
|
||||
QString positionResponse = locationProvider->currentPosition();
|
||||
if (positionResponse == GPS_CURRENT_POS)
|
||||
connect(locationProvider, &GpsLocation::acquiredPosition, this, &QMLManager::waitingForPositionChanged, Qt::UniqueConnection);
|
||||
else
|
||||
disconnect(locationProvider, &GpsLocation::acquiredPosition, this, &QMLManager::waitingForPositionChanged);
|
||||
return positionResponse;
|
||||
}
|
||||
|
||||
void QMLManager::applyGpsData()
|
||||
|
|
|
@ -280,6 +280,7 @@ signals:
|
|||
void buddyListChanged();
|
||||
void divemasterListChanged();
|
||||
void locationListChanged();
|
||||
void waitingForPositionChanged();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue