当前位置: 首页>>代码示例>>Python>>正文


Python utils.openLink方法代码示例

本文整理汇总了Python中aqt.utils.openLink方法的典型用法代码示例。如果您正苦于以下问题:Python utils.openLink方法的具体用法?Python utils.openLink怎么用?Python utils.openLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aqt.utils的用法示例。


在下文中一共展示了utils.openLink方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _linkHandler

# 需要导入模块: from aqt import utils [as 别名]
# 或者: from aqt.utils import openLink [as 别名]
def _linkHandler(self, url):
        """Support for binding custom actions to text links"""
        if isinstance(url, QUrl):
            url = url.toString()
        if not url.startswith("action://"):
            return openLink(url)
        protocol, cmd = url.split("://")
        if cmd == "debug-toggle":
            self._toggleDebugging()
        elif cmd == "debug-open":
            self._openDebuglog()
        elif cmd == "debug-copy":
            self._copyDebuglog()
        elif cmd == "debug-clear":
            self._clearDebuglog()
        elif cmd == "changelog":
            self._openChangelog() 
开发者ID:glutanimate,项目名称:review-heatmap,代码行数:19,代码来源:dialog_options.py

示例2: load_menu

# 需要导入模块: from aqt import utils [as 别名]
# 或者: from aqt.utils import openLink [as 别名]
def load_menu():
    for k, v in PHONETIC_TARGETS.items():
        add_menu_item(
            'Chinese::Phonetics',
            k,
            partial(config.update, {'target': v}),
            checkable=True,
            checked=bool(config['target'] == v),
        )

    for k, v in SPEECH_ENGINES.items():
        add_menu_item(
            'Chinese::Speech Engine',
            k,
            partial(config.update, {'speech': v}),
            checkable=True,
            checked=bool(config['speech'] == v),
        )

    add_menu('Chinese::Bulk Fill')
    add_menu_item('Chinese::Bulk Fill', _('Hanzi'), bulk_fill_hanzi)
    add_menu_item(
        'Chinese::Bulk Fill', _('Transcription'), bulk_fill_transcript
    )
    add_menu_item('Chinese::Bulk Fill', _('Definitions'), bulk_fill_defs)
    add_menu_item('Chinese::Bulk Fill', _('Classifiers'), bulk_fill_classifiers)
    add_menu_item('Chinese::Bulk Fill', _('Sound'), bulk_fill_sound)
    add_menu_item('Chinese::Bulk Fill', _('Silhouette'), bulk_fill_silhouette)
    add_menu_item('Chinese::Bulk Fill', _('All'), bulk_fill_all)

    add_menu('Chinese::Help')
    add_menu_item(
        'Chinese::Help',
        _('Report a bug or make a feature request'),
        lambda: openLink(CSR_GITHUB_URL + '/issues'),
    )
    add_menu_item('Chinese::Help', _('About...'), showAbout) 
开发者ID:luoliyan,项目名称:chinese-support-redux,代码行数:39,代码来源:gui.py

示例3: _setupEvents

# 需要导入模块: from aqt import utils [as 别名]
# 或者: from aqt.utils import openLink [as 别名]
def _setupEvents(self):
        super(OptionsDialog, self)._setupEvents()
        for name, link in ADDON.LINKS.items():
            btn_widget = getattr(self.form, "btn" + name.capitalize(), None)
            if not btn_widget:
                continue
            btn_widget.clicked.connect(lambda _, link=link: openLink(link))

    # Link actions 
开发者ID:glutanimate,项目名称:review-heatmap,代码行数:11,代码来源:dialog_options.py

示例4: _openChangelog

# 需要导入模块: from aqt import utils [as 别名]
# 或者: from aqt.utils import openLink [as 别名]
def _openChangelog(self):
        changelog = ADDON.LINKS.get("changelog")
        if not changelog:
            return
        openLink(changelog) 
开发者ID:glutanimate,项目名称:review-heatmap,代码行数:7,代码来源:dialog_options.py

示例5: _setupEvents

# 需要导入模块: from aqt import utils [as 别名]
# 或者: from aqt.utils import openLink [as 别名]
def _setupEvents(self):
        """
        Connect button presses to actions
        """
        mail_string = "mailto:{}".format(ADDON.AUTHOR_MAIL)
        self.form.btnMail.clicked.connect(
            lambda: openLink(mail_string))
        self.form.btnCoffee.clicked.connect(
            lambda: openLink(ADDON.LINKS["coffee"]))
        self.form.btnPatreon.clicked.connect(
            lambda: openLink(ADDON.LINKS["patreon"]))
        self.form.btnCredits.clicked.connect(
            self._showCredits) 
开发者ID:glutanimate,项目名称:review-heatmap,代码行数:15,代码来源:dialog_contrib.py

示例6: _linkHandler

# 需要导入模块: from aqt import utils [as 别名]
# 或者: from aqt.utils import openLink [as 别名]
def _linkHandler(self, url):
        """Support for binding custom actions to text links"""
        if not url.startswith("action://"):
            return openLink(url)
        protocol, cmd = url.split("://")
        if cmd == "installed-addons":
            print("invoking installed addons dialog") 
开发者ID:glutanimate,项目名称:review-heatmap,代码行数:9,代码来源:dialog_contrib.py

示例7: attemptOpenLink

# 需要导入模块: from aqt import utils [as 别名]
# 或者: from aqt.utils import openLink [as 别名]
def attemptOpenLink(cmd):
    if cmd.startswith('openLink:'):
        openLink(cmd[9:]) 
开发者ID:mass-immersion-approach,项目名称:MIA-Dictionary-Addon,代码行数:5,代码来源:addonSettings.py

示例8: _setupEvents

# 需要导入模块: from aqt import utils [as 别名]
# 或者: from aqt.utils import openLink [as 别名]
def _setupEvents(self):
        super(OptionsDialog, self)._setupEvents()
        for name, link in ADDON.LINKS.items():
            btn_widget = getattr(self.form, "btn" + name.capitalize(), None)
            if not btn_widget:
                continue
            btn_widget.clicked.connect(lambda _, link=link: openLink(link)) 
开发者ID:glutanimate,项目名称:cloze-overlapper,代码行数:9,代码来源:dialog_options.py

示例9: initHandlers

# 需要导入模块: from aqt import utils [as 别名]
# 或者: from aqt.utils import openLink [as 别名]
def initHandlers(self):
        self.ui.autoCSSJS.toggled.connect(self.handleAutoCSSJS)
        self.ui.addMIANoteType.toggled.connect(self.handleAddMIA)
        self.ui.activeProfileCB.currentIndexChanged.connect(self.profileChange )
        self.ui.activeNoteTypeCB.currentIndexChanged.connect(self.noteTypeChange)
        self.ui.activeCardTypeCB.currentIndexChanged.connect(self.selectionChange)
        self.ui.activeFieldCB.currentIndexChanged.connect(self.selectionChange)
        self.ui.activeSideCB.currentIndexChanged.connect(self.selectionChange)
        self.ui.activeDisplayTypeCB.currentIndexChanged.connect(self.selectionChange)
        self.ui.activeActionButton.clicked.connect(self.performButtonAction)
        self.ui.listWidget.cellClicked.connect(self.loadSelectedRow)
        self.ui.applyButton.clicked.connect(self.saveConfiguration)
        self.ui.cancelButton.clicked.connect(self.exit)
        self.ui.profilesPB.clicked.connect(lambda: self.addRemoveFromList(self.ui.profilesCB.currentText(), self.ui.profilesPB, self.ui.profilesList, self.selectedProfiles, True))
        self.ui.profilesCB.currentIndexChanged.connect(lambda: self.profAudioGraphChange(self.ui.profilesCB.currentText(), self.ui.profilesPB, self.selectedProfiles))
        self.ui.audioFieldsPB.clicked.connect(lambda: self.addRemoveFromList(self.ui.audioFieldsCB.currentText(), self.ui.audioFieldsPB, self.ui.audioFieldsList, self.selectedAudioFields, True))
        self.ui.audioFieldsCB.currentIndexChanged.connect(lambda: self.profAudioGraphChange(self.ui.audioFieldsCB.currentText(), self.ui.audioFieldsPB, self.selectedAudioFields))
        self.ui.pitchGraphsPB.clicked.connect(lambda: self.addRemoveFromList(self.ui.pitchGraphsCB.currentText(), self.ui.pitchGraphsPB, self.ui.pitchGraphsList, self.selectedGraphFields, True))
        self.ui.pitchGraphsCB.currentIndexChanged.connect(lambda: self.profAudioGraphChange(self.ui.pitchGraphsCB.currentText(), self.ui.pitchGraphsPB, self.selectedGraphFields))
        self.ui.audioAdd.clicked.connect(lambda: self.enableSep(self.ui.audioSep))
        self.ui.audioOverwrite.clicked.connect(lambda: self.disableSep(self.ui.audioSep))
        self.ui.audioIfEmpty.clicked.connect(lambda: self.disableSep(self.ui.audioSep))
        self.ui.graphAdd.clicked.connect(lambda: self.enableSep(self.ui.graphSep))
        self.ui.graphOverwrite.clicked.connect(lambda: self.disableSep(self.ui.graphSep))
        self.ui.graphIfEmpty.clicked.connect(lambda: self.disableSep(self.ui.graphSep))
        self.ui.heibanSelect.clicked.connect(lambda: self.openDialogColor(self.ui.heibanColor))
        self.ui.atamadakaSelect.clicked.connect(lambda: self.openDialogColor(self.ui.atamadakaColor))
        self.ui.nakadakaSelect.clicked.connect(lambda: self.openDialogColor(self.ui.nakadakaColor))
        self.ui.odakaSelect.clicked.connect(lambda: self.openDialogColor(self.ui.odakaColor))
        self.ui.kifukuSelect.clicked.connect(lambda: self.openDialogColor(self.ui.kifukuColor))
        self.ui.restoreDefaults.clicked.connect(self.restoreDefaultConfig)
        self.ui.addRuleButton.clicked.connect(self.addRule)
        self.ui.exportRules.clicked.connect(self.exportRules)
        self.ui.importRules.clicked.connect(self.importRules)
        self.ui.runRulesButton.clicked.connect(self.applyAllRules)
        self.ui.searchRulesLE.returnPressed.connect(self.initRuleSearch)
        self.ui.searchRulesButton.clicked.connect(self.initRuleSearch)
        self.ui.miaSiteIcon.clicked.connect(lambda: openLink('https://massimmersionapproach.com/'))
        self.ui.miaFBIcon.clicked.connect(lambda: openLink('https://www.facebook.com/MassImmersionApproach/'))
        self.ui.miaPatreonIcon.clicked.connect(lambda: openLink('https://www.patreon.com/massimmersionapproach'))
        self.ui.mattYT.clicked.connect(lambda: openLink('https://www.youtube.com/user/MATTvsJapan?sub_confirmation=1'))
        self.ui.mattTW.clicked.connect(lambda: openLink('https://twitter.com/mattvsjapan'))
        self.ui.yogaYT.clicked.connect(lambda: openLink('https://www.youtube.com/c/yogamia?sub_confirmation=1'))
        self.ui.yogaTW.clicked.connect(lambda: openLink('https://twitter.com/Yoga_MIA'))
        self.ui.gitHubIcon.clicked.connect(lambda: openLink('https://github.com/mass-immersion-approach')) 
开发者ID:mass-immersion-approach,项目名称:MIA-Japanese-Add-on,代码行数:47,代码来源:gui.py


注:本文中的aqt.utils.openLink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。