Implement sharing with Purpose (export)

This provide both a mobile and desktop view

Fix #181
This commit is contained in:
Carl Schwan
2022-02-05 16:30:02 +00:00
parent 3e6f38c8ea
commit ca8a21c0eb
14 changed files with 531 additions and 63 deletions

View File

@@ -16,6 +16,7 @@ MessageDelegateContextMenu {
required property var file
required property var progressInfo
required property string mimeType
property list<Kirigami.Action> actions: [
Kirigami.Action {
@@ -74,6 +75,27 @@ MessageDelegateContextMenu {
}
}
]
property list<Kirigami.Action> nestedActions: [
ShareAction {
id: shareAction
inputData: {
'urls': [],
'mimeType': [mimeType]
}
property string filename: StandardPaths.writableLocation(StandardPaths.CacheLocation) + "/" + eventId.replace(":", "_").replace("/", "_").replace("+", "_") + currentRoom.fileNameToDownload(eventId);
doBeforeSharing: () => {
currentRoom.downloadFile(eventId, filename)
}
Component.onCompleted: {
shareAction.inputData = {
urls: [filename],
mimeType: [mimeType]
};
}
}
]
Component {
id: saveAsDialog
FileDialog {