Skip to content

Commit 1c7b1dc

Browse files
committed
Merge #223: Introduce Proxy settings view
af66daa qml: rework SettingsConnection page to include Proxy settings (jarolrod) cfa9c3e qml: introduce proxy setting components and pages (jarolrod) Pull request description: Introduces the components and views that make up the proxy settings page. Missing options handling wiring, as well as the gray box that signals the current status/activation of specified proxy settings. Based on these designs: [proxy designs](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=6266%3A23933&t=fVYCyV3AXZLRXxpB-4) | light | dark | | ----- | ---- | | <img width="752" alt="Screen Shot 2023-02-17 at 1 15 52 AM" src="https://user-images.githubusercontent.com/23396902/219564274-4156bdff-6d1e-48df-aad1-790800cd1622.png"> | <img width="752" alt="Screen Shot 2023-02-17 at 1 15 28 AM" src="https://user-images.githubusercontent.com/23396902/219564290-2fc83d8c-308d-496a-8de5-34c992701336.png"> | [![Windows](https://img.shields.io/badge/OS-Windows-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/insecure_win_gui.zip?branch=pull/223) [![Intel macOS](https://img.shields.io/badge/OS-Intel%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/insecure_mac_gui.zip?branch=pull/223) [![Apple Silicon macOS](https://img.shields.io/badge/OS-Apple%20Silicon%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/insecure_mac_arm64_gui.zip?branch=pull/223) [![ARM64 Android](https://img.shields.io/badge/OS-Android-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/insecure_android_apk.zip?branch=pull/223) ACKs for top commit: johnny9: ACK af66daa Tree-SHA512: 86e56088ed63c63b9885a309a4e9cf3f1635e91b860b3028feafa5801278d859bdd5c023db74f25c6fdf29a154fd4f3fed51877675dd09656765441cc814a22e
2 parents 37c4d37 + af66daa commit 1c7b1dc

File tree

6 files changed

+152
-9
lines changed

6 files changed

+152
-9
lines changed

src/Makefile.qt.include

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ QML_RES_QML = \
339339
qml/components/DeveloperOptions.qml \
340340
qml/components/PeersIndicator.qml \
341341
qml/components/NetworkIndicator.qml \
342+
qml/components/ProxySettings.qml \
342343
qml/components/Separator.qml \
343344
qml/components/StorageLocations.qml \
344345
qml/components/StorageOptions.qml \
@@ -373,6 +374,7 @@ QML_RES_QML = \
373374
qml/pages/settings/SettingsAbout.qml \
374375
qml/pages/settings/SettingsConnection.qml \
375376
qml/pages/settings/SettingsDeveloper.qml \
377+
qml/pages/settings/SettingsProxy.qml \
376378
qml/pages/settings/SettingsStorage.qml
377379

378380
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
@@ -9,6 +9,7 @@
99
<file>components/PeersIndicator.qml</file>
1010
<file>components/DeveloperOptions.qml</file>
1111
<file>components/NetworkIndicator.qml</file>
12+
<file>components/ProxySettings.qml</file>
1213
<file>components/StorageLocations.qml</file>
1314
<file>components/Separator.qml</file>
1415
<file>components/StorageOptions.qml</file>
@@ -43,6 +44,7 @@
4344
<file>pages/settings/SettingsAbout.qml</file>
4445
<file>pages/settings/SettingsConnection.qml</file>
4546
<file>pages/settings/SettingsDeveloper.qml</file>
47+
<file>pages/settings/SettingsProxy.qml</file>
4648
<file>pages/settings/SettingsStorage.qml</file>
4749
</qresource>
4850
<qresource prefix="/icons">

src/qml/components/ConnectionSettings.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,6 @@ ColumnLayout {
7070
actionItem: CaretRightButton {
7171
stateColor: gotoProxy.stateColor
7272
}
73+
onClicked: connectionSwipe.incrementCurrentIndex()
7374
}
7475
}

src/qml/components/ProxySettings.qml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// Copyright (c) 2023 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+
10+
ColumnLayout {
11+
spacing: 4
12+
Header {
13+
headerBold: true
14+
center: false
15+
header: qsTr("Default Proxy")
16+
headerSize: 24
17+
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.")
18+
descriptionSize: 15
19+
Layout.bottomMargin: 10
20+
}
21+
Separator { Layout.fillWidth: true }
22+
Setting {
23+
Layout.fillWidth: true
24+
header: qsTr("Enable")
25+
actionItem: OptionSwitch {}
26+
onClicked: {
27+
loadedItem.toggle()
28+
loadedItem.toggled()
29+
}
30+
}
31+
Separator { Layout.fillWidth: true }
32+
Setting {
33+
id: defaultProxy
34+
Layout.fillWidth: true
35+
header: qsTr("IP and Port")
36+
actionItem: ValueInput {
37+
parentState: defaultProxy.state
38+
description: "127.0.0.1:9050"
39+
onEditingFinished: {
40+
defaultProxy.forceActiveFocus()
41+
}
42+
}
43+
onClicked: loadedItem.forceActiveFocus()
44+
}
45+
Separator { Layout.fillWidth: true }
46+
Header {
47+
headerBold: 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+
Layout.bottomMargin: 10
55+
}
56+
Separator { Layout.fillWidth: true }
57+
Setting {
58+
Layout.fillWidth: true
59+
header: qsTr("Enable")
60+
actionItem: OptionSwitch {}
61+
description: qsTr("When disabled, Tor connections will use the default proxy (if enabled).")
62+
onClicked: {
63+
loadedItem.toggle()
64+
loadedItem.toggled()
65+
}
66+
}
67+
Separator { Layout.fillWidth: true }
68+
Setting {
69+
id: torProxy
70+
Layout.fillWidth: true
71+
header: qsTr("IP and Port")
72+
actionItem: ValueInput {
73+
parentState: torProxy.state
74+
description: "127.0.0.1:9050"
75+
onEditingFinished: {
76+
torProxy.forceActiveFocus()
77+
}
78+
}
79+
onClicked: loadedItem.forceActiveFocus()
80+
}
81+
Separator { Layout.fillWidth: true }
82+
}

src/qml/pages/settings/SettingsConnection.qml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,40 @@ import QtQuick.Layouts 1.15
88
import "../../controls"
99
import "../../components"
1010

11-
InformationPage {
12-
background: null
13-
clip: true
14-
bannerActive: false
15-
bold: true
16-
headerText: qsTr("Connection settings")
17-
headerMargin: 0
18-
detailActive: true
19-
detailItem: ConnectionSettings {}
11+
Item {
12+
property alias navRightDetail: connectionSwipe.navRightDetail
13+
property alias navLeftDetail: connectionSwipe.navLeftDetail
14+
SwipeView {
15+
id: connectionSwipe
16+
property alias navRightDetail: connection_settings.navRightDetail
17+
property alias navLeftDetail: connection_settings.navLeftDetail
18+
anchors.fill: parent
19+
interactive: false
20+
orientation: Qt.Horizontal
21+
InformationPage {
22+
id: connection_settings
23+
background: null
24+
clip: true
25+
bannerActive: false
26+
bold: true
27+
headerText: qsTr("Connection settings")
28+
headerMargin: 0
29+
detailActive: true
30+
detailItem: ConnectionSettings {}
31+
}
32+
SettingsProxy {
33+
navLeftDetail: NavButton {
34+
iconSource: "image://images/caret-left"
35+
text: qsTr("Back")
36+
onClicked: {
37+
connectionSwipe.decrementCurrentIndex()
38+
}
39+
}
40+
navMiddleDetail: Header {
41+
headerBold: true
42+
headerSize: 18
43+
header: qsTr("Proxy Settings")
44+
}
45+
}
46+
}
2047
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) 2023 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)