mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +02:00
allow moving of location from DataWebDialog for locations
This commit is contained in:
parent
84df6058cb
commit
523a4e6ba2
3 changed files with 58 additions and 6 deletions
|
@ -14,9 +14,9 @@
|
|||
|
||||
#include <AccountManager.h>
|
||||
#include <LimitedNodeList.h>
|
||||
#include <OAuthNetworkAccessManager.h>
|
||||
|
||||
#include "Application.h"
|
||||
#include "DataWebPage.h"
|
||||
|
||||
#include "DataWebDialog.h"
|
||||
|
||||
|
@ -24,11 +24,8 @@ DataWebDialog::DataWebDialog() {
|
|||
// make sure the dialog deletes itself when it closes
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
// use an OAuthNetworkAccessManager instead of regular QNetworkAccessManager so our requests are authed
|
||||
page()->setNetworkAccessManager(OAuthNetworkAccessManager::getInstance());
|
||||
|
||||
// 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);
|
||||
// set our page to a DataWebPage
|
||||
setPage(new DataWebPage(this));
|
||||
|
||||
// have the Application handle external links
|
||||
connect(this, &QWebView::linkClicked, Application::getInstance(), &Application::openUrl);
|
||||
|
|
31
interface/src/ui/DataWebPage.cpp
Normal file
31
interface/src/ui/DataWebPage.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// DataWebPage.cpp
|
||||
// interface/src/ui
|
||||
//
|
||||
// Created by Stephen Birarda on 2014-09-22.
|
||||
// Copyright 2014 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include <OAuthNetworkAccessManager.h>
|
||||
|
||||
#include "DataWebPage.h"
|
||||
|
||||
DataWebPage::DataWebPage(QObject* parent) :
|
||||
QWebPage(parent)
|
||||
{
|
||||
// use an OAuthNetworkAccessManager instead of regular QNetworkAccessManager so our requests are authed
|
||||
setNetworkAccessManager(OAuthNetworkAccessManager::getInstance());
|
||||
|
||||
// have the page delegate external links so they can be captured by the Application in case they are a hifi link
|
||||
setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
|
||||
|
||||
// give the page an empty stylesheet
|
||||
settings()->setUserStyleSheetUrl(QUrl());
|
||||
}
|
||||
|
||||
void DataWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID) {
|
||||
qDebug() << "JS console message at line" << lineNumber << "from" << sourceID << "-" << message;
|
||||
}
|
24
interface/src/ui/DataWebPage.h
Normal file
24
interface/src/ui/DataWebPage.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// DataWebPage.h
|
||||
// interface/src/ui
|
||||
//
|
||||
// Created by Stephen Birarda on 2014-09-22.
|
||||
// Copyright 2014 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#ifndef hifi_DataWebPage_h
|
||||
#define hifi_DataWebPage_h
|
||||
|
||||
#include <qwebpage.h>
|
||||
|
||||
class DataWebPage : public QWebPage {
|
||||
public:
|
||||
DataWebPage(QObject* parent = 0);
|
||||
protected:
|
||||
void javaScriptConsoleMessage(const QString & message, int lineNumber, const QString & sourceID);
|
||||
};
|
||||
|
||||
#endif // hifi_DataWebPage_h
|
Loading…
Reference in a new issue