mirror of
https://github.com/seiichiro0185/sailotp.git
synced 2024-11-22 07:39:42 +00:00
Added Enter-Key Customization to Add and Export/Import Pages
This commit is contained in:
parent
99308f8ecf
commit
82ea4f182c
2 changed files with 23 additions and 0 deletions
|
@ -73,6 +73,10 @@ Dialog {
|
|||
text: paramLabel != "" ? paramLabel : ""
|
||||
focus: true
|
||||
horizontalAlignment: TextInput.AlignLeft
|
||||
|
||||
EnterKey.enabled: text.length > 0
|
||||
EnterKey.iconSource: "image://theme/icon-m-enter-next"
|
||||
EnterKey.onClicked: otpSecret.focus = true
|
||||
}
|
||||
TextField {
|
||||
id: otpSecret
|
||||
|
@ -82,6 +86,10 @@ Dialog {
|
|||
placeholderText: qsTr("Secret OTP Key")
|
||||
focus: true
|
||||
horizontalAlignment: TextInput.AlignLeft
|
||||
|
||||
EnterKey.enabled: text.length > 15
|
||||
EnterKey.iconSource: paramType == "TOTP" ? "image://theme/icon-m-enter-accept" : "image://theme/icon-m-enter-next"
|
||||
EnterKey.onClicked: paramType == "TOTP" ? addOTP.accept() : otpCounter.focus = true
|
||||
}
|
||||
TextField {
|
||||
id: otpCounter
|
||||
|
@ -93,6 +101,9 @@ Dialog {
|
|||
focus: true
|
||||
horizontalAlignment: TextInput.AlignLeft
|
||||
validator: IntValidator { bottom: 0 }
|
||||
|
||||
EnterKey.iconSource: "image://theme/icon-m-enter-accept"
|
||||
EnterKey.onClicked: addOTP.accept()
|
||||
}
|
||||
Component.onCompleted: { typeSel.currentIndex = paramType == "HOTP" ? 1 : 0 }
|
||||
}
|
||||
|
|
|
@ -100,6 +100,10 @@ Dialog {
|
|||
placeholderText: mode == "import" ? qsTr("File to import") : qsTr("File to export")
|
||||
focus: true
|
||||
horizontalAlignment: TextInput.AlignLeft
|
||||
|
||||
EnterKey.enabled: text.length > 0
|
||||
EnterKey.iconSource: "image://theme/icon-m-enter-next"
|
||||
EnterKey.onClicked: filePassword.focus = true
|
||||
}
|
||||
|
||||
TextSwitch {
|
||||
|
@ -117,6 +121,10 @@ Dialog {
|
|||
echoMode: TextInput.Password
|
||||
focus: true
|
||||
horizontalAlignment: TextInput.AlignLeft
|
||||
|
||||
EnterKey.enabled: text.length > 0
|
||||
EnterKey.iconSource: mode == "export" ? "image://theme/icon-m-enter-next" : "image://theme/icon-m-enter-accept"
|
||||
EnterKey.onClicked: mode == "export" ? filePasswordCheck.focus = true : exportPage.accept()
|
||||
}
|
||||
|
||||
TextField {
|
||||
|
@ -128,6 +136,10 @@ Dialog {
|
|||
echoMode: TextInput.Password
|
||||
focus: true
|
||||
horizontalAlignment: TextInput.AlignLeft
|
||||
|
||||
EnterKey.enabled: filePassword.text == filePasswordCheck.text && filePassword.text.length > 0
|
||||
EnterKey.iconSource: "image://theme/icon-m-enter-accept"
|
||||
EnterKey.onClicked: exportPage.accept()
|
||||
}
|
||||
|
||||
Text {
|
||||
|
|
Loading…
Reference in a new issue