Changeset View
Changeset View
Standalone View
Standalone View
mobile/wifi/package/contents/ui/NetworkListView.qml
Show All 20 Lines | |||||
21 | import QtQuick.Layouts 1.2 | 21 | import QtQuick.Layouts 1.2 | ||
22 | import QtQuick.Controls 2.2 as Controls | 22 | import QtQuick.Controls 2.2 as Controls | ||
23 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | 23 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | ||
24 | import org.kde.kirigami 2.6 as Kirigami | 24 | import org.kde.kirigami 2.6 as Kirigami | ||
25 | 25 | | |||
26 | Kirigami.ScrollablePage { | 26 | Kirigami.ScrollablePage { | ||
27 | anchors.leftMargin: Kirigami.Units.largeSpacing * 2 | 27 | anchors.leftMargin: Kirigami.Units.largeSpacing * 2 | ||
28 | 28 | | |||
29 | header: ColumnLayout { | 29 | header: Kirigami.InlineMessage { | ||
30 | width: parent.width | | |||
31 | Kirigami.InlineMessage { | | |||
32 | id: inlineError | 30 | id: inlineError | ||
33 | Layout.fillWidth: true | 31 | Layout.fillWidth: true | ||
34 | showCloseButton: true | 32 | showCloseButton: true | ||
35 | 33 | | |||
36 | visible: false | 34 | visible: false | ||
37 | 35 | | |||
38 | type: Kirigami.MessageType.Warning | 36 | type: Kirigami.MessageType.Warning | ||
39 | Connections { | 37 | Connections { | ||
40 | target: handler | 38 | target: handler | ||
41 | onConnectionActivationFailed: { | 39 | onConnectionActivationFailed: { | ||
42 | inlineError.text = message; | 40 | inlineError.text = message; | ||
43 | inlineError.visible = true; | 41 | inlineError.visible = true; | ||
44 | } | 42 | } | ||
45 | } | 43 | } | ||
46 | } | 44 | } | ||
47 | 45 | | |||
48 | RowLayout { | | |||
49 | id: layoutrow | | |||
50 | Layout.fillWidth: true | | |||
51 | | ||||
52 | Controls.Label { | | |||
53 | anchors.left: parent.left | | |||
54 | text: i18n("Wi-fi") | | |||
55 | Layout.fillWidth: true | | |||
56 | font.bold: true | | |||
57 | } | | |||
58 | | ||||
59 | Controls.Switch { | | |||
60 | id: wifiSwitchButton | | |||
61 | checked: enabled && enabledConnections.wirelessEnabled | | |||
62 | enabled: enabledConnections.wirelessHwEnabled | | |||
63 | onClicked: { | | |||
64 | handler.enableWireless(checked); | | |||
65 | } | | |||
66 | } | | |||
67 | } | | |||
68 | } | | |||
69 | | ||||
70 | ListView { | 46 | ListView { | ||
71 | id: view | 47 | id: view | ||
72 | 48 | | |||
73 | anchors.fill: parent | 49 | anchors.fill: parent | ||
74 | clip: true | 50 | clip: true | ||
75 | width: parent.width | 51 | width: parent.width | ||
76 | currentIndex: -1 | 52 | currentIndex: -1 | ||
77 | boundsBehavior: Flickable.StopAtBounds | 53 | boundsBehavior: Flickable.StopAtBounds | ||
78 | header: Column { | 54 | header: Column { | ||
79 | width: parent.width | 55 | width: parent.width | ||
80 | Controls.Label { | 56 | Controls.Label { | ||
81 | text: (mobileProxyModel.showSavedMode) ? i18n("Saved networks") : i18n("Available networks") | 57 | text: (mobileProxyModel.showSavedMode) ? i18n("Saved networks") : i18n("Available networks") | ||
82 | } | 58 | } | ||
83 | Rectangle { width: parent.width; height: 2; color: Kirigami.Theme.disabledTextColor} | 59 | Rectangle { width: parent.width; height: 2; color: Kirigami.Theme.disabledTextColor} | ||
84 | } | 60 | } | ||
85 | model: mobileProxyModel | 61 | model: mobileProxyModel | ||
86 | delegate: ConnectionItemDelegate {} | 62 | delegate: ConnectionItemDelegate {} | ||
87 | } | 63 | } | ||
88 | 64 | | |||
65 | actions.main: Kirigami.Action { | ||||
66 | iconName: enabledConnections.wirelessEnabled ? "network-wireless-disconnected" : "network-wireless-connected" | ||||
67 | text: enabledConnections.wirelessEnabled ? i18n("Disable Wi-Fi") : i18n("Enable Wi-Fi") | ||||
68 | onTriggered: handler.enableWireless(!enabledConnections.wirelessEnabled); | ||||
69 | } | ||||
70 | | ||||
89 | actions.contextualActions: [ | 71 | actions.contextualActions: [ | ||
90 | 72 | | |||
91 | Kirigami.Action { | 73 | Kirigami.Action { | ||
92 | iconName: "edit" | 74 | iconName: "edit" | ||
93 | text: i18n("Add custom connection") | 75 | text: i18n("Add custom connection") | ||
94 | onTriggered: { | 76 | onTriggered: { | ||
95 | applicationWindow().pageStack.push(connectionEditorDialogComponent) | 77 | applicationWindow().pageStack.push(connectionEditorDialogComponent) | ||
96 | contextDrawer.close() | 78 | contextDrawer.close() | ||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |