From df3c662832ce43003fd4be4d0ee59b0fb73c30d7 Mon Sep 17 00:00:00 2001 From: mailchuck Date: Thu, 5 Nov 2015 17:27:35 +0100 Subject: [PATCH] Message status update Someone reported the exception via BM. Fixes #90 Signed-off-by: mailchuck --- src/bitmessageqt/__init__.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 3f45e340..ce5e3fc4 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1794,23 +1794,25 @@ class MyForm(QtGui.QMainWindow): self.unreadCount = count return self.unreadCount - def updateSentItemStatusByHash(self, toRipe, textToDisplay): - for i in range(self.ui.tableWidgetInbox.rowCount()): - toAddress = str(self.ui.tableWidgetInbox.item( + def updateSentItemStatusByToAddress(self, toAddress, textToDisplay): + sent = self.getAccountMessagelist(toAddress) + treeWidget = self.getAccountTreeWidget(toAddress) + if self.getCurrentFolder(treeWidget) != "sent": + return + for i in range(sent.rowCount()): + rowAddress = str(sent.item( i, 0).data(Qt.UserRole).toPyObject()) - status, addressVersionNumber, streamNumber, ripe = decodeAddress( - toAddress) - if ripe == toRipe: - self.ui.tableWidgetInbox.item(i, 3).setToolTip(textToDisplay) + if toAddress == rowAddress: + sent.item(i, 3).setToolTip(textToDisplay) try: newlinePosition = textToDisplay.indexOf('\n') except: # If someone misses adding a "_translate" to a string before passing it to this function, this function won't receive a qstring which will cause an exception. newlinePosition = 0 if newlinePosition > 1: - self.ui.tableWidgetInbox.item(i, 3).setText( + sent.item(i, 3).setText( textToDisplay[:newlinePosition]) else: - self.ui.tableWidgetInbox.item(i, 3).setText(textToDisplay) + sent.item(i, 3).setText(textToDisplay) def updateSentItemStatusByAckdata(self, ackdata, textToDisplay): for i in range(self.ui.tableWidgetInbox.rowCount()):