Skip to content

Commit

Permalink
Add browser menu items to context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiesel authored and MinmoTech committed Jun 27, 2023
1 parent c4e7d40 commit 01cd68b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions addon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,35 @@ def setup_browser_menu(browser):
create_cards_action.triggered.connect(
lambda: CreateCardsFromNotesDialog.show_modal(browser.selectedNotes(), browser)
)
browser.form.menuEdit.addAction(create_cards_action)

mark_known_action = QAction("Mark Kanji Known From Selection", browser)
mark_known_action.triggered.connect(
lambda: MarkKnownFromNotesDialog.show_modal(browser.selectedNotes(), browser)
)
browser.form.menuEdit.addAction(mark_known_action)

convert_notes_action = QAction(
"Convert Selected Notes To Migaku Kanji Cards", browser
)
convert_notes_action.triggered.connect(
lambda: ConvertNotesDialog.show_modal(browser.selectedNotes(), browser)
)

browser.form.menuEdit.addSeparator()
browser.form.menuEdit.addAction(create_cards_action)
browser.form.menuEdit.addAction(mark_known_action)
browser.form.menuEdit.addAction(convert_notes_action)

browser.form.menu_Notes.insertAction(
browser.form.actionManage_Note_Types, create_cards_action
)
browser.form.menu_Notes.insertAction(
browser.form.actionManage_Note_Types, mark_known_action
)
browser.form.menu_Notes.insertAction(
browser.form.actionManage_Note_Types, convert_notes_action
)
browser.form.menu_Notes.insertSeparator(browser.form.actionManage_Note_Types)


aqt.gui_hooks.browser_menus_did_init.append(setup_browser_menu)

Expand Down

0 comments on commit 01cd68b

Please sign in to comment.