Add shortcut to send file

This commit is contained in:
miruka 2019-11-06 16:45:33 -04:00
parent 5c6b6ef68a
commit 25a86bc484
4 changed files with 23 additions and 1 deletions

View File

@ -142,6 +142,7 @@ class UISettings(JSONConfigFile):
],
"clearRoomMessages": ["Ctrl+L"],
"sendFile": ["Alt+F"],
},
}

View File

@ -216,6 +216,7 @@ Rectangle {
SendFilePicker {
id: sendFilePicker
userId: chatPage.userId
roomId: chatPage.roomId
}
}

View File

@ -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()
}
}
}

View File

@ -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() }
)
}
}