Global Sent and Trash folders
This commit is contained in:
parent
8d8cfe8555
commit
a30d5af948
|
@ -537,6 +537,8 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
db[None] = {}
|
db[None] = {}
|
||||||
db[None]["inbox"] = total
|
db[None]["inbox"] = total
|
||||||
db[None]["new"] = total
|
db[None]["new"] = total
|
||||||
|
db[None]["sent"] = 0
|
||||||
|
db[None]["trash"] = 0
|
||||||
enabled[None] = True
|
enabled[None] = True
|
||||||
|
|
||||||
if treeWidget.isSortingEnabled():
|
if treeWidget.isSortingEnabled():
|
||||||
|
@ -587,8 +589,6 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
for folder in folders:
|
for folder in folders:
|
||||||
if toAddress is not None and folder == "new":
|
if toAddress is not None and folder == "new":
|
||||||
continue
|
continue
|
||||||
if toAddress is None and folder in ["trash", "sent"]:
|
|
||||||
continue
|
|
||||||
subwidget = Ui_FolderWidget(widget, j, toAddress, folder, db[toAddress][folder])
|
subwidget = Ui_FolderWidget(widget, j, toAddress, folder, db[toAddress][folder])
|
||||||
unread += db[toAddress][folder]
|
unread += db[toAddress][folder]
|
||||||
j += 1
|
j += 1
|
||||||
|
@ -992,13 +992,19 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
addressItem = root.child(i)
|
addressItem = root.child(i)
|
||||||
if addressItem.type != AccountMixin.ALL and address is not None and addressItem.data(0, QtCore.Qt.UserRole) != address:
|
if addressItem.type != AccountMixin.ALL and address is not None and addressItem.data(0, QtCore.Qt.UserRole) != address:
|
||||||
continue
|
continue
|
||||||
updateUnreadCount(addressItem)
|
if folder not in ["trash"]:
|
||||||
|
updateUnreadCount(addressItem)
|
||||||
if addressItem.childCount == 0:
|
if addressItem.childCount == 0:
|
||||||
continue
|
continue
|
||||||
for j in range(addressItem.childCount()):
|
for j in range(addressItem.childCount()):
|
||||||
folderItem = addressItem.child(j)
|
folderItem = addressItem.child(j)
|
||||||
if folder is not None and folderItem.folderName != folder and addressItem.type != AccountMixin.ALL:
|
if folder is not None and folderItem.folderName != folder and addressItem.type != AccountMixin.ALL:
|
||||||
continue
|
continue
|
||||||
|
if addressItem.type == AccountMixin.ALL:
|
||||||
|
if folder in ["sent", "trash"] and folderItem.folderName != folder:
|
||||||
|
continue
|
||||||
|
if folder in ["inbox", "new"] and folderItem.folderName not in ["inbox", "new"]:
|
||||||
|
continue
|
||||||
updateUnreadCount(folderItem)
|
updateUnreadCount(folderItem)
|
||||||
|
|
||||||
def addMessageListItem(self, tableWidget, items):
|
def addMessageListItem(self, tableWidget, items):
|
||||||
|
@ -1114,7 +1120,10 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
xAddress = 'both'
|
xAddress = 'both'
|
||||||
else:
|
else:
|
||||||
tableWidget.setColumnHidden(0, False)
|
tableWidget.setColumnHidden(0, False)
|
||||||
tableWidget.setColumnHidden(1, True)
|
if account is None:
|
||||||
|
tableWidget.setColumnHidden(1, False)
|
||||||
|
else:
|
||||||
|
tableWidget.setColumnHidden(1, True)
|
||||||
xAddress = 'fromaddress'
|
xAddress = 'fromaddress'
|
||||||
|
|
||||||
tableWidget.setSortingEnabled(False)
|
tableWidget.setSortingEnabled(False)
|
||||||
|
@ -2396,7 +2405,7 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
continue
|
continue
|
||||||
if tableWidget == inbox and self.getCurrentAccount(treeWidget) == acct.address and self.getCurrentFolder(treeWidget) in ["inbox", None]:
|
if tableWidget == inbox and self.getCurrentAccount(treeWidget) == acct.address and self.getCurrentFolder(treeWidget) in ["inbox", None]:
|
||||||
ret = self.addMessageListItemInbox(inbox, "inbox", inventoryHash, toAddress, fromAddress, subject, time.time(), 0)
|
ret = self.addMessageListItemInbox(inbox, "inbox", inventoryHash, toAddress, fromAddress, subject, time.time(), 0)
|
||||||
elif treeWidget == self.ui.treeWidgetYourIdentities and self.getCurrentAccount(treeWidget) is None:
|
elif treeWidget == self.ui.treeWidgetYourIdentities and self.getCurrentAccount(treeWidget) is None and self.getCurrentFolder(treeWidget) in ["inbox", "new", None]:
|
||||||
ret = self.addMessageListItemInbox(tableWidget, "inbox", inventoryHash, toAddress, fromAddress, subject, time.time(), 0)
|
ret = self.addMessageListItemInbox(tableWidget, "inbox", inventoryHash, toAddress, fromAddress, subject, time.time(), 0)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
acct.parseMessage(toAddress, fromAddress, subject, "")
|
acct.parseMessage(toAddress, fromAddress, subject, "")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user