1
0
Fork 0
mirror of https://github.com/seiichiro0185/sailotp.git synced 2024-11-25 08:39:42 +00:00

Added Enter-Key Customization to Add and Export/Import Pages

This commit is contained in:
seiichiro 2014-02-08 18:05:23 +01:00
parent 99308f8ecf
commit 82ea4f182c
2 changed files with 23 additions and 0 deletions

View file

@ -73,6 +73,10 @@ Dialog {
text: paramLabel != "" ? paramLabel : "" text: paramLabel != "" ? paramLabel : ""
focus: true focus: true
horizontalAlignment: TextInput.AlignLeft horizontalAlignment: TextInput.AlignLeft
EnterKey.enabled: text.length > 0
EnterKey.iconSource: "image://theme/icon-m-enter-next"
EnterKey.onClicked: otpSecret.focus = true
} }
TextField { TextField {
id: otpSecret id: otpSecret
@ -82,6 +86,10 @@ Dialog {
placeholderText: qsTr("Secret OTP Key") placeholderText: qsTr("Secret OTP Key")
focus: true focus: true
horizontalAlignment: TextInput.AlignLeft 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 { TextField {
id: otpCounter id: otpCounter
@ -93,6 +101,9 @@ Dialog {
focus: true focus: true
horizontalAlignment: TextInput.AlignLeft horizontalAlignment: TextInput.AlignLeft
validator: IntValidator { bottom: 0 } validator: IntValidator { bottom: 0 }
EnterKey.iconSource: "image://theme/icon-m-enter-accept"
EnterKey.onClicked: addOTP.accept()
} }
Component.onCompleted: { typeSel.currentIndex = paramType == "HOTP" ? 1 : 0 } Component.onCompleted: { typeSel.currentIndex = paramType == "HOTP" ? 1 : 0 }
} }

View file

@ -100,6 +100,10 @@ Dialog {
placeholderText: mode == "import" ? qsTr("File to import") : qsTr("File to export") placeholderText: mode == "import" ? qsTr("File to import") : qsTr("File to export")
focus: true focus: true
horizontalAlignment: TextInput.AlignLeft horizontalAlignment: TextInput.AlignLeft
EnterKey.enabled: text.length > 0
EnterKey.iconSource: "image://theme/icon-m-enter-next"
EnterKey.onClicked: filePassword.focus = true
} }
TextSwitch { TextSwitch {
@ -117,6 +121,10 @@ Dialog {
echoMode: TextInput.Password echoMode: TextInput.Password
focus: true focus: true
horizontalAlignment: TextInput.AlignLeft 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 { TextField {
@ -128,6 +136,10 @@ Dialog {
echoMode: TextInput.Password echoMode: TextInput.Password
focus: true focus: true
horizontalAlignment: TextInput.AlignLeft 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 { Text {