fix split tunneling settings

This commit is contained in:
Cyril Anisimov 2024-12-14 19:32:46 +01:00
parent 8bc31b60a1
commit 906cf7b939

View file

@ -144,18 +144,17 @@ PageType {
model: root.routeModesModel
currentIndex: getRouteModesModelIndex()
clickedFunction: function() {
selector.text = selectedText
selector.closeTriggered()
if (SitesModel.routeMode !== root.routeModesModel[currentIndex].type) {
SitesModel.routeMode = root.routeModesModel[currentIndex].type
if (SitesModel.routeMode !== root.routeModesModel[selectedIndex].type) {
SitesModel.routeMode = root.routeModesModel[selectedIndex].type
}
}
Component.onCompleted: {
if (root.routeModesModel[currentIndex].type === SitesModel.routeMode) {
if (root.routeModesModel[selectedIndex].type === SitesModel.routeMode) {
selector.text = selectedText
} else {
selector.text = root.routeModesModel[0].name
@ -165,7 +164,7 @@ PageType {
Connections {
target: SitesModel
function onRouteModeChanged() {
currentIndex = getRouteModesModelIndex()
selectedIndex = getRouteModesModelIndex()
}
}
}
@ -173,42 +172,18 @@ PageType {
}
ListView {
id: sites
id: listView
anchors.top: header.bottom
anchors.topMargin: 16
width: parent.width
anchors.bottom: addSiteButton.top
height: 200 // TODO: Change to correct height
width: parent.width
enabled: root.pageEnabled
property bool isFocusable: true
Keys.onTabPressed: {
FocusController.nextKeyTabItem()
}
Keys.onBacktabPressed: {
FocusController.previousKeyTabItem()
}
Keys.onUpPressed: {
FocusController.nextKeyUpItem()
}
Keys.onDownPressed: {
FocusController.nextKeyDownItem()
}
Keys.onLeftPressed: {
FocusController.nextKeyLeftItem()
}
Keys.onRightPressed: {
FocusController.nextKeyRightItem()
}
model: SortFilterProxyModel {
id: proxySitesModel
sourceModel: SitesModel
@ -230,22 +205,12 @@ PageType {
clip: true
delegate: Item {
implicitWidth: sites.width
implicitHeight: delegateContent.implicitHeight
reuseItems: true
// onActiveFocusChanged: {
// if (activeFocus) {
// site.rightButton.forceActiveFocus()
// }
// }
ColumnLayout {
delegate: ColumnLayout {
id: delegateContent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
width: listView.width
LabelWithButtonType {
id: site
@ -280,7 +245,6 @@ PageType {
DividerType {}
}
}
}
Rectangle {
@ -373,7 +337,7 @@ PageType {
LabelWithButtonType {
id: exportSitesButton
visible: !SettingsController.isOnTv()
enabled: !SettingsController.isOnTv()
Layout.fillWidth: true
text: qsTr("Save site list")
@ -398,7 +362,7 @@ PageType {
}
DividerType {
visible: !SettingsController.isOnTv()
enabled: !SettingsController.isOnTv()
}
}
}