Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tags don't expand #2

Open
ghost opened this issue Dec 5, 2015 · 5 comments
Open

tags don't expand #2

ghost opened this issue Dec 5, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 5, 2015

I have Hierarchical Tags installed as well as your addon. Your code (and Hierarchical Tags) is unaltered from what I downloaded via AnkiWeb...

These are how things are set...

FEATURES = {
    "collapseSearchesByDefault": True,
    "expandTagsByDefault": True,
    "refreshTagListAfterDeletingTag": True,
    "rightClickToRename": False, # TO BE IMPLEMENTED
    "rightClickToDelete": False, # TO BE IMPLEMENTED
}

So, expandTagsByDefault isn't doing anything. My tags are still collapsed each time I open the browser. However, by contrast, the searches are indeed collapsed.

About my configuration
anki 2.0.33 on manjaro linux
Qt 4.8.7 PyQt 4.11.4

@thiswillbeyourgithub
Copy link

thiswillbeyourgithub commented Sep 6, 2018

I have the same problem, no solution so far ?

Anki version 2.0.52
Qt 4.8.1 PyQt 4.9.1
Ubuntu 16.04

@Arthaey
Copy link
Owner

Arthaey commented Oct 13, 2018

Do you have the Hierarchical Tags add-on installed too? It's a requirement for this add-on.

@thiswillbeyourgithub
Copy link

Yes I do. Is there any wway I can provide more infos ?

@Arthaey
Copy link
Owner

Arthaey commented Oct 14, 2018

Hmm, strange. I'm running mine on a Mac with a slightly newer version of Anki, but I wouldn't expect that to make a difference here...

Try adding some debug statements to the TagTweaks.py file and restarting Anki. You should see 4 pop-ups:

  1. "feature enabled"
  2. "_expandTagsByDefault called")
  3. "QTreeWidget"
  4. "should be expanded"

Tell me if you see all 4 pop-ups, if you see fewer than 4, if the text in the 3rd one is different...

$ git diff
diff --git a/TagTweaks.py b/TagTweaks.py
index f5e81c2..c7d574e 100644
--- a/TagTweaks.py
+++ b/TagTweaks.py
@@ -26,7 +26,9 @@ def _collapseSearchesByDefault(self, root):
         root.collapseItem(searches)

 def _expandTagsByDefault(self, root):
+   showInfo("_expandTagsByDefault called")
+   showInfo(root.__class__.__name__)
    root.expandAll()
+   showInfo("should be expanded")
     # It's a pain to fully expand each tag, so just re-collapse if needed.
    _collapseSearchesByDefault(self, root)

@@ -65,4 +67,5 @@ if FEATURES["rightClickToDelete"]:
 # and to cross my fingers. :(
 #
 if FEATURES["expandTagsByDefault"]:
+    showInfo("feature enabled")
     Browser._userTagTree = wrap(Browser._userTagTree, _expandTagsByDefault, "after")

@thiswillbeyourgithub
Copy link

I'd like to help but can you be a bit more specific : where is the python file and what line should I add where ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants