def open_help(self): url = QUrl() url.setScheme(DefaultConfig.Help.url_scheme) url.setHost(DefaultConfig.Help.host) url.setPath(DefaultConfig.Help.url_path_pattern) # % str(Version.babel)) QDesktopServices.openUrl(url)
def on_messages_anchorClicked(self, url): """ Private slot to open links in the default browser. @param url URL to be opened (QUrl) """ QDesktopServices.openUrl(url)
def tableClicked(self, r, c): if c == 2 or c == 3: cell = self.table.item(r, c) if cell: url = cell.text() if url: QDesktopServices.openUrl(QUrl(url))
def __open(self): """ Private slot to open the downloaded file. """ info = QFileInfo(self.__output) url = QUrl.fromLocalFile(info.absoluteFilePath()) QDesktopServices.openUrl(url)
def make_cypherseed(self, img, rawnoise, calibration=False, is_seed = True): img = img.convertToFormat(QImage.Format_Mono) p = QPainter() p.begin(img) p.setCompositionMode(26) #xor p.drawImage(0, 0, rawnoise) p.end() cypherseed = self.pixelcode_2x2(img) cypherseed = QBitmap.fromImage(cypherseed) cypherseed = cypherseed.scaled(self.f_size, Qt.KeepAspectRatio) cypherseed = self.overlay_marks(cypherseed, True, calibration) if not is_seed: self.filename_prefix = 'custom_secret_' self.was = _('Custom secret') else: self.filename_prefix = self.wallet_name + '_seed_' self.was = self.wallet_name + ' ' + _('seed') if self.extension: self.ext_warning(self.c_dialog) if not calibration: self.toPdf(QImage(cypherseed)) QDesktopServices.openUrl(QUrl.fromLocalFile(self.get_path_to_revealer_file('.pdf'))) cypherseed.save(self.get_path_to_revealer_file('.png')) self.bcrypt(self.c_dialog) return cypherseed
def _openItem(self): """ Protected slot to handle the open popup menu entry. """ itmList = self.getSelectedItems( [BrowserFileItem, BrowserClassItem, BrowserMethodItem, BrowserClassAttributeItem, BrowserImportItem]) if not self._activating: self._activating = True for itm in itmList: if isinstance(itm, BrowserFileItem): if itm.isPython2File(): self.sourceFile[str].emit(itm.fileName()) elif itm.isPython3File(): self.sourceFile[str].emit(itm.fileName()) elif itm.isRubyFile(): self.sourceFile[str, int, str].emit( itm.fileName(), -1, "Ruby") elif itm.isDFile(): self.sourceFile[str, int, str].emit( itm.fileName(), -1, "D") elif itm.isDesignerFile(): self.designerFile.emit(itm.fileName()) elif itm.isLinguistFile(): if itm.fileExt() == '.ts': self.linguistFile.emit(itm.fileName()) else: self.trpreview.emit([itm.fileName()]) elif itm.isProjectFile(): self.projectFile.emit(itm.fileName()) elif itm.isMultiProjectFile(): self.multiProjectFile.emit(itm.fileName()) elif itm.isIdlFile(): self.sourceFile[str].emit(itm.fileName()) elif itm.isResourcesFile(): self.sourceFile[str].emit(itm.fileName()) elif itm.isSvgFile(): self.svgFile.emit(itm.fileName()) elif itm.isPixmapFile(): self.pixmapFile.emit(itm.fileName()) else: if Utilities.MimeTypes.isTextFile(itm.fileName()): self.sourceFile[str].emit(itm.fileName()) else: QDesktopServices.openUrl(QUrl(itm.fileName())) elif isinstance(itm, BrowserClassItem): self.sourceFile[str, int].emit( itm.fileName(), itm.classObject().lineno) elif isinstance(itm, BrowserMethodItem): self.sourceFile[str, int].emit( itm.fileName(), itm.functionObject().lineno) elif isinstance(itm, BrowserClassAttributeItem): self.sourceFile[str, int].emit( itm.fileName(), itm.attributeObject().lineno) elif isinstance(itm, BrowserImportItem): self.sourceFile[str, list].emit( itm.fileName(), itm.linenos()) self._activating = False
def OnUrlMessage(self): from PyQt5.QtGui import QDesktopServices from PyQt5.QtCore import QUrl reply = QMessageBox.information(self, "www", _('Open web')+'\n'+self.url) if reply == QMessageBox.Ok: QDesktopServices.openUrl(QUrl(self.url))
def showHelp(self): help_path = op.abspath(op.join(HELP_PATH, 'index.html')) if op.exists(help_path): url = QUrl.fromLocalFile(help_path) else: url = QUrl("https://www.hardcoded.net/moneyguru/help/en") QDesktopServices.openUrl(url)
def editorEvent(self, event, model, option, index): #paket seçim olayında hata var seçim olayı gerçekleşiyor ama packageList sonraki seçimde görüyor #geçici çözümle giderildi tamamen çözülmeli if event.type() == QEvent.MouseButtonRelease and index.column() == 0 and index.flags() & Qt.ItemIsUserCheckable: toggled = Qt.Checked if model.data(index, Qt.CheckStateRole) == QVariant(Qt.Unchecked) else Qt.Unchecked self.packageSelected.emit(bool(toggled)) return model.setData(index, toggled, Qt.CheckStateRole) __event = QItemDelegate(self).editorEvent(event, model, option, index) animate_requested = False if event.type() == QEvent.MouseButtonRelease and self.animatable: if self.rowAnimator.row == index.row(): epos = event.pos() if self.rowAnimator.hoverLinkFilter.link_rect.contains(QPoint(epos.x(), epos.y() + 32)): url = QUrl(QVariant.value(model.data(index, HomepageRole))) QDesktopServices.openUrl(url) return __event elif self.rowAnimator.hoverLinkFilter.button_rect.contains(epos, True): self.showPackageDetails(model, index) return __event animate_requested = True elif event.type() == QEvent.KeyPress and self.animatable: # KeyCode 32 : Space key if event.key() == 32 and index.column() == index.model().columnCount() - 1: animate_requested = True if not QVariant.value(model.data(index, DescriptionRole)) == '' and animate_requested: self.rowAnimator.animate(index.row()) return __event
def open_file(self, cmdline=None): """Open the downloaded file. Args: cmdline: The command to use as string. A `{}` is expanded to the filename. None means to use the system's default application. If no `{}` is found, the filename is appended to the cmdline. """ assert self.successful filename = self._get_open_filename() if filename is None: # pragma: no cover log.downloads.error("No filename to open the download!") return if cmdline is None: log.downloads.debug("Opening {} with the system application" .format(filename)) url = QUrl.fromLocalFile(filename) QDesktopServices.openUrl(url) return cmd, *args = shlex.split(cmdline) args = [arg.replace('{}', filename) for arg in args] if '{}' not in cmdline: args.append(filename) log.downloads.debug("Opening {} with {}" .format(filename, [cmd] + args)) proc = guiprocess.GUIProcess(what='download') proc.start_detached(cmd, args)
def contextMenuEvent(self, event): menu = QMenu(self) local_filename = self.currentItem().text() # Get the file extension ext = os.path.splitext(local_filename)[1].lower() open_internal_action = None # Mu micro:bit mode only handles .py & .hex if ext == '.py' or ext == '.hex': open_internal_action = menu.addAction(_("Open in Mu")) # Open outside Mu (things get meta if Mu is the default application) open_action = menu.addAction(_("Open")) action = menu.exec_(self.mapToGlobal(event.pos())) if action == open_action: # Get the file's path path = os.path.join(self.home, local_filename) logger.info("Opening {}".format(path)) msg = _("Opening '{}'").format(local_filename) logger.info(msg) self.set_message.emit(msg) # Let Qt work out how to open it QDesktopServices.openUrl(QUrl.fromLocalFile(path)) elif action == open_internal_action: logger.info("Open {} internally".format(local_filename)) # Get the file's path path = os.path.join(self.home, local_filename) # Send the signal bubbling up the tree self.open_file.emit(path)
def openFolder(self): """ Public slot to open the folder containing the downloaded file. """ info = QFileInfo(self.__fileName) url = QUrl.fromLocalFile(info.absolutePath()) QDesktopServices.openUrl(url)
def showHelpTriggered(self): base_path = platform.HELP_PATH help_path = op.abspath(op.join(base_path, 'index.html')) if op.exists(help_path): url = QUrl.fromLocalFile(help_path) else: url = QUrl('https://www.hardcoded.net/dupeguru/help/en/') QDesktopServices.openUrl(url)
def open_node_in_browser(self): node = self.sender().data() bma_endpoints = [e for e in node.endpoints if isinstance(e, BMAEndpoint)] if bma_endpoints: conn_handler = next(bma_endpoints[0].conn_handler()) peering_url = bma.API(conn_handler, bma.network.URL_PATH).reverse_url(conn_handler.http_scheme, '/peering') url = QUrl(peering_url) QDesktopServices.openUrl(url)
def acceptNavigationRequest(self, url, _type, isMainFrame): query = QUrlQuery(url) if query.hasQueryItem("requrl"): orig_url = query.queryItemValue("requrl", QUrl.FullyDecoded) url = QUrl(orig_url) QDesktopServices.openUrl(url) return False return super().acceptNavigationRequest(url, _type, isMainFrame)
def _onCloudFlowStarted(self, messageId: str, actionId: str) -> None: address = self._application.getMachineManager().activeMachineAddress # type: str if address: QDesktopServices.openUrl(QUrl("http://" + address + "/cloud_connect")) if self._start_cloud_flow_message: self._start_cloud_flow_message.hide() self._start_cloud_flow_message = None return
def _edit_ui_file(self): item = self.currentItem() if item.parent() is None: pathForFile = item.path else: pathForFile = os.path.join(item.path, item.text(0)) pathForFile = "file://%s" % pathForFile #open the correct program to edit Qt UI files! QDesktopServices.openUrl(QUrl(pathForFile, QUrl.TolerantMode))
def calibration(self): img = QImage(self.SIZE[0], self.SIZE[1], QImage.Format_Mono) bitmap = QBitmap.fromImage(img, Qt.MonoOnly) bitmap.fill(Qt.black) self.make_calnoise() img = self.overlay_marks(self.calnoise.scaledToHeight(self.f_size.height()), False, True) self.calibration_pdf(img) QDesktopServices.openUrl(QUrl.fromLocalFile(self.get_path_to_calibration_file())) return img
def _examine_backup(self): error = None try: filename = get_rename_plan_backup_filename() QDesktopServices.openUrl(QUrl.fromLocalFile(filename)) except Exception as err: error = err finally: self._show_backup_decision(error)
def setupMenuBar(self, menuBar=None): if menuBar is None: try: menuBar = self._menuBar except: return menuBar.resetState() activeWindow = self.activeWindow() fileMenu = menuBar.fetchMenu(Entries.File) # HACK: scripting window has its own New/Open; # figure out how to do this without explicit blacklist. if not isinstance(activeWindow, ScriptingWindow): fileMenu.fetchAction(Entries.File_New, self.newFile) fileMenu.fetchAction(Entries.File_Open, self.openFile) recentFilesMenu = fileMenu.fetchMenu(Entries.File_Open_Recent) self.updateRecentFiles(recentFilesMenu) if not platformSpecific.mergeOpenAndImport(): fileMenu.fetchAction(Entries.File_Import, self.importFile) fileMenu.fetchAction(Entries.File_Save_All, self.saveAll) fileMenu.fetchAction(Entries.File_Exit, self.closeAll) editMenu = menuBar.fetchMenu(Entries.Edit) editMenu.fetchAction(Entries.Edit_Settings, self.settings) scriptsMenu = menuBar.fetchMenu(Entries.Scripts) self.updateExtensions(scriptsMenu) windowMenu = menuBar.fetchMenu(Entries.Window) if platformSpecific.windowCommandsInMenu( ) and activeWindow is not None: windowMenu.fetchAction( Entries.Window_Minimize, activeWindow.showMinimized) windowMenu.fetchAction( Entries.Window_Minimize_All, self.minimizeAll) windowMenu.fetchAction( Entries.Window_Zoom, lambda: self.zoom(activeWindow)) windowMenu.fetchAction(Entries.Window_Inspector, self.inspector) windowMenu.fetchAction(Entries.Window_Scripting, self.scripting) if self.outputWindow is not None: windowMenu.fetchAction( Entries.Window_Output, self.output) # TODO: add a list of open windows in window menu, check active window # maybe add helper function that filters topLevelWidgets into windows # bc we need this in a few places helpMenu = menuBar.fetchMenu(Entries.Help) helpMenu.fetchAction( Entries.Help_Documentation, lambda: QDesktopServices.openUrl( QUrl("http://trufont.github.io/"))) helpMenu.fetchAction( Entries.Help_Report_An_Issue, lambda: QDesktopServices.openUrl( QUrl("https://github.com/trufont/trufont/issues/new"))) helpMenu.addSeparator() helpMenu.fetchAction(Entries.Help_About, self.about)
def open_file(self): """Open the downloaded file.""" assert self.successful filename = self._filename if filename is None: filename = getattr(self.fileobj, 'name', None) if filename is None: log.downloads.error("No filename to open the download!") return url = QUrl.fromLocalFile(filename) QDesktopServices.openUrl(url)
def make_revealer(self): revealer = self.pixelcode_2x2(self.rawnoise) revealer.invertPixels() revealer = QBitmap.fromImage(revealer) revealer = revealer.scaled(self.f_size, Qt.KeepAspectRatio) revealer = self.overlay_marks(revealer) self.filename_prefix = 'revealer_' revealer.save(self.get_path_to_revealer_file('.png')) self.toPdf(QImage(revealer)) QDesktopServices.openUrl(QUrl.fromLocalFile(self.get_path_to_revealer_file('.pdf')))
def openInternal(self, link): url = link.url() if JEKYLL_BASE_URL in url: fileToOpen = url.replace(JEKYLL_BASE_URL, self.tab.p.jekyll_path) if fileToOpen.endswith('/'): fileToOpen = fileToOpen[:-1] if fileToOpen == self.tab.p.jekyll_path: fileToOpen += '/index' self.tab.p.openFileWrapper(fileToOpen + '.' + QFileInfo(self.tab.fileName).completeSuffix()) else: QDesktopServices.openUrl(link)
def acceptNavigationRequest(self, url, type, isMainFrame): if url.isLocalFile(): localFile = url.toLocalFile() if localFile == self.tab.fileName: self.tab.startPendingConversion() return False if self.tab.openSourceFile(localFile): return False if globalSettings.handleWebLinks: return True QDesktopServices.openUrl(url) return False
def _onMessageActionTriggered(self, message, action): if action == "open_browser": QDesktopServices.openUrl(QUrl(self.getPrintJobsUrl())) if action == "Abort": Logger.log("d", "User aborted sending print to remote.") self._progress_message.hide() self._compressing_print = False if self._reply: self._reply.abort() self._stage = OutputStage.ready Application.getInstance().getController().setActiveStage("PrepareStage")
def _handleLinkClicked(self, url): if url.isLocalFile(): localFile = url.toLocalFile() if localFile == self.tab.fileName and url.hasFragment(): self.page().mainFrame().scrollToAnchor(url.fragment()) return if self.tab.openSourceFile(localFile): return if globalSettings.handleWebLinks: self.load(url) else: QDesktopServices.openUrl(url)
def saveImage(self): fileName = QFileDialog.getSaveFileName(self, self.tr("Select save location"), "", self.tr("Images (*.png *.jpg *.bmp *.xpm)")) if "" != fileName[0] and os.path.isdir(os.path.dirname(fileName[0])): imgSize = QSize(self.plot.scene().width() * 4, self.plot.scene().height() * 4) img = QImage(imgSize, QImage.Format_ARGB32) img.fill(Qt.transparent) painter = QPainter(img) self.plot.render(painter) img.save(fileName[0]) del painter QDesktopServices.openUrl(QUrl("file:///" + fileName[0], QUrl.TolerantMode))
def setupMenuBar(self, menuBar=None): if menuBar is None: try: menuBar = self._menuBar except: return menuBar.resetState() activeWindow = self.activeWindow() # XXX: on local menu bar, entries shouldnt be activated if they werent # fetched by local # in that case, maybe return a parentless action, that isnt added to # the menu fileMenu = menuBar.fetchMenu(Entries.File) fileMenu.fetchAction(Entries.File_New, self.newFile) fileMenu.fetchAction(Entries.File_Open, self.openFile) # TODO: maybe move save in there and add save all and close recentFilesMenu = fileMenu.fetchMenu(Entries.File_Open_Recent) self.updateRecentFiles(recentFilesMenu) fileMenu.fetchAction(Entries.File_Exit, self.exit) scriptsMenu = menuBar.fetchMenu(Entries.Scripts) self.updateExtensions(scriptsMenu) windowMenu = menuBar.fetchMenu(Entries.Window) if platformSpecific.windowCommandsInMenu( ) and activeWindow is not None: windowMenu.fetchAction( Entries.Window_Minimize, activeWindow.showMinimized) windowMenu.fetchAction( Entries.Window_Minimize_All, self.minimizeAll) windowMenu.fetchAction( Entries.Window_Zoom, lambda: self.zoom(activeWindow)) windowMenu.fetchAction(Entries.Window_Inspector, self.inspector) windowMenu.fetchAction(Entries.Window_Scripting, self.scripting) if self.outputWindow is not None: windowMenu.fetchAction( Entries.Window_Output, self.output) # TODO: add a list of open windows in window menu, check active window # maybe add helper function that filters topLevelWidgets into windows # bc we need this in a few places helpMenu = menuBar.fetchMenu(Entries.Help) helpMenu.fetchAction( Entries.Help_Documentation, lambda: QDesktopServices.openUrl( QUrl("http://trufont.github.io/"))) helpMenu.fetchAction( Entries.Help_Report_An_Issue, lambda: QDesktopServices.openUrl( QUrl("https://github.com/trufont/trufont/issues/new"))) helpMenu.addSeparator() helpMenu.fetchAction(Entries.Help_About, self.about)
def help_button_triggered(self): index = self.pluginTree.currentIndex() plugin_info = self.pluginTree.model().data(index, Qt.UserRole) if plugin_info is not None: path = plugin_info.path plugin_type = path.split('/')[-3] suffix = "." + '.'.join(path.split('/')[-2:]) target_url = pc.PAPI_DOC_URL + pc.PAPI_DOC_PREFIX_PLUGIN + "." + plugin_type.lower() + suffix + ".html" QDesktopServices.openUrl(QUrl(target_url, QUrl.TolerantMode))
def lookup_forvo(field_list): "Look up pronunciation on forvo." if field_list: text = get_text_from_fields(field_list) else: text = get_selection() if len(text) == 0: raise ValueError(u"No text to look up.") new_text = urllib.quote(text.encode("utf-8")) url = ("http://de.forvo.com/search/" + new_text) qurl = QUrl() qurl.setEncodedUrl(url) QDesktopServices.openUrl(qurl)
def hyperlink_activated(self, link): QDesktopServices.openUrl(QUrl(link))
def _openItem(self): """ Protected slot to handle the open popup menu entry. """ itmList = self.getSelectedItems([ BrowserFileItem, BrowserClassItem, BrowserMethodItem, BrowserClassAttributeItem, BrowserImportItem ]) if not self._activating: self._activating = True for itm in itmList: if isinstance(itm, BrowserFileItem): if itm.isPython2File(): self.sourceFile[str].emit(itm.fileName()) elif itm.isPython3File(): self.sourceFile[str].emit(itm.fileName()) elif itm.isRubyFile(): self.sourceFile[str, int, str].emit(itm.fileName(), -1, "Ruby") elif itm.isDFile(): self.sourceFile[str, int, str].emit(itm.fileName(), -1, "D") elif itm.isDesignerFile(): self.designerFile.emit(itm.fileName()) elif itm.isLinguistFile(): if itm.fileExt() == '.ts': self.linguistFile.emit(itm.fileName()) else: self.trpreview.emit([itm.fileName()]) elif itm.isProjectFile(): self.projectFile.emit(itm.fileName()) elif itm.isMultiProjectFile(): self.multiProjectFile.emit(itm.fileName()) elif itm.isIdlFile(): self.sourceFile[str].emit(itm.fileName()) elif itm.isProtobufFile(): self.sourceFile[str].emit(itm.fileName()) elif itm.isResourcesFile(): self.sourceFile[str].emit(itm.fileName()) elif itm.isSvgFile(): self.svgFile.emit(itm.fileName()) elif itm.isPixmapFile(): self.pixmapFile.emit(itm.fileName()) else: if Utilities.MimeTypes.isTextFile(itm.fileName()): self.sourceFile[str].emit(itm.fileName()) else: QDesktopServices.openUrl(QUrl(itm.fileName())) elif isinstance(itm, BrowserClassItem): self.sourceFile[str, int].emit(itm.fileName(), itm.classObject().lineno) elif isinstance(itm, BrowserMethodItem): self.sourceFile[str, int].emit(itm.fileName(), itm.functionObject().lineno) elif isinstance(itm, BrowserClassAttributeItem): self.sourceFile[str, int].emit(itm.fileName(), itm.attributeObject().lineno) elif isinstance(itm, BrowserImportItem): self.sourceFile[str, list].emit(itm.fileName(), itm.linenos()) self._activating = False
def open_doc_link(self): QDesktopServices.openUrl(QUrl(doc_url))
def _onMessageActionTriggered(self, message, action): if action == "open_folder" and hasattr(message, "_folder"): QDesktopServices.openUrl(QUrl.fromLocalFile(message._folder))
def _menu_slack(self): QDesktopServices.openUrl( QUrl('https://join.slack.com/t/resecret/shared_invite' '/enQtMzc1NTg4MzE3NjA1LTlkNzYxNTIwYTc2ZTYyOWY1MT' 'Q1NzBiN2ZhYjQwYmY0ZmRhODQ0NDE3NmRmZjFiMmE1MDYwN' 'WJlNDVjZDcwNGE'))
def _menu_documentation(self): QDesktopServices.openUrl(QUrl('https://igio90.github.io/Dwarf/api'))
def open_map(self): """Open map in a default browser""" QDesktopServices.openUrl(QUrl(self.current_map_url))
def _menu_github(self): QDesktopServices.openUrl(QUrl('https://github.com/iGio90/Dwarf'))
def triggered_papi_doc(self): QDesktopServices.openUrl(QUrl(pc.PAPI_DOC_URL, QUrl.TolerantMode))
def triggered_papi_wiki(self): QDesktopServices.openUrl(QUrl(pc.PAPI_WIKI_URL, QUrl.TolerantMode))
def mousePressEvent(self, me): # 继承父类方法 super().mousePressEvent(me) url = self.anchorAt(me.pos()) if url.endswith('.zip') or url.endswith('.gz'): QDesktopServices.openUrl(QUrl(url))
def open_url(self): url = QUrl('https://github.com/tadodaho/color') if not QDesktopServices.openUrl(url): QMessageBox.warning(self, 'Warning', 'Could not open url')
def openDirectory(dir_path): QDesktopServices.openUrl(QUrl.fromLocalFile(dir_path))
def handle_links(url): if not url.scheme(): url = QtCore.QUrl.fromLocalFile(url.toString()) QDesktopServices.openUrl(url)
def launch_app(self, item: QTableWidgetItem): path_item = self.fileTable.item(item.row(), FILE_LOCATION_INDEX) file_url = QUrl(path_item.text().replace("\\", "/")) print(file_url) QDesktopServices.openUrl(file_url)
def __init__(self, parent=None): super(MainWindow, self).__init__(parent) if getattr(sys, 'frozen', False): # 打包后的资源路径 bundle_dir = sys._MEIPASS else: # 直接运行脚本资源路径 bundle_dir = os.path.dirname(os.path.abspath(__file__)) loadUi(bundle_dir + '/ui/main.ui', self) self.add_config_dialog = loadUi(bundle_dir + '/ui/add_config_dialog.ui') self.add_config_dialog.setWindowIcon(QIcon(bundle_dir + '/icon/3.ico')) self.setWindowIcon(QIcon(bundle_dir + '/icon/3.ico')) self.tray_icon = QSystemTrayIcon(self) # self.tray_icon.setIcon(self.style().standardIcon(QStyle.SP_ComputerIcon)) self.tray_icon.setIcon(QIcon(bundle_dir + '/icon/2.ico')) self.tray_icon.setToolTip('wfrpc') show_action = QAction("打开", self) quit_action = QAction("退出", self) show_action.triggered.connect(self.showNormal) quit_action.triggered.connect(lambda: (self.stop_frpc(), qApp.quit())) tray_menu = QMenu() tray_menu.addAction(show_action) tray_menu.addAction(quit_action) self.tray_icon.setContextMenu(tray_menu) self.tray_icon.show() self.tray_icon.activated[QSystemTrayIcon.ActivationReason].connect( self.iconActivated) self.statusbar.showMessage(random.choice(self.wisdom_list)) def handle_links(url): if not url.scheme(): url = QtCore.QUrl.fromLocalFile(url.toString()) QDesktopServices.openUrl(url) self.show_log.setOpenLinks(False) self.show_log.anchorClicked.connect(handle_links) # self.show_log.setOpenExternalLinks(True) self.load_config() if self.frpc_config_parser.has_section('common'): for i in self.frpc_config_parser.items('common'): if i[0] == 'server_addr': self.frpc_config_server_addr = i[1] if i[0] == 'server_port': self.frpc_config_server_port = i[1] if i[0] == 'token': self.frpc_config_server_passwd = i[1] self.input_frp_server_addr.setText(self.frpc_config_server_addr) self.input_frp_server_port.setText(self.frpc_config_server_port) self.input_frp_server_passwd.setText(self.frpc_config_server_passwd) self.btn_start_frpc.clicked.connect(self.start_frpc) self.btn_stop_frpc.clicked.connect( lambda: self.stop_frpc(show_msg=True)) self.btn_clear_config.clicked.connect(self.clear_frpc_config) self.btn_add_config.clicked.connect(self.show_add_config_dialog) self.btn_run_backgrounder.clicked.connect(self.run_backgrounder) self.btn_edit_config.clicked.connect(lambda: QDesktopServices.openUrl( QtCore.QUrl(f'file:///{self.frpc_config_path}'))) self.add_config_dialog.btn_ok.clicked.connect(self.add_frpc_config) self.run_frpc = Thread(run_type='run') self.run_frpc.trigger.connect(lambda msg: self.show_log.append(msg)) self.download_frpc = Thread(run_type='download') self.download_frpc.trigger.connect(self.alert_message) self.download_frpc.start() self.download_failed = False, '正在后台下载frp中。。。' self.start_frpc_status = True
def open_model_folder(self): QDesktopServices.openUrl(QUrl.fromLocalFile(self.fitter.models_dir))
def go_to_site(): QDesktopServices.openUrl(QUrl('www.kolgimet.ru'))
def about(self): # 关于 QMessageBox.about(self, '批量重命名工具', '<h1>批量重命名工具!点击确定查看源代码</h1>') QDesktopServices.openUrl(QUrl('https://github.com/nalipiaoxiang/BatchFilesRename'))
def report_bugs(self): QDesktopServices.openUrl( QUrl('https://github.com/ingbyr/GUI-YouGet/issues'))
def openPrinterControlPanel(self) -> None: Logger.log("d", "Opening printer control panel...") QDesktopServices.openUrl(QUrl("http://" + self._address + "/printers"))
def do_updates(self): QDesktopServices.openUrl( QUrl('http://www.ingbyr.tk/2016/05/16/youget/'))
def show_help(self): from PyQt5.QtCore import QUrl from PyQt5.QtGui import QDesktopServices QDesktopServices.openUrl( QUrl('https://github.com/JorgeGIlG/MTF_Estimator'))
def open_url(url): QDesktopServices.openUrl(QUrl(url))
def showHelp(self): QDesktopServices.openUrl(QUrl.fromLocalFile('README.html'))
def _open_directory(self): QDesktopServices.openUrl(QUrl.fromUserInput(self.directory))
def openLink(self, link): QDesktopServices.openUrl(QUrl(link))
def get_help(self) -> None: "Launch the documentation for this dialog in a browser." url = QUrl( r"https://sobjornstad.github.io/TiddlyRemember/#Configuring%20the%20Anki%20add-on" ) QDesktopServices.openUrl(url)
def _menu_api(self): QDesktopServices.openUrl(QUrl('https://igio90.github.io/Dwarf/'))
def _showConfigurationFolder(self): path = Resources.getConfigStoragePath() QDesktopServices.openUrl(QUrl.fromLocalFile(path))