From 7e7c4bd5804682e8f977abec64d5e8cbc3c8a313 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 18 Sep 2014 10:09:57 -0700 Subject: [PATCH 1/2] 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) { From 9f3d908d9f87972e53b750a32f5876a591047fc7 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 18 Sep 2014 13:32:01 -0700 Subject: [PATCH 2/2] fix typo in comment --- interface/src/ui/DataWebDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/ui/DataWebDialog.cpp b/interface/src/ui/DataWebDialog.cpp index 9a67da48a8..0f70537b26 100644 --- a/interface/src/ui/DataWebDialog.cpp +++ b/interface/src/ui/DataWebDialog.cpp @@ -26,7 +26,7 @@ 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 + // have the page delegate 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