1
0
This commit is contained in:
SomberNight
2018-03-14 12:42:42 +01:00
parent 7e6fba0513
commit 0f5cabc7f6
6 changed files with 16 additions and 4 deletions

View File

@@ -50,6 +50,9 @@ class GuiMixin(object):
else:
msg = _("Enter your current {} PIN:")
pin = self.handler.get_pin(msg.format(self.device))
if len(pin) > 9:
self.handler.show_error(_('The PIN cannot be longer than 9 characters.'))
pin = '' # to cancel below
if not pin:
return self.proto.Cancel()
return self.proto.PinMatrixAck(pin=pin)

View File

@@ -251,7 +251,7 @@ class QtPlugin(QtPluginBase):
vbox.addWidget(QLabel(msg))
vbox.addWidget(text)
pin = QLineEdit()
pin.setValidator(QRegExpValidator(QRegExp('[1-9]{0,10}')))
pin.setValidator(QRegExpValidator(QRegExp('[1-9]{0,9}')))
pin.setMaximumWidth(100)
hbox_pin = QHBoxLayout()
hbox_pin.addWidget(QLabel(_("Enter your PIN (digits 1-9):")))