From 1f1d51d8e1eeae0d4fba4396df3f13d84f9c9ee7 Mon Sep 17 00:00:00 2001 From: stoffu Date: Tue, 19 Sep 2017 07:57:06 +0900 Subject: [PATCH] Show password dialog before making a transfer --- main.qml | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/main.qml b/main.qml index e5d312d1..c9bf9b19 100644 --- a/main.qml +++ b/main.qml @@ -912,13 +912,25 @@ ApplicationWindow { id: transactionConfirmationPopup onAccepted: { close(); - - // Save transaction to file if view only wallet - if(viewOnly) { - saveTxDialog.open(); - return; - } else - handleTransactionConfirmed() + transactionConfirmationPasswordDialog.onAcceptedCallback = function() { + if(appWindow.password === transactionConfirmationPasswordDialog.password){ + // Save transaction to file if view only wallet + if(viewOnly) { + saveTxDialog.open(); + } else { + handleTransactionConfirmed() + } + } else { + informationPopup.title = qsTr("Error") + translationManager.emptyString; + informationPopup.text = qsTr("Wrong password"); + informationPopup.open() + informationPopup.onCloseCallback = function() { + transactionConfirmationPasswordDialog.open() + } + } + transactionConfirmationPasswordDialog.password = "" + } + transactionConfirmationPasswordDialog.open() } } @@ -968,6 +980,15 @@ ApplicationWindow { } + PasswordDialog { + id: transactionConfirmationPasswordDialog + property var onAcceptedCallback + onAccepted: { + if (onAcceptedCallback()) + onAcceptedCallback(); + } + } + DaemonManagerDialog { id: daemonManagerDialog onRejected: {