Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/PasswordField.qml
Show All 19 Lines | |||||
20 | 20 | | |||
21 | import QtQuick 2.2 | 21 | import QtQuick 2.2 | ||
22 | import org.kde.plasma.components 2.0 as PlasmaComponents | 22 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
23 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | 23 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | ||
24 | 24 | | |||
25 | PlasmaComponents.TextField { | 25 | PlasmaComponents.TextField { | ||
26 | property int securityType | 26 | property int securityType | ||
27 | 27 | | |||
28 | width: units.gridUnit * 15 | | |||
29 | echoMode: TextInput.Password | 28 | echoMode: TextInput.Password | ||
30 | revealPasswordButtonShown: true | 29 | revealPasswordButtonShown: true | ||
31 | placeholderText: i18n("Password...") | 30 | placeholderText: i18n("Password...") | ||
32 | validator: RegExpValidator { | 31 | validator: RegExpValidator { | ||
33 | regExp: if (securityType == PlasmaNM.Enums.StaticWep) { | 32 | regExp: if (securityType == PlasmaNM.Enums.StaticWep) { | ||
34 | /^(?:.{5}|[0-9a-fA-F]{10}|.{13}|[0-9a-fA-F]{26}){1}$/ | 33 | /^(?:.{5}|[0-9a-fA-F]{10}|.{13}|[0-9a-fA-F]{26}){1}$/ | ||
35 | } else { | 34 | } else { | ||
36 | /^(?:.{8,64}){1}$/ | 35 | /^(?:.{8,64}){1}$/ | ||
37 | } | 36 | } | ||
38 | } | 37 | } | ||
39 | } | 38 | } |