Add saveFileAs() && init setting page.

This commit is contained in:
Black Hat
2018-07-19 21:02:06 +08:00
parent febff558fd
commit 80fca26092
5 changed files with 55 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
import QtQuick.Dialogs 1.2
Item {
property bool openOnFinished: false
@@ -14,9 +15,22 @@ Item {
opacity: 0.4
}
FileDialog {
id: locationDialog
title: "Please choose a location"
folder: shortcuts.home
selectFolder: true
onAccepted: currentRoom.downloadFile(eventId, folder + "/" + currentRoom.fileNameToDownload(eventId))
}
onDownloadedChanged: {
if (downloaded && openOnFinished)
openSavedFile()
if (downloaded && openOnFinished) openSavedFile()
}
function saveFileAs() {
locationDialog.open()
}
function downloadAndOpen()