From 321bf9a6c99ef3c0fcdb7f201ccb5d379f8ef645 Mon Sep 17 00:00:00 2001 From: mailchuck Date: Mon, 5 Oct 2015 17:07:23 +0200 Subject: [PATCH] Chan UI fix Minor chan UI fix. Still not completely smooth but mostly working. --- src/bitmessageqt/__init__.py | 7 +++++-- src/bitmessageqt/account.py | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index dfd381c1..e6544da8 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -2667,7 +2667,7 @@ more work your computer must do to send the message. A Time-To-Live of four or f acct = accountClass(addressAtCurrentRow) # no chans / mailinglists if acct.type != 'normal': - continue + return if self.dialog.ui.radioButtonUnregister.isChecked(): print "unregister" acct.unregister() @@ -3481,7 +3481,10 @@ more work your computer must do to send the message. A Time-To-Live of four or f if column != 0: return # only account names of normal addresses (no chans/mailinglists) - if (not isinstance(item, Ui_AddressWidget)) or item.type != 'normal': + if (not isinstance(item, Ui_AddressWidget)) or item.type != 'normal' or self.getCurrentTreeWidget().currentItem() is None: + return + # not visible + if (not self.getCurrentAccount()) or (not isinstance (self.getCurrentAccount(), Ui_AddressWidget)): return # only currently selected item if item.address != self.getCurrentTreeWidget().currentItem().address: diff --git a/src/bitmessageqt/account.py b/src/bitmessageqt/account.py index 05613e47..f140235c 100644 --- a/src/bitmessageqt/account.py +++ b/src/bitmessageqt/account.py @@ -28,6 +28,12 @@ def accountClass(address): class BMAccount(object): def __init__(self, address = None): self.address = address + self.type = 'normal' + if shared.config.has_section(address): + if shared.safeConfigGetBoolean(self.address, 'chan'): + self.type = "chan" + elif shared.safeConfigGetBoolean(self.address, 'mailinglist'): + self.type = "mailinglist" def getLabel(self, address = None): if address is None: