Do not show context menu on 'sent' folder

because the 'sent' table have no column 'read'
This commit is contained in:
Dmitri Bogomolov 2019-01-31 18:23:43 +02:00
parent ffbc09758c
commit 5e0d168db6
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -2656,15 +2656,13 @@ class MyForm(settingsmixin.SMainWindow):
tableWidget.item(i, 3).setFont(font) tableWidget.item(i, 3).setFont(font)
markread = sqlExecuteChunked( markread = sqlExecuteChunked(
"UPDATE %s SET read = 1 WHERE %s IN({0}) AND read=0" % ( "UPDATE inbox SET read = 1 WHERE msgid IN({0}) AND read=0",
('sent', 'ackdata') if self.getCurrentFolder() == 'sent' idCount, *msgids
else ('inbox', 'msgid')
), idCount, *msgids
) )
if markread > 0: if markread > 0:
self.propagateUnreadCount() self.propagateUnreadCount()
# addressAtCurrentRow, self.getCurrentFolder(), None, 0) # addressAtCurrentRow, self.getCurrentFolder(), None, 0)
def click_NewAddressDialog(self): def click_NewAddressDialog(self):
dialogs.NewAddressDialog(self) dialogs.NewAddressDialog(self)
@ -3459,11 +3457,14 @@ class MyForm(settingsmixin.SMainWindow):
for plugin in self.menu_plugins['address']: for plugin in self.menu_plugins['address']:
self.popMenuSubscriptions.addAction(plugin) self.popMenuSubscriptions.addAction(plugin)
self.popMenuSubscriptions.addSeparator() self.popMenuSubscriptions.addSeparator()
self.popMenuSubscriptions.addAction(self.actionMarkAllRead) if self.getCurrentFolder() != 'sent':
self.popMenuSubscriptions.addAction(self.actionMarkAllRead)
if self.popMenuSubscriptions.isEmpty():
return
self.popMenuSubscriptions.exec_( self.popMenuSubscriptions.exec_(
self.ui.treeWidgetSubscriptions.mapToGlobal(point)) self.ui.treeWidgetSubscriptions.mapToGlobal(point))
def widgetConvert (self, widget): def widgetConvert(self, widget):
if widget == self.ui.tableWidgetInbox: if widget == self.ui.tableWidgetInbox:
return self.ui.treeWidgetYourIdentities return self.ui.treeWidgetYourIdentities
elif widget == self.ui.tableWidgetInboxSubscriptions: elif widget == self.ui.tableWidgetInboxSubscriptions:
@ -3874,8 +3875,10 @@ class MyForm(settingsmixin.SMainWindow):
for plugin in self.menu_plugins['address']: for plugin in self.menu_plugins['address']:
self.popMenuYourIdentities.addAction(plugin) self.popMenuYourIdentities.addAction(plugin)
self.popMenuYourIdentities.addSeparator() self.popMenuYourIdentities.addSeparator()
self.popMenuYourIdentities.addAction(self.actionMarkAllRead) if self.getCurrentFolder() != 'sent':
self.popMenuYourIdentities.addAction(self.actionMarkAllRead)
if self.popMenuYourIdentities.isEmpty():
return
self.popMenuYourIdentities.exec_( self.popMenuYourIdentities.exec_(
self.ui.treeWidgetYourIdentities.mapToGlobal(point)) self.ui.treeWidgetYourIdentities.mapToGlobal(point))
@ -3899,7 +3902,10 @@ class MyForm(settingsmixin.SMainWindow):
for plugin in self.menu_plugins['address']: for plugin in self.menu_plugins['address']:
self.popMenu.addAction(plugin) self.popMenu.addAction(plugin)
self.popMenu.addSeparator() self.popMenu.addSeparator()
self.popMenu.addAction(self.actionMarkAllRead) if self.getCurrentFolder() != 'sent':
self.popMenu.addAction(self.actionMarkAllRead)
if self.popMenu.isEmpty():
return
self.popMenu.exec_( self.popMenu.exec_(
self.ui.treeWidgetChans.mapToGlobal(point)) self.ui.treeWidgetChans.mapToGlobal(point))