Skip to content

Commit bf0c097

Browse files
committed
qml: introduce proxy setting components and pages
1 parent 1a71fd4 commit bf0c097

File tree

4 files changed

+119
-0
lines changed

4 files changed

+119
-0
lines changed

src/Makefile.qt.include

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ QML_RES_QML = \
326326
qml/components/ConnectionOptions.qml \
327327
qml/components/ConnectionSettings.qml \
328328
qml/components/DeveloperOptions.qml \
329+
qml/components/ProxySettings.qml \
329330
qml/components/StorageLocations.qml \
330331
qml/components/StorageOptions.qml \
331332
qml/components/StorageSettings.qml \
@@ -358,6 +359,7 @@ QML_RES_QML = \
358359
qml/pages/settings/SettingsAbout.qml \
359360
qml/pages/settings/SettingsConnection.qml \
360361
qml/pages/settings/SettingsDeveloper.qml \
362+
qml/pages/settings/SettingsProxy.qml \
361363
qml/pages/settings/SettingsStorage.qml
362364

363365
BITCOIN_QT_CPP = $(BITCOIN_QT_BASE_CPP)

src/qml/bitcoin_qml.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<file>components/ConnectionOptions.qml</file>
66
<file>components/ConnectionSettings.qml</file>
77
<file>components/DeveloperOptions.qml</file>
8+
<file>components/ProxySettings.qml</file>
89
<file>components/StorageLocations.qml</file>
910
<file>components/StorageOptions.qml</file>
1011
<file>components/StorageSettings.qml</file>
@@ -37,6 +38,7 @@
3738
<file>pages/settings/SettingsAbout.qml</file>
3839
<file>pages/settings/SettingsConnection.qml</file>
3940
<file>pages/settings/SettingsDeveloper.qml</file>
41+
<file>pages/settings/SettingsProxy.qml</file>
4042
<file>pages/settings/SettingsStorage.qml</file>
4143
</qresource>
4244
<qresource prefix="/icons">

src/qml/components/ProxySettings.qml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import QtQuick 2.15
2+
import QtQuick.Controls 2.15
3+
import QtQuick.Layouts 1.15
4+
import "../controls"
5+
6+
ColumnLayout {
7+
spacing: 10
8+
Header {
9+
bold: true
10+
center: false
11+
header: qsTr("Default Proxy")
12+
headerSize: 24
13+
description: qsTr("Run peer connections through a proxy (SOCKS5) for improved privacy. The default proxy supports connections via IPv4, IPv6 and Tor. Tor connections can also be run through a separate Tor proxy.")
14+
descriptionSize: 15
15+
}
16+
Rectangle {
17+
height: 1
18+
color: Theme.color.neutral5
19+
Layout.fillWidth: true
20+
}
21+
Setting {
22+
Layout.topMargin: 10
23+
Layout.fillWidth: true
24+
header: qsTr("Enable")
25+
actionItem: OptionSwitch {}
26+
}
27+
Setting {
28+
Layout.topMargin: 10
29+
Layout.fillWidth: true
30+
header: qsTr("IP and Port")
31+
actionItem: RowLayout {
32+
ValueInput {
33+
id: default_ip
34+
description: "127.0.0.1"
35+
}
36+
Header {
37+
header: ":"
38+
headerSize: 18
39+
}
40+
ValueInput {
41+
id: default_port
42+
description: "9050"
43+
}
44+
}
45+
}
46+
Header {
47+
bold: true
48+
center: false
49+
header: qsTr("Tor Proxy")
50+
headerSize: 24
51+
description: qsTr("Enable to run Tor connections through a dedicated proxy.")
52+
descriptionSize: 15
53+
Layout.topMargin: 35
54+
}
55+
Rectangle {
56+
height: 1
57+
color: Theme.color.neutral5
58+
Layout.fillWidth: true
59+
}
60+
Setting {
61+
Layout.topMargin: 10
62+
Layout.fillWidth: true
63+
header: qsTr("Enable")
64+
actionItem: OptionSwitch {}
65+
description: qsTr("When disabled, Tor connections will use the default proxy (if enabled).")
66+
}
67+
Setting {
68+
Layout.topMargin: 10
69+
Layout.fillWidth: true
70+
header: qsTr("IP and Port")
71+
actionItem: RowLayout {
72+
ValueInput {
73+
id: tor_ip
74+
description: "127.0.0.1"
75+
}
76+
Header {
77+
header: ":"
78+
headerSize: 18
79+
}
80+
ValueInput {
81+
id: tor_port
82+
description: "9050"
83+
}
84+
}
85+
}
86+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) 2022 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
import QtQuick 2.15
6+
import QtQuick.Controls 2.15
7+
import QtQuick.Layouts 1.15
8+
import "../../controls"
9+
import "../../components"
10+
11+
Page {
12+
id: proxy_settings
13+
property alias navLeftDetail: navbar.leftDetail
14+
property alias navMiddleDetail: navbar.middleDetail
15+
16+
background: null
17+
implicitWidth: 450
18+
leftPadding: 20
19+
rightPadding: 20
20+
topPadding: 30
21+
22+
header: NavigationBar {
23+
id: navbar
24+
}
25+
ProxySettings {
26+
width: Math.min(parent.width, 450)
27+
anchors.horizontalCenter: parent.horizontalCenter
28+
}
29+
}

0 commit comments

Comments
 (0)