"All accounts" can't be renamed
Minor error
This commit is contained in:
parent
106ac6ce78
commit
bf93a394c0
|
@ -478,7 +478,6 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
subwidget = Ui_FolderWidget(widget, j, toAddress, folder, 0)
|
||||
j += 1
|
||||
widget.setUnreadCount(unread)
|
||||
widget.setFlags (widget.flags() | QtCore.Qt.ItemIsEditable)
|
||||
i += 1
|
||||
|
||||
treeWidget.setSortingEnabled(True)
|
||||
|
@ -593,7 +592,6 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
unread += db[toAddress][folder]
|
||||
j += 1
|
||||
widget.setUnreadCount(unread)
|
||||
widget.setFlags (widget.flags() | QtCore.Qt.ItemIsEditable)
|
||||
i += 1
|
||||
|
||||
treeWidget.setSortingEnabled(True)
|
||||
|
@ -3939,6 +3937,9 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
# only currently selected item
|
||||
if item.address != self.getCurrentAccount():
|
||||
return
|
||||
# "All accounts" can't be renamed
|
||||
if item.type == AccountMixin.ALL:
|
||||
return
|
||||
|
||||
newLabel = str(item.text(0))
|
||||
if item.type == AccountMixin.SUBSCRIPTION:
|
||||
|
|
|
@ -61,8 +61,10 @@ class AccountMixin (object):
|
|||
self.updateText()
|
||||
|
||||
def setType(self):
|
||||
self.setFlags(self.flags() | QtCore.Qt.ItemIsEditable)
|
||||
if self.address is None:
|
||||
self.type = self.ALL
|
||||
self.setFlags(self.flags() & ~QtCore.Qt.ItemIsEditable)
|
||||
elif shared.safeConfigGetBoolean(self.address, 'chan'):
|
||||
self.type = self.CHAN
|
||||
elif shared.safeConfigGetBoolean(self.address, 'mailinglist'):
|
||||
|
@ -246,7 +248,8 @@ class Ui_SubscriptionWidget(Ui_AddressWidget, AccountMixin):
|
|||
return unicode(self.label, 'utf-8)')
|
||||
|
||||
def setType(self):
|
||||
self.type = self.SUBSCRIPTION
|
||||
super(Ui_SubscriptionWidget, self).setType() # sets it editable
|
||||
self.type = self.SUBSCRIPTION # overrides type
|
||||
|
||||
def setData(self, column, role, value):
|
||||
if role == QtCore.Qt.EditRole:
|
||||
|
|
Loading…
Reference in New Issue
Block a user