parent
77382a2424
commit
63431556be
|
@ -444,6 +444,8 @@ class MyForm(QtGui.QMainWindow):
|
|||
newSubItem = Ui_FolderWidget(newItem, 0, address, folder, 0)
|
||||
|
||||
newItem.setUnreadCount(unread)
|
||||
newItem.setFlags (newItem.flags() | QtCore.Qt.ItemIsEditable)
|
||||
|
||||
treeWidget.setSortingEnabled(True)
|
||||
|
||||
def rerenderTabTreeMessages(self):
|
||||
|
@ -537,7 +539,6 @@ class MyForm(QtGui.QMainWindow):
|
|||
unread += db[toAddress][folder]
|
||||
j += 1
|
||||
widget.setUnreadCount(unread)
|
||||
if (tab == 'messages'):
|
||||
widget.setFlags (widget.flags() | QtCore.Qt.ItemIsEditable)
|
||||
i += 1
|
||||
|
||||
|
@ -658,8 +659,12 @@ class MyForm(QtGui.QMainWindow):
|
|||
"itemChanged (QTreeWidgetItem *, int)"), self.treeWidgetItemChanged)
|
||||
QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL(
|
||||
"itemSelectionChanged ()"), self.treeWidgetItemClicked)
|
||||
QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL(
|
||||
"itemChanged (QTreeWidgetItem *, int)"), self.treeWidgetItemChanged)
|
||||
QtCore.QObject.connect(self.ui.treeWidgetChans, QtCore.SIGNAL(
|
||||
"itemSelectionChanged ()"), self.treeWidgetItemClicked)
|
||||
QtCore.QObject.connect(self.ui.treeWidgetChans, QtCore.SIGNAL(
|
||||
"itemChanged (QTreeWidgetItem *, int)"), self.treeWidgetItemChanged)
|
||||
|
||||
# Put the colored icon on the status bar
|
||||
# self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png"))
|
||||
|
@ -3615,7 +3620,7 @@ class MyForm(QtGui.QMainWindow):
|
|||
if column != 0:
|
||||
return
|
||||
# only account names of normal addresses (no chans/mailinglists)
|
||||
if (not isinstance(item, Ui_AddressWidget)) or item.type != 'normal' or not self.getCurrentTreeWidget() or self.getCurrentTreeWidget().currentItem() is None:
|
||||
if (not isinstance(item, Ui_AddressWidget)) or (not self.getCurrentTreeWidget()) or self.getCurrentTreeWidget().currentItem() is None:
|
||||
return
|
||||
# not visible
|
||||
if (not self.getCurrentItem()) or (not isinstance (self.getCurrentItem(), Ui_AddressWidget)):
|
||||
|
@ -3627,6 +3632,9 @@ class MyForm(QtGui.QMainWindow):
|
|||
newLabel = str(item.text(0))
|
||||
newLabel = newLabel.replace("(" + str(item.address) + ")", '')
|
||||
newLabel = newLabel.rstrip()
|
||||
if item.type == "subscription":
|
||||
oldLabel = item.label
|
||||
else:
|
||||
oldLabel = shared.config.get(str(item.address), 'label')
|
||||
oldLabel = oldLabel.replace("(" + str(item.address) + ")", '')
|
||||
oldLabel = oldLabel.rstrip()
|
||||
|
@ -3639,12 +3647,18 @@ class MyForm(QtGui.QMainWindow):
|
|||
return
|
||||
|
||||
self.recurDepth += 1
|
||||
if item.type == "subscription":
|
||||
sqlExecute(
|
||||
'''UPDATE subscriptions SET label=? WHERE address=?''',
|
||||
newLabel, item.address)
|
||||
item.setLabel(newLabel)
|
||||
else:
|
||||
shared.config.set(str(item.address), 'label', newLabel)
|
||||
item.updateText()
|
||||
shared.writeKeysFile()
|
||||
item.updateText()
|
||||
if item.type == 'mailinglist':
|
||||
self.rerenderComboBoxSendFromBroadcast()
|
||||
else:
|
||||
elif item.type != "subscription":
|
||||
self.rerenderComboBoxSendFrom()
|
||||
self.recurDepth -= 1
|
||||
|
||||
|
|
|
@ -184,6 +184,10 @@ class Ui_SubscriptionWidget(Ui_AddressWidget, AccountMixin):
|
|||
def setType(self):
|
||||
self.type = "subscription"
|
||||
|
||||
def edit(self):
|
||||
self.setText(0, self.label)
|
||||
super(QtGui.QAbstractItemView, self).edit()
|
||||
|
||||
def updateText(self):
|
||||
if not self.initialised:
|
||||
return
|
||||
|
|
Reference in New Issue
Block a user