V0.6 #852

Merged
Atheros1 merged 399 commits from v0.6 into master 2016-05-03 01:58:38 +02:00
Showing only changes of commit dd15d1b6ed - Show all commits

View File

@ -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,11 +3167,18 @@ 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())
sqlExecute('''UPDATE inbox SET folder='trash' WHERE msgid=?''', inventoryHashToTrash) 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)
if tableWidget.item(currentRow, 0).font().bold(): if tableWidget.item(currentRow, 0).font().bold():
unread = True unread = True
self.getCurrentMessageTextedit().setText("") self.getCurrentMessageTextedit().setText("")
@ -3241,11 +3254,16 @@ 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())
sqlExecute('''UPDATE sent SET folder='trash' WHERE ackdata=?''', ackdataToTrash) if folder == "trash" or shifted:
sqlExecute('''DELETE FROM sent WHERE ackdata=?''', ackdataToTrash)
else:
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
self.getCurrentMessageTextedit().setPlainText("") self.getCurrentMessageTextedit().setPlainText("")