V0.6 #852
|
@ -1065,7 +1065,7 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
|
|
||||||
tableWidget.setSortingEnabled(False)
|
tableWidget.setSortingEnabled(False)
|
||||||
tableWidget.horizontalHeader().setSortIndicator(3, Qt.DescendingOrder)
|
tableWidget.horizontalHeader().setSortIndicator(3, Qt.DescendingOrder)
|
||||||
tableWidget.keyPressEvent = self.tableWidgetInboxKeyPressEvent
|
tableWidget.keyPressEvent = self.tableWidgetSentKeyPressEvent
|
||||||
|
|
||||||
# Load messages from database file
|
# Load messages from database file
|
||||||
def loadMessagelist(self, tableWidget, account, folder="inbox", where="", what=""):
|
def loadMessagelist(self, tableWidget, account, folder="inbox", where="", what=""):
|
||||||
|
@ -1497,6 +1497,12 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
self.on_action_InboxTrash()
|
self.on_action_InboxTrash()
|
||||||
return QtGui.QTableWidget.keyPressEvent(self.getCurrentMessagelist(), event)
|
return QtGui.QTableWidget.keyPressEvent(self.getCurrentMessagelist(), event)
|
||||||
|
|
||||||
|
# set delete key in inbox
|
||||||
|
def tableWidgetSentKeyPressEvent(self, event):
|
||||||
|
if event.key() == QtCore.Qt.Key_Delete:
|
||||||
|
self.on_action_SentTrash()
|
||||||
|
return QtGui.QTableWidget.keyPressEvent(self.getCurrentMessagelist(), event)
|
||||||
|
|
||||||
# menu button 'manage keys'
|
# menu button 'manage keys'
|
||||||
def click_actionManageKeys(self):
|
def click_actionManageKeys(self):
|
||||||
if 'darwin' in sys.platform or 'linux' in sys.platform:
|
if 'darwin' in sys.platform or 'linux' in sys.platform:
|
||||||
|
@ -3161,10 +3167,17 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
return
|
return
|
||||||
unread = False
|
unread = False
|
||||||
currentRow = 0
|
currentRow = 0
|
||||||
|
folder = self.getCurrentFolder()
|
||||||
|
shifted = QtGui.QApplication.queryKeyboardModifiers() & QtCore.Qt.ShiftModifier
|
||||||
while tableWidget.selectedIndexes():
|
while tableWidget.selectedIndexes():
|
||||||
currentRow = tableWidget.selectedIndexes()[0].row()
|
currentRow = tableWidget.selectedIndexes()[0].row()
|
||||||
inventoryHashToTrash = str(tableWidget.item(
|
inventoryHashToTrash = str(tableWidget.item(
|
||||||
currentRow, 3).data(Qt.UserRole).toPyObject())
|
currentRow, 3).data(Qt.UserRole).toPyObject())
|
||||||
|
if folder == "trash" or shifted:
|
||||||
|
logger.debug ("deleting")
|
||||||
|
sqlExecute('''DELETE FROM inbox WHERE msgid=?''', inventoryHashToTrash)
|
||||||
|
else:
|
||||||
|
logger.debug ("moving to trash, because folder = \"%s\" and shifted = %r %x", folder, shifted)
|
||||||
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).font().bold():
|
||||||
unread = True
|
unread = True
|
||||||
|
@ -3241,10 +3254,15 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
tableWidget = self.getCurrentMessagelist()
|
tableWidget = self.getCurrentMessagelist()
|
||||||
if not tableWidget:
|
if not tableWidget:
|
||||||
return
|
return
|
||||||
|
folder = self.getCurrentFolder()
|
||||||
|
shifted = (QtGui.QApplication.queryKeyboardModifiers() & QtCore.Qt.ShiftModifier) > 0
|
||||||
while tableWidget.selectedIndexes() != []:
|
while tableWidget.selectedIndexes() != []:
|
||||||
currentRow = tableWidget.selectedIndexes()[0].row()
|
currentRow = tableWidget.selectedIndexes()[0].row()
|
||||||
ackdataToTrash = str(tableWidget.item(
|
ackdataToTrash = str(tableWidget.item(
|
||||||
currentRow, 3).data(Qt.UserRole).toPyObject())
|
currentRow, 3).data(Qt.UserRole).toPyObject())
|
||||||
|
if folder == "trash" or shifted:
|
||||||
|
sqlExecute('''DELETE FROM sent WHERE ackdata=?''', ackdataToTrash)
|
||||||
|
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).font().bold():
|
||||||
unread = True
|
unread = True
|
||||||
|
|
Reference in New Issue
Block a user