From a49097789a2e5fb67d0526b1e77ad0fb2d4c8505 Mon Sep 17 00:00:00 2001
From: Seth Alves <seth.alves@gmail.com>
Date: Wed, 31 Jan 2018 13:32:19 -0800
Subject: [PATCH] =?UTF-8?q?Revert=20"AddressBar=20trigger=20implemented.?=
 =?UTF-8?q?=20Fixed=20warnings=20on=20non=20existing=20contex=E2=80=A6"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 interface/src/Menu.cpp                     |  2 +-
 interface/src/ui/AddressBarDialog.h        |  2 +-
 interface/src/ui/DialogsManager.cpp        | 22 ++--------------------
 interface/src/ui/DialogsManager.h          |  4 +---
 interface/src/ui/overlays/Web3DOverlay.cpp |  7 -------
 5 files changed, 5 insertions(+), 32 deletions(-)

diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp
index f3d8ea2344..50e25287f1 100644
--- a/interface/src/Menu.cpp
+++ b/interface/src/Menu.cpp
@@ -282,7 +282,7 @@ Menu::Menu() {
 
     // Navigate > Show Address Bar
     addActionToQMenuAndActionHash(navigateMenu, MenuOption::AddressBar, Qt::CTRL | Qt::Key_L,
-        dialogsManager.data(), SLOT(toggleAddressBar()));
+        dialogsManager.data(), SLOT(showAddressBar()));
 
     // Navigate > LocationBookmarks related menus -- Note: the LocationBookmarks class adds its own submenus here.
     auto locationBookmarks = DependencyManager::get<LocationBookmarks>();
diff --git a/interface/src/ui/AddressBarDialog.h b/interface/src/ui/AddressBarDialog.h
index 7806436774..66f208ca90 100644
--- a/interface/src/ui/AddressBarDialog.h
+++ b/interface/src/ui/AddressBarDialog.h
@@ -22,7 +22,7 @@ class AddressBarDialog : public OffscreenQmlDialog {
     Q_PROPERTY(bool backEnabled READ backEnabled NOTIFY backEnabledChanged)
     Q_PROPERTY(bool forwardEnabled READ forwardEnabled NOTIFY forwardEnabledChanged)
     Q_PROPERTY(bool useFeed READ useFeed WRITE setUseFeed NOTIFY useFeedChanged)
-    Q_PROPERTY(QString metaverseServerUrl READ metaverseServerUrl CONSTANT)
+    Q_PROPERTY(QString metaverseServerUrl READ metaverseServerUrl)
 
 public:
     AddressBarDialog(QQuickItem* parent = nullptr);
diff --git a/interface/src/ui/DialogsManager.cpp b/interface/src/ui/DialogsManager.cpp
index 310a4cc1cd..ff2d4868df 100644
--- a/interface/src/ui/DialogsManager.cpp
+++ b/interface/src/ui/DialogsManager.cpp
@@ -58,7 +58,7 @@ void DialogsManager::showAddressBar() {
         hmd->openTablet();
     }
     qApp->setKeyboardFocusOverlay(hmd->getCurrentTabletScreenID());
-    setAddressBarVisible(true);
+    emit addressBarShown(true);
 }
 
 void DialogsManager::hideAddressBar() {
@@ -71,7 +71,7 @@ void DialogsManager::hideAddressBar() {
         hmd->closeTablet();
     }
     qApp->setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID);
-    setAddressBarVisible(false);
+    emit addressBarShown(false);
 }
 
 void DialogsManager::showFeed() {
@@ -157,24 +157,6 @@ void DialogsManager::hmdToolsClosed() {
     }
 }
 
-void DialogsManager::toggleAddressBar() {
-    auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
-    auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
-
-    const bool addressBarLoaded = tablet->isPathLoaded(TABLET_ADDRESS_DIALOG);
-
-    if (_addressBarVisible || addressBarLoaded) {
-        hideAddressBar();
-    } else {
-        showAddressBar();
-    }
-}
-
-void DialogsManager::setAddressBarVisible(bool addressBarVisible) {
-    _addressBarVisible = addressBarVisible;
-    emit addressBarShown(_addressBarVisible);
-}
-
 void DialogsManager::showTestingResults() {
     if (!_testingDialog) {
         _testingDialog = new TestingDialog(qApp->getWindow());
diff --git a/interface/src/ui/DialogsManager.h b/interface/src/ui/DialogsManager.h
index f17ac39a7e..3a40b15a3b 100644
--- a/interface/src/ui/DialogsManager.h
+++ b/interface/src/ui/DialogsManager.h
@@ -39,7 +39,6 @@ public:
     QPointer<OctreeStatsDialog> getOctreeStatsDialog() const { return _octreeStatsDialog; }
     QPointer<TestingDialog> getTestingDialog() const { return _testingDialog; }
     void emitAddressBarShown(bool visible) { emit addressBarShown(visible); }
-    void setAddressBarVisible(bool addressBarVisible);
 
 public slots:
     void showAddressBar();
@@ -53,7 +52,6 @@ public slots:
     void hmdTools(bool showTools);
     void showDomainConnectionDialog();
     void showTestingResults();
-    void toggleAddressBar();
     
     // Application Update
     void showUpdateDialog();
@@ -80,7 +78,7 @@ private:
     QPointer<OctreeStatsDialog> _octreeStatsDialog;
     QPointer<TestingDialog> _testingDialog;
     QPointer<DomainConnectionDialog> _domainConnectionDialog;
-    bool _addressBarVisible { false };
+    bool _closeAddressBar { false };
 };
 
 #endif // hifi_DialogsManager_h
diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp
index 076b0f0114..8121b985cb 100644
--- a/interface/src/ui/overlays/Web3DOverlay.cpp
+++ b/interface/src/ui/overlays/Web3DOverlay.cpp
@@ -72,13 +72,6 @@ Web3DOverlay::Web3DOverlay() {
     connect(this, &Web3DOverlay::requestWebSurface, this, &Web3DOverlay::buildWebSurface);
     connect(this, &Web3DOverlay::releaseWebSurface, this, &Web3DOverlay::destroyWebSurface);
     connect(this, &Web3DOverlay::resizeWebSurface, this, &Web3DOverlay::onResizeWebSurface);
-
-    //need to be intialized before Tablet 1st open
-    _webSurface = DependencyManager::get<OffscreenQmlSurfaceCache>()->acquire(_url);
-    _webSurface->getSurfaceContext()->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data());
-    _webSurface->getSurfaceContext()->setContextProperty("Account", GlobalServicesScriptingInterface::getInstance());
-    _webSurface->getSurfaceContext()->setContextProperty("AddressManager", DependencyManager::get<AddressManager>().data());
-
 }
 
 Web3DOverlay::Web3DOverlay(const Web3DOverlay* Web3DOverlay) :