1
0
Fork 0
mirror of https://github.com/seiichiro0185/sailotp.git synced 2024-12-22 11:42:30 +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 : ""
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 }
}

View file

@ -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 {