Changeset View
Changeset View
Standalone View
Standalone View
mobile/wifi/package/contents/ui/main.qml
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | 80 | ListView { | |||
---|---|---|---|---|---|
81 | id: view | 81 | id: view | ||
82 | 82 | | |||
83 | anchors.fill: parent | 83 | anchors.fill: parent | ||
84 | clip: true | 84 | clip: true | ||
85 | width: parent.width | 85 | width: parent.width | ||
86 | currentIndex: -1 | 86 | currentIndex: -1 | ||
87 | boundsBehavior: Flickable.StopAtBounds | 87 | boundsBehavior: Flickable.StopAtBounds | ||
88 | 88 | | |||
89 | header: Kirigami.ListSectionHeader { | 89 | section.property: "ConnectionState" | ||
jgrulich: You can use "Section" property from the model, which already contains either "Active… | |||||
90 | text: mobileProxyModel.showSavedMode ? i18n("Saved networks") : i18n("Available networks") | 90 | section.delegate: Kirigami.ListSectionHeader { | ||
91 | text: { | ||||
92 | | ||||
93 | if (section == 1) { | ||||
94 | return i18n("Activating") | ||||
95 | } | ||||
96 | | ||||
97 | if (section == 2) { | ||||
98 | return i18n("Connected") | ||||
99 | } | ||||
100 | | ||||
101 | if (section == 3) { | ||||
102 | return i18n("Deactivating") | ||||
103 | } | ||||
104 | | ||||
105 | if (section == 4) { | ||||
106 | return i18n("Available") | ||||
107 | } | ||||
108 | return i18n("Unknown") | ||||
109 | } | ||||
91 | } | 110 | } | ||
92 | 111 | | |||
93 | model: mobileProxyModel | 112 | model: mobileProxyModel | ||
94 | delegate: ConnectionItemDelegate {} | 113 | delegate: ConnectionItemDelegate {} | ||
95 | } | 114 | } | ||
96 | 115 | | |||
97 | actions.main: Kirigami.Action { | 116 | actions.main: Kirigami.Action { | ||
98 | iconName: enabledConnections.wirelessEnabled ? "network-wireless-disconnected" : "network-wireless-connected" | 117 | iconName: enabledConnections.wirelessEnabled ? "network-wireless-disconnected" : "network-wireless-connected" | ||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |
You can use "Section" property from the model, which already contains either "Active connections" or "Available connections".
We use it in the applet as well: