Page MenuHomePhorge

No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None
diff --git a/src/contents/ui/MediaFileMenu.qml b/src/contents/ui/MediaFileMenu.qml
index e5fcdb8..3964e3a 100644
--- a/src/contents/ui/MediaFileMenu.qml
+++ b/src/contents/ui/MediaFileMenu.qml
@@ -1,59 +1,62 @@
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2022-2023 nannanko <nannanko@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Dialogs 1.3
import Qt.labs.platform 1.1 as Platform
import org.kde.kirigami 2.13 as Kirigami
import '.' as Types
QtObject {
id: mediaFileMenu
required property var eventContent
property var jobManager: kazvIOManager
property var mtxSdk: matrixSdk
signal startDownload
property var fileHandler: FileHandler {
id: fileHandler
autoCache: false
eventContent: mediaFileMenu.eventContent
kazvIOManager: mediaFileMenu.jobManager
matrixSdk: mediaFileMenu.mtxSdk
}
property var viewAction: Kirigami.Action {
text: l10n.get('media-file-menu-option-view')
- // TODO: open with default program
+ onTriggered: {
+ fileHandler.cacheFile()
+ Qt.openUrlExternally(fileHandler.cachedFile)
+ }
}
property var saveAction: Kirigami.Action {
text: l10n.get('media-file-menu-option-save-as')
onTriggered: {
fileDialog.open()
}
}
property var optionMenu: [viewAction, saveAction]
property var fileDialog: FileDialog {
folder: Platform.StandardPaths.writableLocation(Platform.StandardPaths.DownloadLocation)
selectExisting: false
onAccepted: {
mediaFileMenu.fileHandler.downloadFile(fileUrl)
}
}
Component.onCompleted: {
// mediaFileMenu.fileHandler.startDownload.connect(mediaFileMenu.startDownload)
}
}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Jan 19, 3:01 PM (22 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
55246
Default Alt Text
(1 KB)

Event Timeline