Add some keyboard shortcuts

This commit is contained in:
Dag Heyman 2017-02-16 09:55:47 +01:00
parent dfb445b66b
commit 75afc6f7dc
No known key found for this signature in database
GPG Key ID: 06FC004369E7D338

View File

@ -119,16 +119,24 @@ ApplicationWindow {
id: credentialMenu
MenuItem {
text: qsTr('Copy')
onTriggered: clipboard.setClipboard(selectedCredential.code)
shortcut: StandardKey.Copy
onTriggered: {
if (selectedCredential != null) {
clipboard.setClipboard(selectedCredential.code)
}
}
}
MenuItem {
visible: selectedCredential != null
&& selectedCredential.code == null
&& (selectedCredential.oath_type === "hotp"
|| selectedCredential.touch === true)
text: qsTr('Generate code')
shortcut: "Space"
onTriggered: calculateCredential(selectedCredential)
}
MenuItem {
text: qsTr('Delete')
shortcut: StandardKey.Delete
onTriggered: confirmDeleteCredential.open()
}
}