Use dialogs from qt labs platform and fix a image downloading bug.

This commit is contained in:
Black Hat
2019-05-04 10:18:09 +08:00
parent 85ceec7b44
commit ce688e9756
6 changed files with 34 additions and 15 deletions

View File

@@ -153,9 +153,9 @@ ColumnLayout {
}
Component {
id: openFileDialog
id: openFolderDialog
OpenFileDialog {}
OpenFolderDialog {}
}
Component {
@@ -169,15 +169,15 @@ ColumnLayout {
}
function saveFileAs() {
var fileDialog = openFileDialog.createObject(ApplicationWindow.overlay, {"selectFolder": true})
var folderDialog = openFolderDialog.createObject(ApplicationWindow.overlay)
fileDialog.chosen.connect(function(path) {
folderDialog.chosen.connect(function(path) {
if (!path) return
currentRoom.downloadFile(eventId, path + "/" + (content.filename || content.body))
})
fileDialog.open()
folderDialog.open()
}
function downloadAndOpen()