mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
CR changes
This commit is contained in:
parent
c009834685
commit
b8f5a9d22f
4 changed files with 46 additions and 42 deletions
|
@ -218,9 +218,9 @@ ScrollingWindow {
|
||||||
onIconChanged: {
|
onIconChanged: {
|
||||||
console.log("New icon: " + icon)
|
console.log("New icon: " + icon)
|
||||||
}
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
desktop.initWebviewProfileHandlers(webview.profile)
|
desktop.initWebviewProfileHandlers(webview.profile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//profile: desktop.browserProfile
|
//profile: desktop.browserProfile
|
||||||
|
|
|
@ -20,12 +20,14 @@ import "controls-uit" as Controls
|
||||||
import "styles"
|
import "styles"
|
||||||
import "styles-uit"
|
import "styles-uit"
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
id: marketplaceComboBox
|
id: marketplaceComboBox
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: hifi.colors.baseGrayShadow
|
color: hifi.colors.baseGrayShadow
|
||||||
property var currentUrl: "https://metaverse.highfidelity.com/marketplace"
|
property var currentUrl: "https://metaverse.highfidelity.com/marketplace"
|
||||||
|
|
||||||
Controls.WebView {
|
Controls.WebView {
|
||||||
id: webview
|
id: webview
|
||||||
url: currentUrl
|
url: currentUrl
|
||||||
|
@ -33,6 +35,46 @@ Rectangle {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height - 40
|
height: parent.height - 40
|
||||||
focus: true
|
focus: true
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: zipTimer
|
||||||
|
running: false
|
||||||
|
repeat: false
|
||||||
|
interval: 1500
|
||||||
|
property var handler;
|
||||||
|
onTriggered: handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
property var autoCancel: 'var element = $("a.btn.cancel");
|
||||||
|
element.click();'
|
||||||
|
|
||||||
|
onNewViewRequested: {
|
||||||
|
console.log("new view requested url");
|
||||||
|
var component = Qt.createComponent("Browser.qml");
|
||||||
|
var newWindow = component.createObject(desktop);
|
||||||
|
request.openIn(newWindow.webView);
|
||||||
|
if (File.testUrl(desktop.currentUrl)) {
|
||||||
|
zipTimer.handler = function() {
|
||||||
|
newWindow.destroy();
|
||||||
|
runJavaScript(autoCancel);
|
||||||
|
}
|
||||||
|
zipTimer.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
property var simpleDownload: 'var element = $("a.download-file");
|
||||||
|
element.removeClass("download-file");
|
||||||
|
element.removeAttr("download");'
|
||||||
|
|
||||||
|
onLinkHovered: {
|
||||||
|
desktop.currentUrl = hoveredUrl
|
||||||
|
console.log("my url in WebView: " + desktop.currentUrl)
|
||||||
|
if (File.testUrl(desktop.currentUrl)) {
|
||||||
|
runJavaScript(simpleDownload, function(){console.log("ran the JS");});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.ComboBox {
|
Controls.ComboBox {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
import QtQuick 2.5
|
import QtQuick 2.3
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
import QtWebChannel 1.0
|
import QtWebChannel 1.0
|
||||||
import QtWebEngine 1.1
|
import QtWebEngine 1.1
|
||||||
|
|
|
@ -62,44 +62,6 @@ WebEngineView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: zipTimer
|
|
||||||
running: false
|
|
||||||
repeat: false
|
|
||||||
interval: 1500
|
|
||||||
property var handler;
|
|
||||||
onTriggered: handler();
|
|
||||||
}
|
|
||||||
|
|
||||||
property var autoCancel: 'var element = $("a.btn.cancel");
|
|
||||||
element.click();'
|
|
||||||
|
|
||||||
onNewViewRequested: {
|
|
||||||
console.log("new view requested url");
|
|
||||||
var component = Qt.createComponent("../Browser.qml");
|
|
||||||
var newWindow = component.createObject(desktop);
|
|
||||||
request.openIn(newWindow.webView);
|
|
||||||
if (File.testUrl(desktop.currentUrl)) {
|
|
||||||
zipTimer.handler = function() {
|
|
||||||
newWindow.destroy();
|
|
||||||
runJavaScript(autoCancel);
|
|
||||||
}
|
|
||||||
zipTimer.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property var simpleDownload: 'var element = $("a.download-file");
|
|
||||||
element.removeClass("download-file");
|
|
||||||
element.removeAttr("download");'
|
|
||||||
|
|
||||||
onLinkHovered: {
|
|
||||||
desktop.currentUrl = hoveredUrl
|
|
||||||
console.log("my url in WebView: " + desktop.currentUrl)
|
|
||||||
if (File.testUrl(desktop.currentUrl)) {
|
|
||||||
runJavaScript(simpleDownload, function(){console.log("ran the JS");});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// This breaks the webchannel used for passing messages. Fixed in Qt 5.6
|
// This breaks the webchannel used for passing messages. Fixed in Qt 5.6
|
||||||
// See https://bugreports.qt.io/browse/QTBUG-49521
|
// See https://bugreports.qt.io/browse/QTBUG-49521
|
||||||
|
|
Loading…
Reference in a new issue