From 2783a1c1e5d7fb21fade87c87efaf6133e20b0ee Mon Sep 17 00:00:00 2001 From: mailchuck Date: Mon, 9 Nov 2015 18:45:35 +0100 Subject: [PATCH] Autofold/unfold when enabling/disabling Fixes #93 --- src/bitmessageqt/foldertree.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bitmessageqt/foldertree.py b/src/bitmessageqt/foldertree.py index 6f5ad40c..1aab7e0e 100644 --- a/src/bitmessageqt/foldertree.py +++ b/src/bitmessageqt/foldertree.py @@ -29,6 +29,8 @@ class AccountMixin (object): def setEnabled(self, enabled): self.isEnabled = enabled + if hasattr(self, "setExpanded"): + self.setExpanded(enabled) self.updateText() def setType(self): @@ -107,9 +109,8 @@ class Ui_AddressWidget(QtGui.QTreeWidgetItem, AccountMixin): self.setAddress(address) self.setEnabled(enabled) self.setUnreadCount(unreadCount) - self.setType() self.initialised = True - self.setExpanded(enabled) # does updateText + self.setType() # does updateText def setAddress(self, address): super(Ui_AddressWidget, self).setAddress(address) @@ -182,9 +183,8 @@ class Ui_SubscriptionWidget(Ui_AddressWidget, AccountMixin): self.setEnabled(enabled) self.setType() self.setLabel(label) - self.setUnreadCount (unreadCount) self.initialised = True - self.setExpanded(enabled) # does updateText + self.setUnreadCount (unreadCount) # does updateText def setLabel(self, label): self.label = label