From 5fd77215089ec254e6e1ff28c98342cb5f951f54 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 13 Mar 2023 18:22:51 +0100 Subject: [PATCH] qml: de-dupe broadcastFailed handler, styling InvoiceDialog amount --- electrum/gui/qml/components/InvoiceDialog.qml | 2 ++ .../gui/qml/components/WalletMainView.qml | 25 +++++++------------ 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/electrum/gui/qml/components/InvoiceDialog.qml b/electrum/gui/qml/components/InvoiceDialog.qml index 87558ab0d..d20f35ff9 100644 --- a/electrum/gui/qml/components/InvoiceDialog.qml +++ b/electrum/gui/qml/components/InvoiceDialog.qml @@ -254,6 +254,7 @@ ElDialog { } Label { + Layout.alignment: Qt.AlignRight visible: !invoice.amount.isMax font.pixelSize: constants.fontSizeXLarge font.family: FixedFont @@ -271,6 +272,7 @@ ElDialog { Label { id: fiatValue + Layout.alignment: Qt.AlignRight visible: Daemon.fx.enabled && !invoice.amount.isMax text: Daemon.fx.fiatValue(invoice.amount, false) font.pixelSize: constants.fontSizeMedium diff --git a/electrum/gui/qml/components/WalletMainView.qml b/electrum/gui/qml/components/WalletMainView.qml index 957817a27..e664e7cb1 100644 --- a/electrum/gui/qml/components/WalletMainView.qml +++ b/electrum/gui/qml/components/WalletMainView.qml @@ -240,6 +240,15 @@ Item { Connections { target: Daemon.currentWallet + function onOtpRequested() { + console.log('OTP requested') + var dialog = otpDialog.createObject(mainView) + dialog.accepted.connect(function() { + console.log('accepted ' + dialog.otpauth) + Daemon.currentWallet.finish_otp(dialog.otpauth) + }) + dialog.open() + } function onBroadcastFailed(txid, code, message) { var dialog = app.messageDialog.createObject(app, { text: message @@ -289,22 +298,6 @@ Item { } } - Connections { - target: Daemon.currentWallet - function onOtpRequested() { - console.log('OTP requested') - var dialog = otpDialog.createObject(mainView) - dialog.accepted.connect(function() { - console.log('accepted ' + dialog.otpauth) - Daemon.currentWallet.finish_otp(dialog.otpauth) - }) - dialog.open() - } - function onBroadcastFailed() { - notificationPopup.show(qsTr('Broadcast transaction failed')) - } - } - Component { id: sendDialog SendDialog {