(self)
| 3209 | |
| 3210 | # Send item on the Sent tab to trash |
| 3211 | def on_action_SentTrash(self): |
| 3212 | currentRow = 0 |
| 3213 | unread = False |
| 3214 | tableWidget = self.getCurrentMessagelist() |
| 3215 | if not tableWidget: |
| 3216 | return |
| 3217 | folder = self.getCurrentFolder() |
| 3218 | shifted = (QtGui.QApplication.queryKeyboardModifiers() & QtCore.Qt.ShiftModifier) > 0 |
| 3219 | while tableWidget.selectedIndexes() != []: |
| 3220 | currentRow = tableWidget.selectedIndexes()[0].row() |
| 3221 | ackdataToTrash = str(tableWidget.item( |
| 3222 | currentRow, 3).data(QtCore.Qt.UserRole).toPyObject()) |
| 3223 | if folder == "trash" or shifted: |
| 3224 | sqlExecute('''DELETE FROM sent WHERE ackdata=?''', ackdataToTrash) |
| 3225 | else: |
| 3226 | sqlExecute('''UPDATE sent SET folder='trash' WHERE ackdata=?''', ackdataToTrash) |
| 3227 | if tableWidget.item(currentRow, 0).unread: |
| 3228 | self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget.item(currentRow, 1).type == AccountMixin.SUBSCRIPTION else 0).data(QtCore.Qt.UserRole), folder, self.getCurrentTreeWidget(), -1) |
| 3229 | self.getCurrentMessageTextedit().setPlainText("") |
| 3230 | tableWidget.removeRow(currentRow) |
| 3231 | self.updateStatusBar(_translate( |
| 3232 | "MainWindow", "Moved items to trash.")) |
| 3233 | |
| 3234 | self.ui.tableWidgetInbox.selectRow( |
| 3235 | currentRow if currentRow == 0 else currentRow - 1) |
| 3236 | |
| 3237 | def on_action_ForceSend(self): |
| 3238 | currentRow = self.ui.tableWidgetInbox.currentRow() |
no test coverage detected