prevent exception if user presses delete key when no more messages to delete
This commit is contained in:
parent
8a5982fb28
commit
d9a44f0f17
|
@ -5021,31 +5021,33 @@ class MyForm(QtGui.QMainWindow):
|
||||||
#Send item on the Inbox tab to trash
|
#Send item on the Inbox tab to trash
|
||||||
def on_action_InboxTrash(self):
|
def on_action_InboxTrash(self):
|
||||||
currentRow = self.ui.tableWidgetInbox.currentRow()
|
currentRow = self.ui.tableWidgetInbox.currentRow()
|
||||||
inventoryHashToTrash = str(self.ui.tableWidgetInbox.item(currentRow,3).data(Qt.UserRole).toPyObject())
|
if currentRow >= 0:
|
||||||
t = (inventoryHashToTrash,)
|
inventoryHashToTrash = str(self.ui.tableWidgetInbox.item(currentRow,3).data(Qt.UserRole).toPyObject())
|
||||||
sqlLock.acquire()
|
t = (inventoryHashToTrash,)
|
||||||
#sqlSubmitQueue.put('''delete from inbox where msgid=?''')
|
sqlLock.acquire()
|
||||||
sqlSubmitQueue.put('''UPDATE inbox SET folder='trash' WHERE msgid=?''')
|
#sqlSubmitQueue.put('''delete from inbox where msgid=?''')
|
||||||
sqlSubmitQueue.put(t)
|
sqlSubmitQueue.put('''UPDATE inbox SET folder='trash' WHERE msgid=?''')
|
||||||
sqlReturnQueue.get()
|
sqlSubmitQueue.put(t)
|
||||||
sqlLock.release()
|
sqlReturnQueue.get()
|
||||||
self.ui.textEditInboxMessage.setText("")
|
sqlLock.release()
|
||||||
self.ui.tableWidgetInbox.removeRow(currentRow)
|
self.ui.textEditInboxMessage.setText("")
|
||||||
self.statusBar().showMessage('Moved item to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.')
|
self.ui.tableWidgetInbox.removeRow(currentRow)
|
||||||
|
self.statusBar().showMessage('Moved item to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.')
|
||||||
|
|
||||||
#Send item on the Sent tab to trash
|
#Send item on the Sent tab to trash
|
||||||
def on_action_SentTrash(self):
|
def on_action_SentTrash(self):
|
||||||
currentRow = self.ui.tableWidgetSent.currentRow()
|
currentRow = self.ui.tableWidgetSent.currentRow()
|
||||||
ackdataToTrash = str(self.ui.tableWidgetSent.item(currentRow,3).data(Qt.UserRole).toPyObject())
|
if currentRow >= 0:
|
||||||
t = (ackdataToTrash,)
|
ackdataToTrash = str(self.ui.tableWidgetSent.item(currentRow,3).data(Qt.UserRole).toPyObject())
|
||||||
sqlLock.acquire()
|
t = (ackdataToTrash,)
|
||||||
sqlSubmitQueue.put('''UPDATE sent SET folder='trash' WHERE ackdata=?''')
|
sqlLock.acquire()
|
||||||
sqlSubmitQueue.put(t)
|
sqlSubmitQueue.put('''UPDATE sent SET folder='trash' WHERE ackdata=?''')
|
||||||
sqlReturnQueue.get()
|
sqlSubmitQueue.put(t)
|
||||||
sqlLock.release()
|
sqlReturnQueue.get()
|
||||||
self.ui.textEditSentMessage.setText("")
|
sqlLock.release()
|
||||||
self.ui.tableWidgetSent.removeRow(currentRow)
|
self.ui.textEditSentMessage.setText("")
|
||||||
self.statusBar().showMessage('Moved item to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.')
|
self.ui.tableWidgetSent.removeRow(currentRow)
|
||||||
|
self.statusBar().showMessage('Moved item to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.')
|
||||||
def on_action_SentClipboard(self):
|
def on_action_SentClipboard(self):
|
||||||
currentRow = self.ui.tableWidgetSent.currentRow()
|
currentRow = self.ui.tableWidgetSent.currentRow()
|
||||||
addressAtCurrentRow = str(self.ui.tableWidgetSent.item(currentRow,0).data(Qt.UserRole).toPyObject())
|
addressAtCurrentRow = str(self.ui.tableWidgetSent.item(currentRow,0).data(Qt.UserRole).toPyObject())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user