Browse Source

qml: add lightning node id to walletdetails

master
Sander van Grieken 3 years ago
parent
commit
1731c36234
  1. 36
      electrum/gui/qml/components/WalletDetails.qml
  2. 4
      electrum/gui/qml/qewallet.py

36
electrum/gui/qml/components/WalletDetails.qml

@ -174,6 +174,41 @@ Pane {
visible: Daemon.currentWallet
columns: 2
Label {
Layout.columnSpan: 2
visible: Daemon.currentWallet.isLightning
text: qsTr('Lightning Node ID')
color: Material.accentColor
}
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
visible: Daemon.currentWallet.isLightning
RowLayout {
width: parent.width
Label {
Layout.fillWidth: true
text: Daemon.currentWallet.lightningNodePubkey
wrapMode: Text.Wrap
font.family: FixedFont
font.pixelSize: constants.fontSizeMedium
}
ToolButton {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
onClicked: {
var dialog = app.genericShareDialog.createObject(rootItem, {
title: qsTr('Lightning Node ID'),
text: Daemon.currentWallet.lightningNodePubkey
})
dialog.open()
}
}
}
}
Label {
visible: _is2fa
text: qsTr('2FA')
@ -278,6 +313,7 @@ Pane {
Layout.fillWidth: true
text: modelData.derivation_prefix
visible: modelData.derivation_prefix
font.family: FixedFont
}
Label {

4
electrum/gui/qml/qewallet.py

@ -349,6 +349,10 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
})
return result
@pyqtProperty(str, notify=dataChanged)
def lightningNodePubkey(self):
return self.wallet.lnworker.node_keypair.pubkey.hex() if self.wallet.lnworker else ''
@pyqtProperty(str, notify=dataChanged)
def derivationPrefix(self):
keystores = self.wallet.get_keystores()

Loading…
Cancel
Save