prevent exception if user presses delete key when no more messages to delete

This commit is contained in:
Jonathan Warren 2013-03-27 17:14:01 -04:00
parent 8a5982fb28
commit d9a44f0f17
1 changed files with 23 additions and 21 deletions

View File

@ -5021,6 +5021,7 @@ class MyForm(QtGui.QMainWindow):
#Send item on the Inbox tab to trash
def on_action_InboxTrash(self):
currentRow = self.ui.tableWidgetInbox.currentRow()
if currentRow >= 0:
inventoryHashToTrash = str(self.ui.tableWidgetInbox.item(currentRow,3).data(Qt.UserRole).toPyObject())
t = (inventoryHashToTrash,)
sqlLock.acquire()
@ -5036,6 +5037,7 @@ class MyForm(QtGui.QMainWindow):
#Send item on the Sent tab to trash
def on_action_SentTrash(self):
currentRow = self.ui.tableWidgetSent.currentRow()
if currentRow >= 0:
ackdataToTrash = str(self.ui.tableWidgetSent.item(currentRow,3).data(Qt.UserRole).toPyObject())
t = (ackdataToTrash,)
sqlLock.acquire()