make decks root search collection; move current deck
Also use explicit 'deck:*' search, to make it more obvious what is happening
This commit is contained in:
parent
a8ddb65e1c
commit
05074f2cc1
@ -591,12 +591,6 @@ class SidebarTreeView(QTreeView):
|
|||||||
type = SidebarItemType.FLAG
|
type = SidebarItemType.FLAG
|
||||||
search = self._filter_func
|
search = self._filter_func
|
||||||
|
|
||||||
root.add_simple(
|
|
||||||
TR.BROWSING_CURRENT_DECK,
|
|
||||||
icon=icon,
|
|
||||||
type=type,
|
|
||||||
on_click=search(SearchTerm(deck="current")),
|
|
||||||
)
|
|
||||||
root.add_simple(
|
root.add_simple(
|
||||||
name=TR.BROWSING_SIDEBAR_DUE_TODAY,
|
name=TR.BROWSING_SIDEBAR_DUE_TODAY,
|
||||||
icon=icon,
|
icon=icon,
|
||||||
@ -814,6 +808,14 @@ class SidebarTreeView(QTreeView):
|
|||||||
collapse_key=Config.Bool.COLLAPSE_DECKS,
|
collapse_key=Config.Bool.COLLAPSE_DECKS,
|
||||||
type=SidebarItemType.DECK_ROOT,
|
type=SidebarItemType.DECK_ROOT,
|
||||||
)
|
)
|
||||||
|
root.on_click = self._filter_func(SearchTerm(deck="*"))
|
||||||
|
root.add_simple(
|
||||||
|
name=tr(TR.BROWSING_CURRENT_DECK),
|
||||||
|
icon=icon,
|
||||||
|
type=SidebarItemType.DECK,
|
||||||
|
on_click=self._filter_func(SearchTerm(deck="current")),
|
||||||
|
)
|
||||||
|
|
||||||
render(root, tree.children)
|
render(root, tree.children)
|
||||||
|
|
||||||
# Tree: Notetypes
|
# Tree: Notetypes
|
||||||
|
@ -304,7 +304,12 @@ impl From<pb::SearchTerm> for Node<'_> {
|
|||||||
escape_anki_wildcards(&s).into_owned().into(),
|
escape_anki_wildcards(&s).into_owned().into(),
|
||||||
)),
|
)),
|
||||||
Filter::Deck(s) => Node::Search(SearchNode::Deck(
|
Filter::Deck(s) => Node::Search(SearchNode::Deck(
|
||||||
escape_anki_wildcards(&s).into_owned().into(),
|
if s == "*" {
|
||||||
|
s
|
||||||
|
} else {
|
||||||
|
escape_anki_wildcards(&s).into_owned()
|
||||||
|
}
|
||||||
|
.into(),
|
||||||
)),
|
)),
|
||||||
Filter::Note(s) => Node::Search(SearchNode::NoteType(
|
Filter::Note(s) => Node::Search(SearchNode::NoteType(
|
||||||
escape_anki_wildcards(&s).into_owned().into(),
|
escape_anki_wildcards(&s).into_owned().into(),
|
||||||
|
Loading…
Reference in New Issue
Block a user