diff --git a/CHANGELOG.md b/CHANGELOG.md index d2ebb02..4cc73e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Unreleased - New: Rename a card +- Fix: Use a regex validator instead of input mask for Libby setup code due to wonkiness, ref #14 Version 0.1.9 - 2023-09-19 - Fix: Error on launch for calibre <6.2.0 diff --git a/calibre-plugin/config.py b/calibre-plugin/config.py index 062c8dd..3784014 100644 --- a/calibre-plugin/config.py +++ b/calibre-plugin/config.py @@ -36,6 +36,8 @@ QWidget, Qt, QTimer, + QRegularExpressionValidator, + QRegularExpression, ) from . import DEMO_MODE, PLUGIN_NAME, PLUGINS_FOLDER_NAME, logger @@ -227,7 +229,10 @@ def __init__(self, plugin_action): self.libby_setup_code_txt.setPlaceholderText( PreferenceTexts.LIBBY_SETUP_CODE_DESC ) - self.libby_setup_code_txt.setInputMask("99999999") + self.libby_setup_code_txt.setValidator( + QRegularExpressionValidator(QRegularExpression(r"\d{8}")) + ) + if not DEMO_MODE: self.libby_setup_code_txt.setText(PREFS[PreferenceKeys.LIBBY_SETUP_CODE]) libby_layout.addRow(self.libby_setup_code_lbl, self.libby_setup_code_txt)