Browse Source

move channels_updated event handling to ui thread, fix some debug statements

patch-4
Sander van Grieken 3 years ago
parent
commit
e289b8b46c
  1. 2
      electrum/gui/qml/components/OpenChannel.qml
  2. 8
      electrum/gui/qml/qechannellistmodel.py

2
electrum/gui/qml/components/OpenChannel.qml

@ -179,7 +179,7 @@ Pane {
message = message + ' (but no backup. TODO: show QR)'
var dialog = app.messageDialog.createObject(root, { 'text': message })
dialog.open()
// channelopener.wallet.channelModel.new_channel(cid)
channelopener.wallet.channelModel.new_channel(cid)
app.stack.pop()
}
}

8
electrum/gui/qml/qechannellistmodel.py

@ -40,7 +40,7 @@ class QEChannelListModel(QAbstractListModel):
self.destroyed.connect(lambda: self.on_destroy())
def on_network(self, event, *args):
if event == 'channel':
if event in ['channel','channels_updated']:
# Handle in GUI thread (_network_signal -> on_network_qt)
self._network_signal.emit(event, args)
else:
@ -131,7 +131,7 @@ class QEChannelListModel(QAbstractListModel):
def do_update(self, modelindex, channel):
modelitem = self.channels[modelindex]
self._logger.debug(repr(modelitem))
#self._logger.debug(repr(modelitem))
modelitem.update(self.channel_to_model(channel))
mi = self.createIndex(modelindex, 0)
@ -140,7 +140,7 @@ class QEChannelListModel(QAbstractListModel):
@pyqtSlot(str)
def new_channel(self, cid):
self._logger.debug('new channel with cid ' % cid)
self._logger.debug('new channel with cid %s' % cid)
lnchannels = self.wallet.lnworker.channels
for channel in lnchannels.values():
self._logger.debug(repr(channel))
@ -153,7 +153,7 @@ class QEChannelListModel(QAbstractListModel):
@pyqtSlot(str)
def remove_channel(self, cid):
self._logger.debug('remove channel with cid ' % cid)
self._logger.debug('remove channel with cid %s' % cid)
i = 0
for channel in self.channels:
if cid == channel['cid']:

Loading…
Cancel
Save