Changeset View
Changeset View
Standalone View
Standalone View
mobile/wifi/package/contents/ui/ConnectionItemDelegate.qml
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 90 | if (acceptableInput) | |||
---|---|---|---|---|---|
91 | handler.addAndActivateConnection(DevicePath, SpecificPath, connectionPasswordField.text); | 91 | handler.addAndActivateConnection(DevicePath, SpecificPath, connectionPasswordField.text); | ||
92 | } | 92 | } | ||
93 | } | 93 | } | ||
94 | } | 94 | } | ||
95 | 95 | | |||
96 | actions: [ | 96 | actions: [ | ||
97 | Kirigami.Action { | 97 | Kirigami.Action { | ||
98 | iconName: "network-connect" | 98 | iconName: "network-connect" | ||
99 | visible: ConnectionState != PlasmaNM.Enums.Activated && Signal > 0 | 99 | visible: ConnectionState != PlasmaNM.Enums.Activated | ||
100 | onTriggered: changeState() | 100 | onTriggered: changeState() | ||
101 | }, | 101 | }, | ||
102 | Kirigami.Action { | 102 | Kirigami.Action { | ||
103 | iconName: "network-disconnect" | 103 | iconName: "network-disconnect" | ||
104 | visible: ConnectionState == PlasmaNM.Enums.Activated | 104 | visible: ConnectionState == PlasmaNM.Enums.Activated | ||
105 | onTriggered: handler.deactivateConnection(ConnectionPath, DevicePath) | 105 | onTriggered: handler.deactivateConnection(ConnectionPath, DevicePath) | ||
106 | }, | 106 | }, | ||
107 | Kirigami.Action { | 107 | Kirigami.Action { | ||
Show All 10 Lines | |||||
118 | } | 118 | } | ||
119 | ] | 119 | ] | ||
120 | 120 | | |||
121 | onClicked: { | 121 | onClicked: { | ||
122 | changeState() | 122 | changeState() | ||
123 | } | 123 | } | ||
124 | 124 | | |||
125 | function changeState() { | 125 | function changeState() { | ||
126 | if (Signal === 0) | | |||
127 | return | | |||
128 | if (Uuid || !predictableWirelessPassword || connectionPasswordField.visible) { | 126 | if (Uuid || !predictableWirelessPassword || connectionPasswordField.visible) { | ||
129 | if (ConnectionState == PlasmaNM.Enums.Deactivated) { | 127 | if (ConnectionState == PlasmaNM.Enums.Deactivated) { | ||
130 | if (!predictableWirelessPassword && !Uuid) { | 128 | if (!predictableWirelessPassword && !Uuid) { | ||
131 | handler.addAndActivateConnection(DevicePath, SpecificPath); | 129 | handler.addAndActivateConnection(DevicePath, SpecificPath); | ||
132 | } else if (connectionPasswordField.visible) { | 130 | } else if (connectionPasswordField.visible) { | ||
133 | if (connectionPasswordField.text != "") { | 131 | if (connectionPasswordField.text != "") { | ||
134 | handler.addAndActivateConnection(DevicePath, SpecificPath, connectionPasswordFieldField.text); | 132 | handler.addAndActivateConnection(DevicePath, SpecificPath, connectionPasswordFieldField.text); | ||
135 | connectionPasswordField.visible = false; | 133 | connectionPasswordField.visible = false; | ||
Show All 14 Lines |