diff --git a/electrum/gui/qml/components/wizard/WCProxyAsk.qml b/electrum/gui/qml/components/wizard/WCProxyAsk.qml new file mode 100644 index 000000000..02dd9d3bc --- /dev/null +++ b/electrum/gui/qml/components/wizard/WCProxyAsk.qml @@ -0,0 +1,43 @@ +import QtQuick 2.6 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 2.1 +import QtQuick.Controls.Material 2.0 + +import "../controls" + +WizardComponent { + valid: true + + function apply() { + wizard_data['want_proxy'] = wantproxygroup.checkedButton.wantproxy + } + + ColumnLayout { + width: parent.width + + Label { + Layout.fillWidth: true + text: qsTr('Do you want to connect through TOR, or through another service to reach to the internet?') + wrapMode: Text.Wrap + } + + ButtonGroup { + id: wantproxygroup + onCheckedButtonChanged: checkIsLast() + } + + RadioButton { + ButtonGroup.group: wantproxygroup + property bool wantproxy: true + text: qsTr('Yes') + } + RadioButton { + ButtonGroup.group: wantproxygroup + property bool wantproxy: false + text: qsTr('No') + checked: true + } + + } + +} diff --git a/electrum/gui/qml/components/wizard/WCProxyConfig.qml b/electrum/gui/qml/components/wizard/WCProxyConfig.qml index 6a4018ff8..94b7c6ec4 100644 --- a/electrum/gui/qml/components/wizard/WCProxyConfig.qml +++ b/electrum/gui/qml/components/wizard/WCProxyConfig.qml @@ -21,7 +21,8 @@ WizardComponent { ProxyConfig { id: pc - width: parent.width + Layout.fillWidth: true + proxy_enabled: true } } } diff --git a/electrum/gui/qml/qewizard.py b/electrum/gui/qml/qewizard.py index f00217327..77f09e459 100644 --- a/electrum/gui/qml/qewizard.py +++ b/electrum/gui/qml/qewizard.py @@ -122,6 +122,7 @@ class QEServerConnectWizard(ServerConnectWizard, QEAbstractWizard): # attach view names self.navmap_merge({ 'autoconnect': { 'gui': 'WCAutoConnect' }, + 'proxy_ask': { 'gui': 'WCProxyAsk' }, 'proxy_config': { 'gui': 'WCProxyConfig' }, 'server_config': { 'gui': 'WCServerConfig' }, }) diff --git a/electrum/wizard.py b/electrum/wizard.py index e37ec185e..9e8358982 100644 --- a/electrum/wizard.py +++ b/electrum/wizard.py @@ -435,9 +435,12 @@ class ServerConnectWizard(AbstractWizard): def __init__(self, daemon): self.navmap = { 'autoconnect': { - 'next': 'proxy_config', + 'next': 'proxy_ask', 'last': lambda v,d: d['autoconnect'] }, + 'proxy_ask': { + 'next': lambda d: 'proxy_config' if d['want_proxy'] else 'server_config' + }, 'proxy_config': { 'next': 'server_config' },