mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-03 09:29:38 +00:00
SettingsLayout: ask password for password relevant setting
This commit is contained in:
parent
c9ee76c2ee
commit
c0e0626b84
1 changed files with 16 additions and 2 deletions
|
@ -88,10 +88,24 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
MoneroComponents.CheckBox {
|
MoneroComponents.CheckBox {
|
||||||
id: askPasswordBeforeSendingCheckbox
|
|
||||||
checked: persistentSettings.askPasswordBeforeSending
|
checked: persistentSettings.askPasswordBeforeSending
|
||||||
onClicked: persistentSettings.askPasswordBeforeSending = !persistentSettings.askPasswordBeforeSending
|
|
||||||
text: qsTr("Ask for password before sending a transaction") + translationManager.emptyString
|
text: qsTr("Ask for password before sending a transaction") + translationManager.emptyString
|
||||||
|
toggleOnClick: false
|
||||||
|
onClicked: {
|
||||||
|
if (persistentSettings.askPasswordBeforeSending) {
|
||||||
|
passwordDialog.onAcceptedCallback = function() {
|
||||||
|
if (appWindow.walletPassword === passwordDialog.password){
|
||||||
|
persistentSettings.askPasswordBeforeSending = false;
|
||||||
|
} else {
|
||||||
|
passwordDialog.showError(qsTr("Wrong password"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
passwordDialog.onRejectedCallback = null;
|
||||||
|
passwordDialog.open()
|
||||||
|
} else {
|
||||||
|
persistentSettings.askPasswordBeforeSending = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MoneroComponents.CheckBox {
|
MoneroComponents.CheckBox {
|
||||||
|
|
Loading…
Reference in a new issue