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:
parent
7dfd336c77
commit
5ddc4dcf90
1 changed files with 23 additions and 0 deletions
|
@ -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
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue