Browse Source

add manual input option

patch-4
Sander van Grieken 2 years ago
parent
commit
58e3e0c235
  1. 53
      electrum/gui/qml/components/SendDialog.qml
  2. 17
      electrum/gui/qml/components/WalletMainView.qml

53
electrum/gui/qml/components/SendDialog.qml

@ -2,7 +2,6 @@ import QtQuick 2.6
import QtQuick.Controls 2.14 import QtQuick.Controls 2.14
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material 2.0
import QtQml.Models 2.1
import org.electrum 1.0 import org.electrum 1.0
@ -13,8 +12,6 @@ ElDialog {
property InvoiceParser invoiceParser property InvoiceParser invoiceParser
signal manualInput
parent: Overlay.overlay parent: Overlay.overlay
modal: true modal: true
standardButtons: Dialog.Close standardButtons: Dialog.Close
@ -28,8 +25,6 @@ ElDialog {
padding: 0 padding: 0
onClosed: destroy()
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
@ -44,7 +39,12 @@ ElDialog {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr('Manual input') text: qsTr('Manual input')
onClicked: { onClicked: {
manualInput() var _mid = manualInputDialog.createObject(mainView)
_mid.accepted.connect(function() {
console.log(_mid.recipient)
invoiceParser.recipient = _mid.recipient
})
_mid.open()
} }
} }
@ -55,4 +55,45 @@ ElDialog {
} }
} }
Component {
id: manualInputDialog
ElDialog {
property alias recipient: recipientTextEdit.text
anchors.centerIn: parent
implicitWidth: parent.width * 0.9
parent: Overlay.overlay
modal: true
standardButtons: Dialog.Ok
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
}
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()
}
}
} }

17
electrum/gui/qml/components/WalletMainView.qml

@ -73,8 +73,6 @@ Item {
} }
} }
property var _sendDialog
ColumnLayout { ColumnLayout {
anchors.centerIn: parent anchors.centerIn: parent
width: parent.width width: parent.width
@ -115,11 +113,7 @@ Item {
text: qsTr('Send') text: qsTr('Send')
onClicked: { onClicked: {
console.log('send') console.log('send')
var comp = Qt.createComponent(Qt.resolvedUrl('SendDialog.qml')) _sendDialog = sendDialog.createObject(mainView, {invoiceParser: invoiceParser})
if (comp.status == Component.Error)
console.log(comp.errorString())
_sendDialog = comp.createObject(mainView, { invoiceParser: invoiceParser } )
// dialog.
_sendDialog.open() _sendDialog.open()
} }
} }
@ -215,6 +209,15 @@ Item {
} }
} }
property var _sendDialog
Component {
id: sendDialog
SendDialog {
onClosed: destroy()
}
}
Component { Component {
id: confirmPaymentDialog id: confirmPaymentDialog
ConfirmTxDialog { ConfirmTxDialog {

Loading…
Cancel
Save