1
0

implement auth by PIN and allow auth override to wallet password

by passing method='wallet' to auth_protect
This commit is contained in:
Sander van Grieken
2022-07-06 16:23:29 +02:00
parent cc778356eb
commit 2a13212ded
5 changed files with 218 additions and 34 deletions

View File

@@ -6,6 +6,8 @@ import QtQuick.Controls.Material 2.0
import org.electrum 1.0
Pane {
id: preferences
property string title: qsTr("Preferences")
ColumnLayout {
@@ -116,6 +118,49 @@ Pane {
}
}
Label {
text: qsTr('PIN')
}
RowLayout {
Label {
text: Config.pinCode == '' ? qsTr('Off'): qsTr('On')
color: Material.accentColor
Layout.rightMargin: constants.paddingMedium
}
Button {
text: qsTr('Enable')
visible: Config.pinCode == ''
onClicked: {
var dialog = pinSetup.createObject(preferences, {mode: 'enter'})
dialog.accepted.connect(function() {
Config.pinCode = dialog.pincode
dialog.close()
})
dialog.open()
}
}
Button {
text: qsTr('Change')
visible: Config.pinCode != ''
onClicked: {
var dialog = pinSetup.createObject(preferences, {mode: 'change', pincode: Config.pinCode})
dialog.accepted.connect(function() {
Config.pinCode = dialog.pincode
dialog.close()
})
dialog.open()
}
}
Button {
text: qsTr('Remove')
visible: Config.pinCode != ''
onClicked: {
Config.pinCode = ''
}
}
}
Label {
text: qsTr('Lightning Routing')
}
@@ -136,6 +181,11 @@ Pane {
}
Component {
id: pinSetup
Pin {}
}
Component.onCompleted: {
baseUnit.currentIndex = ['BTC','mBTC','bits','sat'].indexOf(Config.baseUnit)
thousands.checked = Config.thousandsSeparator