electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit eadd5d58e83a9e40e042fbfb4267e9fb603b55ac
parent cb14bde42286b6fcd57fe74574e445759a843b5f
Author: ThomasV <thomasv@electrum.org>
Date:   Thu,  5 Mar 2020 11:54:33 +0100

kivy: improve open_channel dialog

Diffstat:
Melectrum/gui/kivy/uix/dialogs/lightning_open_channel.py | 34+++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/electrum/gui/kivy/uix/dialogs/lightning_open_channel.py b/electrum/gui/kivy/uix/dialogs/lightning_open_channel.py @@ -42,19 +42,6 @@ Builder.load_string(''' BlueButton: text: s.pubkey if s.pubkey else _('Node ID') shorten: True - #CardSeparator: - # color: blue_bottom.foreground_color - #BoxLayout: - # size_hint: 1, None - # height: blue_bottom.item_height - # Image: - # source: 'atlas://electrum/gui/kivy/theming/light/network' - # size_hint: None, None - # size: '22dp', '22dp' - # pos_hint: {'center_y': .5} - # BlueButton: - # text: s.ipport if s.ipport else _('host:port') - # on_release: s.ipport_dialog() CardSeparator: color: blue_bottom.foreground_color BoxLayout: @@ -68,8 +55,11 @@ Builder.load_string(''' BlueButton: text: s.amount if s.amount else _('Amount') on_release: app.amount_dialog(s, True) + TopLabel: + text: _('Paste or scan a node ID, a connection string or a lightning invoice.') BoxLayout: size_hint: 1, None + height: '48dp' IconButton: icon: 'atlas://electrum/gui/kivy/theming/light/copy' size_hint: 0.5, None @@ -86,12 +76,22 @@ Builder.load_string(''' height: '48dp' on_release: s.choose_node() Button: - text: _('Open') + text: _('Clear') size_hint: 1, None height: '48dp' - on_release: s.open_channel() + on_release: s.do_clear() Widget: size_hint: 1, 1 + BoxLayout: + size_hint: 1, None + Widget: + size_hint: 2, None + Button: + text: _('Open') + size_hint: 1, None + height: '48dp' + on_release: s.open_channel() + disabled: not root.pubkey or not root.amount ''') class LightningOpenChannelDialog(Factory.Popup): @@ -123,6 +123,10 @@ class LightningOpenChannelDialog(Factory.Popup): if self.msg: self.app.show_info(self.msg) + def do_clear(self): + self.pubkey = '' + self.amount = '' + def do_paste(self): contents = self.app._clipboard.paste() if not contents: