def on_to_url(self):
     """
     打开网址按钮的消息响应函数\n
     :return: None
     """
     QDesktopServices().openUrl(
         QUrl("https://github.com/GoogleLLP/Archive-password-cracker"))
Esempio n. 2
0
    def _openbrowser_clicked(self):
        rid = self._get_current_rid()
        if rid != -1:
            item = MRHPROJECT.mrhdata[rid]
            pmid = item.pmid
            pmcid = item.pmcid
            link = item.link
            title = item.title
            database = item.database

            pubmed_url = 'https://www.ncbi.nlm.nih.gov/pubmed/'
            pmc_url = 'https://www.ncbi.nlm.nih.gov/pmc/articles/'
            webpage = ''
            # Change it as Preferred
            # doi_url = 'https://doi.org/'
            # scholar_google_url = 'https://scholar.google.com.hk/scholar?&q='
            xueshu_baidu_url = 'http://xueshu.baidu.com/s?wd='
            # wanfang_url = 'http://www.wanfangdata.com.cn/search/searchList.do?searchType=all&searchWord='

            # TODO wos link

            if database == 'PUBMED' or database == 'WOS':
                if pmcid:
                    webpage = pmc_url + pmcid
                elif pmid:
                    webpage = pubmed_url + pmid
            else:
                if database == 'CNKI' or database == 'WANFANG':
                    if link:
                        webpage = link
            if not webpage:
                webpage = xueshu_baidu_url + title

            QDesktopServices().openUrl(QUrl(webpage))
Esempio n. 3
0
    def answer_change_log_action_triggered():
        """

        :return:
        """
        desktop_services = QDesktopServices()
        _app_info = get_app_info()
        desktop_services.openUrl(QUrl(_app_info["change_log_url"]))
Esempio n. 4
0
    def answer_check_version_action_triggered():
        """

        :return:
        """
        # TODO: 获取GitHub API 进行检查并弹窗
        desktop_services = QDesktopServices()
        desktop_services.openUrl(
            QUrl("https://github.com/parzulpan/real-live/releases"))
Esempio n. 5
0
    def answer_check_version_action_triggered():
        """

        :return:
        """
        # TODO: 获取 GitHub API 进行检查并弹窗
        desktop_services = QDesktopServices()
        _app_info = get_app_info()
        desktop_services.openUrl(QUrl(_app_info["update"]))
Esempio n. 6
0
    def answer_copy_link_btn_clicked():
        """

        :return:
        """
        # clipboard = QApplication.clipboard()
        # clipboard.setText(self.link_content_label.text())
        # # original_text = clipboard.text()
        desktop_services = QDesktopServices()
        desktop_services.openUrl(QUrl("https://github.com/parzulpan/real-live"))
Esempio n. 7
0
    def answer_change_log_action_triggered():
        """

        :return:
        """
        desktop_services = QDesktopServices()
        desktop_services.openUrl(
            QUrl(
                "https://github.com/parzulpan/real-live/blob/master/resources/ChangeLog.md"
            ))
Esempio n. 8
0
    def answer_open_src_btn_clicked(self):
        """

        :return:
        """
        clipboard = QApplication.clipboard()
        clipboard.setText(self._app_info["src_url"])
        # original_text = clipboard.text()
        desktop_services = QDesktopServices()
        desktop_services.openUrl(QUrl(self._app_info["src_url"]))
    def open_up_desktop_files(self, path):
        """
        Open up windows resource manager to see folders and result directly
        :param path:
        :return:
        """

        desktopService = QDesktopServices()
        path_url = hp.load_file(path).replace('/', '\\').replace('\\', '\\\\')
        desktopService.openUrl(QUrl('file:///' + path_url))
Esempio n. 10
0
 def _fulltext_button_clicked(self):
     rid = self._get_current_rid()
     if rid != -1:
         mrhitem = MRHPROJECT.mrhdata[rid]
         pdffile = str(rid) + '.pdf'
         pdf = os.path.join(CONFIG.ini['Directory']['project'], 'pdf',
                            pdffile)
         if os.path.exists(pdf):
             QDesktopServices().openUrl(QUrl.fromLocalFile(pdf))
         else:
             self._fulltext_open(mrhitem)
Esempio n. 11
0
    def add_click_path(self, item):
        item = item.listWidget().itemWidget(item)
        _path = item.desc.text()

        self.set_data(_path)

        if not os.path.isfile(_path):
            wh = "" if not os.path.isdir(os.path.expanduser(_path)) else "/"
            self.input.setText(_path + wh)
        else:
            QDesktopServices().openUrl(QUrl(_path))  # from PyQt5
            self.parent.hide_win()
Esempio n. 12
0
def exceptHook(type_, value, tback):
    stack = ''.join(traceback.format_exception(type_, value, tback))

    title = QApplication.translate("ExcpHook", "System error")
    text = QApplication.translate(
        "ExcpHook", "A system error occurred.\n"
        "Do you want to send an error message to the author?")
    msgBox = QMessageBox(QMessageBox.Information, title, text)
    msgBox.setDetailedText(stack)
    msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
    if msgBox.exec_() == QMessageBox.Yes:
        line = traceback.extract_tb(tback)[-1]
        subject = "[v%s] %s - %s:%d" % (version.Version, type_.__name__,
                                        line[0], line[1])

        errorMessage = []
        # errorMessage.append(QApplication.translate(
        #    "ExcpHook",
        #    "PLEASE ADD A COMMENT, IT WILL HELP IN SOLVING THE PROBLEM"))
        # errorMessage.append('')
        errorMessage.append("%s: %s" % (version.AppName, version.Version))
        errorMessage.append(
            "OS: %s %s (%s)" %
            (platform.system(), platform.release(), platform.version()))
        errorMessage.append(
            "Python: %s (%s)" %
            (platform.python_version(), platform.architecture()[0]))
        errorMessage.append("Qt: %s" % PYQT_VERSION_STR)
        try:
            errorMessage.append("Locale: %s" % Settings()['locale'])
        except:
            pass

        errorMessage.append('')
        errorMessage.append(stack)

        url = QUrl('http://opennumismat.idea.informer.com/proj/')
        query = QUrlQuery()
        query.addQueryItem('mod', 'add')
        query.addQueryItem('cat', '3')
        query.addQueryItem('idea', subject)
        query.addQueryItem('descr', '\n'.join(errorMessage))
        url.setQuery(query)

        executor = QDesktopServices()
        executor.openUrl(url)

    # Call the default handler
    sys.__excepthook__(type_, value, tback)
Esempio n. 13
0
 def export_resources(self) -> None:
     self.components.status_bar.clearMessage()
     self.components.progress_bar.show()
     export_count = self.components.table.get_selected_count()
     completed_count = 0
     if self.settings.output_format == OutputMode.DICT:
         with open(
                 os.path.join(self.data.export_location, 'dictionary.csv'),
                 'w') as file:
             writer = csv.writer(file)
             writer.writerow(
                 ['Transcription', 'Translation', 'Audio', 'Image'])
     elif self.settings.output_format == OutputMode.LMF:
         lmf_manifest_window = ManifestWindow(self.parent, self.data)
         _ = lmf_manifest_window.exec()
     opie_index = 0
     for row in range(self.components.table.rowCount()):
         if self.components.table.row_is_checked(row) and \
                 self.components.table.get_cell_value(row, TABLE_COLUMNS["Transcription"]):
             self.components.status_bar.showMessage(
                 f'Exporting file {completed_count + 1} of {export_count}')
             if self.settings.output_format == OutputMode.OPIE:
                 create_opie_files(row, self.data, self.components,
                                   opie_index)
                 opie_index += 1
             elif self.settings.output_format == OutputMode.DICT:
                 create_dict_files(row, self.data)
             elif self.settings.output_format == OutputMode.LMF:
                 create_lmf_files(row, self.data)
             completed_count += 1
             self.components.progress_bar.update_progress(completed_count /
                                                          export_count)
     self.components.progress_bar.hide()
     if self.settings.output_format == OutputMode.LMF:
         manifest_file_path = os.path.join(self.data.export_location,
                                           'manifest.json')
         with open(manifest_file_path, 'w') as manifest_file:
             json.dump(self.data.lmf, manifest_file, indent=4)
     self.components.status_bar.showMessage(
         f'Exported {str(completed_count)} valid words to '
         f'{self.data.export_location}')
     QDesktopServices().openUrl(QUrl().fromLocalFile(
         self.data.export_location))
     LOG_CONVERTER.info(f"Exported {completed_count} transcriptions.")
Esempio n. 14
0
 def _fulltext_open(mrhitem):
     if mrhitem.database == 'WOS' or mrhitem.database == 'PUBMED':
         if mrhitem.doi:
             address = CONFIG.ini['Scihub']['url'] + mrhitem.doi
         else:
             return
     elif mrhitem.database == 'CNKI':
         id_cnki = mrhitem.link.split('&DbName=')[0].split('FileName=')[1]
         prefix_cnki = 'http://kns.cnki.net/KXReader/Detail?dbcode=CJFD&filename='
         address = ''.join([prefix_cnki, id_cnki])
     elif mrhitem.database == 'WANFANG':
         prefix_wf = 'http://www.wanfangdata.com.cn/search/onlineread.do?language=chi&resourceType=perio&source=WF&resourceId='
         id_wanfang = mrhitem.link.split('&id=')[1]
         title_wanfang = '&resourceTitle='
         title = mrhitem.title
         address = ''.join([prefix_wf, id_wanfang, title_wanfang, title])
     else:
         return
     QDesktopServices().openUrl(QUrl(address))
Esempio n. 15
0
    def slotActionInvoked(self, msg):
        notifyId, action = msg.arguments()
        task = self._notifications.get(notifyId, None)
        if not task:
            # other applications' notifications
            return
        name = task["name"]  # filename
        path = task["path"]  # location

        if action == "open":
            openPath = os.path.join(path, name)
        elif action == "openDir":
            openPath = path
        elif action == "default":  # Unity's notify osd always have a default action.
            return
        else:
            raise Exception("Unknown action from slotActionInvoked: {}.".format(action))

        localOpenPath = app.mountsFaker.convertToLocalPath(openPath)
        qUrl = QUrl.fromLocalFile(localOpenPath)
        QDesktopServices().openUrl(qUrl)
Esempio n. 16
0
 def initGui(self):
     self.actions['showSettings'] = QAction(
         QIcon(":/plugins/quickfinder/icons/settings.svg"),
         self.tr(u"&Settings"),
         self.iface.mainWindow())
     self.actions['showSettings'].triggered.connect(self.show_settings)
     self.iface.addPluginToMenu(self.name, self.actions['showSettings'])
     self.actions['help'] = QAction(
         QIcon(":/plugins/quickfinder/icons/help.svg"),
         self.tr("Help"),
         self.iface.mainWindow())
     self.actions['help'].triggered.connect(
         lambda: QDesktopServices().openUrl(
             QUrl("http://3nids.github.io/quickfinder")))
     self.iface.addPluginToMenu(self.name, self.actions['help'])
     self._init_toolbar()
     self.rubber = QgsRubberBand(self.iface.mapCanvas())
     self.rubber.setColor(QColor(255, 255, 50, 200))
     self.rubber.setIcon(self.rubber.ICON_CIRCLE)
     self.rubber.setIconSize(15)
     self.rubber.setWidth(4)
     self.rubber.setBrushStyle(Qt.NoBrush)
Esempio n. 17
0
def exceptHook(type_, value, tback):
    stack = ''.join(traceback.format_exception(type_, value, tback))

    title = QApplication.translate("ExcpHook", "System error")
    text = QApplication.translate(
        "ExcpHook", "A system error occurred.\n"
        "Do you want to send an error message to the author\n"
        "(Google account required)?")
    msgBox = QMessageBox(QMessageBox.Information, title, text)
    msgBox.setDetailedText(stack)
    msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
    if msgBox.exec_() == QMessageBox.Yes:
        line = traceback.extract_tb(tback, 1)[0]
        subject = "[v%s] %s - %s:%d" % (version.Version, type_.__name__,
                                        line[0], line[1])

        errorMessage = []
        errorMessage.append("%s: %s" % (version.AppName, version.Version))
        errorMessage.append("OS: %s %s %s (%s)" %
                            (platform.system(), platform.release(),
                             platform.architecture()[0], platform.version()))
        errorMessage.append("Python: %s" % platform.python_version())
        errorMessage.append("Qt: %s" % PYQT_VERSION_STR)
        errorMessage.append('')
        errorMessage.append(stack)

        url = QUrl('https://code.google.com/p/open-numismat/issues/entry')
        query = QUrlQuery()
        query.addQueryItem('summary', subject)
        query.addQueryItem('comment', '\n'.join(errorMessage))
        url.setQuery(query)

        executor = QDesktopServices()
        executor.openUrl(url)

    # Call the default handler
    sys.__excepthook__(type_, value, tback)
Esempio n. 18
0
 def acceptNavigationRequest(self, url, type_, isMainFrame):
     if type_ == QWebEnginePage.NavigationTypeLinkClicked:
         executor = QDesktopServices()
         executor.openUrl(QUrl(url))
         return False
     return super().acceptNavigationRequest(url, type_, isMainFrame)
Esempio n. 19
0
 def systemOpen(self, url):
     url = app.mountsFaker.convertToNativePath(url)
     qurl = QUrl.fromLocalFile(url)
     QDesktopServices().openUrl(qurl)
Esempio n. 20
0
 def reportBug(self):
     """Opens link to GitHub issues."""
     QDesktopServices().openUrl(
         QUrl('https://github.com/GammaDeltaII/4PlayerChess/issues'))
Esempio n. 21
0
 def ok(self):
     QDesktopServices().openUrl(
         QUrl("https://github.com/lsldragon/AITranslator/releases"))
     self.dialog.close()
Esempio n. 22
0
 def on_btn_open_click(self):
     QDesktopServices().openUrl(
         QtCore.QUrl(self.__path, QtCore.QUrl.TolerantMode))
Esempio n. 23
0
    def m_video_url(self, url):

        print('add search log', time.time())
        f = open('search_log.csv', 'w')
        f.write(url)

        print('verificate:'.format(url), time.time())
        verification, title = utils.download_options(url)
        # 进入下载选项,否则打开网页
        if verification == True:

            sub_title = self.conf['download']['auto-download-subtitle']
            filepath = self.conf['download']['save-path']

            print('begain download', time.time())
            multi_download = multi_thread(url, sub_title, filepath)
            title = multi_download.start()

            system_time = QDateTime.currentDateTime()
            timeDisplay = system_time.toString("yyyy-MM-dd hh:mm:ss")
            self.temp.append([title, url, filepath, timeDisplay])

            self.download_page = QWidget()

            video_info = QGridLayout()
            download_option = QHBoxLayout()

            re_load = QPushButton('重新加载')
            close_tab = QPushButton('关闭此页面')
            goto_webpage = QPushButton('打开网页')
            video_title = QLabel(title)
            back_mainpage = QPushButton('返回主页')
            upload_time = QLabel(timeDisplay)

            video_info.addWidget(back_mainpage, 0, 0, 1, 1)
            video_info.addWidget(close_tab, 0, 1, 1, 1)
            video_info.addWidget(re_load, 0, 3, 1, 1)
            video_info.addWidget(goto_webpage, 0, 4, 1, 1)
            video_info.addWidget(video_title, 1, 2, 2, 5)
            video_info.addWidget(upload_time, 2, 3, 1, 3)
            video_info.setAlignment(Qt.AlignTop)

            flv_720 = QPushButton('flv高清')
            mp4_1080 = QPushButton('mp4超清')
            mp4_720 = QPushButton('mp4高清')
            wav_720 = QPushButton('wav高清')

            download_option.addWidget(flv_720)
            download_option.addWidget(mp4_720)
            download_option.addWidget(mp4_1080)
            download_option.addWidget(wav_720)

            video_download = QVBoxLayout()
            video_download.addLayout(video_info)
            video_download.addLayout(download_option)
            self.download_page.setLayout(video_download)

            self.tabwidget.addTab(self.download_page, '{}'.format(title))
            self.tab_num += 1

            self.tabwidget.setCurrentWidget(self.download_page)

            re_load.pressed.connect(self.relaod)
            close_tab.pressed.connect(self.closetab)
            goto_webpage.pressed.connect(lambda: self.gotowebpage(url))
            back_mainpage.pressed.connect(self.backmainpage)

            # self.signal_1(self.video_tabwidget_close)

            # self.temp_thread=self.temp_thread+1
            # while True:
            #     if self.max_thread == self.temp_thread-1:
            #         self.timer=QTimer()
            #         self.timer.start(5000)
            #     else:
            #         break

            # self.browser=QWebEngineView()
            # self.browser.load(url)

            print('method end', time.time())
            f = open('searched_log.csv', 'w')
            # video_title=title
            # save_path=filepath
            # cur_time=time.strftime('%Y%m%d%H%M%S')
            f.write('{0}{1}{2}{3}'.format(title, url, filepath, timeDisplay))

        else:
            self.browser_search = QWebEngineView()
            search_preview = 'https://www.youtube.com/results?search_query={}'.format(
                url)
            # search_preview ='www.bing.com'
            self.search_url = QUrl(search_preview)
            # self.browser_search.load(self.search_url)

            # self.browser=QWebEnginePage()
            # self.browser.load(self.search_url)

            # open system default browser
            open_system_browser = QDesktopServices()
            open_system_browser.openUrl(self.search_url)
Esempio n. 24
0
 def doUrl(self, url):
     '''opening URL in default browser'''
     url = QUrl(url)
     service = QDesktopServices()
     service.openUrl(url)
Esempio n. 25
0
 def linkClicked(self, url):
     executor = QDesktopServices()
     executor.openUrl(QUrl(url))
Esempio n. 26
0
 def tech_support(self):
     QDesktopServices().openUrl(QUrl(Settings.get("SUPPORT_URL")))