@@ -19,6 +19,7 @@
20import QtQuick 2.0
20import QtQuick 2.0
21import Ubuntu.Components 0.1
21import Ubuntu.Components 0.1
22import "../Components"
23import "../Components"
@@ -26,7 +27,7 @@ Loader {
27 property QtObject menuModel: null
28 property QtObject menuModel: null
28 property QtObject menuData: null
29 property QtObject menuData: null
29− property int menuIndex
30+ property int menuIndex : -1
30 property int maxHeight
31 property int maxHeight
31 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
32 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
@@ -46,6 +47,13 @@ Loader {
50+ function getExtendedProperty(object, propertyName, defaultValue) {
51+ if (object && object.hasOwnProperty(propertyName)) {
52+ return object[propertyName];
49 Component {
57 Component {
50 id: textfield
58 id: textfield
@@ -117,14 +125,14 @@ Loader {
117 right: parent.right
125 right: parent.right
119 height: menuFactory.maxHeight
127 height: menuFactory.maxHeight
120− infoText: i18n.tr("Enter SIM PIN")
128+ infoText: notification.summary
121− errorText: i18n.tr("Sorry, incorrect PIN")
129+ errorText: errorAction.valid ? errorAction.state : ""
122− minPinLength: 4
130+ retryText: notification.body
124 background: shell.background
131 background: shell.background
126 onEntered: {
133 onEntered: {
127 menuModel.changeState(menuIndex, passphrase);
134 menuModel.changeState(menuIndex, passphrase);
130 onCancel: {
138 onCancel: {
@@ -135,6 +143,70 @@ Loader {
135 shell.activateApplication("dialer-app")
143 shell.activateApplication("dialer-app")
136 menuModel.activate(menuIndex, false)
144 menuModel.activate(menuIndex, false)
147+ property var extendedData: menuData && menuData.ext || undefined
149+ property var pinMinMaxAction : UnityMenuAction {
152+ name: getExtendedProperty(extendedData, "xCanonicalPinMinMax", "")
155+ var min = pinMinMaxAction.state[0];
156+ var max = pinMinMaxAction.state[1];
158+ if (min === 0) min = -1;
159+ if (max === 0) max = -1;
166+ property var popupAction: UnityMenuAction {
169+ name: getExtendedProperty(extendedData, "xCanonicalPinPopup", "")
172+ showInfoPopup("", state);
175+ onInfoPopupConfirmed: {
176+ popupAction.activate();
185+ errorAction.activate();
188+ property var errorAction: UnityMenuAction {
191+ name: getExtendedProperty(extendedData, "xCanonicalPinError", "")
196+ errorTimer.running = true;
201+ function loadAttributes() {
202+ if (!menuModel || menuIndex == -1) return;
203+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-pin-min-max': 'string',
204+ 'x-canonical-pin-popup': 'string',
205+ 'x-canonical-pin-error': 'string'});
207+ Component.onCompleted: {