From 2eaf3dcc642de9cb45a9b0fa4d766b08e94c541a Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Wed, 3 May 2023 22:50:58 +0200 Subject: [PATCH] qml: cleanup --- electrum/gui/qml/components/WalletDetails.qml | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/electrum/gui/qml/components/WalletDetails.qml b/electrum/gui/qml/components/WalletDetails.qml index f0e316712..b8d76bfc6 100644 --- a/electrum/gui/qml/components/WalletDetails.qml +++ b/electrum/gui/qml/components/WalletDetails.qml @@ -16,19 +16,16 @@ Pane { property bool _is2fa: Daemon.currentWallet && Daemon.currentWallet.walletType == '2fa' function enableLightning() { - var dialog = app.messageDialog.createObject(rootItem, - {'title': qsTr('Enable Lightning for this wallet?'), 'yesno': true}) + var dialog = app.messageDialog.createObject(rootItem, { + title: qsTr('Enable Lightning for this wallet?'), + yesno: true + }) dialog.accepted.connect(function() { Daemon.currentWallet.enableLightning() }) dialog.open() } - function changePassword() { - // trigger dialog via wallet (auth then signal) - Daemon.startChangePassword() - } - function importAddressesKeys() { var dialog = importAddressesKeysDialog.createObject(rootItem) dialog.open() @@ -44,7 +41,7 @@ Pane { Layout.fillHeight: true contentHeight: flickableRoot.height - clip:true + clip: true interactive: height < contentHeight Pane { @@ -416,7 +413,7 @@ Pane { Layout.fillWidth: true Layout.preferredWidth: 1 text: qsTr('Change Password') - onClicked: rootItem.changePassword() + onClicked: Daemon.startChangePassword() icon.source: '../../icons/lock.png' } FlatButton { @@ -466,19 +463,30 @@ Pane { } function onWalletDeleteError(code, message) { if (code == 'unpaid_requests') { - var dialog = app.messageDialog.createObject(app, {title: qsTr('Error'), text: message, yesno: true }) + var dialog = app.messageDialog.createObject(app, { + title: qsTr('Error'), + text: message, + yesno: true + }) dialog.accepted.connect(function() { Daemon.checkThenDeleteWallet(Daemon.currentWallet, true) }) dialog.open() } else if (code == 'balance') { - var dialog = app.messageDialog.createObject(app, {title: qsTr('Error'), text: message, yesno: true }) + var dialog = app.messageDialog.createObject(app, { + title: qsTr('Error'), + text: message, + yesno: true + }) dialog.accepted.connect(function() { Daemon.checkThenDeleteWallet(Daemon.currentWallet, true, true) }) dialog.open() } else { - var dialog = app.messageDialog.createObject(app, {title: qsTr('Error'), text: message }) + var dialog = app.messageDialog.createObject(app, { + title: qsTr('Error'), + text: message + }) dialog.open() } }