1
0

qml: move technical details to bottom of InvoiceDialog, add routing hints

This commit is contained in:
Sander van Grieken
2023-03-15 15:18:48 +01:00
parent 206bacbcb3
commit 2881c49671
2 changed files with 134 additions and 83 deletions

View File

@@ -118,82 +118,6 @@ ElDialog {
}
}
Label {
Layout.columnSpan: 2
Layout.topMargin: constants.paddingSmall
visible: invoice.invoiceType == Invoice.LightningInvoice
text: qsTr('Remote Pubkey')
color: Material.accentColor
}
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
visible: invoice.invoiceType == Invoice.LightningInvoice
leftPadding: constants.paddingMedium
RowLayout {
width: parent.width
Label {
id: pubkeyLabel
Layout.fillWidth: true
text: 'pubkey' in invoice.lnprops ? invoice.lnprops.pubkey : ''
font.family: FixedFont
wrapMode: Text.Wrap
}
ToolButton {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
enabled: pubkeyLabel.text
onClicked: {
var dialog = app.genericShareDialog.createObject(app,
{ title: qsTr('Node public key'), text: invoice.lnprops.pubkey }
)
dialog.open()
}
}
}
}
Label {
Layout.columnSpan: 2
Layout.topMargin: constants.paddingSmall
visible: invoice.invoiceType == Invoice.LightningInvoice
text: qsTr('Payment hash')
color: Material.accentColor
}
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
visible: invoice.invoiceType == Invoice.LightningInvoice
leftPadding: constants.paddingMedium
RowLayout {
width: parent.width
Label {
id: paymenthashLabel
Layout.fillWidth: true
text: 'payment_hash' in invoice.lnprops ? invoice.lnprops.payment_hash : ''
font.family: FixedFont
wrapMode: Text.Wrap
}
ToolButton {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
enabled: paymenthashLabel.text
onClicked: {
var dialog = app.genericShareDialog.createObject(app,
{ title: qsTr('Payment hash'), text: invoice.lnprops.payment_hash }
)
dialog.open()
}
}
}
}
Label {
Layout.columnSpan: 2
Layout.topMargin: constants.paddingSmall
@@ -366,6 +290,118 @@ ElDialog {
}
Heading {
Layout.columnSpan: 2
text: qsTr('Technical properties')
}
Label {
Layout.columnSpan: 2
Layout.topMargin: constants.paddingSmall
visible: invoice.invoiceType == Invoice.LightningInvoice
text: qsTr('Remote Pubkey')
color: Material.accentColor
}
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
visible: invoice.invoiceType == Invoice.LightningInvoice
leftPadding: constants.paddingMedium
RowLayout {
width: parent.width
Label {
id: pubkeyLabel
Layout.fillWidth: true
text: 'pubkey' in invoice.lnprops ? invoice.lnprops.pubkey : ''
font.family: FixedFont
wrapMode: Text.Wrap
}
ToolButton {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
enabled: pubkeyLabel.text
onClicked: {
var dialog = app.genericShareDialog.createObject(app,
{ title: qsTr('Node public key'), text: invoice.lnprops.pubkey }
)
dialog.open()
}
}
}
}
Label {
Layout.columnSpan: 2
Layout.topMargin: constants.paddingSmall
visible: invoice.invoiceType == Invoice.LightningInvoice
text: qsTr('Payment hash')
color: Material.accentColor
}
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
visible: invoice.invoiceType == Invoice.LightningInvoice
leftPadding: constants.paddingMedium
RowLayout {
width: parent.width
Label {
id: paymenthashLabel
Layout.fillWidth: true
text: 'payment_hash' in invoice.lnprops ? invoice.lnprops.payment_hash : ''
font.family: FixedFont
wrapMode: Text.Wrap
}
ToolButton {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
enabled: paymenthashLabel.text
onClicked: {
var dialog = app.genericShareDialog.createObject(app, {
title: qsTr('Payment hash'),
text: invoice.lnprops.payment_hash
})
dialog.open()
}
}
}
}
Label {
Layout.columnSpan: 2
Layout.topMargin: constants.paddingSmall
visible: 'r' in invoice.lnprops && invoice.lnprops.r.length
text: qsTr('Routing hints')
color: Material.accentColor
}
Repeater {
visible: 'r' in invoice.lnprops && invoice.lnprops.r.length
model: invoice.lnprops.r
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
RowLayout {
width: parent.width
Label {
text: modelData.scid
}
Label {
Layout.fillWidth: true
text: modelData.node
wrapMode: Text.Wrap
}
}
}
}
}
}