qml: show request details on receive dialog after adding message/amount
This commit is contained in:
@@ -11,7 +11,7 @@ import "controls"
|
||||
ElDialog {
|
||||
id: dialog
|
||||
|
||||
title: qsTr('Edit payment request details')
|
||||
title: qsTr('Edit payment request')
|
||||
|
||||
property alias amount: amountBtc.text
|
||||
property alias description: message.text
|
||||
@@ -20,6 +20,7 @@ ElDialog {
|
||||
parent: Overlay.overlay
|
||||
modal: true
|
||||
standardButtons: Dialog.Close
|
||||
iconSource: Qt.resolvedUrl('../../icons/pen.png')
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: "#aa000000"
|
||||
@@ -93,14 +94,12 @@ ElDialog {
|
||||
|
||||
Item { width: 1; height: 1; Layout.fillWidth: true }
|
||||
|
||||
Button {
|
||||
FlatButton {
|
||||
Layout.columnSpan: 4
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: qsTr('Create Request')
|
||||
icon.source: '../../icons/qrcode.png'
|
||||
onClicked: {
|
||||
accept()
|
||||
}
|
||||
Layout.fillWidth: true
|
||||
text: qsTr('Apply')
|
||||
icon.source: '../../icons/confirmed.png'
|
||||
onClicked: accept()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -164,6 +164,57 @@ ElDialog {
|
||||
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 {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
FlatButton {
|
||||
|
||||
@@ -76,12 +76,11 @@ class QERequestDetails(QObject):
|
||||
statusChanged = pyqtSignal()
|
||||
@pyqtProperty(int, notify=statusChanged)
|
||||
def status(self):
|
||||
req = self._wallet.wallet.get_request(self._key)
|
||||
return self._wallet.wallet.get_invoice_status(req)
|
||||
return self._wallet.wallet.get_invoice_status(self._req)
|
||||
|
||||
@pyqtProperty(str, notify=statusChanged)
|
||||
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)
|
||||
def isLightning(self):
|
||||
@@ -94,7 +93,7 @@ class QERequestDetails(QObject):
|
||||
|
||||
@pyqtProperty(str, notify=detailsChanged)
|
||||
def message(self):
|
||||
return self._req.get_message()
|
||||
return self._req.get_message() if self._req else ''
|
||||
|
||||
@pyqtProperty(QEAmount, notify=detailsChanged)
|
||||
def amount(self):
|
||||
|
||||
Reference in New Issue
Block a user