qml: ask user whether to configure Tor or other proxy before presenting proxy detail config screen
This commit is contained in:
43
electrum/gui/qml/components/wizard/WCProxyAsk.qml
Normal file
43
electrum/gui/qml/components/wizard/WCProxyAsk.qml
Normal file
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,8 @@ WizardComponent {
|
||||
|
||||
ProxyConfig {
|
||||
id: pc
|
||||
width: parent.width
|
||||
Layout.fillWidth: true
|
||||
proxy_enabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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' },
|
||||
})
|
||||
|
||||
@@ -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'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user