mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-23 20:20:02 +00:00
Merge pull request #2838
ffceda9
SettingsLayout: add checkbox 'ask for password before sending a transaction' (rating89us)
This commit is contained in:
commit
2bef74fe8a
2 changed files with 22 additions and 7 deletions
22
main.qml
22
main.qml
|
@ -1367,6 +1367,7 @@ ApplicationWindow {
|
||||||
property int segregationHeight: 0
|
property int segregationHeight: 0
|
||||||
property int kdfRounds: 1
|
property int kdfRounds: 1
|
||||||
property bool hideBalance: false
|
property bool hideBalance: false
|
||||||
|
property bool askPasswordBeforeSending: true
|
||||||
property bool lockOnUserInActivity: true
|
property bool lockOnUserInActivity: true
|
||||||
property int walletMode: 2
|
property int walletMode: 2
|
||||||
property int lockOnUserInActivityInterval: 10 // minutes
|
property int lockOnUserInActivityInterval: 10 // minutes
|
||||||
|
@ -1402,21 +1403,28 @@ ApplicationWindow {
|
||||||
z: parent.z + 1
|
z: parent.z + 1
|
||||||
id: transactionConfirmationPopup
|
id: transactionConfirmationPopup
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
|
var handleAccepted = function() {
|
||||||
|
// Save transaction to file if view only wallet
|
||||||
|
if (viewOnly) {
|
||||||
|
saveTxDialog.open();
|
||||||
|
} else {
|
||||||
|
handleTransactionConfirmed()
|
||||||
|
}
|
||||||
|
}
|
||||||
close();
|
close();
|
||||||
passwordDialog.onAcceptedCallback = function() {
|
passwordDialog.onAcceptedCallback = function() {
|
||||||
if(walletPassword === passwordDialog.password){
|
if(walletPassword === passwordDialog.password){
|
||||||
// Save transaction to file if view only wallet
|
handleAccepted()
|
||||||
if(viewOnly) {
|
|
||||||
saveTxDialog.open();
|
|
||||||
} else {
|
|
||||||
handleTransactionConfirmed()
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
passwordDialog.showError(qsTr("Wrong password") + translationManager.emptyString);
|
passwordDialog.showError(qsTr("Wrong password") + translationManager.emptyString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
passwordDialog.onRejectedCallback = null;
|
passwordDialog.onRejectedCallback = null;
|
||||||
passwordDialog.open()
|
if(!persistentSettings.askPasswordBeforeSending) {
|
||||||
|
handleAccepted()
|
||||||
|
} else {
|
||||||
|
passwordDialog.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,13 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 {
|
MoneroComponents.CheckBox {
|
||||||
id: userInActivityCheckbox
|
id: userInActivityCheckbox
|
||||||
checked: persistentSettings.lockOnUserInActivity
|
checked: persistentSettings.lockOnUserInActivity
|
||||||
|
|
Loading…
Reference in a new issue