From c5c1ead4003efc2e638ddd85d3a7ddf6eb1d42de Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Nov 2017 10:51:21 +1300 Subject: [PATCH] Fix GOTO dialog's connection status and location not always updating --- interface/resources/qml/hifi/tablet/TabletAddressDialog.qml | 6 +++--- interface/src/ui/AddressBarDialog.cpp | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml index 4e546ffa0d..5f1fa2900c 100644 --- a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml @@ -84,7 +84,6 @@ StackView { anchors.centerIn = parent; } - function resetAfterTeleport() { //storyCardFrame.shown = root.shown = false; } @@ -135,7 +134,8 @@ StackView { bottom: parent.bottom } - onHostChanged: updateLocationTextTimer.start(); + onHostChanged: updateLocationTextTimer.restart(); + Rectangle { id: navBar width: parent.width @@ -358,7 +358,7 @@ StackView { // Delay updating location text a bit to avoid flicker of content and so that connection status is valid. id: updateLocationTextTimer running: false - interval: 500 // ms + interval: 1000 // ms repeat: false onTriggered: updateLocationText(false); } diff --git a/interface/src/ui/AddressBarDialog.cpp b/interface/src/ui/AddressBarDialog.cpp index 8b5e255b06..1a23674fa3 100644 --- a/interface/src/ui/AddressBarDialog.cpp +++ b/interface/src/ui/AddressBarDialog.cpp @@ -40,6 +40,10 @@ AddressBarDialog::AddressBarDialog(QQuickItem* parent) : OffscreenQmlDialog(pare _backEnabled = !(DependencyManager::get()->getBackStack().isEmpty()); _forwardEnabled = !(DependencyManager::get()->getForwardStack().isEmpty()); connect(addressManager.data(), &AddressManager::hostChanged, this, &AddressBarDialog::hostChanged); + auto nodeList = DependencyManager::get(); + const DomainHandler& domainHandler = nodeList->getDomainHandler(); + connect(&domainHandler, &DomainHandler::connectedToDomain, this, &AddressBarDialog::hostChanged); + connect(&domainHandler, &DomainHandler::disconnectedFromDomain, this, &AddressBarDialog::hostChanged); connect(DependencyManager::get().data(), &DialogsManager::setUseFeed, this, &AddressBarDialog::setUseFeed); connect(qApp, &Application::receivedHifiSchemeURL, this, &AddressBarDialog::receivedHifiSchemeURL); }