on xenial help sign in
Only show Snap Decision notification actions when available.
8293d56Nick Dedekind
Greeter/PinLockscreen.qml+5
@@ -32,6 +32,8 @@ Column {
32 signal entered(string passphrase)
32 signal entered(string passphrase)
33 signal cancel()
33 signal cancel()
34
34
35+ property bool entryEnabled: true
36+
35 function clear(playAnimation) {
37 function clear(playAnimation) {
36 pinentryField.text = "";
38 pinentryField.text = "";
37 if (playAnimation) {
39 if (playAnimation) {
@@ -140,6 +142,7 @@ Column {
140 width: root.padWidth / 3
142 width: root.padWidth / 3
141 height: root.padHeight / 4
143 height: root.padHeight / 4
142 text: index + 1
144 text: index + 1
145+ enabled: entryEnabled
143
146
144 onClicked: {
147 onClicked: {
145 pinentryField.text = pinentryField.text + text;
148 pinentryField.text = pinentryField.text + text;
@@ -161,6 +164,7 @@ Column {
161 height: root.padHeight / 4
164 height: root.padHeight / 4
162 text: "0"
165 text: "0"
163 onClicked: pinentryField.text = pinentryField.text + text
166 onClicked: pinentryField.text = pinentryField.text + text
167+ enabled: entryEnabled
164 }
168 }
165
169
166 PinPadButton {
170 PinPadButton {
@@ -169,6 +173,7 @@ Column {
169 height: root.padHeight / 4
173 height: root.padHeight / 4
170 iconName: "erase"
174 iconName: "erase"
171 onClicked: pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
175 onClicked: pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
176+ enabled: entryEnabled
172 }
177 }
173 }
178 }
174 }
179 }
Notifications/Notification.qml+1−1
@@ -193,7 +193,7 @@ UbuntuShape {
193 left: parent.left
193 left: parent.left
194 right: parent.right
194 right: parent.right
195 }
195 }
196− visible: notification.type == Notification.SnapDecision
196+ visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
197 height: units.gu(5)
197 height: units.gu(5)
198
198
199 property real buttonWidth: (width - contentColumn.spacing) / 2
199 property real buttonWidth: (width - contentColumn.spacing) / 2
Notifications/NotificationMenuItemFactory.qml+6
@@ -78,8 +78,14 @@ Loader {
78 PinLockscreen {
78 PinLockscreen {
79 anchors.left: parent.left; anchors.right: parent.right
79 anchors.left: parent.left; anchors.right: parent.right
80
80
81+ Component.onCompleted: {
82+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-pin-length': 'int'});
83+ pinLength = menuData.ext.xCanonicalPinLength;
84+ }
85+
81 onEntered: {
86 onEntered: {
82 menuModel.changeState(menuIndex, passphrase);
87 menuModel.changeState(menuIndex, passphrase);
88+ entryEnabled = false;
83 }
89 }
84
90
85 onCancel: {
91 onCancel: {