'Transactions in the wallet will show their description.
Pass desc to give a description for txs not yet in the wallet.'

def __init__(self, tx, parent, desc, prompt_if_unsaved):

    QDialog.__init__(self, parent=None)
    self.tx = copy.deepcopy(tx)
    self.tx.deserialize()
    self.main_window = parent
    self.wallet = parent.wallet
    self.prompt_if_unsaved = prompt_if_unsaved
    self.saved = False
    self.desc = desc
    self.setMinimumWidth(660)
    self.setWindowTitle(_('Transaction'))
    vbox = QVBoxLayout()
    self.setLayout(vbox)
    vbox.addWidget(QLabel(_('Transaction    ID:')))
    self.tx_hash_e = ButtonsLineEdit()
    qr_show = (lambda : parent.show_qrcode(str(self.tx_hash_e.text()), 'Transaction    ID', parent=self))
    self.tx_hash_e.addButton(':icons/qrcode.png', qr_show, _('Show    as    QR    code'))
    self.tx_hash_e.setReadOnly(True)
    vbox.addWidget(self.tx_hash_e)
    self.tx_desc = QLabel()
    vbox.addWidget(self.tx_desc)
    self.status_label = QLabel()
    vbox.addWidget(self.status_label)
    self.date_label = QLabel()
    vbox.addWidget(self.date_label)
    self.amount_label = QLabel()
    vbox.addWidget(self.amount_label)
    self.size_label = QLabel()
    vbox.addWidget(self.size_label)
    self.fee_label = QLabel()
    vbox.addWidget(self.fee_label)
    self.add_io(vbox)
    vbox.addStretch(1)
    self.sign_button = b = QPushButton(_('Sign'))
    b.clicked.connect(self.sign)
    self.broadcast_button = b = QPushButton(_('Broadcast'))
    b.clicked.connect(self.do_broadcast)
    self.save_button = b = QPushButton(_('Save'))
    b.clicked.connect(self.save)
    self.cancel_button = b = QPushButton(_('Close'))
    b.clicked.connect(self.close)
    b.setDefault(True)
    self.qr_button = b = QPushButton()
    b.setIcon(QIcon(':icons/qrcode.png'))
    b.clicked.connect(self.show_qr)
    self.copy_button = CopyButton((lambda : str(self.tx)), parent.app)
    self.buttons = [self.sign_button, self.broadcast_button, self.cancel_button]
    self.sharing_buttons = [self.copy_button, self.qr_button, self.save_button]
    run_hook('transaction_dialog', self)
    hbox = QHBoxLayout()
    hbox.addLayout(Buttons(*self.sharing_buttons))
    hbox.addStretch(1)
    hbox.addLayout(Buttons(*self.buttons))
    vbox.addLayout(hbox)
    self.update()
