def __init__(self, headers): super(AdvancedPanel, self).__init__() self._complex = settings[SETTINGS.COMPLEX_PINS] layout = QtGui.QFormLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.addRow(QtGui.QLabel(m.key_label)) self._key = QtGui.QLineEdit() self._key.setValidator(KEY_VALIDATOR) self._key.textChanged.connect(self._validate_key) layout.addRow(self._key) buttons = QtGui.QDialogButtonBox() self._randomize_btn = QtGui.QPushButton(m.randomize) self._randomize_btn.clicked.connect(self.randomize) self._copy_btn = QtGui.QPushButton(m.copy_clipboard) self._copy_btn.clicked.connect(self._copy) buttons.addButton(self._randomize_btn, QtGui.QDialogButtonBox.ActionRole) buttons.addButton(self._copy_btn, QtGui.QDialogButtonBox.ActionRole) layout.addRow(buttons) layout.addRow(headers.section(m.puk)) self._puk = pin_field() layout.addRow(m.new_puk_label, self._puk) self._confirm_puk = pin_field() layout.addRow(m.verify_puk_label, self._confirm_puk)
def _build_ui(self, forced): self.setWindowTitle(self.window_title) layout = QtGui.QVBoxLayout(self) if forced: layout.addWidget(QtGui.QLabel(m.change_pin_forced_desc)) layout.addWidget(QtGui.QLabel(self.label_current)) self._old_pin = pin_field() layout.addWidget(self._old_pin) layout.addWidget(QtGui.QLabel(self.label_new)) self._new_pin = pin_field() layout.addWidget(self._new_pin) layout.addWidget(QtGui.QLabel(self.label_verify)) self._confirm_pin = pin_field() layout.addWidget(self._confirm_pin) self._new_pin.textChanged.connect(self._check_confirm) self._confirm_pin.textChanged.connect(self._check_confirm) if forced: buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok) else: buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel) self._ok_btn = buttons.button(QtGui.QDialogButtonBox.Ok) self._ok_btn.setDisabled(True) buttons.accepted.connect(self._set_pin) buttons.rejected.connect(self.reject) layout.addWidget(buttons)
def _build_ui(self, forced): self.setWindowTitle(self.window_title) layout = QtGui.QVBoxLayout(self) if forced: layout.addWidget(QtGui.QLabel(m.change_pin_forced_desc)) layout.addWidget(QtGui.QLabel(self.label_current)) self._old_pin = pin_field() layout.addWidget(self._old_pin) layout.addWidget(QtGui.QLabel(self.label_new_complex if self._complex else self.label_new)) self._new_pin = pin_field() layout.addWidget(self._new_pin) layout.addWidget(QtGui.QLabel(self.label_verify)) self._confirm_pin = pin_field() layout.addWidget(self._confirm_pin) self._new_pin.textChanged.connect(self._check_confirm) self._confirm_pin.textChanged.connect(self._check_confirm) if forced: buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok) else: buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel) self._ok_btn = buttons.button(QtGui.QDialogButtonBox.Ok) self._ok_btn.setDisabled(True) buttons.accepted.connect(self._set_pin) buttons.rejected.connect(self.reject) layout.addWidget(buttons)
def __init__(self, headers): super(PinPanel, self).__init__() self._complex = settings[SETTINGS.COMPLEX_PINS] layout = QtGui.QFormLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.addRow(headers.section(m.pin)) self._new_pin = pin_field() layout.addRow(m.new_pin_label, self._new_pin) self._confirm_pin = pin_field() layout.addRow(m.verify_pin_label, self._confirm_pin)
def __init__(self, headers): super(PinPanel, self).__init__() self._complex = settings[SETTINGS.COMPLEX_PINS] layout = QtGui.QFormLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.addRow(headers.section(m.pin)) self._new_pin = pin_field() label = m.new_complex_pin_label if self._complex else m.new_pin_label layout.addRow(label, self._new_pin) self._confirm_pin = pin_field() layout.addRow(m.verify_pin_label, self._confirm_pin)
def __init__(self, headers): super(PinPanel, self).__init__() self._complex = settings[SETTINGS.COMPLEX_PINS] layout = QtGui.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) rowLayout = QtGui.QFormLayout() rowLayout.addRow(headers.section(m.pin)) self._new_pin = pin_field() rowLayout.addRow(m.new_pin_label, self._new_pin) self._confirm_pin = pin_field() rowLayout.addRow(m.verify_pin_label, self._confirm_pin) layout.addLayout(rowLayout) self._non_numeric_pin_warning = QtGui.QLabel(m.non_numeric_pin_warning) self._non_numeric_pin_warning.setWordWrap(True) layout.addWidget(self._non_numeric_pin_warning)