Use dialogs from qt labs platform and fix a image downloading bug.
This commit is contained in:
@@ -27,8 +27,14 @@ ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
onDownloadedChanged: {
|
||||
if (downloaded && showOnFinished) showSavedFile()
|
||||
if (downloaded && openOnFinished) openSavedFile()
|
||||
if (downloaded && showOnFinished) {
|
||||
showSavedFile()
|
||||
showOnFinished = false
|
||||
}
|
||||
if (downloaded && openOnFinished) {
|
||||
openSavedFile()
|
||||
openOnFinished = false
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
@@ -183,9 +189,9 @@ ColumnLayout {
|
||||
}
|
||||
|
||||
Component {
|
||||
id: openFileDialog
|
||||
id: openFolderDialog
|
||||
|
||||
OpenFileDialog {}
|
||||
OpenFolderDialog {}
|
||||
}
|
||||
|
||||
Component {
|
||||
@@ -204,15 +210,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 downloadAndShow()
|
||||
|
||||
Reference in New Issue
Block a user