mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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()
|
gpsText = manager.getCurrentPosition()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Connections {
|
||||||
|
target: manager
|
||||||
|
onWaitingForPositionChanged: {
|
||||||
|
gpsText = manager.getCurrentPosition()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
|
|
|
@ -1297,7 +1297,12 @@ QString QMLManager::getCurrentPosition()
|
||||||
if (!hasLocationSource)
|
if (!hasLocationSource)
|
||||||
return tr("Unknown GPS location");
|
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()
|
void QMLManager::applyGpsData()
|
||||||
|
|
|
@ -280,6 +280,7 @@ signals:
|
||||||
void buddyListChanged();
|
void buddyListChanged();
|
||||||
void divemasterListChanged();
|
void divemasterListChanged();
|
||||||
void locationListChanged();
|
void locationListChanged();
|
||||||
|
void waitingForPositionChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue