Skip to content

Commit 3fa2ed0

Browse files
committed
Add (working) note-mode toggle shortcut
1 parent cd7eac8 commit 3fa2ed0

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ You can also add these extra columns:
2929

3030
There is now a menu option to **Only show notes**. If you are only interested in editing the content of notes and don't care about the statistics of individual card reviews, you can enable the note browser mode.
3131

32-
When this option is enabled, the browser will show a single row for each note regardless of how many cards a note may have generated. You can use `Ctrl+shift+n` as a shortcut to toggle this option. (Pay attention to the fact that buttons, such as `suspend`, act on cards and not on notes. Therefore, avoid using this button while you use the option to see notes.)
32+
When this option is enabled, the browser will show a single row for each note regardless of how many cards a note may have generated. You can use *Ctrl+Alt+N* as a shortcut to toggle this option. (Pay attention to the fact that buttons, such as «suspend», act on cards and not on notes. Therefore, avoid using this button while you use the option to see notes.)
3333

3434
![Note browser mode](https://raw.github.com/hssm/advanced-browser/master/docs/note_browser_toggle.png)
3535

advancedbrowser/advancedbrowser/core.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,14 @@ def __init__(self, mw):
274274
# and restore constructor.
275275
origInit(self, mw)
276276
Browser.__init__ = origInit
277-
277+
278+
279+
tn = QAction(('- Only show notes -'), self)
280+
tn.setShortcut(QKeySequence("Ctrl+Alt+N"))
281+
self.addAction(tn)
282+
tn.triggered.connect(self.toggleUniqueNote)
283+
284+
278285
# Remove excluded columns after the browser is built. Doing it here
279286
# is mostly a compromise in complexity. The alternative is to
280287
# rewrite the order of the original __init__ method, which is
@@ -374,6 +381,10 @@ def addToSubgroup(menu, items):
374381
# Add unique note toggle
375382
a = main.addAction("- Only show notes -")
376383
a.setCheckable(True)
384+
# This shortcut has no effect since it's attached to the context menu
385+
# which needs to be open, but the visual indicator is still useful.
386+
# The real shortcut is in init.
387+
a.setShortcut(QKeySequence("Ctrl+Alt+N"))
377388
a.setChecked(mw.col.conf.get("advbrowse_uniqueNote", False))
378389
a.toggled.connect(self.toggleUniqueNote)
379390

0 commit comments

Comments
 (0)