From 00be891d3b0cb401e642a5331aedcc399641b8ef Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Mon, 31 May 2021 01:49:43 +0200 Subject: [refactor] unclutter main qml --- gui/qml/BridgesItem.qml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 gui/qml/BridgesItem.qml (limited to 'gui/qml/BridgesItem.qml') diff --git a/gui/qml/BridgesItem.qml b/gui/qml/BridgesItem.qml new file mode 100644 index 0000000..1cf152c --- /dev/null +++ b/gui/qml/BridgesItem.qml @@ -0,0 +1,58 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.12 +import QtQuick.Controls 2.4 + +import "logic.js" as Logic + +Item { + + anchors.centerIn: parent + width: parent.width + property alias displayReconnect: bridgeReconnect.visible + + Column { + + anchors.centerIn: parent + spacing: 10 + width: parent.width + + CheckBox { + id: bridgeCheck + checked: false + text: qsTr("Use obfs4 bridges") + font.pixelSize: 14 + anchors.horizontalCenter: parent.horizontalCenter + onClicked: { + if (checked) { + Logic.setNeedsReconnect(true); + bridgeReconnect.visible = true; + } else { + // This would also need a "needs reconnect" for de-selecting bridges the next time. + // better to wait and see the new connection widgets though + Logic.setNeedsReconnect(false); + bridgeReconnect.visible = false; + } + } + } + + Text { + id: bridgesInfo + width: 250 + color: "grey" + text: qsTr("Select a bridge only if you know that you need it to evade censorship in your country or local network.") + anchors.horizontalCenter: parent.horizontalCenter + wrapMode: Text.WordWrap + } + + Text { + id: bridgeReconnect + width: 250 + font.pixelSize: 12 + color: "red" + text: qsTr("We will attempt to connect to a bridge the next time you connect to the VPN.") + anchors.horizontalCenter: parent.horizontalCenter + wrapMode: Text.WordWrap + visible: false; + } + } +} -- cgit v1.2.3