From 5ee91594d3ac7baef959fd97ed90f6652a6335b4 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 24 Feb 2023 11:15:12 +0100 Subject: [PATCH] qml: replace Enter manually option in SendDialog with Invoices, which is removed from main menu --- electrum/gui/qml/components/SendDialog.qml | 56 ++----------------- .../gui/qml/components/WalletMainView.qml | 9 --- 2 files changed, 5 insertions(+), 60 deletions(-) diff --git a/electrum/gui/qml/components/SendDialog.qml b/electrum/gui/qml/components/SendDialog.qml index 56e4457a0..11df6b8f6 100644 --- a/electrum/gui/qml/components/SendDialog.qml +++ b/electrum/gui/qml/components/SendDialog.qml @@ -55,14 +55,12 @@ ElDialog { FlatButton { Layout.fillWidth: true Layout.preferredWidth: 1 - icon.source: '../../icons/pen.png' - text: qsTr('Manual input') + icon.source: '../../icons/tab_receive.png' + text: qsTr('Invoices') + enabled: Daemon.currentWallet.invoiceModel.rowCount() // TODO: only count non-expired onClicked: { - var _mid = manualInputDialog.createObject(mainView) - _mid.accepted.connect(function() { - dialog.dispatch(_mid.recipient) - }) - _mid.open() + dialog.close() + app.stack.push(Qt.resolvedUrl('Invoices.qml')) } } @@ -77,50 +75,6 @@ ElDialog { } - Component { - id: manualInputDialog - ElDialog { - property alias recipient: recipientTextEdit.text - - iconSource: Qt.resolvedUrl('../../icons/pen.png') - - anchors.centerIn: parent - implicitWidth: parent.width * 0.9 - - parent: Overlay.overlay - modal: true - - Overlay.modal: Rectangle { - color: "#aa000000" - } - - title: qsTr('Manual Input') - - ColumnLayout { - width: parent.width - - Label { - text: 'Enter a bitcoin address or a Lightning invoice' - wrapMode: Text.Wrap - Layout.maximumWidth: parent.width - } - - TextField { - id: recipientTextEdit - topPadding: constants.paddingXXLarge - bottomPadding: constants.paddingXXLarge - Layout.preferredWidth: parent.width - font.family: FixedFont - - wrapMode: TextInput.WrapAnywhere - placeholderText: qsTr('Enter the payment request here') - } - } - - onClosed: destroy() - } - } - Bitcoin { id: bitcoin } diff --git a/electrum/gui/qml/components/WalletMainView.qml b/electrum/gui/qml/components/WalletMainView.qml index 8b913af7d..72a4df14b 100644 --- a/electrum/gui/qml/components/WalletMainView.qml +++ b/electrum/gui/qml/components/WalletMainView.qml @@ -48,15 +48,6 @@ Item { } id: menu - MenuItem { - icon.color: 'transparent' - action: Action { - text: qsTr('Invoices'); - onTriggered: menu.openPage(Qt.resolvedUrl('Invoices.qml')) - enabled: Daemon.currentWallet - icon.source: '../../icons/tab_receive.png' - } - } MenuItem { icon.color: 'transparent' action: Action {