1
0

qml: ask user whether to configure Tor or other proxy before presenting proxy detail config screen

This commit is contained in:
Sander van Grieken
2023-03-16 15:42:24 +01:00
parent 39eaf9d871
commit 7a86d8dc9e
4 changed files with 50 additions and 2 deletions

View 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
}
}
}

View File

@@ -21,7 +21,8 @@ WizardComponent {
ProxyConfig {
id: pc
width: parent.width
Layout.fillWidth: true
proxy_enabled: true
}
}
}

View File

@@ -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' },
})

View File

@@ -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'
},