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

Added type and counter value to the Add/Edit-Page

This commit is contained in:
seiichiro 2014-01-12 16:25:02 +01:00
parent 7dfd336c77
commit 5ddc4dcf90

View file

@ -40,20 +40,32 @@ Dialog {
property QtObject parentPage: null property QtObject parentPage: null
// If we want to edit a Key we get title and key from the calling page // If we want to edit a Key we get title and key from the calling page
property string paramType: "TOTP"
property string paramLabel: "" property string paramLabel: ""
property string paramKey: "" property string paramKey: ""
property int paramCounter: 0
SilicaFlickable { SilicaFlickable {
id: addOtpList id: addOtpList
anchors.fill: parent anchors.fill: parent
width: parent.width
VerticalScrollDecorator {} VerticalScrollDecorator {}
Column { Column {
anchors.fill: parent anchors.fill: parent
width: parent.width
DialogHeader { DialogHeader {
acceptText: paramLabel != "" ? "Save" : "Add" acceptText: paramLabel != "" ? "Save" : "Add"
} }
ComboBox {
label: "Type"
menu: ContextMenu {
MenuItem { text: "Time-based"; onClicked: { paramType = "TOTP" } }
MenuItem { text: "Counter-based"; onClicked: { paramType = "HOTP" } }
}
}
TextField { TextField {
id: otpLabel id: otpLabel
width: parent.width width: parent.width
@ -72,6 +84,17 @@ Dialog {
focus: true focus: true
horizontalAlignment: TextInput.AlignLeft horizontalAlignment: TextInput.AlignLeft
} }
TextField {
id: otpCounter
width: parent.width
visible: paramType == "HOTP" ? true : false
label: "Counter Value"
text: paramCounter
placeholderText: "Initial Value of the Counter"
focus: true
horizontalAlignment: TextInput.AlignLeft
}
} }
} }