implement enable lightning button
This commit is contained in:
@@ -48,7 +48,26 @@ Pane {
|
|||||||
Label { text: Daemon.currentWallet.isLightning }
|
Label { text: Daemon.currentWallet.isLightning }
|
||||||
|
|
||||||
Label { text: 'has Seed'; color: Material.accentColor }
|
Label { text: 'has Seed'; color: Material.accentColor }
|
||||||
Label { text: Daemon.currentWallet.hasSeed; Layout.columnSpan: 3 }
|
Label { text: Daemon.currentWallet.hasSeed }
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
visible: !Daemon.currentWallet.isLightning && Daemon.currentWallet.canHaveLightning
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
|
Button {
|
||||||
|
enabled: Daemon.currentWallet.canHaveLightning && !Daemon.currentWallet.isLightning
|
||||||
|
text: qsTr('Enable Lightning')
|
||||||
|
onClicked: Daemon.currentWallet.enableLightning()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
visible: Daemon.currentWallet.isLightning || !Daemon.currentWallet.canHaveLightning
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.preferredHeight: 1
|
||||||
|
Layout.preferredWidth: 1
|
||||||
|
}
|
||||||
|
|
||||||
Label { Layout.columnSpan:4; text: qsTr('Master Public Key'); color: Material.accentColor }
|
Label { Layout.columnSpan:4; text: qsTr('Master Public Key'); color: Material.accentColor }
|
||||||
|
|
||||||
|
|||||||
@@ -243,6 +243,10 @@ class QEWallet(QObject):
|
|||||||
def isLightning(self):
|
def isLightning(self):
|
||||||
return bool(self.wallet.lnworker)
|
return bool(self.wallet.lnworker)
|
||||||
|
|
||||||
|
@pyqtProperty(bool, notify=dataChanged)
|
||||||
|
def canHaveLightning(self):
|
||||||
|
return self.wallet.can_have_lightning()
|
||||||
|
|
||||||
@pyqtProperty(bool, notify=dataChanged)
|
@pyqtProperty(bool, notify=dataChanged)
|
||||||
def hasSeed(self):
|
def hasSeed(self):
|
||||||
return self.wallet.has_seed()
|
return self.wallet.has_seed()
|
||||||
@@ -318,6 +322,10 @@ class QEWallet(QObject):
|
|||||||
self._lightningcanreceive = QEAmount(amount_sat=self.wallet.lnworker.num_sats_can_receive())
|
self._lightningcanreceive = QEAmount(amount_sat=self.wallet.lnworker.num_sats_can_receive())
|
||||||
return self._lightningcanreceive
|
return self._lightningcanreceive
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def enableLightning(self):
|
||||||
|
self.wallet.init_lightning(password=None) # TODO pass password if needed
|
||||||
|
self.isLightningChanged.emit()
|
||||||
|
|
||||||
@pyqtSlot('QString', int, int, bool)
|
@pyqtSlot('QString', int, int, bool)
|
||||||
def send_onchain(self, address, amount, fee=None, rbf=False):
|
def send_onchain(self, address, amount, fee=None, rbf=False):
|
||||||
|
|||||||
Reference in New Issue
Block a user