History

handle hifi urls emitted from DataWebDialog

Stephen Birarda committed 12 years ago

Commit 7e7c4bd1 parent 929e4631 file · +8 −0Browse files

Showing the changes to interface/src/ui/DataWebDialog.cpp (1 of 1 file). Show all

Unified · Split

interface/src/ui/DataWebDialog.cpp+8−0
@@ -15,6 +15,8 @@ · 14 unmodified lines
1515 #include <LimitedNodeList.h>
1616 #include <OAuthNetworkAccessManager.h>
1717
18+#include "Application.h"
19+
1820 #include "DataWebDialog.h"
1921
2022 DataWebDialog::DataWebDialog() {
@@ -23,6 +25,12 @@ DataWebDialog::DataWebDialog() { · 2 unmodified lines
2325
2426 // use an OAuthNetworkAccessManager instead of regular QNetworkAccessManager so our requests are authed
2527 page()->setNetworkAccessManager(OAuthNetworkAccessManager::getInstance());
28+
29+ // have the page delete external links so they can be captured by the Application in case they are a hifi link
30+ page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
31+
32+ // have the Application handle external links
33+ connect(this, &QWebView::linkClicked, Application::getInstance(), &Application::openUrl);
2634 }
2735
2836 DataWebDialog* DataWebDialog::dialogForPath(const QString& path) {