yubioath-flutter/qml/MainMenuBar.qml
Dag Heyman 60a96f190a
Override copy action from search
Since the search field already have
an action on Ctrl/Cmd + C, we need to
override it to copy the credential code
to the clipboard from search.
2018-01-02 11:31:15 +01:00

85 lines
1.9 KiB
QML

import QtQuick 2.5
import QtQuick.Controls 1.4
MenuBar {
property bool slotMode
property bool hasDevice
property bool enableGenerate
signal openAddCredential
signal openAbout
signal openReset
signal openSettings
signal openSetPassword
Menu {
title: qsTr("\&File")
MenuItem {
text: qsTr("\&Scan QR code...")
enabled: hasDevice
onTriggered: scanQr()
shortcut: StandardKey.Open
}
MenuItem {
text: qsTr("\&New credential...")
enabled: hasDevice
onTriggered: openAddCredential()
shortcut: StandardKey.New
}
MenuItem {
text: qsTr("Set password...")
enabled: !slotMode && hasDevice
onTriggered: openSetPassword()
}
MenuItem {
text: qsTr("Reset...")
enabled: !slotMode && hasDevice
onTriggered: openReset()
}
MenuItem {
text: qsTr("\&Settings")
onTriggered: openSettings()
}
MenuItem {
text: qsTr("E\&xit")
onTriggered: Qt.quit()
shortcut: StandardKey.Quit
}
}
Menu {
title: qsTr("\&Edit")
MenuItem {
action: copyAction
}
MenuItem {
enabled: enableGenerate
text: qsTr("\&Generate code")
shortcut: "Space"
onTriggered: generate(false)
}
MenuSeparator {
}
MenuItem {
text: qsTr("\&Delete")
shortcut: StandardKey.Delete
enabled: (getSelected() != null)
onTriggered: deleteCredential()
}
}
Menu {
title: qsTr("\&Help")
MenuItem {
text: qsTr("\&About Yubico Authenticator")
onTriggered: openAbout()
}
}
}