Merge pull request #2838

ffceda9 SettingsLayout: add checkbox 'ask for password before sending a transaction' (rating89us)
This commit is contained in:
luigi1111 2020-04-22 13:34:47 -05:00
commit 2bef74fe8a
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
2 changed files with 22 additions and 7 deletions

View file

@ -1367,6 +1367,7 @@ ApplicationWindow {
property int segregationHeight: 0
property int kdfRounds: 1
property bool hideBalance: false
property bool askPasswordBeforeSending: true
property bool lockOnUserInActivity: true
property int walletMode: 2
property int lockOnUserInActivityInterval: 10 // minutes
@ -1402,21 +1403,28 @@ ApplicationWindow {
z: parent.z + 1
id: transactionConfirmationPopup
onAccepted: {
var handleAccepted = function() {
// Save transaction to file if view only wallet
if (viewOnly) {
saveTxDialog.open();
} else {
handleTransactionConfirmed()
}
}
close();
passwordDialog.onAcceptedCallback = function() {
if(walletPassword === passwordDialog.password){
// Save transaction to file if view only wallet
if(viewOnly) {
saveTxDialog.open();
} else {
handleTransactionConfirmed()
}
handleAccepted()
} else {
passwordDialog.showError(qsTr("Wrong password") + translationManager.emptyString);
}
}
passwordDialog.onRejectedCallback = null;
passwordDialog.open()
if(!persistentSettings.askPasswordBeforeSending) {
handleAccepted()
} else {
passwordDialog.open()
}
}
}

View file

@ -78,6 +78,13 @@ Rectangle {
persistentSettings.blackTheme = MoneroComponents.Style.blackTheme;
}
}
MoneroComponents.CheckBox {
id: askPasswordBeforeSendingCheckbox
checked: persistentSettings.askPasswordBeforeSending
onClicked: persistentSettings.askPasswordBeforeSending = !persistentSettings.askPasswordBeforeSending
text: qsTr("Ask for password before sending a transaction") + translationManager.emptyString
}
MoneroComponents.CheckBox {
id: userInActivityCheckbox