How to use the aqt.mw.form.menuTools.addAction function in aqt

To help you get started, we’ve selected a few aqt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ospalh / anki-addons / Sweep.py View on Github external
sweep_files(mw.reviewer.card.note())
    except:
        pass


if find_sweep():
    # Now add to the menu
    mw.sweep_audio_fiels_action = QAction(mw)
    mw.sweep_audio_fiels_action.setText(u"Edit audio")
    # mw.sweep_audio_fiels_action.setIcon(
    #     QIcon(os.path.join(icons_dir, 'download_audio_manual.png')))
    mw.sweep_audio_fiels_action.setToolTip(
        "Edit audio files of the current note with sweep-audio-editor.")
    mw.connect(mw.sweep_audio_fiels_action, SIGNAL("triggered()"),
               sweep_current_note)
    mw.form.menuTools.addAction(mw.sweep_audio_fiels_action)
github ospalh / anki-addons / colorful_toolbars / __init__.py View on Github external
mw.addon_go_menu.addSeparator()
    except AttributeError:
        mw.addon_go_menu = QMenu(_(u"&Go"), mw)
        mw.form.menubar.insertMenu(
            mw.form.menuTools.menuAction(), mw.addon_go_menu)
    # Add DSAB to the new go menu
    mw.addon_go_menu.addAction(decks_action)
    mw.addon_go_menu.addAction(overview_action)
    mw.addon_go_menu.addAction(study_action)
    mw.addon_go_menu.addAction(add_notes_action)
    mw.addon_go_menu.addAction(browse_cards_action)
    mw.addon_go_menu.addAction(toggle_last_card_action)
    mw.addon_view_menu.addAction(mute_action)
    # Stats. Maybe this should go to help. Seems somewhat help-ish to
    # me, but not too much.
    mw.form.menuTools.addAction(statistics_action)
    # Add to the edit menu. The undo looked a bit forlorn.
    edit_menu = mw.form.menuEdit
    edit_menu.addSeparator()
    edit_menu.addAction(edit_current_action)
    edit_menu.addAction(edit_layout_action)
    edit_menu.addSeparator()
    edit_menu.addAction(bury_action)
    edit_menu.addAction(toggle_mark_action)
    edit_menu.addAction(suspend_card_action)
    edit_menu.addAction(suspend_note_action)
    edit_menu.addAction(delete_action)
github sth2018 / FastWordQuery / addons / fastwq / __init__.py View on Github external
def config_menu():
    """
    add menu to anki window menebar
    """
    action = QAction(APP_ICON, "FastWQ...", mw)
    action.triggered.connect(lambda: show_options())
    mw.form.menuTools.addAction(action)
github luoliyan / incremental-reading / ir / util.py View on Github external
def addMenuItem(path, text, function, keys=None):
    action = QAction(text, mw)

    if keys:
        action.setShortcut(QKeySequence(keys))

    action.triggered.connect(function)

    if path == 'File':
        mw.form.menuCol.addAction(action)
    elif path == 'Edit':
        mw.form.menuEdit.addAction(action)
    elif path == 'Tools':
        mw.form.menuTools.addAction(action)
    elif path == 'Help':
        mw.form.menuHelp.addAction(action)
    else:
        addMenu(path)
        mw.customMenus[path].addAction(action)
github ospalh / anki-addons / Edit media.py View on Github external
sweep_files(mw.reviewer.card.note())
    except:
        pass


if find_sweep():
    # Now add to the menu
    mw.sweep_audio_fiels_action = QAction(mw)
    mw.sweep_audio_fiels_action.setText(u"Edit audio")
    # mw.sweep_audio_fiels_action.setIcon(
    #     QIcon(os.path.join(icons_dir, 'download_audio_manual.png')))
    mw.sweep_audio_fiels_action.setToolTip(
        "Edit audio files of the current note with sweep-audio-editor.")
    mw.connect(mw.sweep_audio_fiels_action, SIGNAL("triggered()"),
               sweep_current_note)
    mw.form.menuTools.addAction(mw.sweep_audio_fiels_action)