tkivy: TxHashLabel - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 9bb5b0a70b98eb54ef7f4f354fe03941d13a22ff DIR parent fbfb75eaa16222e3bf7cb6ceadd565b3301dc632 HTML Author: ThomasV <thomasv@electrum.org> Date: Wed, 17 Feb 2016 18:04:34 +0100 kivy: TxHashLabel Diffstat: M gui/kivy/main.kv | 14 ++++++++++++++ M gui/kivy/main_window.py | 5 ++--- M gui/kivy/uix/dialogs/tx_dialog.py | 15 ++------------- M gui/kivy/uix/ui_screens/invoice.kv | 6 ++++-- 4 files changed, 22 insertions(+), 18 deletions(-) --- DIR diff --git a/gui/kivy/main.kv b/gui/kivy/main.kv t@@ -91,6 +91,20 @@ size: self.size pos: self.pos +<TxHashLabel@TopLabel> + font_size: '6pt' + tx_hash: '' + text: '[ref=x]%s[/ref]' %' '.join(map(''.join, zip(*[iter(self.tx_hash)]*4))) if self.tx_hash else '' + padding: '10dp', '10dp' + on_ref_press: + app._clipboard.copy(self.text) + app.show_info(_('Transaction ID copied to clipboard')) + canvas.before: + Color: + rgb: .3, .3, .3 + Rectangle: + size: self.size + pos: self.pos <InfoBubble> size_hint: None, None DIR diff --git a/gui/kivy/main_window.py b/gui/kivy/main_window.py t@@ -294,10 +294,9 @@ class ElectrumWindow(App): popup.signature = req.get('signature', '') popup.status = status txid = req.get('txid') - if txid: - popup.ids.txid_label.text = _("Transaction ID") + ':\n' + ' '.join(map(''.join, zip(*[iter(txid)]*4))) - popup.open() + popup.tx_hash = txid or '' popup.ids.output_list.update(req.get('outputs', [])) + popup.open() def qr_dialog(self, title, data): from uix.dialogs.qr_dialog import QRDialog DIR diff --git a/gui/kivy/uix/dialogs/tx_dialog.py b/gui/kivy/uix/dialogs/tx_dialog.py t@@ -64,19 +64,8 @@ Builder.load_string(''' id: output_list TopLabel: text: _('Transaction ID') + ':' if root.tx_hash else '' - TopLabel: - font_size: '6pt' - text: '[ref=x]%s[/ref]' %' '.join(map(''.join, zip(*[iter(root.tx_hash)]*4))) if root.tx_hash else '' - padding: '10dp', '10dp' - on_ref_press: - app._clipboard.copy(self.text) - app.show_info(_('Transaction ID copied to clipboard')) - canvas.before: - Color: - rgb: .3, .3, .3 - Rectangle: - size: self.size - pos: self.pos + TxHashLabel: + tx_hash: root.tx_hash Widget: size_hint: 1, 0.1 DIR diff --git a/gui/kivy/uix/ui_screens/invoice.kv b/gui/kivy/uix/ui_screens/invoice.kv t@@ -12,9 +12,9 @@ Popup: status: '' signature: '' title: _('Invoice') if popup.is_invoice else _('Request') + tx_hash: '' BoxLayout: orientation: 'vertical' - padding: '10dp' ScrollView: GridLayout: cols: 1 t@@ -56,7 +56,9 @@ Popup: OutputList: id: output_list TopLabel: - id: txid_label + text: _('Transaction ID') if popup.tx_hash else '' + TxHashLabel: + tx_hash: popup.tx_hash Widget: size_hint: 1, 0.1