V0.6 #852
|
@ -1929,7 +1929,7 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
self.statusBar().showMessage(_translate(
|
self.statusBar().showMessage(_translate(
|
||||||
"MainWindow", "Message trashed"))
|
"MainWindow", "Message trashed"))
|
||||||
treeWidget = self.widgetConvert(inbox)
|
treeWidget = self.widgetConvert(inbox)
|
||||||
self.propagateUnreadCount(inbox.item(i, 1 if inbox == self.ui.tableWidgetInboxSubscriptions else 0).data(Qt.UserRole), self.getCurrentFolder(treeWidget), treeWidget, 0)
|
self.propagateUnreadCount(inbox.item(i, 1 if inbox.item(i, 1).type == AccountMixin.SUBSCRIPTION else 0).data(Qt.UserRole), self.getCurrentFolder(treeWidget), treeWidget, 0)
|
||||||
inbox.removeRow(i)
|
inbox.removeRow(i)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -2901,7 +2901,7 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
if inventoryHashToMarkUnread in inventoryHashesToMarkUnread:
|
if inventoryHashToMarkUnread in inventoryHashesToMarkUnread:
|
||||||
# it returns columns as separate items, so we skip dupes
|
# it returns columns as separate items, so we skip dupes
|
||||||
continue
|
continue
|
||||||
if not tableWidget.item(currentRow, 0).font().bold():
|
if not tableWidget.item(currentRow, 0).unread:
|
||||||
modified += 1
|
modified += 1
|
||||||
inventoryHashesToMarkUnread.append(inventoryHashToMarkUnread)
|
inventoryHashesToMarkUnread.append(inventoryHashToMarkUnread)
|
||||||
tableWidget.item(currentRow, 0).setUnread(True)
|
tableWidget.item(currentRow, 0).setUnread(True)
|
||||||
|
@ -2913,9 +2913,9 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
"?," * len(inventoryHashesToMarkUnread))[:-1], *inventoryHashesToMarkUnread)
|
"?," * len(inventoryHashesToMarkUnread))[:-1], *inventoryHashesToMarkUnread)
|
||||||
if modified == 1:
|
if modified == 1:
|
||||||
# performance optimisation
|
# performance optimisation
|
||||||
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget == self.ui.tableWidgetInboxSubscriptions else 0).data(Qt.UserRole), self.getCurrentFolder())
|
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget.item(currentRow, 1).type == AccountMixin.SUBSCRIPTION else 0).data(Qt.UserRole), self.getCurrentFolder())
|
||||||
else:
|
else:
|
||||||
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget == self.ui.tableWidgetInboxSubscriptions else 0).data(Qt.UserRole), self.getCurrentFolder(), self.getCurrentTreeWidget(), 0)
|
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget.item(currentRow, 1).type == AccountMixin.SUBSCRIPTION else 0).data(Qt.UserRole), self.getCurrentFolder(), self.getCurrentTreeWidget(), 0)
|
||||||
# tableWidget.selectRow(currentRow + 1)
|
# tableWidget.selectRow(currentRow + 1)
|
||||||
# This doesn't de-select the last message if you try to mark it unread, but that doesn't interfere. Might not be necessary.
|
# This doesn't de-select the last message if you try to mark it unread, but that doesn't interfere. Might not be necessary.
|
||||||
# We could also select upwards, but then our problem would be with the topmost message.
|
# We could also select upwards, but then our problem would be with the topmost message.
|
||||||
|
@ -3083,10 +3083,10 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
sqlExecute('''DELETE FROM inbox WHERE msgid=?''', inventoryHashToTrash)
|
sqlExecute('''DELETE FROM inbox WHERE msgid=?''', inventoryHashToTrash)
|
||||||
else:
|
else:
|
||||||
sqlExecute('''UPDATE inbox SET folder='trash' WHERE msgid=?''', inventoryHashToTrash)
|
sqlExecute('''UPDATE inbox SET folder='trash' WHERE msgid=?''', inventoryHashToTrash)
|
||||||
if tableWidget.item(currentRow, 0).font().bold():
|
if tableWidget.item(currentRow, 0).unread:
|
||||||
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget == self.ui.tableWidgetInboxSubscriptions else 0).data(Qt.UserRole), folder, self.getCurrentTreeWidget(), -1)
|
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget.item(currentRow, 1).type == AccountMixin.SUBSCRIPTION else 0).data(Qt.UserRole), folder, self.getCurrentTreeWidget(), -1)
|
||||||
if folder != "trash" and not shifted:
|
if folder != "trash" and not shifted:
|
||||||
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget == self.ui.tableWidgetInboxSubscriptions else 0).data(Qt.UserRole), "trash", self.getCurrentTreeWidget(), 1)
|
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget.item(currentRow, 1).type == AccountMixin.SUBSCRIPTION else 0).data(Qt.UserRole), "trash", self.getCurrentTreeWidget(), 1)
|
||||||
|
|
||||||
self.getCurrentMessageTextedit().setText("")
|
self.getCurrentMessageTextedit().setText("")
|
||||||
tableWidget.removeRow(currentRow)
|
tableWidget.removeRow(currentRow)
|
||||||
|
@ -3108,9 +3108,9 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
inventoryHashToTrash = str(tableWidget.item(
|
inventoryHashToTrash = str(tableWidget.item(
|
||||||
currentRow, 3).data(Qt.UserRole).toPyObject())
|
currentRow, 3).data(Qt.UserRole).toPyObject())
|
||||||
sqlExecute('''UPDATE inbox SET folder='inbox' WHERE msgid=?''', inventoryHashToTrash)
|
sqlExecute('''UPDATE inbox SET folder='inbox' WHERE msgid=?''', inventoryHashToTrash)
|
||||||
if tableWidget.item(currentRow, 0).font().bold():
|
if tableWidget.item(currentRow, 0).unread:
|
||||||
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget == self.ui.tableWidgetInboxSubscriptions else 0).data(Qt.UserRole), "inbox", self.getCurrentTreeWidget(), 1)
|
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget.item(curentRow, 1).type == AccountMixin.SUBSCRIPTION else 0).data(Qt.UserRole), "inbox", self.getCurrentTreeWidget(), 1)
|
||||||
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget == self.ui.tableWidgetInboxSubscriptions else 0).data(Qt.UserRole), "trash", self.getCurrentTreeWidget(), -1)
|
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget.item(curentRow, 1).type == AccountMixin.SUBSCRIPTION else 0).data(Qt.UserRole), "trash", self.getCurrentTreeWidget(), -1)
|
||||||
self.getCurrentMessageTextedit().setText("")
|
self.getCurrentMessageTextedit().setText("")
|
||||||
tableWidget.removeRow(currentRow)
|
tableWidget.removeRow(currentRow)
|
||||||
self.statusBar().showMessage(_translate(
|
self.statusBar().showMessage(_translate(
|
||||||
|
@ -3168,8 +3168,8 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
sqlExecute('''DELETE FROM sent WHERE ackdata=?''', ackdataToTrash)
|
sqlExecute('''DELETE FROM sent WHERE ackdata=?''', ackdataToTrash)
|
||||||
else:
|
else:
|
||||||
sqlExecute('''UPDATE sent SET folder='trash' WHERE ackdata=?''', ackdataToTrash)
|
sqlExecute('''UPDATE sent SET folder='trash' WHERE ackdata=?''', ackdataToTrash)
|
||||||
if tableWidget.item(currentRow, 0).font().bold():
|
if tableWidget.item(currentRow, 0).unread:
|
||||||
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget == self.ui.tableWidgetInboxSubscriptions else 0).data(Qt.UserRole), folder, self.getCurrentTreeWidget(), -1)
|
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget.item(curentRow, 1).type == AccountMixin.SUBSCRIPTION else 0).data(Qt.UserRole), folder, self.getCurrentTreeWidget(), -1)
|
||||||
self.getCurrentMessageTextedit().setPlainText("")
|
self.getCurrentMessageTextedit().setPlainText("")
|
||||||
tableWidget.removeRow(currentRow)
|
tableWidget.removeRow(currentRow)
|
||||||
self.statusBar().showMessage(_translate(
|
self.statusBar().showMessage(_translate(
|
||||||
|
@ -3906,20 +3906,24 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
|
|
||||||
if queryreturn != []:
|
if queryreturn != []:
|
||||||
refresh = False
|
refresh = False
|
||||||
|
propagate = False
|
||||||
|
tableWidget = self.getCurrentMessagelist()
|
||||||
|
currentRow = tableWidget.currentRow()
|
||||||
for row in queryreturn:
|
for row in queryreturn:
|
||||||
message, read = row
|
message, read = row
|
||||||
if folder != 'sent' and read == 0:
|
if folder != 'sent' and read == 0:
|
||||||
markread = sqlQuery(
|
markread = sqlQuery(
|
||||||
'''UPDATE inbox SET read = 1 WHERE msgid = ?''', msgid)
|
'''UPDATE inbox SET read = 1 WHERE msgid = ?''', msgid)
|
||||||
|
refresh = propagate = True
|
||||||
|
elif tableWidget.item(currentRow, 0).unread == True:
|
||||||
refresh = True
|
refresh = True
|
||||||
|
propagate = False
|
||||||
if refresh:
|
if refresh:
|
||||||
tableWidget = self.getCurrentMessagelist()
|
|
||||||
if not tableWidget:
|
if not tableWidget:
|
||||||
return
|
return
|
||||||
font = QFont()
|
font = QFont()
|
||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
# inventoryHashesToMarkRead = []
|
# inventoryHashesToMarkRead = []
|
||||||
currentRow = tableWidget.currentRow()
|
|
||||||
# inventoryHashToMarkRead = str(tableWidget.item(
|
# inventoryHashToMarkRead = str(tableWidget.item(
|
||||||
# currentRow, 3).data(Qt.UserRole).toPyObject())
|
# currentRow, 3).data(Qt.UserRole).toPyObject())
|
||||||
# inventoryHashesToMarkRead.append(inventoryHashToMarkRead)
|
# inventoryHashesToMarkRead.append(inventoryHashToMarkRead)
|
||||||
|
@ -3927,7 +3931,8 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
tableWidget.item(currentRow, 1).setUnread(False)
|
tableWidget.item(currentRow, 1).setUnread(False)
|
||||||
tableWidget.item(currentRow, 2).setUnread(False)
|
tableWidget.item(currentRow, 2).setUnread(False)
|
||||||
tableWidget.item(currentRow, 3).setFont(font)
|
tableWidget.item(currentRow, 3).setFont(font)
|
||||||
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget == self.ui.tableWidgetInboxSubscriptions else 0).data(Qt.UserRole), folder, self.getCurrentTreeWidget(), -1)
|
if propagate:
|
||||||
|
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget.item(currentRow, 1).type == AccountMixin.SUBSCRIPTION else 0).data(Qt.UserRole), folder, self.getCurrentTreeWidget(), -1)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
data = self.getCurrentMessageId()
|
data = self.getCurrentMessageId()
|
||||||
|
|
Reference in New Issue
Block a user