diff --git a/nitrokeyapp/secrets_tab/__init__.py b/nitrokeyapp/secrets_tab/__init__.py index fa0a75c6..00a29413 100644 --- a/nitrokeyapp/secrets_tab/__init__.py +++ b/nitrokeyapp/secrets_tab/__init__.py @@ -185,6 +185,7 @@ def __init__(self, info_box: InfoBox, parent: Optional[QWidget] = None) -> None: self.ui.name.textChanged.connect(self.check_credential) self.ui.otp.textChanged.connect(self.check_credential) self.ui.select_algorithm.currentIndexChanged.connect(self.check_credential) + self.ui.comment.textChanged.connect(self.check_credential) self.ui.btn_refresh.pressed.connect(self.refresh_credential_list) self.ui.is_protected.stateChanged.connect(self.refresh_credential_list) @@ -628,6 +629,10 @@ def check_credential(self) -> None: if len(self.ui.name.text()) < 3: can_save = False + if len(self.ui.comment.text()) >= 96: + can_save = False + self.info_box.set_status("Comment is too long") + self.ui.btn_save.setEnabled(can_save) def act_copy_line_edit(self, obj: QLineEdit) -> None: