summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kacej <[email protected]>2018-01-24 22:47:58 +0100
committerMartin Kacej <[email protected]>2018-01-24 22:47:58 +0100
commitc701d3714107f5f235b4c1bfea71c1f1becb826c (patch)
tree785a121c3d9dc66cb97d6d86ba072d086a5ad070
parent0e1f1cd1ddaad6efcbbddb5f6fbf12de30cbf621 (diff)
password field copied from applet
-rw-r--r--mobile/package/contents/ui/PasswordField.qml39
1 files changed, 39 insertions, 0 deletions
diff --git a/mobile/package/contents/ui/PasswordField.qml b/mobile/package/contents/ui/PasswordField.qml
new file mode 100644
index 0000000..425da7d
--- /dev/null
+++ b/mobile/package/contents/ui/PasswordField.qml
@@ -0,0 +1,39 @@
+/*
+ Copyright 2013-2017 Jan Grulich <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) version 3, or any
+ later version accepted by the membership of KDE e.V. (or its
+ successor approved by the membership of KDE e.V.), which shall
+ act as a proxy defined in Section 6 of version 3 of the license.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+import QtQuick 2.2
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
+
+PlasmaComponents.TextField {
+ property int securityType
+
+ height: implicitHeight; width: units.gridUnit * 15
+ echoMode: TextInput.Password
+ revealPasswordButtonShown: true
+ placeholderText: i18n("Password...")
+ validator: RegExpValidator {
+ regExp: if (securityType == PlasmaNM.Enums.StaticWep) {
+ /^(?:.{5}|[0-9a-fA-F]{10}|.{13}|[0-9a-fA-F]{26}){1}$/
+ } else {
+ /^(?:.{8,64}){1}$/
+ }
+ }
+}