Esempio n. 1
0
def create_menu():
    u"""Set up the menu."""
    mn = QMenu()
    mn.setTitle("Nachschlagen")
    mw.form.menuTools.addAction(mn.menuAction())
    #
    mw.form.menu_nachschlagen = mn
    # add actions
    if show_japanese:
        # Maybe not show the Japanese actions.
        wae = QAction(mw)
        wae.setText("Japanisch bei Wadoku")
        # wae.setShortcut("Ctrl+4")
        mn.addAction(wae)
        mw.connect(wae, SIGNAL("triggered()"), on_lookup_wadoku_expression)
        wam = QAction(mw)
        wam.setText("Deutsch bei Wadoku")
        # wam.setShortcut("Ctrl+2")
        mn.addAction(wam)
        mw.connect(wam, SIGNAL("triggered()"), on_lookup_wadoku_meaning)
        was = QAction(mw)
        was.setText("Auswahl bei Wadoku")
        mn.addAction(was)
        mw.connect(was, SIGNAL("triggered()"), on_lookup_wadoku_selection)

        if show_saiga:
            # Personal taste: i like the Kanjilexikon better than the
            # Saiga look up. So i like this switched off.
            sae = QAction(mw)
            sae.setText("Kanji bei Saiga")
            #sae.setShortcut("Ctrl+4")
            mn.addAction(sae)
            mw.connect(sae, SIGNAL("triggered()"), on_lookup_saiga_expression)
            sas = QAction(mw)
            sas.setText("Kanjiauswahl bei Saiga")
            mn.addAction(sas)
            mw.connect(sas, SIGNAL("triggered()"), on_lookup_saiga_selection)

        kle = QAction(mw)
        kle.setText("Kanji bei Kanji-Lexikon")
        # kle.setShortcut("Ctrl+4")
        mn.addAction(kle)
        mw.connect(kle, SIGNAL("triggered()"), on_lookup_kl_expression)
        kls = QAction(mw)
        kls.setText("Kanjiauswahl bei Kanji-Lexikon")
        mn.addAction(kls)
        mw.connect(kls, SIGNAL("triggered()"), on_lookup_kl_selection)
    # Show these always.
    fae = QAction(mw)
    fae.setText("Ausdruck bei Forvo")
    # fae.setShortcut("Ctrl+4")
    mn.addAction(fae)
    mw.connect(fae, SIGNAL("triggered()"), on_lookup_forvo_expression)
    fas = QAction(mw)
    fas.setText("Auswahl bei Forvo")
    mn.addAction(fas)
    mw.connect(fas, SIGNAL("triggered()"), on_lookup_forvo_selection)
Esempio n. 2
0
def setup_browser_menu(browser):
    menu = QMenu('Kanji Extractor', browser)
    browser.form.menuEdit.addAction(menu.menuAction())

    create_action = QAction("Extract Kanji", browser)
    create_action.triggered.connect(
        lambda: create_kanji_notes_browser(browser))
    menu.addAction(create_action)

    update_action = QAction("Update Kanji Notes", browser)
    update_action.triggered.connect(
        lambda: update_kanji_notes_browser(browser))
    menu.addAction(update_action)
Esempio n. 3
0
def setup_menu():
    menu = QMenu('Kanji Exctractor', mw)
    mw.form.menuTools.addAction(menu.menuAction())
    # mw.form.menuLookup = menu

    create_action = QAction('Create Kanji Notes', mw)
    create_action.triggered.connect(create_kanji_notes)
    menu.addAction(create_action)

    settings_action = QAction('Update Kanji Notes', mw)
    settings_action.triggered.connect(open_settings)
    menu.addAction(settings_action)

    settings_action = QAction('Settings', mw)
    settings_action.triggered.connect(open_settings)
    menu.addAction(settings_action)

    about_action = QAction('About...', mw)
    about_action.triggered.connect(show_about)
    menu.addAction(about_action)