From 0c23093760a3018d65d7f49ff7594742a9f52dc6 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Tue, 5 Mar 2013 14:50:31 -0500 Subject: [PATCH] When deleting last message, be sure no message remains displayed in inbox --- bitmessagemain.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index c39402ac..ec504dca 100755 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -1798,7 +1798,7 @@ class receiveDataThread(QThread): numberOfAddressesInAddrMessage = 0 payload = '' - print 'addrsInMyStream.items()', addrsInMyStream.items() + #print 'addrsInMyStream.items()', addrsInMyStream.items() for HOST, value in addrsInMyStream.items(): PORT, timeLastReceivedMessageFromThisNode = value if timeLastReceivedMessageFromThisNode > (int(time.time())- maximumAgeOfNodesThatIAdvertiseToOthers): #If it is younger than 3 hours old.. @@ -4546,6 +4546,7 @@ class MyForm(QtGui.QMainWindow): sqlSubmitQueue.put(t) sqlReturnQueue.get() sqlLock.release() + self.ui.textEditInboxMessage.setText("") 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.') @@ -4734,8 +4735,9 @@ class MyForm(QtGui.QMainWindow): def tableWidgetInboxItemClicked(self): currentRow = self.ui.tableWidgetInbox.currentRow() - self.ui.textEditInboxMessage.setText(self.ui.tableWidgetInbox.item(currentRow,2).data(Qt.UserRole).toPyObject()) - + if currentRow >= 0: + self.ui.textEditInboxMessage.setText(self.ui.tableWidgetInbox.item(currentRow,2).data(Qt.UserRole).toPyObject()) + def tableWidgetSentItemClicked(self): currentRow = self.ui.tableWidgetSent.currentRow() self.ui.textEditSentMessage.setText(self.ui.tableWidgetSent.item(currentRow,2).data(Qt.UserRole).toPyObject())