From c0e0626b849966de1f87498e0108740ce83575aa Mon Sep 17 00:00:00 2001 From: selsta Date: Tue, 16 Jun 2020 13:27:49 +0200 Subject: [PATCH] SettingsLayout: ask password for password relevant setting --- pages/settings/SettingsLayout.qml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pages/settings/SettingsLayout.qml b/pages/settings/SettingsLayout.qml index af00f024..22b9ec52 100644 --- a/pages/settings/SettingsLayout.qml +++ b/pages/settings/SettingsLayout.qml @@ -88,10 +88,24 @@ Rectangle { } MoneroComponents.CheckBox { - id: askPasswordBeforeSendingCheckbox checked: persistentSettings.askPasswordBeforeSending - onClicked: persistentSettings.askPasswordBeforeSending = !persistentSettings.askPasswordBeforeSending 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 {