From 5ddc4dcf90b950a4ffaac40797718bf2c24ce895 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Sun, 12 Jan 2014 16:25:02 +0100 Subject: [PATCH] Added type and counter value to the Add/Edit-Page --- qml/pages/AddOTP.qml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/qml/pages/AddOTP.qml b/qml/pages/AddOTP.qml index c68afae..da5b8b9 100644 --- a/qml/pages/AddOTP.qml +++ b/qml/pages/AddOTP.qml @@ -40,20 +40,32 @@ Dialog { property QtObject parentPage: null // 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 paramKey: "" + property int paramCounter: 0 SilicaFlickable { id: addOtpList anchors.fill: parent + width: parent.width VerticalScrollDecorator {} Column { anchors.fill: parent + width: parent.width DialogHeader { acceptText: paramLabel != "" ? "Save" : "Add" } + + ComboBox { + label: "Type" + menu: ContextMenu { + MenuItem { text: "Time-based"; onClicked: { paramType = "TOTP" } } + MenuItem { text: "Counter-based"; onClicked: { paramType = "HOTP" } } + } + } TextField { id: otpLabel width: parent.width @@ -72,6 +84,17 @@ Dialog { focus: true 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 + } + } }