channels_list: use icon to tell apart channels from backups
This commit is contained in:
@@ -21,6 +21,7 @@ from electrum.gui import messages
|
|||||||
from .util import (MyTreeView, WindowModalDialog, Buttons, OkButton, CancelButton,
|
from .util import (MyTreeView, WindowModalDialog, Buttons, OkButton, CancelButton,
|
||||||
EnterButton, WaitingDialog, MONOSPACE_FONT, ColorScheme)
|
EnterButton, WaitingDialog, MONOSPACE_FONT, ColorScheme)
|
||||||
from .amountedit import BTCAmountEdit, FreezableLineEdit
|
from .amountedit import BTCAmountEdit, FreezableLineEdit
|
||||||
|
from .util import read_QIcon
|
||||||
|
|
||||||
|
|
||||||
ROLE_CHANNEL_ID = Qt.UserRole
|
ROLE_CHANNEL_ID = Qt.UserRole
|
||||||
@@ -296,6 +297,8 @@ class ChannelsList(MyTreeView):
|
|||||||
items[self.Columns.LOCAL_BALANCE].setFont(QFont(MONOSPACE_FONT))
|
items[self.Columns.LOCAL_BALANCE].setFont(QFont(MONOSPACE_FONT))
|
||||||
items[self.Columns.REMOTE_BALANCE].setFont(QFont(MONOSPACE_FONT))
|
items[self.Columns.REMOTE_BALANCE].setFont(QFont(MONOSPACE_FONT))
|
||||||
items[self.Columns.CAPACITY].setFont(QFont(MONOSPACE_FONT))
|
items[self.Columns.CAPACITY].setFont(QFont(MONOSPACE_FONT))
|
||||||
|
icon = "lightning" if not chan.is_backup() else "network"
|
||||||
|
items[self.Columns.SHORT_CHANID].setIcon(read_QIcon(icon))
|
||||||
self._update_chan_frozen_bg(chan=chan, items=items)
|
self._update_chan_frozen_bg(chan=chan, items=items)
|
||||||
self.model().insertRow(0, items)
|
self.model().insertRow(0, items)
|
||||||
|
|
||||||
|
|||||||
@@ -335,7 +335,6 @@ class AbstractChannel(Logger, ABC):
|
|||||||
def get_funding_address(self) -> str:
|
def get_funding_address(self) -> str:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
|
||||||
def get_state_for_GUI(self) -> str:
|
def get_state_for_GUI(self) -> str:
|
||||||
cs = self.get_state()
|
cs = self.get_state()
|
||||||
if cs < ChannelState.CLOSED and self.force_close_detected:
|
if cs < ChannelState.CLOSED and self.force_close_detected:
|
||||||
@@ -479,10 +478,6 @@ class ChannelBackup(AbstractChannel):
|
|||||||
def is_initiator(self):
|
def is_initiator(self):
|
||||||
return self.cb.is_initiator
|
return self.cb.is_initiator
|
||||||
|
|
||||||
def get_state_for_GUI(self):
|
|
||||||
cs_name = super().get_state_for_GUI()
|
|
||||||
return 'BACKUP' + ', '+ cs_name
|
|
||||||
|
|
||||||
def get_oldest_unrevoked_ctn(self, who):
|
def get_oldest_unrevoked_ctn(self, who):
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user