Add copyFilesLocalPath keybind
This commit is contained in:
parent
67b7821fae
commit
3435dbc2f8
|
@ -367,6 +367,7 @@ class UISettings(JSONDataFile):
|
||||||
"debugFocusedMessage": ["Ctrl+Shift+D"],
|
"debugFocusedMessage": ["Ctrl+Shift+D"],
|
||||||
"openMessagesLinksOrFiles": ["Ctrl+O"],
|
"openMessagesLinksOrFiles": ["Ctrl+O"],
|
||||||
"openMessagesLinksOrFilesExternally": ["Ctrl+Shift+O"],
|
"openMessagesLinksOrFilesExternally": ["Ctrl+Shift+O"],
|
||||||
|
"copyFilesLocalPath": ["Ctrl+Shift+C"],
|
||||||
"clearRoomMessages": ["Ctrl+L"],
|
"clearRoomMessages": ["Ctrl+L"],
|
||||||
|
|
||||||
"sendFile": ["Alt+S"],
|
"sendFile": ["Alt+S"],
|
||||||
|
|
|
@ -170,6 +170,26 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HShortcut {
|
||||||
|
sequences: window.settings.keys.copyFilesLocalPath
|
||||||
|
onActivated: {
|
||||||
|
const paths = []
|
||||||
|
const indice =
|
||||||
|
eventList.getFocusedOrSelectedOrLastMediaEvents(false)
|
||||||
|
|
||||||
|
for (const i of Array.from(indice).sort().reverse()) {
|
||||||
|
const event = eventList.model.get(i)
|
||||||
|
|
||||||
|
if (event.media_local_path)
|
||||||
|
paths.push(
|
||||||
|
event.media_local_path.replace(/^file:\/\//, ""),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (paths.length > 0) Clipboard.text = paths.join("\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HShortcut {
|
HShortcut {
|
||||||
active: eventList.currentItem
|
active: eventList.currentItem
|
||||||
sequences: window.settings.keys.debugFocusedMessage
|
sequences: window.settings.keys.debugFocusedMessage
|
||||||
|
|
Loading…
Reference in New Issue
Block a user