mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 04:44:08 +02:00
handle application title change for place name change
This commit is contained in:
parent
92b8cd2d1e
commit
6e1ba17c6e
3 changed files with 14 additions and 3 deletions
|
@ -306,6 +306,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
// use our MyAvatar position and quat for address manager path
|
||||
addressManager->setPositionGetter(getPositionForPath);
|
||||
addressManager->setOrientationGetter(getOrientationForPath);
|
||||
|
||||
connect(addressManager.data(), &AddressManager::rootPlaceNameChanged, this, &Application::updateWindowTitle);
|
||||
|
||||
_settings = new QSettings(this);
|
||||
_numChangedSettings = 0;
|
||||
|
|
|
@ -181,8 +181,6 @@ void AddressManager::goToAddressFromObject(const QVariantMap& dataObject) {
|
|||
locationMap = dataObject[DATA_OBJECT_USER_LOCATION_KEY].toMap();
|
||||
}
|
||||
|
||||
qDebug() << locationMap;
|
||||
|
||||
if (!locationMap.isEmpty()) {
|
||||
const QString LOCATION_API_ROOT_KEY = "root";
|
||||
const QString LOCATION_API_DOMAIN_KEY = "domain";
|
||||
|
@ -222,7 +220,8 @@ void AddressManager::goToAddressFromObject(const QVariantMap& dataObject) {
|
|||
|
||||
// set our current root place name to the name that came back
|
||||
const QString PLACE_NAME_KEY = "name";
|
||||
_rootPlaceName = rootMap[PLACE_NAME_KEY].toString();
|
||||
QString newRootPlaceName = rootMap[PLACE_NAME_KEY].toString();
|
||||
setRootPlaceName(newRootPlaceName);
|
||||
|
||||
// take the path that came back
|
||||
const QString PLACE_PATH_KEY = "path";
|
||||
|
@ -384,6 +383,13 @@ bool AddressManager::handleUsername(const QString& lookupString) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void AddressManager::setRootPlaceName(const QString& rootPlaceName) {
|
||||
if (rootPlaceName != _rootPlaceName) {
|
||||
_rootPlaceName = rootPlaceName;
|
||||
emit rootPlaceNameChanged(_rootPlaceName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void AddressManager::setDomainInfo(const QString& hostname, quint16 port) {
|
||||
_rootPlaceName = hostname;
|
||||
|
|
|
@ -43,7 +43,9 @@ public:
|
|||
const QString currentPath(bool withOrientation = true) const;
|
||||
|
||||
const QUuid& getRootPlaceID() const { return _rootPlaceID; }
|
||||
|
||||
const QString& getRootPlaceName() const { return _rootPlaceName; }
|
||||
void setRootPlaceName(const QString& rootPlaceName);
|
||||
|
||||
void attemptPlaceNameLookup(const QString& lookupString);
|
||||
|
||||
|
@ -68,6 +70,7 @@ signals:
|
|||
void locationChangeRequired(const glm::vec3& newPosition,
|
||||
bool hasOrientationChange, const glm::quat& newOrientation,
|
||||
bool shouldFaceLocation);
|
||||
void rootPlaceNameChanged(const QString& newRootPlaceName);
|
||||
protected:
|
||||
AddressManager();
|
||||
private slots:
|
||||
|
|
Loading…
Reference in a new issue