Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F83565326
D304.1779716628.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D304.1779716628.diff
View Options
diff --git a/src/contents/ui/MediaFileMenu.qml b/src/contents/ui/MediaFileMenu.qml
--- a/src/contents/ui/MediaFileMenu.qml
+++ b/src/contents/ui/MediaFileMenu.qml
@@ -40,28 +40,12 @@
property var saveAction: Kirigami.Action {
text: l10n.get('media-file-menu-option-save-as')
onTriggered: {
- fileDialog.open()
+ fileDialog.saveAs(mediaFileMenu.eventContent);
}
}
property var optionMenu: [viewAction, saveAction]
- property var fileDialog: Kazv.FileDialogAdapter {
- id: fileDialog
- folder: Platform.StandardPaths.writableLocation(Platform.StandardPaths.DownloadLocation)
- onAccepted: {
- mediaFileMenu.fileHandler.downloadFile(fileUrl)
- }
-
- Component.onCompleted: {
- if (MK.KazvUtil.kfQtMajorVersion === 5) {
- fileDialog.selectExisting = false;
- } else {
- fileDialog.fileMode = Kazv.FileDialogAdapter.SaveFile;
- }
- }
- }
-
Component.onCompleted: {
mediaFileMenu.fileHandler.startDownload.connect(mediaFileMenu.startDownload)
}
diff --git a/src/contents/ui/RoomPage.qml b/src/contents/ui/RoomPage.qml
--- a/src/contents/ui/RoomPage.qml
+++ b/src/contents/ui/RoomPage.qml
@@ -8,6 +8,7 @@
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
+import Qt.labs.platform as Platform
import org.kde.kirigami 2.13 as Kirigami
import moe.kazv.mxc.kazv 0.0 as MK
@@ -28,6 +29,40 @@
property var paginationRequests: ({})
property var refreshRoomStateRequest: null
+ property var fileDialog: Kazv.FileDialogAdapter {
+ id: fileDialog
+
+ property var eventContent
+ property var jobManager: kazvIOManager
+ property var mtxSdk: matrixSdk
+ property var fileHandler: Kazv.FileHandler {
+ id: fileHandler
+ autoCache: false
+ eventContent: fileDialog.eventContent
+ kazvIOManager: fileDialog.jobManager
+ matrixSdk: fileDialog.mtxSdk
+ }
+
+ function saveAs(eventContent) {
+ fileDialog.eventContent = eventContent;
+ fileDialog.open();
+ }
+
+ folder: Platform.StandardPaths.writableLocation(Platform.StandardPaths.DownloadLocation)
+
+ onAccepted: {
+ fileDialog.fileHandler.downloadFile(fileUrl);
+ }
+
+ Component.onCompleted: {
+ if (MK.KazvUtil.kfQtMajorVersion === 5) {
+ fileDialog.selectExisting = false;
+ } else {
+ fileDialog.fileMode = Kazv.FileDialogAdapter.SaveFile;
+ }
+ }
+ }
+
signal mentionUserRequested(string userId)
signal replaceDraftRequested(string newDraft)
signal paginateBackRequested(string eventId)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, May 25, 6:43 AM (22 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1504273
Default Alt Text
D304.1779716628.diff (2 KB)
Attached To
Mode
D304: Lift the save as dialog to the RoomPage to prevent ListView updates from destroying it
Attached
Detach File
Event Timeline
Log In to Comment