Skip to content

Commit

Permalink
fix new tx systray notification
Browse files Browse the repository at this point in the history
  • Loading branch information
goatpig committed Mar 31, 2018
1 parent fb77d4f commit fee1f91
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions ArmoryQt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5345,22 +5345,19 @@ def doTheSystemTrayThing(self):
# If coins were either received or sent from the loaded wlt/lbox
dispLines = QStringList()
totalStr = coin2strNZS(abs(le.getValue()))
title = None
if le.getValue() > 0:
title = self.tr('Bitcoins Received!')
dispLines.append(self.tr('Amount: %1 BTC').arg(totalStr))
dispLines.append(self.tr('From: %2').arg(wltName))
elif le.getValue() < 0:
try:
# Also display the address of where they went
txref = TheBDM.bdv().getTxByHash(le.getTxHash())
nOut = txref.getNumTxOut()
recipStr = ''
for i in range(0, nOut):
script = txref.getTxOutCopy(i).getScript()
if pywlt.hasScrAddr(script_to_scrAddr(script)):
for addr in le.getScrAddrList():
if pywlt.hasScrAddr(addr):
continue
if len(recipStr)==0:
recipStr = self.getDisplayStringForScript(script, 45)['String']
recipStr = hash160_to_addrStr(addr[1:], addr[0])
else:
recipStr = self.tr('<Multiple Recipients>')

Expand All @@ -5371,9 +5368,10 @@ def doTheSystemTrayThing(self):
except Exception as e:
LOGERROR('tx broadcast systray display failed with error: %s' % e)

self.showTrayMsg(title, dispLines.join("\n"), \
QSystemTrayIcon.Information, 10000)
LOGINFO(title + '\n' + dispLines.join("\n"))
if title:
self.showTrayMsg(title, dispLines.join("\n"), \
QSystemTrayIcon.Information, 10000)
LOGINFO(title + '\n' + dispLines.join("\n"))

# Wait for 5 seconds before processing the next queue object.
self.notifyBlockedUntil = RightNow() + 5
Expand Down

0 comments on commit fee1f91

Please sign in to comment.