tshow tx details - electrum - Electrum Bitcoin wallet
 (HTM) git clone https://git.parazyd.org/electrum
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
       ---
 (DIR) commit af52d67f84fa56c33d40295bc00ea58b3df4e3d2
 (DIR) parent 0c11bd119f4daaa0e54fcb4e4497562b05c698a4
 (HTM) Author: ThomasV <thomasv@gitorious>
       Date:   Sun, 12 Feb 2012 18:02:11 +0100
       
       show tx details
       
       Diffstat:
         M client/gui_qt.py                    |      41 ++++++++++++++++++++++++++++++-
       
       1 file changed, 40 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/client/gui_qt.py b/client/gui_qt.py
       t@@ -83,9 +83,46 @@ class ElectrumWindow(QMainWindow):
                w.setColumnWidth(2, 340) 
                w.setColumnWidth(3, 120) 
                w.setColumnWidth(4, 120) 
       -        w.setHeaderLabels( ['', 'Date', 'Description', 'Amount', 'Balance'] )
       +        w.setHeaderLabels( [ '', 'Date', 'Description', 'Amount', 'Balance', ''] )
       +        self.connect(w, SIGNAL('itemClicked(QTreeWidgetItem*, int)'), self.tx_label)
       +        self.connect(w, SIGNAL('itemActivated(QTreeWidgetItem*, int)'), self.tx_details)
                return w
        
       +    def tx_details(self, item, column):
       +        tx_hash = str(item.toolTip(0))
       +        tx = self.wallet.tx_history.get(tx_hash)
       +
       +        if tx['height']:
       +            conf = self.wallet.interface.blocks - tx['height'] + 1
       +            time_str = datetime.datetime.fromtimestamp( tx['nTime']).isoformat(' ')[:-3]
       +        else:
       +            conf = 0
       +            time_str = 'pending'
       +
       +        tx_details = "Transaction Details:\n\n" \
       +            + "Transaction ID:\n" + tx_hash + "\n\n" \
       +            + "Status: %d confirmations\n\n"%conf  \
       +            + "Date: %s\n\n"%time_str \
       +            + "Inputs:\n-"+ '\n-'.join(tx['inputs']) + "\n\n" \
       +            + "Outputs:\n-"+ '\n-'.join(tx['outputs'])
       +
       +        r = self.wallet.receipts.get(tx_hash)
       +        if r:
       +            tx_details += "\n_______________________________________" \
       +                + '\n\nSigned URI: ' + r[2] \
       +                + "\n\nSigned by: " + r[0] \
       +                + '\n\nSignature: ' + r[1]
       +
       +        QMessageBox.information(self, 'Details', tx_details, 'OK')
       +
       +        
       +
       +
       +    def tx_label(self, item, column):
       +        if column==2:
       +            print 's', item, column
       +
       +
            def update_history_tab(self):
                self.history_list.clear()
                balance = 0
       t@@ -104,10 +141,12 @@ class ElectrumWindow(QMainWindow):
                    label = self.wallet.labels.get(tx_hash)
                    is_default_label = (label == '') or (label is None)
                    if is_default_label: label = tx['default_label']
       +
                    item = QTreeWidgetItem( [ '', time_str, label, format_satoshis(v,True), format_satoshis(balance)] )
                    item.setFont(2, QFont('monospace'))
                    item.setFont(3, QFont('monospace'))
                    item.setFont(4, QFont('monospace'))
       +            item.setToolTip(0, tx_hash)
                    if is_default_label:
                        item.setForeground(2, QBrush(QColor('gray')))