Browse Source

qml: make request types clickable, some fixes

patch-4
Sander van Grieken 2 years ago
parent
commit
fd791f4fb1
  1. 6
      electrum/gui/qml/components/InvoiceDialog.qml
  2. 10
      electrum/gui/qml/components/Pin.qml
  3. 2
      electrum/gui/qml/components/ReceiveDetailsDialog.qml
  4. 15
      electrum/gui/qml/components/ReceiveDialog.qml
  5. 2
      electrum/gui/qml/qewallet.py

6
electrum/gui/qml/components/InvoiceDialog.qml

@ -227,7 +227,7 @@ ElDialog {
Label {
visible: invoice.invoiceType == Invoice.LightningInvoice
Layout.fillWidth: true
text: invoice.lnprops.pubkey
text: invoice.lnprops ? invoice.lnprops.pubkey : ''
font.family: FixedFont
wrapMode: Text.Wrap
}
@ -241,7 +241,7 @@ ElDialog {
Label {
visible: invoice.invoiceType == Invoice.LightningInvoice
Layout.fillWidth: true
text: invoice.lnprops.t
text: invoice.lnprops ? invoice.lnprops.t : ''
font.family: FixedFont
wrapMode: Text.Wrap
}
@ -255,7 +255,7 @@ ElDialog {
Label {
visible: invoice.invoiceType == Invoice.LightningInvoice
Layout.fillWidth: true
text: invoice.lnprops.r
text: invoice.lnprops ? invoice.lnprops.r : ''
font.family: FixedFont
wrapMode: Text.Wrap
}

10
electrum/gui/qml/components/Pin.qml

@ -15,8 +15,7 @@ ElDialog {
width: parent.width * 2/3
height: parent.height * 1/3
x: (parent.width - width) / 2
y: (parent.height - height) / 2
anchors.centerIn: parent
modal: true
parent: Overlay.overlay
@ -121,7 +120,7 @@ ElDialog {
TextField {
id: pin
Layout.preferredWidth: root.width *2/3
Layout.preferredWidth: fontMetrics.advanceWidth(passwordCharacter) * 6
Layout.alignment: Qt.AlignHCenter
font.pixelSize: constants.fontSizeXXLarge
maximumLength: 6
@ -146,4 +145,9 @@ ElDialog {
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
}
FontMetrics {
id: fontMetrics
font: pin.font
}
}

2
electrum/gui/qml/components/ReceiveDetailsDialog.qml

@ -25,6 +25,8 @@ ElDialog {
color: "#aa000000"
}
implicitWidth: parent.width
GridLayout {
id: form
width: parent.width

15
electrum/gui/qml/components/ReceiveDialog.qml

@ -120,6 +120,11 @@ ElDialog {
id: bolt11label
text: qsTr('Lightning')
color: _bolt11 ? Material.foreground : constants.mutedForeground
MouseArea {
anchors.fill: parent
enabled: _bolt11
onClicked: rootLayout.state = 'bolt11'
}
}
Rectangle {
Layout.preferredWidth: constants.paddingXXSmall
@ -131,6 +136,11 @@ ElDialog {
id: bip21label
text: qsTr('URI')
color: _bip21uri ? Material.foreground : constants.mutedForeground
MouseArea {
anchors.fill: parent
enabled: _bip21uri
onClicked: rootLayout.state = 'bip21uri'
}
}
Rectangle {
Layout.preferredWidth: constants.paddingXXSmall
@ -142,6 +152,11 @@ ElDialog {
id: addresslabel
text: qsTr('Address')
color: _address ? Material.foreground : constants.mutedForeground
MouseArea {
anchors.fill: parent
enabled: _address
onClicked: rootLayout.state = 'address'
}
}
}

2
electrum/gui/qml/qewallet.py

@ -534,7 +534,7 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
def createDefaultRequest(self, ignore_gap: bool = False):
try:
default_expiry = self.wallet.config.get('request_expiry', PR_DEFAULT_EXPIRATION_WHEN_CREATING)
if self.wallet.lnworker.channels:
if self.wallet.lnworker and self.wallet.lnworker.channels:
addr = None
if self.wallet.config.get('bolt11_fallback', True):
addr = self.wallet.get_unused_address()

Loading…
Cancel
Save