Have a dedicated SendFilePicker component
This commit is contained in:
20
src/qml/Dialogs/SendFilePicker.qml
Normal file
20
src/qml/Dialogs/SendFilePicker.qml
Normal file
@@ -0,0 +1,20 @@
|
||||
import QtQuick 2.12
|
||||
|
||||
HFileDialogOpener {
|
||||
fill: false
|
||||
dialog.title: qsTr("Select a file to send")
|
||||
|
||||
onFilePicked: {
|
||||
let path = Qt.resolvedUrl(file).replace(/^file:/, "")
|
||||
py.callClientCoro(userId, "send_file", [roomId, path], () => {
|
||||
if (destroyWhenDone) destroy()
|
||||
})
|
||||
}
|
||||
|
||||
onCancelled: if (destroyWhenDone) destroy()
|
||||
|
||||
|
||||
property string userId
|
||||
property string roomId
|
||||
property bool destroyWhenDone: false
|
||||
}
|
Reference in New Issue
Block a user