Browse Source
Offer a first-start network setup screen when using the kivy GUI, similar to what is already done in Qt.patch-4
Siddhant Chawla
3 years ago
committed by
GitHub
5 changed files with 141 additions and 58 deletions
@ -0,0 +1,49 @@ |
|||
Popup: |
|||
id: nd |
|||
title: _('Network Setup') |
|||
was_cancelled: True |
|||
auto_connect: True |
|||
on_dismiss: app.stop() if nd.was_cancelled else None |
|||
BoxLayout: |
|||
orientation: 'vertical' |
|||
padding: '10dp' |
|||
spacing: '10dp' |
|||
TopLabel: |
|||
text: _("How do you want to connect to a server?") |
|||
font_size: '18sp' |
|||
bold: True |
|||
TopLabel: |
|||
text: _("Electrum communicates with remote servers to get information about your transactions and addresses. The servers all fulfill the same purpose only differing in hardware. In most cases you simply want to let Electrum pick one at random. However if you prefer feel free to select a server manually.") |
|||
font_size: '16sp' |
|||
spacing: '10dp' |
|||
GridLayout: |
|||
cols: 2 |
|||
size_hint: 1, 0.1 |
|||
height: self.minimum_height |
|||
padding: '10dp' |
|||
spacing: '10dp' |
|||
Label: |
|||
text: _("Auto Connect") |
|||
CheckBox: |
|||
group: "NetworkConfig" |
|||
active: True |
|||
on_active: nd.auto_connect = True |
|||
Label: |
|||
text: _("Select server manually") |
|||
CheckBox: |
|||
group: "NetworkConfig" |
|||
on_active: nd.auto_connect = False |
|||
BoxLayout: |
|||
orientation:'horizontal' |
|||
size_hint: 1, 0.2 |
|||
Widget: |
|||
size_hint: 0.5, None |
|||
Button: |
|||
size_hint: 0.5, None |
|||
height: '48dp' |
|||
text: _('Next') |
|||
on_release: |
|||
app.set_auto_connect(nd.auto_connect) if nd.auto_connect else None |
|||
app.load_wallet_by_name(app.electrum_config.get_wallet_path(use_gui_last_wallet=True)) if nd.auto_connect else app.popup_dialog("initial_network_setup") |
|||
nd.was_cancelled = False |
|||
nd.dismiss() |
@ -0,0 +1,20 @@ |
|||
Popup: |
|||
id: nd |
|||
title: _('Network Setup') |
|||
was_cancelled: True |
|||
on_dismiss: app.stop() if nd.was_cancelled else None |
|||
NetworkDialog |
|||
BoxLayout: |
|||
orientation:'horizontal' |
|||
size_hint: 1, 0.2 |
|||
Widget: |
|||
size_hint: 0.5, None |
|||
Button: |
|||
size_hint: 0.5, None |
|||
height: '48dp' |
|||
text: _('Next') |
|||
on_release: |
|||
app.set_auto_connect(app.auto_connect) |
|||
app.load_wallet_by_name(app.electrum_config.get_wallet_path(use_gui_last_wallet=True)) |
|||
nd.was_cancelled = False |
|||
nd.dismiss() |
@ -1,55 +1,4 @@ |
|||
Popup: |
|||
id: nd |
|||
title: _('Network') |
|||
BoxLayout: |
|||
orientation: 'vertical' |
|||
ScrollView: |
|||
GridLayout: |
|||
id: scrollviewlayout |
|||
cols:1 |
|||
size_hint: 1, None |
|||
height: self.minimum_height |
|||
padding: '10dp' |
|||
SettingsItem: |
|||
value: _("{} connections.").format(app.num_nodes) if app.num_nodes else _("Not connected") |
|||
title: _("Status") + ': ' + self.value |
|||
description: _("Connections with Electrum servers") |
|||
|
|||
CardSeparator |
|||
SettingsItem: |
|||
title: _("Server") + ': ' + app.server_host |
|||
description: _("Server used to query your history.") |
|||
action: lambda x: app.popup_dialog('server') |
|||
|
|||
CardSeparator |
|||
SettingsItem: |
|||
title: _("Proxy") + ': ' + app.proxy_str |
|||
description: _('Proxy configuration') |
|||
action: lambda x: app.popup_dialog('proxy') |
|||
|
|||
CardSeparator |
|||
SettingsItem: |
|||
title: _("Auto-connect") + ': ' + ('ON' if app.auto_connect else 'OFF') |
|||
description: _("Select your server automatically") |
|||
action: app.toggle_auto_connect |
|||
|
|||
CardSeparator |
|||
SettingsItem: |
|||
title: _("One-server mode") + ': ' + ('ON' if app.oneserver else 'OFF') |
|||
description: _("Only connect to a single server") |
|||
action: app.toggle_oneserver |
|||
disabled: app.auto_connect and not app.oneserver |
|||
|
|||
CardSeparator |
|||
SettingsItem: |
|||
value: "%d blocks" % app.num_blocks |
|||
title: _("Blockchain") + ': ' + self.value |
|||
description: _('Verified block headers') |
|||
|
|||
CardSeparator |
|||
SettingsItem: |
|||
title: _('Fork detected at block {}').format(app.blockchain_forkpoint) if app.num_chains>1 else _('No fork detected') |
|||
fork_description: (_('You are following branch') if app.auto_connect else _("Your server is on branch")) + ' ' + app.blockchain_name |
|||
description: self.fork_description if app.num_chains>1 else _('Connected nodes are on the same chain') |
|||
action: app.choose_blockchain_dialog |
|||
disabled: app.num_chains == 1 |
|||
NetworkDialog |
|||
|
Loading…
Reference in new issue