parameters: (self)
docstring: I named this method as it is because this is not just "show a message."
        I need to display all relevant transactions, in sequence that they were
        received.  I will store them in self.notifyQueue, and this method will
        do nothing if it's empty.
docstring_summary: I named this method as it is because this is not just "show a message."
        I need to display all relevant transactions, in sequence that they were
        received.  I will store them in self.notifyQueue, and this method will
        do nothing if it's empty.
docstring_tokens: I named this method as it is because this is not just show a message . I need to display all relevant transactions in sequence that they were received . I will store them in self . notifyQueue and this method will do nothing if it s empty .
function: def doTheSystemTrayThing(self):
        """
        I named this method as it is because this is not just "show a message."
        I need to display all relevant transactions, in sequence that they were
        received.  I will store them in self.notifyQueue, and this method will
        do nothing if it's empty.
        """
        if not TheBDM.getState()==BDM_BLOCKCHAIN_READY or \
           RightNow()<self.notifyBlockedUntil:
           return
  
        # Notify queue input is: [WltID/LBID, LedgerEntry, alreadyNotified]
        for i in range(len(self.notifyQueue)):
           moneyID, le, alreadyNotified = self.notifyQueue[i]
  
           # Skip the ones we've notified of already.
           if alreadyNotified:
              continue
  
           # Marke it alreadyNotified=True
           self.notifyQueue[i][2] = True
  
           # Catch condition that somehow the tx isn't related to us
           if le.getTxHash()=='\x00'*32:
              continue
  
           # Make sure the wallet ID or lockbox ID keys are actually valid before
           # using them to grab the appropriate C++ wallet.
           pywlt = self.walletMap.get(moneyID)
           lbox  = self.getLockboxByID(moneyID)
  
           # If we couldn't find a matching wallet or lbox, bail
           if pywlt is None and lbox is None:
              LOGERROR('Could not find moneyID = %s; skipping notify' % moneyID)
              continue
  
           
           if pywlt:
              cppWlt  = self.walletMap[moneyID].cppWallet
              wname = self.walletMap[moneyID].labelName
              if len(wname)>20:
                 wname = wname[:17] + '...'
              wltName = tr('Wallet "%(wname)s" (%(moneyID)s)') % { 'wname': wname, 'moneyID' : moneyID }
           else:
              cppWlt = self.cppLockboxWltMap[moneyID]
              lbox   = self.getLockboxByID(moneyID)
              M      = self.getLockboxByID(moneyID).M
              N      = self.getLockboxByID(moneyID).N
              lname  = self.getLockboxByID(moneyID).shortName
              if len(lname) > 20:
                 lname = lname[:17] + '...'
              wltName = tr('Lockbox %(M)d-of-%(N)d "%(lname)s" (%(id)s)') % { 'M' : M, 'N' : N, 'lname' : lname, 'id' : moneyID }
  
           if le.isSentToSelf():
              # Used to display the sent-to-self amount, but if this is a lockbox
              # we only have a cppWallet, and the determineSentToSelfAmt() func
              # only operates on python wallets.  Oh well, the user can double-
              # click on the tx in their ledger if they want to see what's in it.
              # amt = determineSentToSelfAmt(le, cppWlt)[0]
              # self.showTrayMsg('Your bitcoins just did a lap!', \
              #             'Wallet "%s" (%s) just sent %s BTC to itself!' % \
              #         (wlt.labelName, moneyID, coin2str(amt,maxZeros=1).strip()),
              self.showTrayMsg(tr('Your bitcoins just did a lap!'), \
                               tr('%(wltName)s just sent some BTC to itself!') % { 'wltName' : wltName }, \
                               QSystemTrayIcon.Information, 10000)
              return
  
           # If coins were either received or sent from the loaded wlt/lbox         
           dispLines = []
           totalStr = coin2strNZS(abs(le.getValue()))
           if le.getValue() > 0:
              title = tr('Bitcoins Received!')
              dispLines.append(tr('Amount:  %(tot)s BTC') % { 'tot' : totalStr })
              dispLines.append(tr('From:    %(wlt)s') % { 'wlt' : wltName })
           elif le.getValue() < 0:
              # Also display the address of where they went
              txref = TheBDM.bdv().getTxByHash(le.getTxHash())
              nOut = txref.getNumTxOut()
              recipStr = ''
              for i in range(nOut):
                 script = txref.getTxOutCopy(i).getScript()
                 if cppWlt.hasScrAddress(script_to_scrAddr(script)):
                    continue
                 if len(recipStr)==0:
                    recipStr = self.getDisplayStringForScript(script, 45)['String']
                 else:
                    recipStr = tr('<Multiple Recipients>')
              
              title = tr('Bitcoins Sent!')
              dispLines.append(tr('Amount:  %(tot)s BTC') % { 'tot' : totalStr })
              dispLines.append(tr('From:    %(wlt)s') % { 'wlt' : wltName })
              dispLines.append(tr('To:      %(recp)s') % { 'recp' : recipStr })
     
           self.showTrayMsg(title, '\n'.join(dispLines), \
                            QSystemTrayIcon.Information, 10000)
           LOGINFO(title + '\n' + '\n'.join(dispLines))
  
           # Wait for 5 seconds before processing the next queue object.
           self.notifyBlockedUntil = RightNow() + 5
           return
function_tokens: def doTheSystemTrayThing ( self ) : if not TheBDM . getState ( ) == BDM_BLOCKCHAIN_READY or RightNow ( ) < self . notifyBlockedUntil : return # Notify queue input is: [WltID/LBID, LedgerEntry, alreadyNotified] for i in range ( len ( self . notifyQueue ) ) : moneyID , le , alreadyNotified = self . notifyQueue [ i ] # Skip the ones we've notified of already. if alreadyNotified : continue # Marke it alreadyNotified=True self . notifyQueue [ i ] [ 2 ] = True # Catch condition that somehow the tx isn't related to us if le . getTxHash ( ) == '\x00' * 32 : continue # Make sure the wallet ID or lockbox ID keys are actually valid before # using them to grab the appropriate C++ wallet. pywlt = self . walletMap . get ( moneyID ) lbox = self . getLockboxByID ( moneyID ) # If we couldn't find a matching wallet or lbox, bail if pywlt is None and lbox is None : LOGERROR ( 'Could not find moneyID = %s; skipping notify' % moneyID ) continue if pywlt : cppWlt = self . walletMap [ moneyID ] . cppWallet wname = self . walletMap [ moneyID ] . labelName if len ( wname ) > 20 : wname = wname [ : 17 ] + '...' wltName = tr ( 'Wallet "%(wname)s" (%(moneyID)s)' ) % { 'wname' : wname , 'moneyID' : moneyID } else : cppWlt = self . cppLockboxWltMap [ moneyID ] lbox = self . getLockboxByID ( moneyID ) M = self . getLockboxByID ( moneyID ) . M N = self . getLockboxByID ( moneyID ) . N lname = self . getLockboxByID ( moneyID ) . shortName if len ( lname ) > 20 : lname = lname [ : 17 ] + '...' wltName = tr ( 'Lockbox %(M)d-of-%(N)d "%(lname)s" (%(id)s)' ) % { 'M' : M , 'N' : N , 'lname' : lname , 'id' : moneyID } if le . isSentToSelf ( ) : # Used to display the sent-to-self amount, but if this is a lockbox # we only have a cppWallet, and the determineSentToSelfAmt() func # only operates on python wallets.  Oh well, the user can double- # click on the tx in their ledger if they want to see what's in it. # amt = determineSentToSelfAmt(le, cppWlt)[0] # self.showTrayMsg('Your bitcoins just did a lap!', \ #             'Wallet "%s" (%s) just sent %s BTC to itself!' % \ #         (wlt.labelName, moneyID, coin2str(amt,maxZeros=1).strip()), self . showTrayMsg ( tr ( 'Your bitcoins just did a lap!' ) , tr ( '%(wltName)s just sent some BTC to itself!' ) % { 'wltName' : wltName } , QSystemTrayIcon . Information , 10000 ) return # If coins were either received or sent from the loaded wlt/lbox          dispLines = [ ] totalStr = coin2strNZS ( abs ( le . getValue ( ) ) ) if le . getValue ( ) > 0 : title = tr ( 'Bitcoins Received!' ) dispLines . append ( tr ( 'Amount:  %(tot)s BTC' ) % { 'tot' : totalStr } ) dispLines . append ( tr ( 'From:    %(wlt)s' ) % { 'wlt' : wltName } ) elif le . getValue ( ) < 0 : # Also display the address of where they went txref = TheBDM . bdv ( ) . getTxByHash ( le . getTxHash ( ) ) nOut = txref . getNumTxOut ( ) recipStr = '' for i in range ( nOut ) : script = txref . getTxOutCopy ( i ) . getScript ( ) if cppWlt . hasScrAddress ( script_to_scrAddr ( script ) ) : continue if len ( recipStr ) == 0 : recipStr = self . getDisplayStringForScript ( script , 45 ) [ 'String' ] else : recipStr = tr ( '<Multiple Recipients>' ) title = tr ( 'Bitcoins Sent!' ) dispLines . append ( tr ( 'Amount:  %(tot)s BTC' ) % { 'tot' : totalStr } ) dispLines . append ( tr ( 'From:    %(wlt)s' ) % { 'wlt' : wltName } ) dispLines . append ( tr ( 'To:      %(recp)s' ) % { 'recp' : recipStr } ) self . showTrayMsg ( title , '\n' . join ( dispLines ) , QSystemTrayIcon . Information , 10000 ) LOGINFO ( title + '\n' + '\n' . join ( dispLines ) ) # Wait for 5 seconds before processing the next queue object. self . notifyBlockedUntil = RightNow ( ) + 5 return