From e3ffc560cb5c72da87aa9f0135ebddeed6c7c455 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 9fe593ad..600cb78b 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -2665,7 +2665,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() @@ -3479,7 +3479,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: