當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。