Make Clara.io download more robust

This commit is contained in:
David Rowe 2016-10-29 21:31:27 +13:00
parent 95c175ae74
commit 5e82410371
2 changed files with 9 additions and 15 deletions

View file

@ -23,6 +23,8 @@ ScrollingWindow {
property alias eventBridge: eventBridgeWrapper.eventBridge
signal loadingChanged(int status)
x: 100
y: 100
@ -243,6 +245,7 @@ ScrollingWindow {
if (loadRequest.status === WebEngineView.LoadSucceededStatus) {
addressBar.text = loadRequest.url
}
root.loadingChanged(loadRequest.status);
}
onIconChanged: {

View file

@ -40,15 +40,6 @@ Rectangle {
height: parent.height - statusBarHeight
focus: true
Timer {
id: zipTimer
running: false
repeat: false
interval: 1500
property var handler;
onTriggered: handler();
}
Timer {
id: alertTimer
running: false
@ -113,13 +104,13 @@ Rectangle {
request.openIn(newWindow.webView);
if (File.isZippedFbx(desktop.currentUrl)) {
runJavaScript(autoCancel);
zipTimer.handler = function() {
newWindow.destroy();
}
zipTimer.start();
newWindow.loadingChanged.connect(function(status) {
if (status > 0) {
newWindow.destroy(); // Download has kicked off so we can destroy the Web window.
}
});
}
}
}
Rectangle {
@ -164,4 +155,4 @@ Rectangle {
}
}
}