mirror of
https://github.com/lubosz/overte.git
synced 2025-08-06 02:56:13 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into dev319
This commit is contained in:
commit
e4e8fe4d34
3 changed files with 15 additions and 17 deletions
|
@ -1225,8 +1225,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool isStore = property(hifi::properties::OCULUS_STORE).toBool();
|
bool isStore = property(hifi::properties::OCULUS_STORE).toBool();
|
||||||
|
// Or we could make it a separate arg, or if either arg is set, etc. And should this instead by a hifi::properties?
|
||||||
DependencyManager::get<WalletScriptingInterface>()->setLimitedCommerce(isStore); // Or we could make it a separate arg, or if either arg is set, etc. And should this instead by a hifi::properties?
|
DependencyManager::get<WalletScriptingInterface>()->setLimitedCommerce(isStore || property(hifi::properties::STEAM).toBool());
|
||||||
|
|
||||||
updateHeartbeat();
|
updateHeartbeat();
|
||||||
|
|
||||||
|
|
|
@ -136,12 +136,16 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap
|
||||||
if (properties.contains(PRESENTATION_MODE_PROPERTY)) {
|
if (properties.contains(PRESENTATION_MODE_PROPERTY)) {
|
||||||
presentationMode = (InteractiveWindowPresentationMode) properties[PRESENTATION_MODE_PROPERTY].toInt();
|
presentationMode = (InteractiveWindowPresentationMode) properties[PRESENTATION_MODE_PROPERTY].toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_interactiveWindowProxy = std::unique_ptr<InteractiveWindowProxy,
|
||||||
|
std::function<void(InteractiveWindowProxy*)>>(new InteractiveWindowProxy, [](InteractiveWindowProxy *p) {
|
||||||
|
p->deleteLater();
|
||||||
|
});
|
||||||
|
|
||||||
if (!_interactiveWindowProxy) {
|
connect(_interactiveWindowProxy.get(), &InteractiveWindowProxy::webEventReceived,
|
||||||
_interactiveWindowProxy = new InteractiveWindowProxy();
|
this, &InteractiveWindow::emitWebEvent, Qt::QueuedConnection);
|
||||||
QObject::connect(_interactiveWindowProxy, &InteractiveWindowProxy::webEventReceived, this, &InteractiveWindow::emitWebEvent, Qt::QueuedConnection);
|
connect(this, &InteractiveWindow::scriptEventReceived, _interactiveWindowProxy.get(),
|
||||||
QObject::connect(this, &InteractiveWindow::scriptEventReceived, _interactiveWindowProxy, &InteractiveWindowProxy::emitScriptEvent, Qt::QueuedConnection);
|
&InteractiveWindowProxy::emitScriptEvent, Qt::QueuedConnection);
|
||||||
}
|
|
||||||
|
|
||||||
if (properties.contains(DOCKED_PROPERTY) && presentationMode == InteractiveWindowPresentationMode::Native) {
|
if (properties.contains(DOCKED_PROPERTY) && presentationMode == InteractiveWindowPresentationMode::Native) {
|
||||||
QVariantMap nativeWindowInfo = properties[DOCKED_PROPERTY].toMap();
|
QVariantMap nativeWindowInfo = properties[DOCKED_PROPERTY].toMap();
|
||||||
|
@ -161,7 +165,7 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap
|
||||||
_dockWidget = std::shared_ptr<DockWidget>(new DockWidget(title, mainWindow), dockWidgetDeleter);
|
_dockWidget = std::shared_ptr<DockWidget>(new DockWidget(title, mainWindow), dockWidgetDeleter);
|
||||||
auto quickView = _dockWidget->getQuickView();
|
auto quickView = _dockWidget->getQuickView();
|
||||||
|
|
||||||
Application::setupQmlSurface(quickView->rootContext() , true);
|
Application::setupQmlSurface(quickView->rootContext(), true);
|
||||||
|
|
||||||
//add any whitelisted callbacks
|
//add any whitelisted callbacks
|
||||||
OffscreenUi::applyWhiteList(sourceUrl, quickView->rootContext());
|
OffscreenUi::applyWhiteList(sourceUrl, quickView->rootContext());
|
||||||
|
@ -201,7 +205,7 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap
|
||||||
QObject::connect(quickView.get(), &QQuickView::statusChanged, [&, this] (QQuickView::Status status) {
|
QObject::connect(quickView.get(), &QQuickView::statusChanged, [&, this] (QQuickView::Status status) {
|
||||||
if (status == QQuickView::Ready) {
|
if (status == QQuickView::Ready) {
|
||||||
QQuickItem* rootItem = _dockWidget->getRootItem();
|
QQuickItem* rootItem = _dockWidget->getRootItem();
|
||||||
_dockWidget->getQuickView()->rootContext()->setContextProperty(EVENT_BRIDGE_PROPERTY, _interactiveWindowProxy);
|
_dockWidget->getQuickView()->rootContext()->setContextProperty(EVENT_BRIDGE_PROPERTY, _interactiveWindowProxy.get());
|
||||||
// The qmlToScript method handles the thread-safety of this call. Because the QVariant argument
|
// The qmlToScript method handles the thread-safety of this call. Because the QVariant argument
|
||||||
// passed to the sendToScript signal may wrap an externally managed and thread-unsafe QJSValue,
|
// passed to the sendToScript signal may wrap an externally managed and thread-unsafe QJSValue,
|
||||||
// qmlToScript needs to be called directly, so the QJSValue can be immediately converted to a plain QVariant.
|
// qmlToScript needs to be called directly, so the QJSValue can be immediately converted to a plain QVariant.
|
||||||
|
@ -222,7 +226,7 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap
|
||||||
// Build the event bridge and wrapper on the main thread
|
// Build the event bridge and wrapper on the main thread
|
||||||
offscreenUi->loadInNewContext(CONTENT_WINDOW_QML, [&](QQmlContext* context, QObject* object) {
|
offscreenUi->loadInNewContext(CONTENT_WINDOW_QML, [&](QQmlContext* context, QObject* object) {
|
||||||
_qmlWindowProxy = std::shared_ptr<QmlWindowProxy>(new QmlWindowProxy(object, nullptr), qmlWindowProxyDeleter);
|
_qmlWindowProxy = std::shared_ptr<QmlWindowProxy>(new QmlWindowProxy(object, nullptr), qmlWindowProxyDeleter);
|
||||||
context->setContextProperty(EVENT_BRIDGE_PROPERTY, _interactiveWindowProxy);
|
context->setContextProperty(EVENT_BRIDGE_PROPERTY, _interactiveWindowProxy.get());
|
||||||
if (properties.contains(ADDITIONAL_FLAGS_PROPERTY)) {
|
if (properties.contains(ADDITIONAL_FLAGS_PROPERTY)) {
|
||||||
object->setProperty(ADDITIONAL_FLAGS_PROPERTY, properties[ADDITIONAL_FLAGS_PROPERTY].toUInt());
|
object->setProperty(ADDITIONAL_FLAGS_PROPERTY, properties[ADDITIONAL_FLAGS_PROPERTY].toUInt());
|
||||||
}
|
}
|
||||||
|
@ -313,10 +317,6 @@ void InteractiveWindow::close() {
|
||||||
_qmlWindowProxy->deleteLater();
|
_qmlWindowProxy->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_interactiveWindowProxy) {
|
|
||||||
_interactiveWindowProxy->deleteLater();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_dockWidget) {
|
if (_dockWidget) {
|
||||||
auto window = qApp->getWindow();
|
auto window = qApp->getWindow();
|
||||||
if (QThread::currentThread() != window->thread()) {
|
if (QThread::currentThread() != window->thread()) {
|
||||||
|
|
|
@ -41,7 +41,6 @@ class InteractiveWindowProxy : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
InteractiveWindowProxy(){}
|
InteractiveWindowProxy(){}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void emitScriptEvent(const QVariant& scriptMessage);
|
void emitScriptEvent(const QVariant& scriptMessage);
|
||||||
|
@ -53,7 +52,6 @@ signals:
|
||||||
void webEventReceived(const QVariant& message);
|
void webEventReceived(const QVariant& message);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
namespace InteractiveWindowEnums {
|
namespace InteractiveWindowEnums {
|
||||||
Q_NAMESPACE
|
Q_NAMESPACE
|
||||||
|
|
||||||
|
@ -325,7 +323,7 @@ protected slots:
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<QmlWindowProxy> _qmlWindowProxy;
|
std::shared_ptr<QmlWindowProxy> _qmlWindowProxy;
|
||||||
std::shared_ptr<DockWidget> _dockWidget { nullptr };
|
std::shared_ptr<DockWidget> _dockWidget { nullptr };
|
||||||
InteractiveWindowProxy *_interactiveWindowProxy{ nullptr };
|
std::unique_ptr<InteractiveWindowProxy, std::function<void(InteractiveWindowProxy*)>> _interactiveWindowProxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef InteractiveWindow* InteractiveWindowPointer;
|
typedef InteractiveWindow* InteractiveWindowPointer;
|
||||||
|
|
Loading…
Reference in a new issue