From ea6cea5be7712db7420cbfe11071954f3cd23cbb Mon Sep 17 00:00:00 2001 From: Ren Tatsumoto Date: Thu, 15 Aug 2024 20:17:51 +0300 Subject: [PATCH] use anki field selector to select sentence field --- settings_dialog.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/settings_dialog.py b/settings_dialog.py index 7950259..6513603 100644 --- a/settings_dialog.py +++ b/settings_dialog.py @@ -50,7 +50,8 @@ def __init__(self, *args, **kwargs) -> None: self.tab_view = QTabWidget() self.checkboxes = make_checkboxes() self.tag_edit = QLineEdit(config.exported_tag) - self.sentence_field_edit = QLineEdit(config.sentence_field_name) + self.sentence_field_edit = AnkiFieldSelector() + self.sentence_field_edit.setCurrentText(config.sentence_field_name) self.notes_per_page_edit = CroProSpinBox(min_val=10, max_val=10_000, step=50, value=config.notes_per_page) self.hidden_fields = ItemEditBox("Hidden fields", initial_values=config.hidden_fields) self.web_timeout_spinbox = CroProSpinBox(min_val=1, max_val=999, step=1, value=config.timeout_seconds) @@ -262,7 +263,7 @@ def done(self, result: int) -> None: def accept(self) -> None: config.notes_per_page = self.notes_per_page_edit.value() config.exported_tag = self.tag_edit.text() - config.sentence_field_name = self.sentence_field_edit.text() + config.sentence_field_name = self.sentence_field_edit.currentText() config.hidden_fields = self.hidden_fields.values() config.timeout_seconds = self.web_timeout_spinbox.value() config.sentence_min_length = self.sentence_min_length.value()