From 7e7c4bd5804682e8f977abec64d5e8cbc3c8a313 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 18 Sep 2014 10:09:57 -0700 Subject: [PATCH] handle hifi urls emitted from DataWebDialog --- interface/src/ui/DataWebDialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/interface/src/ui/DataWebDialog.cpp b/interface/src/ui/DataWebDialog.cpp index 9914383220..9a67da48a8 100644 --- a/interface/src/ui/DataWebDialog.cpp +++ b/interface/src/ui/DataWebDialog.cpp @@ -15,6 +15,8 @@ #include #include +#include "Application.h" + #include "DataWebDialog.h" DataWebDialog::DataWebDialog() { @@ -23,6 +25,12 @@ DataWebDialog::DataWebDialog() { // use an OAuthNetworkAccessManager instead of regular QNetworkAccessManager so our requests are authed page()->setNetworkAccessManager(OAuthNetworkAccessManager::getInstance()); + + // have the page delete external links so they can be captured by the Application in case they are a hifi link + page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks); + + // have the Application handle external links + connect(this, &QWebView::linkClicked, Application::getInstance(), &Application::openUrl); } DataWebDialog* DataWebDialog::dialogForPath(const QString& path) {