def _show(self, field_names: Sequence[str]) -> None: # add "all fields" and "tags" to the top of the list self.field_names = [ tr.browsing_all_fields(), tr.editing_tags(), ] + list(field_names) disable_help_button(self) self.form = aqt.forms.findreplace.Ui_Dialog() self.form.setupUi(self) self.setWindowModality(Qt.WindowModal) self._find_history = restore_combo_history(self.form.find, self.COMBO_NAME + "Find") self.form.find.completer().setCaseSensitivity(Qt.CaseSensitive) self._replace_history = restore_combo_history( self.form.replace, self.COMBO_NAME + "Replace") self.form.replace.completer().setCaseSensitivity(Qt.CaseSensitive) restore_is_checked(self.form.re, self.COMBO_NAME + "Regex") restore_is_checked(self.form.ignoreCase, self.COMBO_NAME + "ignoreCase") self.form.field.addItems(self.field_names) restore_combo_index_for_session(self.form.field, self.field_names, self.COMBO_NAME + "Field") qconnect(self.form.buttonBox.helpRequested, self.show_help) restoreGeom(self, "findreplace") self.show() self.form.find.setFocus()
def _load_columns(self) -> None: self._columns = [ ("note", tr.browsing_note()), ("noteCards", tr.editing_cards()), ("noteCrt", tr.browsing_created()), ("noteDue", tr.statistics_due_date()), ("noteEase", tr.browsing_average_ease()), ("noteFld", tr.browsing_sort_field()), ("noteIvl", tr.browsing_average_interval()), ("noteLapses", tr.scheduling_lapses()), ("noteMod", tr.search_note_modified()), ("noteReps", tr.scheduling_reviews()), ("noteTags", tr.editing_tags()), ] self._columns.sort(key=itemgetter(1))
def setupTags(self) -> None: import aqt.tagedit g = QGroupBox(self.widget) g.setStyleSheet("border: 0") tb = QGridLayout() tb.setSpacing(12) tb.setContentsMargins(2, 6, 2, 6) # tags l = QLabel(tr.editing_tags()) tb.addWidget(l, 1, 0) self.tags = aqt.tagedit.TagEdit(self.widget) qconnect(self.tags.lostFocus, self.on_tag_focus_lost) self.tags.setToolTip(shortcut(tr.editing_jump_to_tags_with_ctrlandshiftandt())) border = theme_manager.color(colors.BORDER) self.tags.setStyleSheet(f"border: 1px solid {border}") tb.addWidget(self.tags, 1, 1) g.setLayout(tb) self.outerLayout.addWidget(g)
def _load_columns(self) -> None: self._columns = [ ("question", tr.browsing_question()), ("answer", tr.browsing_answer()), ("template", tr.browsing_card()), ("deck", tr.decks_deck()), ("noteFld", tr.browsing_sort_field()), ("noteCrt", tr.browsing_created()), ("noteMod", tr.search_note_modified()), ("cardMod", tr.search_card_modified()), ("cardDue", tr.statistics_due_date()), ("cardIvl", tr.browsing_interval()), ("cardEase", tr.browsing_ease()), ("cardReps", tr.scheduling_reviews()), ("cardLapses", tr.scheduling_lapses()), ("noteTags", tr.editing_tags()), ("note", tr.browsing_note()), ] self._columns.sort(key=itemgetter(1))