Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/ConnectionItem.qml
Show All 27 Lines | |||||
28 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | 28 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | ||
29 | 29 | | |||
30 | PlasmaComponents.ListItem { | 30 | PlasmaComponents.ListItem { | ||
31 | id: connectionItem | 31 | id: connectionItem | ||
32 | 32 | | |||
33 | property bool activating: ConnectionState == PlasmaNM.Enums.Activating | 33 | property bool activating: ConnectionState == PlasmaNM.Enums.Activating | ||
34 | property int baseHeight: Math.max(units.iconSizes.medium, connectionNameLabel.height + connectionStatusLabel.height) + Math.round(units.gridUnit / 2) | 34 | property int baseHeight: Math.max(units.iconSizes.medium, connectionNameLabel.height + connectionStatusLabel.height) + Math.round(units.gridUnit / 2) | ||
35 | property bool expanded: visibleDetails || visiblePasswordDialog | 35 | property bool expanded: visibleDetails || visiblePasswordDialog | ||
36 | property bool predictableWirelessPassword: !Uuid && Type == PlasmaNM.Enums.Wireless && | 36 | property bool passwordIsStatic: (SecurityType == PlasmaNM.Enums.StaticWep || SecurityType == PlasmaNM.Enums.WpaPsk || | ||
37 | (SecurityType == PlasmaNM.Enums.StaticWep || SecurityType == PlasmaNM.Enums.WpaPsk || | 37 | SecurityType == PlasmaNM.Enums.Wpa2Psk || SecurityType == PlasmaNM.Enums.SAE) | ||
38 | SecurityType == PlasmaNM.Enums.Wpa2Psk) | 38 | property bool predictableWirelessPassword: !Uuid && Type == PlasmaNM.Enums.Wireless && passwordIsStatic | ||
39 | property bool showSpeed: plasmoid.expanded && | 39 | property bool showSpeed: plasmoid.expanded && | ||
40 | ConnectionState == PlasmaNM.Enums.Activated && | 40 | ConnectionState == PlasmaNM.Enums.Activated && | ||
41 | (Type == PlasmaNM.Enums.Wired || | 41 | (Type == PlasmaNM.Enums.Wired || | ||
42 | Type == PlasmaNM.Enums.Wireless || | 42 | Type == PlasmaNM.Enums.Wireless || | ||
43 | Type == PlasmaNM.Enums.Gsm || | 43 | Type == PlasmaNM.Enums.Gsm || | ||
44 | Type == PlasmaNM.Enums.Cdma) | 44 | Type == PlasmaNM.Enums.Cdma) | ||
45 | property bool visibleDetails: false | 45 | property bool visibleDetails: false | ||
46 | property bool visiblePasswordDialog: false | 46 | property bool visiblePasswordDialog: false | ||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | |||||
159 | PlasmaComponents.Menu { | 159 | PlasmaComponents.Menu { | ||
160 | id: contextMenu | 160 | id: contextMenu | ||
161 | 161 | | |||
162 | property Component showQRComponent: null | 162 | property Component showQRComponent: null | ||
163 | 163 | | |||
164 | function prepare() { | 164 | function prepare() { | ||
165 | showQRMenuItem.visible = false; | 165 | showQRMenuItem.visible = false; | ||
166 | 166 | | |||
167 | if (Uuid && Type === PlasmaNM.Enums.Wireless && | 167 | if (Uuid && Type === PlasmaNM.Enums.Wireless && passwordIsStatic) { | ||
168 | (SecurityType === PlasmaNM.Enums.StaticWep || SecurityType === PlasmaNM.Enums.WpaPsk || SecurityType === PlasmaNM.Enums.Wpa2Psk)) { | | |||
169 | if (!showQRComponent) { | 168 | if (!showQRComponent) { | ||
170 | showQRComponent = Qt.createComponent("ShowQR.qml", this); | 169 | showQRComponent = Qt.createComponent("ShowQR.qml", this); | ||
171 | if (showQRComponent.status === Component.Error) { | 170 | if (showQRComponent.status === Component.Error) { | ||
172 | console.warn("Cannot create QR code component:", showQRComponent.errorString()); | 171 | console.warn("Cannot create QR code component:", showQRComponent.errorString()); | ||
173 | } | 172 | } | ||
174 | } | 173 | } | ||
175 | 174 | | |||
176 | showQRMenuItem.visible = (showQRComponent.status === Component.Ready); | 175 | showQRMenuItem.visible = (showQRComponent.status === Component.Ready); | ||
▲ Show 20 Lines • Show All 270 Lines • Show Last 20 Lines |