Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7890183
MediaFileMenu.qml
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
MediaFileMenu.qml
View Options
/*
* 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
Qt
.
labs
.
platform
1.1
as
Platform
import
org
.
kde
.
kirigami
2.13
as
Kirigami
import
'.'
as
Types
TapHandler
{
id: mediaFileMenu
required
property
var
serverUrl
required
property
var
jobId
required
property
var
fileName
signal
startDownload
acceptedButtons:
Qt
.
LeftButton
|
Qt
.
RightButton
onSingleTapped:
{
if
(
eventPoint
.
event
.
button
===
Qt
.
RightButton
)
{
optionMenu
.
popup
(
parent
)
}
if
(
eventPoint
.
event
.
button
===
Qt
.
LeftButton
)
{
// TODO: Open with default program
}
}
onLongPressed:
{
optionMenu
.
popup
(
parent
)
}
property
var
optionMenu:
Menu
{
Kirigami
.
Action
{
text:
l10n
.
get
(
'media-file-menu-option-view'
)
// shortcut: StandardKey.Open
// TODO: open with default program
}
Kirigami
.
Action
{
text:
l10n
.
get
(
'media-file-menu-option-save-as'
)
// Can't think of a suitable shortcut key
// shortcut: StandardKey.Save
onTriggered:
{
fileDialog
.
open
()
}
}
}
property
var
fileDialog:
Platform
.
FileDialog
{
fileMode:
Platform
.
FileDialog
.
SaveFile
folder:
Platform
.
StandardPaths
.
writableLocation
(
Platform
.
StandardPaths
.
DownloadLocation
)
// This is not work
// currentFile: fileName
onAccepted:
{
kazvIOManager
.
startNewDownloadJob
(
mediaFileMenu
.
serverUrl
,
file
,
mediaFileMenu
.
jobId
)
startDownload
()
}
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 2, 3:00 AM (13 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
472930
Default Alt Text
MediaFileMenu.qml (1 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment