mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
app split tunneling search field (#727)
This commit is contained in:
@@ -20,6 +20,17 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
property bool pageEnabled
|
||||
|
||||
Component.onCompleted: {
|
||||
if (ConnectionController.isConnected) {
|
||||
PageController.showNotificationMessage(qsTr("Cannot change split tunneling settings during active connection"))
|
||||
root.pageEnabled = false
|
||||
} else {
|
||||
root.pageEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: routeMode
|
||||
property int allApps: 0
|
||||
@@ -70,6 +81,8 @@ PageType {
|
||||
Layout.leftMargin: 16
|
||||
|
||||
headerText: qsTr("App split tunneling")
|
||||
|
||||
enabled: root.pageEnabled
|
||||
}
|
||||
|
||||
SwitcherType {
|
||||
@@ -78,6 +91,8 @@ PageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
|
||||
enabled: root.pageEnabled
|
||||
|
||||
checked: AppSplitTunnelingModel.isTunnelingEnabled
|
||||
onToggled: {
|
||||
AppSplitTunnelingModel.toggleSplitTunneling(checked)
|
||||
@@ -99,7 +114,7 @@ PageType {
|
||||
|
||||
headerText: qsTr("Mode")
|
||||
|
||||
enabled: Qt.platform.os === "android"
|
||||
enabled: Qt.platform.os === "android" && root.pageEnabled
|
||||
|
||||
listView: ListViewWithRadioButtonType {
|
||||
rootWidth: root.width
|
||||
@@ -139,6 +154,8 @@ PageType {
|
||||
anchors.topMargin: 16
|
||||
contentHeight: col.implicitHeight + addAppButton.implicitHeight + addAppButton.anchors.bottomMargin + addAppButton.anchors.topMargin
|
||||
|
||||
enabled: root.pageEnabled
|
||||
|
||||
Column {
|
||||
id: col
|
||||
anchors.top: parent.top
|
||||
@@ -213,6 +230,8 @@ PageType {
|
||||
RowLayout {
|
||||
id: addAppButton
|
||||
|
||||
enabled: root.pageEnabled
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
@@ -24,9 +24,7 @@ PageType {
|
||||
|
||||
defaultActiveFocusItem: searchField.textField
|
||||
|
||||
property bool pageEnabled: {
|
||||
return !ConnectionController.isConnected && !isServerFromApi
|
||||
}
|
||||
property bool pageEnabled
|
||||
|
||||
Component.onCompleted: {
|
||||
if (ConnectionController.isConnected) {
|
||||
|
||||
Reference in New Issue
Block a user