fix: support downloads in browser

This commit is contained in:
Richard Ramos 2020-10-19 16:16:02 -04:00 committed by Iuri Matias
parent b4425322ac
commit c68498fcfe
3 changed files with 12 additions and 10 deletions

View File

@ -4,7 +4,7 @@ import sets
import libstatus/core
import libstatus/types
import chronicles
import eventemitter
import ../eventemitter
import sequtils
type

View File

@ -378,11 +378,12 @@ Rectangle {
anchors.top: parent.top
anchors.topMargin: tabs.tabHeight + tabs.anchors.topMargin
z: 52
visible: !downloadView.visible
}
QQC1.TabView {
property int tabHeight: 40
visible: !downloadView.visible
id: tabs
function createEmptyTab(profile) {
var tab = addTab("", tabComponent);
@ -413,6 +414,8 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
Component.onCompleted: {
defaultProfile.downloadRequested.connect(onDownloadRequested);
otrProfile.downloadRequested.connect(onDownloadRequested);
var tab = createEmptyTab(defaultProfile);
tab.item.url = determineRealURL("https://simpledapp.eth");
}
@ -721,6 +724,12 @@ Rectangle {
}
}
function onDownloadRequested(download) {
downloadView.visible = true;
downloadView.append(download);
download.accept();
}
MessageDialog {
id: sslDialog
@ -756,13 +765,6 @@ Rectangle {
anchors.fill: parent
}
function onDownloadRequested(download) {
console.log("DOWNLOAD REQUESTED")
downloadView.visible = true;
downloadView.append(download);
download.accept();
}
FindBar {
id: findBar
visible: false

View File

@ -111,7 +111,7 @@ Rectangle {
Button {
id: cancelButton
anchors.right: parent.right
iconSource: "icons/process-stop.png"
text: "X"
onClicked: {
var download = downloadModel.downloads[index];