Exemplo n.º 1
0
 def _default_search(self, card: Card | None = None) -> None:
     default = self.col.get_config_string(Config.String.DEFAULT_SEARCH_TEXT)
     if default.strip():
         search = default
         prompt = default
     else:
         search = self.col.build_search_string(SearchNode(deck="current"))
         prompt = ""
     if card is not None:
         search = gui_hooks.default_search(search, card)
     self.search_for(search, prompt)
Exemplo n.º 2
0
 def on_show_single_card() -> None:
     self.card = card
     search = self.col.build_search_string(SearchNode(nid=card.nid))
     search = gui_hooks.default_search(search, card)
     self.search_for(search, "")
     self.table.select_single_card(card.id)
Exemplo n.º 3
0
 def _default_search(self, card: Optional[Card] = None) -> None:
     search = self.col.build_search_string(SearchNode(deck="current"))
     if card is not None:
         search = gui_hooks.default_search(search, card)
     self.search_for(search, "")