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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 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))
Esempio n. 4
0
 def __open(self):
     """
     Private slot to open the downloaded file.
     """
     info = QFileInfo(self.__output)
     url = QUrl.fromLocalFile(info.absoluteFilePath())
     QDesktopServices.openUrl(url)
Esempio n. 5
0
    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
Esempio n. 6
0
 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
Esempio n. 7
0
 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))
Esempio n. 8
0
 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
Esempio n. 10
0
    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)
Esempio n. 11
0
 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)
Esempio n. 12
0
 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)
Esempio n. 13
0
 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)
Esempio n. 14
0
 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)
Esempio n. 15
0
File: view.py Progetto: zhsj/qwechat
 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)
Esempio n. 16
0
 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))
Esempio n. 18
0
 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
Esempio n. 19
0
 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)
Esempio n. 20
0
    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)
Esempio n. 21
0
 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)
Esempio n. 22
0
    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')))
Esempio n. 23
0
	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)
Esempio n. 24
0
 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")
Esempio n. 26
0
	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)
Esempio n. 27
0
 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))
Esempio n. 28
0
    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)
Esempio n. 29
0
    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))
Esempio n. 30
0
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)
Esempio n. 31
0
 def hyperlink_activated(self, link):
     QDesktopServices.openUrl(QUrl(link))
Esempio n. 32
0
    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
Esempio n. 33
0
    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))
Esempio n. 35
0
 def _menu_slack(self):
     QDesktopServices.openUrl(
         QUrl('https://join.slack.com/t/resecret/shared_invite'
              '/enQtMzc1NTg4MzE3NjA1LTlkNzYxNTIwYTc2ZTYyOWY1MT'
              'Q1NzBiN2ZhYjQwYmY0ZmRhODQ0NDE3NmRmZjFiMmE1MDYwN'
              'WJlNDVjZDcwNGE'))
Esempio n. 36
0
 def _menu_documentation(self):
     QDesktopServices.openUrl(QUrl('https://igio90.github.io/Dwarf/api'))
Esempio n. 37
0
 def open_map(self):
     """Open map in a default browser"""
     QDesktopServices.openUrl(QUrl(self.current_map_url))
Esempio n. 38
0
 def _menu_github(self):
     QDesktopServices.openUrl(QUrl('https://github.com/iGio90/Dwarf'))
Esempio n. 39
0
 def triggered_papi_doc(self):
     QDesktopServices.openUrl(QUrl(pc.PAPI_DOC_URL, QUrl.TolerantMode))
Esempio n. 40
0
 def triggered_papi_wiki(self):
     QDesktopServices.openUrl(QUrl(pc.PAPI_WIKI_URL, QUrl.TolerantMode))
Esempio n. 41
0
 def mousePressEvent(self, me):
     # 继承父类方法
     super().mousePressEvent(me)
     url = self.anchorAt(me.pos())
     if url.endswith('.zip') or url.endswith('.gz'):
         QDesktopServices.openUrl(QUrl(url))
Esempio n. 42
0
	def open_url(self):
		url = QUrl('https://github.com/tadodaho/color')
		if not QDesktopServices.openUrl(url):
			QMessageBox.warning(self, 'Warning', 'Could not open url')
Esempio n. 43
0
def openDirectory(dir_path):
    QDesktopServices.openUrl(QUrl.fromLocalFile(dir_path))
Esempio n. 44
0
 def handle_links(url):
     if not url.scheme():
         url = QtCore.QUrl.fromLocalFile(url.toString())
     QDesktopServices.openUrl(url)
Esempio n. 45
0
 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)
Esempio n. 46
0
    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
Esempio n. 47
0
 def open_model_folder(self):
     QDesktopServices.openUrl(QUrl.fromLocalFile(self.fitter.models_dir))
Esempio n. 48
0
 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'))
Esempio n. 50
0
 def report_bugs(self):
     QDesktopServices.openUrl(
         QUrl('https://github.com/ingbyr/GUI-YouGet/issues'))
Esempio n. 51
0
 def openPrinterControlPanel(self) -> None:
     Logger.log("d", "Opening printer control panel...")
     QDesktopServices.openUrl(QUrl("http://" + self._address + "/printers"))
Esempio n. 52
0
 def do_updates(self):
     QDesktopServices.openUrl(
         QUrl('http://www.ingbyr.tk/2016/05/16/youget/'))
Esempio n. 53
0
 def show_help(self):
     from PyQt5.QtCore import QUrl
     from PyQt5.QtGui import QDesktopServices
     QDesktopServices.openUrl(
         QUrl('https://github.com/JorgeGIlG/MTF_Estimator'))
Esempio n. 54
0
def open_url(url):

    QDesktopServices.openUrl(QUrl(url))
Esempio n. 55
0
 def showHelp(self):
     QDesktopServices.openUrl(QUrl.fromLocalFile('README.html'))
Esempio n. 56
0
 def _open_directory(self):
     QDesktopServices.openUrl(QUrl.fromUserInput(self.directory))
Esempio n. 57
0
 def openLink(self, link):
     QDesktopServices.openUrl(QUrl(link))
Esempio n. 58
0
 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)
Esempio n. 59
0
 def _menu_api(self):
     QDesktopServices.openUrl(QUrl('https://igio90.github.io/Dwarf/'))
Esempio n. 60
0
 def _showConfigurationFolder(self):
     path = Resources.getConfigStoragePath()
     QDesktopServices.openUrl(QUrl.fromLocalFile(path))