Merge lp:~unity-api-team/unity8/pinunlock-ng into lp:unity8

Proposed by Antti Kaijanmäki
Status: Rejected
Rejected by: Michael Zanetti
Proposed branch: lp:~unity-api-team/unity8/pinunlock-ng
Merge into: lp:unity8
Diff against target: 129 lines (+38/-5)
4 files modified
qml/Components/PinPadButton.qml (+1/-1)
qml/Greeter/Lockscreen.qml (+10/-0)
qml/Greeter/PinLockscreen.qml (+23/-3)
qml/Notifications/NotificationMenuItemFactory.qml (+4/-1)
To merge this branch: bzr merge lp:~unity-api-team/unity8/pinunlock-ng
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Disapprove
Review via email: mp+217010@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Zanetti (mzanetti) wrote :

49 + property var pinMinMax : [4, 8]

Don't set this as default for all PinlockScreens. Keep it null in here and only set it in NotificationMenuItemFactory.

review: Needs Fixing
856. By Antti Kaijanmäki

Increase the height of the PinLockScreen pinEntry shape to make room for the pin retry count.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> Increase the height of the PinLockScreen pinEntry shape to make room for the pin retry count.

The pin entry count should not be in there. You'll find the visual design in lp:~amanzi-team/design.

review: Needs Fixing
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

> 49 + property var pinMinMax : [4, 8]
>
> Don't set this as default for all PinlockScreens. Keep it null in here and
> only set it in NotificationMenuItemFactory.

For _PIN_ lockscreen [4, 8] is the sane default as that is the most common limit. I can move it to the NotificatoinMenuItemFactory if you insist, though.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> > 49 + property var pinMinMax : [4, 8]
> >
> > Don't set this as default for all PinlockScreens. Keep it null in here and
> > only set it in NotificationMenuItemFactory.
>
> For _PIN_ lockscreen [4, 8] is the sane default as that is the most common
> limit. I can move it to the NotificatoinMenuItemFactory if you insist, though.

well, the PinLockscreen file is also used in case of the phone lock screen if it consists only of numbers. So... Everthing that should only affect _SIM PIN_ should be in Notification*

Revision history for this message
Michael Zanetti (mzanetti) wrote :

superseeded by another branch

review: Disapprove

Unmerged revisions

856. By Antti Kaijanmäki

Increase the height of the PinLockScreen pinEntry shape to make room for the pin retry count.

855. By Antti Kaijanmäki

minmax init

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Components/PinPadButton.qml'
2--- qml/Components/PinPadButton.qml 2013-10-17 12:54:22 +0000
3+++ qml/Components/PinPadButton.qml 2014-04-25 08:19:00 +0000
4@@ -62,7 +62,7 @@
5 Label {
6 id: subTextLabel
7 fontSize: "small"
8- color: "grey"
9+ color: root.enabled ? "#f3f3e7" : "grey"
10 anchors.horizontalCenter: parent.horizontalCenter
11 visible: text.length > 0
12 }
13
14=== modified file 'qml/Greeter/Lockscreen.qml'
15--- qml/Greeter/Lockscreen.qml 2013-12-18 20:09:55 +0000
16+++ qml/Greeter/Lockscreen.qml 2014-04-25 08:19:00 +0000
17@@ -34,6 +34,11 @@
18 // This is ignored by the alphaNumeric lockscreen as that one is confirmed with pressing enter on the OSK.
19 property int pinLength: -1
20
21+ // min and max of the pin
22+ // null - not set
23+ // array of two integers: [min, max]
24+ property var pinMinMax : null
25+
26 property url background: ""
27
28 signal entered(string passphrase)
29@@ -110,6 +115,11 @@
30 }
31 Binding {
32 target: pinPadLoader.item
33+ property: "pinMinMax"
34+ value: root.pinMinMax
35+ }
36+ Binding {
37+ target: pinPadLoader.item
38 property: "placeholderText"
39 value: root.placeholderText
40 }
41
42=== modified file 'qml/Greeter/PinLockscreen.qml'
43--- qml/Greeter/PinLockscreen.qml 2013-11-26 14:16:26 +0000
44+++ qml/Greeter/PinLockscreen.qml 2014-04-25 08:19:00 +0000
45@@ -28,6 +28,7 @@
46 property int padWidth: units.gu(34)
47 property int padHeight: units.gu(28)
48 property int pinLength: -1
49+ property var pinMinMax : [4, 8]
50
51 signal entered(string passphrase)
52 signal cancel()
53@@ -48,18 +49,26 @@
54 anchors.horizontalCenter: parent.horizontalCenter
55 color: "#55000000"
56 width:root.padWidth
57- height: units.gu(5)
58+ height: units.gu(6)
59 radius: "medium"
60 property string text: ""
61 property string placeholderText: ""
62 onTextChanged: {
63+ /// todo: get rid of the pinLength and replace with MinMax
64+ if (root.pinMinMax != null) {
65+ if (text.length > root.pinMinMax[1]) {
66+ text = text.substring(0, text.length-1);
67+ return;
68+ }
69+ }
70+
71 pinentryFieldLabel.text = "";
72 for (var i = 0; i < text.length; ++i) {
73 pinentryFieldLabel.text += "•";
74 }
75 if (text.length === root.pinLength) {
76 root.entered(text);
77- }
78+ }
79 }
80
81 Label {
82@@ -71,6 +80,7 @@
83 font.pixelSize: units.dp(44)
84 color: "#f3f3e7"
85 opacity: 0.6
86+ textFormat: Text.RichText
87 }
88 Label {
89 id: pinentryFieldPlaceHolder
90@@ -203,7 +213,17 @@
91 root.entered(pinentryField.text);
92 }
93 }
94- enabled: entryEnabled
95+ enabled: {
96+ if (root.pinMinMax == null) {
97+ return true;
98+ } else {
99+ if (root.pinMinMax[0] <= pinentryField.text.length) {
100+ return true;
101+ } else {
102+ return false;
103+ }
104+ }
105+ }
106 }
107 }
108 }
109
110=== modified file 'qml/Notifications/NotificationMenuItemFactory.qml'
111--- qml/Notifications/NotificationMenuItemFactory.qml 2014-04-10 08:37:13 +0000
112+++ qml/Notifications/NotificationMenuItemFactory.qml 2014-04-25 08:19:00 +0000
113@@ -99,13 +99,16 @@
114 id: pinLock
115
116 Lockscreen {
117+ id: lockscreen
118 anchors.left: parent.left; anchors.right: parent.right
119 height: menuFactory.maxHeight
120- placeholderText: i18n.tr("Please enter SIM PIN")
121+ placeholderText: notification.summary
122 background: shell.background
123+ pinMinMax: [4, 8]
124
125 onEntered: {
126 menuModel.changeState(menuIndex, passphrase);
127+ lockscreen.clear(false);
128 entryEnabled = false;
129 }
130

Subscribers

People subscribed via source and target branches