Comment 12 for bug 1267135

Revision history for this message
MichaƂ Sawicz (saviq) wrote :

On 10.01.2014 11:47, Matthew Paul Thomas wrote:
> I'm not an engineer, but it's a bit odd to me that two of those three
> bits of code should have to supply an identical "Enter SIM PIN" string.
> If you decided to improve the string later, you'd need to remember to
> change it in both places. Seems to me that the string belongs in the
> same place as the logic for the dialog -- the code that provides the
> "Incorrect PIN. %d attempts remaining." string, that makes the button
> insensitive when the PIN field contains an implausible number of digits,
> and so on. System Settings would then override the title and button text
> for its "Enter Previous PIN" dialog, but any other call-site would get
> the default text.

Thing is "the logic" doesn't live with the UI, unity8 doesn't know what a SIM PIN is, nor how to supply it back to the SIM, nor how to query the SIM for how many remaining tries there are until you b0rk your SIM card. There needs to be a service (which right now is indicator-network) that deals with the SIM card. And System Settings will talk to that service when dealing with the SIM PIN. The "%d attempts remaining" string won't belong to unity8 either, but to the service that actually knows how to determine however many attempts are, in fact, remaining. The problem with unity8 holding the default text with domain knowledge (SIM) is that suddenly you have the translation for it spread between indicator-network and unity8. The fact alone that "Enter Previous PIN" needs to override the default string means that it needs to be *able* to come from the caller (which, right now, it cannot). Sure, we can have a default one (that IMO should not contain the word "SIM"), but services that use it can't rely on the fact that we won't change that default - they need to have control, and so should provide all the strings displayed in a dialog it controls.

On 10.01.2014 12:07, Michael Zanetti wrote:
> I tend to agree with Matthew here. The notification only opens that
> dialog if there is a x-canonical-simpin flag in the notification. So
> imho the text should be added there.
>
> I don't see a point in changing it in a way where every caller needs to
> create a notification with the x-canonical-simpin flag AND the text.

Well, IMO the hint shouldn't be named "-simpin", really, since it also allows for entering a PUK code, and generally unity8 should have no idea what kind of PIN is that. Let alone what a SIM is. See above also that that's not the only string that's meant to be displayed there.