From ce49ea3ae4c9c78e4fb2b1e4a30e382cb28dbc0e Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 3 Jan 2020 16:55:35 +0000 Subject: [PATCH] Qt: Only show wallet sync in status bar at start In refactor for #359 it was noted that the wallet monitoring loop in Qt updated the status bar every 5 seconds, overwriting any existing status updates. This fixes that UI bug so that the wallet synced successfully (or unsucessfully) message is only shown at start up or if there is a change of status (i.e. the wallet monitoring loop stops working). --- scripts/joinmarket-qt.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/joinmarket-qt.py b/scripts/joinmarket-qt.py index 395e4bb..cb5249f 100644 --- a/scripts/joinmarket-qt.py +++ b/scripts/joinmarket-qt.py @@ -1292,6 +1292,10 @@ class JMMainWindow(QMainWindow): # the walletservice to update the GUI self.walletRefresh = None + # keep track of whether wallet sync message + # was already shown + self.syncmsg = "" + self.reactor = reactor self.initUI() @@ -1631,13 +1635,15 @@ class JMMainWindow(QMainWindow): def updateWalletInfo(self): t = self.centralWidget().widget(0) if not self.wallet_service: #failure to sync in constructor means object is not created - newstmsg = "Unable to sync wallet - see error in console." + newsyncmsg = "Unable to sync wallet - see error in console." elif not self.wallet_service.synced: return else: t.updateWalletInfo(get_wallet_printout(self.wallet_service)) - newstmsg = "Wallet synced successfully." - self.statusBar().showMessage(newstmsg) + newsyncmsg = "Wallet synced successfully." + if newsyncmsg != self.syncmsg: + self.syncmsg = newsyncmsg + self.statusBar().showMessage(self.syncmsg) def generateWallet(self): log.debug('generating wallet')