Add externally open image support & file download support && more code

cleanup.
This commit is contained in:
Black Hat
2018-07-10 14:34:17 +08:00
parent 31d435e6f4
commit 0b2f252c42
8 changed files with 132 additions and 64 deletions

View File

@@ -0,0 +1,35 @@
import QtQuick 2.11
import QtQuick.Controls 2.4
Item {
width: parent.width
height: visible ? childrenRect.height : 0
property bool openOnFinished: false
readonly property bool downloaded: progressInfo && progressInfo.completed
onDownloadedChanged: {
if (downloaded && openOnFinished)
openSavedFile()
}
function downloadAndOpen()
{
if (downloaded)
openSavedFile()
else
{
openOnFinished = true
currentRoom.downloadFile(eventId)
}
}
function openSavedFile()
{
if (Qt.openUrlExternally(progressInfo.localPath))
return;
if (Qt.openUrlExternally(progressInfo.localDir))
return;
}
}