1
0

qml: remove display states in ReceiveDialog, add balance check for enabling Lightning receive option.

This commit is contained in:
Sander van Grieken
2025-02-24 17:49:52 +01:00
committed by ThomasV
parent 3d2531cb93
commit d005da1ea2
2 changed files with 9 additions and 57 deletions

View File

@@ -106,6 +106,7 @@ ElDialog {
}
FlatButton {
Layout.fillWidth: true
enabled: Daemon.currentWallet.isLightning && Daemon.currentWallet.lightningCanReceive.satsInt > amountBtc.textAsSats.satsInt
text: qsTr('Lightning')
icon.source: '../../icons/lightning.png'
onClicked: { dialog.isLightning = true; doAccept() }

View File

@@ -48,21 +48,6 @@ ElDialog {
width: parent.width
spacing: constants.paddingMedium
states: [
State {
name: 'bolt11'
PropertyChanges { target: qrloader; sourceComponent: qri_bolt11 }
},
State {
name: 'bip21uri'
PropertyChanges { target: qrloader; sourceComponent: qri_bip21uri }
},
State {
name: 'address'
PropertyChanges { target: qrloader; sourceComponent: qri_address }
}
]
TextHighlightPane {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
@@ -80,33 +65,15 @@ ElDialog {
color: 'white'
Loader {
id: qrloader
QRImage {
anchors.centerIn: parent
Component {
id: qri_bolt11
QRImage {
qrdata: _bolt11
render: _render_qr
enableToggleText: true
}
}
Component {
id: qri_bip21uri
QRImage {
qrdata: _bip21uri
render: _render_qr
enableToggleText: true
}
}
Component {
id: qri_address
QRImage {
qrdata: _address
render: _render_qr
enableToggleText: true
}
}
qrdata: _bolt11
? _bolt11
: _bip21uri
? _bip21uri
: _address
render: _render_qr
enableToggleText: true
}
}
}
@@ -250,22 +217,6 @@ ElDialog {
RequestDetails {
id: request
wallet: Daemon.currentWallet
onDetailsChanged: {
var req_type = Config.preferredRequestType
if (bolt11 && req_type == 'bolt11') {
rootLayout.state = 'bolt11'
} else if (bip21 && req_type == 'bip21uri') {
rootLayout.state = 'bip21uri'
} else if (req_type == 'address') {
rootLayout.state = 'address'
} else if (bolt11) {
rootLayout.state = 'bolt11'
} else if (bip21) {
rootLayout.state = 'bip21uri'
} else {
rootLayout.state = 'address'
}
}
onStatusChanged: {
if (status == RequestDetails.Paid || status == RequestDetails.Unconfirmed) {
_ispaid = true