app split tunneling search field (#727)

This commit is contained in:
Nethius 2024-04-06 22:29:51 +07:00 committed by GitHub
parent 7db84122f9
commit e39efb1d68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 93 additions and 38 deletions

View file

@ -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

View file

@ -24,9 +24,7 @@ PageType {
defaultActiveFocusItem: searchField.textField
property bool pageEnabled: {
return !ConnectionController.isConnected && !isServerFromApi
}
property bool pageEnabled
Component.onCompleted: {
if (ConnectionController.isConnected) {