qml: show request details on receive dialog after adding message/amount
This commit is contained in:
@@ -11,7 +11,7 @@ import "controls"
|
|||||||
ElDialog {
|
ElDialog {
|
||||||
id: dialog
|
id: dialog
|
||||||
|
|
||||||
title: qsTr('Edit payment request details')
|
title: qsTr('Edit payment request')
|
||||||
|
|
||||||
property alias amount: amountBtc.text
|
property alias amount: amountBtc.text
|
||||||
property alias description: message.text
|
property alias description: message.text
|
||||||
@@ -20,6 +20,7 @@ ElDialog {
|
|||||||
parent: Overlay.overlay
|
parent: Overlay.overlay
|
||||||
modal: true
|
modal: true
|
||||||
standardButtons: Dialog.Close
|
standardButtons: Dialog.Close
|
||||||
|
iconSource: Qt.resolvedUrl('../../icons/pen.png')
|
||||||
|
|
||||||
Overlay.modal: Rectangle {
|
Overlay.modal: Rectangle {
|
||||||
color: "#aa000000"
|
color: "#aa000000"
|
||||||
@@ -93,14 +94,12 @@ ElDialog {
|
|||||||
|
|
||||||
Item { width: 1; height: 1; Layout.fillWidth: true }
|
Item { width: 1; height: 1; Layout.fillWidth: true }
|
||||||
|
|
||||||
Button {
|
FlatButton {
|
||||||
Layout.columnSpan: 4
|
Layout.columnSpan: 4
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.fillWidth: true
|
||||||
text: qsTr('Create Request')
|
text: qsTr('Apply')
|
||||||
icon.source: '../../icons/qrcode.png'
|
icon.source: '../../icons/confirmed.png'
|
||||||
onClicked: {
|
onClicked: accept()
|
||||||
accept()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -164,6 +164,57 @@ ElDialog {
|
|||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GridLayout {
|
||||||
|
columns: 2
|
||||||
|
visible: request.message || !request.amount.isEmpty
|
||||||
|
Layout.maximumWidth: qrloader.width
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: request.message
|
||||||
|
text: qsTr('Message')
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
visible: request.message
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: request.message
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
visible: !request.amount.isEmpty
|
||||||
|
text: qsTr('Amount')
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
visible: !request.amount.isEmpty
|
||||||
|
Label {
|
||||||
|
text: Config.formatSats(request.amount)
|
||||||
|
font.family: FixedFont
|
||||||
|
font.pixelSize: constants.fontSizeMedium
|
||||||
|
font.bold: true
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
text: Config.baseUnit
|
||||||
|
color: Material.accentColor
|
||||||
|
font.pixelSize: constants.fontSizeMedium
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
visible: Daemon.fx.enabled
|
||||||
|
text: '(' + Daemon.fx.fiatValue(request.amount, false) + ' ' + Daemon.fx.fiatCurrency + ')'
|
||||||
|
font.pixelSize: constants.fontSizeMedium
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
visible: request.message || !request.amount.isEmpty
|
||||||
|
height: 1
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
Layout.preferredWidth: qrloader.width
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
FlatButton {
|
FlatButton {
|
||||||
|
|||||||
@@ -76,12 +76,11 @@ class QERequestDetails(QObject):
|
|||||||
statusChanged = pyqtSignal()
|
statusChanged = pyqtSignal()
|
||||||
@pyqtProperty(int, notify=statusChanged)
|
@pyqtProperty(int, notify=statusChanged)
|
||||||
def status(self):
|
def status(self):
|
||||||
req = self._wallet.wallet.get_request(self._key)
|
return self._wallet.wallet.get_invoice_status(self._req)
|
||||||
return self._wallet.wallet.get_invoice_status(req)
|
|
||||||
|
|
||||||
@pyqtProperty(str, notify=statusChanged)
|
@pyqtProperty(str, notify=statusChanged)
|
||||||
def status_str(self):
|
def status_str(self):
|
||||||
return self._req.get_status_str(self.status)
|
return self._req.get_status_str(self.status) if self._req else ''
|
||||||
|
|
||||||
@pyqtProperty(bool, notify=detailsChanged)
|
@pyqtProperty(bool, notify=detailsChanged)
|
||||||
def isLightning(self):
|
def isLightning(self):
|
||||||
@@ -94,7 +93,7 @@ class QERequestDetails(QObject):
|
|||||||
|
|
||||||
@pyqtProperty(str, notify=detailsChanged)
|
@pyqtProperty(str, notify=detailsChanged)
|
||||||
def message(self):
|
def message(self):
|
||||||
return self._req.get_message()
|
return self._req.get_message() if self._req else ''
|
||||||
|
|
||||||
@pyqtProperty(QEAmount, notify=detailsChanged)
|
@pyqtProperty(QEAmount, notify=detailsChanged)
|
||||||
def amount(self):
|
def amount(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user