on xenial help sign in
Only show Snap Decision notification actions when available.

Approved by Mirco Müller.

commit8293d56133042699bf3ddf691d7a70e31ef4a24f authorNick Dedekind <nicholas.dedekind@gmail.com> dateThu 10 Oct 2013, 16:54 (13 years ago) parentb8d332c298d310
3 files changed+12−1
Greeter/PinLockscreen.qml+5 Notifications/Notification.qml+1−1 Notifications/NotificationMenuItemFactory.qml+6
Greeter/PinLockscreen.qml+5
@@ -32,6 +32,8 @@ Column {
3232 signal entered(string passphrase)
3333 signal cancel()
3434
35+ property bool entryEnabled: true
36+
3537 function clear(playAnimation) {
3638 pinentryField.text = "";
3739 if (playAnimation) {
@@ -140,6 +142,7 @@ Column {
140142 width: root.padWidth / 3
141143 height: root.padHeight / 4
142144 text: index + 1
145+ enabled: entryEnabled
143146
144147 onClicked: {
145148 pinentryField.text = pinentryField.text + text;
@@ -161,6 +164,7 @@ Column {
161164 height: root.padHeight / 4
162165 text: "0"
163166 onClicked: pinentryField.text = pinentryField.text + text
167+ enabled: entryEnabled
164168 }
165169
166170 PinPadButton {
@@ -169,6 +173,7 @@ Column {
169173 height: root.padHeight / 4
170174 iconName: "erase"
171175 onClicked: pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
176+ enabled: entryEnabled
172177 }
173178 }
174179 }
Notifications/Notification.qml+1−1
@@ -193,7 +193,7 @@ UbuntuShape {
193193 left: parent.left
194194 right: parent.right
195195 }
196− visible: notification.type == Notification.SnapDecision
196+ visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
197197 height: units.gu(5)
198198
199199 property real buttonWidth: (width - contentColumn.spacing) / 2
Notifications/NotificationMenuItemFactory.qml+6
@@ -78,8 +78,14 @@ Loader {
7878 PinLockscreen {
7979 anchors.left: parent.left; anchors.right: parent.right
8080
81+ Component.onCompleted: {
82+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-pin-length': 'int'});
83+ pinLength = menuData.ext.xCanonicalPinLength;
84+ }
85+
8186 onEntered: {
8287 menuModel.changeState(menuIndex, passphrase);
88+ entryEnabled = false;
8389 }
8490
8591 onCancel: {