Add shortcut to send file
This commit is contained in:
parent
5c6b6ef68a
commit
25a86bc484
|
@ -142,6 +142,7 @@ class UISettings(JSONConfigFile):
|
|||
],
|
||||
|
||||
"clearRoomMessages": ["Ctrl+L"],
|
||||
"sendFile": ["Alt+F"],
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -216,6 +216,7 @@ Rectangle {
|
|||
|
||||
SendFilePicker {
|
||||
id: sendFilePicker
|
||||
userId: chatPage.userId
|
||||
roomId: chatPage.roomId
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ Item {
|
|||
|
||||
|
||||
signal filePicked()
|
||||
signal cancelled()
|
||||
|
||||
|
||||
property bool fill: true
|
||||
|
@ -66,6 +67,10 @@ Item {
|
|||
opener.file = file
|
||||
opener.filePicked(file)
|
||||
}
|
||||
onRejected: { selectedFile = ""; file = ""}
|
||||
onRejected: {
|
||||
selectedFile = ""
|
||||
file = ""
|
||||
cancelled()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,4 +132,19 @@ HShortcutHandler {
|
|||
}
|
||||
)
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
enabled: window.uiState.page == "Chat/Chat.qml"
|
||||
sequences: settings.keys.sendFile
|
||||
onPressed: Utils.makeObject(
|
||||
"Dialogs/SendFilePicker.qml",
|
||||
mainUI,
|
||||
{
|
||||
userId: window.uiState.pageProperties.userId,
|
||||
roomId: window.uiState.pageProperties.roomId,
|
||||
destroyWhenDone: true,
|
||||
},
|
||||
picker => { picker.dialog.open() }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user