Add dialog for settings

This commit is contained in:
Dag Heyman 2017-02-20 12:27:10 +01:00
parent 3856c53e7b
commit f117e4de92
No known key found for this signature in database
GPG Key ID: 06FC004369E7D338
2 changed files with 86 additions and 0 deletions

View File

@ -48,6 +48,10 @@ ApplicationWindow {
text: qsTr('Reset...')
onTriggered: reset.open()
}
MenuItem {
text: qsTr('Settings')
onTriggered: settings.open()
}
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit()
@ -72,6 +76,17 @@ ApplicationWindow {
id: addCredential
}
/*******
Settings dialog
*******/
Settings {
id: settings
}
/*******
Set password dialog

71
qml/Settings.qml Normal file
View File

@ -0,0 +1,71 @@
import QtQuick 2.6
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.2
Dialog {
title: qsTr("Settings")
modality: Qt.ApplicationModal
ColumnLayout {
anchors.fill: parent
Label {
text: qsTr("Authenticator Mode")
font.bold: true
}
ColumnLayout {
ExclusiveGroup {
id: mode
}
RadioButton {
id: ccid
text: qsTr("CCID (Smart card)")
checked: true
exclusiveGroup: mode
}
RadioButton {
id: slot
text: qsTr("YubiKey Slots")
exclusiveGroup: mode
}
CheckBox {
id: slot1
enabled: mode.current == slot
text: qsTr("Slot 1")
}
RowLayout{
Label {
text: qsTr("Digits")
enabled: mode.current == slot && slot1.checked
}
ComboBox {
id: slot1digits
enabled: mode.current == slot && slot1.checked
model: [6, 8]
}
}
CheckBox {
id: slot2
enabled: mode.current == slot
text: qsTr("Slot 2")
}
RowLayout{
Label {
text: qsTr("Digits")
enabled: mode.current == slot && slot2.checked
}
ComboBox {
id: slot2digits
enabled: mode.current == slot && slot2.checked
model: [6, 8]
}
}
}
}
}