2023-04-26 15:53:49 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2023-07-21 08:41:24 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2023-04-26 15:53:49 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import "../stores/NetworkSelectPopup"
|
|
|
|
import "../controls"
|
|
|
|
|
2024-03-13 17:38:16 +00:00
|
|
|
StatusListView {
|
2023-04-26 15:53:49 +00:00
|
|
|
id: root
|
|
|
|
|
2024-03-13 17:38:16 +00:00
|
|
|
required property var flatNetworks
|
2023-04-26 15:53:49 +00:00
|
|
|
property bool useEnabledRole: true
|
|
|
|
property SingleSelectionInfo singleSelection: SingleSelectionInfo {}
|
2023-07-21 08:41:24 +00:00
|
|
|
property var preferredSharingNetworks: []
|
|
|
|
property bool preferredNetworksMode: false
|
2024-05-13 20:25:18 +00:00
|
|
|
property bool showCheckboxes: true
|
2023-04-26 15:53:49 +00:00
|
|
|
|
2024-03-13 17:38:16 +00:00
|
|
|
signal toggleNetwork(var network, int index)
|
|
|
|
|
|
|
|
model: root.flatNetworks
|
|
|
|
|
|
|
|
delegate: NetworkSelectItemDelegate {
|
|
|
|
implicitHeight: 48
|
|
|
|
implicitWidth: root.width
|
|
|
|
radioButtonGroup: radioBtnGroup
|
|
|
|
networkModel: root.model
|
|
|
|
useEnabledRole: root.useEnabledRole
|
|
|
|
singleSelection: root.singleSelection
|
|
|
|
onToggleNetwork: root.toggleNetwork(network, index)
|
|
|
|
preferredNetworksMode: root.preferredNetworksMode
|
|
|
|
preferredSharingNetworks: root.preferredSharingNetworks
|
|
|
|
allChecked: root.preferredSharingNetworks.length === root.count
|
2024-05-13 20:25:18 +00:00
|
|
|
showCheckboxes: root.showCheckboxes
|
2024-03-13 17:38:16 +00:00
|
|
|
}
|
2023-04-26 15:53:49 +00:00
|
|
|
|
2024-03-13 17:38:16 +00:00
|
|
|
section {
|
|
|
|
property: "layer"
|
|
|
|
delegate: Loader {
|
|
|
|
required property int section
|
2023-04-26 15:53:49 +00:00
|
|
|
width: parent.width
|
2024-03-13 17:38:16 +00:00
|
|
|
sourceComponent: section === 2 ? layer2text: null
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: layer2text
|
|
|
|
StatusBaseText {
|
|
|
|
width: parent.width
|
|
|
|
font.pixelSize: Style.current.primaryTextFontSize
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
text: qsTr("Layer 2")
|
|
|
|
height: 40
|
|
|
|
leftPadding: 16
|
|
|
|
topPadding: 10
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
2023-04-26 15:53:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ButtonGroup {
|
|
|
|
id: radioBtnGroup
|
|
|
|
}
|
|
|
|
}
|