Autofold/unfold when enabling/disabling

Fixes #93
This commit is contained in:
mailchuck 2015-11-09 18:45:35 +01:00
parent c1269d9d56
commit e72773c5bb
Signed by untrusted user who does not match committer: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -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