diff --git a/AutoConfig.py b/AutoConfig.py index e313c5d..f0f3313 100755 --- a/AutoConfig.py +++ b/AutoConfig.py @@ -19,13 +19,20 @@ import req as requests import PyQt5.QtWidgets as QtWidgets from UI.AutoConfig import * from Model import * +try: + import PyQt5.QtWebEngineWidgets as QtWebEngineWidgets + webeng = True +except: + print("未安装此依赖库") + webeng = False urlSourcesList = [ "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/auto", # Gitlink 源 "https://gitee.com/gfdgd-xi/deep-wine-runner-auto-configuration-script/raw/master/", # Gitee 源 "https://gfdgd-xi.github.io/deep-wine-runner-auto-configuration-script/", # Github 源 "http://gfdgdxi.msns.cn/wine-runner-list/auto/", # 备用源1,纯 IPv6 源 - "http://120.25.153.144/deep-wine-runner-auto-configuration-script/", # 备用源2,纯 IPv6 源 + "http://120.25.153.144/deep-wine-runner-auto-configuration-script/", # 备用源2 + "http://gfdgdxi.free.idcfengye.com/wine-runner-list/auto/", # 备用源 3 "http://127.0.0.1/wine-runner-list/auto/" # 本地测试源 ] urlSources = urlSourcesList[0] @@ -98,6 +105,7 @@ class ProgramRunStatusUpload(): class InformationWindow(): def ShowWindow(): + #webeng = False # 获取选中项 try: choose = ui.searchList.selectionModel().selectedIndexes()[0].data() @@ -145,20 +153,43 @@ class InformationWindow(): starHtml = "" if maxHead > 5: for i in range(end): - starHtml += f"\n" + if webeng: + starHtml += f"\n" + else: + starHtml += f"\n" else: for i in range(maxHead): - starHtml += f"\n" + if webeng: + starHtml += f"\n" + else: + starHtml += f"\n" head = maxHead for i in range(head, end): - starHtml += f"" + if webeng: + starHtml += f"" + else: + starHtml += f"" about += f"\n
{starHtml}
\n{tipsInfo}
" message = QtWidgets.QDialog() messageLayout = QtWidgets.QVBoxLayout() - informationText = QtWidgets.QTextBrowser() + if webeng: + informationText = QtWebEngineWidgets.QWebEngineView() + #informationText.linkClicked.connect(lambda: print("a")) + '''try: + with open("/tmp/deepin-wine-runner-information.html", "w") as file: + file.write(about) + informationText.setUrl(QtCore.QUrl("file:///tmp/deepin-wine-runner-information.html")) + except: + traceback.print_exc()''' + informationText.setHtml(about) + #informationText.urlChanged.connect(lambda: informationText.setUrl(QtCore.QUrl("https://gfdgd-xi.github.io"))) + else: + informationText = QtWidgets.QTextBrowser() + informationText.setHtml(about) uploadFen = QtWidgets.QPushButton("提交评分") uploadFen.clicked.connect(lambda: ProgramRunStatusUpload.ShowWindow(fileName, choose)) - informationText.setHtml(about) + + #informationText.setUrl(QtCore.QUrl("https://gfdgd-xi.github.io")) messageLayout.addWidget(informationText) messageLayout.addWidget(uploadFen) message.setWindowTitle(f"关于“{choose}”的介绍") @@ -329,7 +360,7 @@ def readtxt(path): def ChangeSources(): global urlSources - sources = [ui.actionGitlink, ui.actionGitee, ui.actionGithub, ui.action_IPv6, ui.action_2, ui.action] + sources = [ui.actionGitlink, ui.actionGitee, ui.actionGithub, ui.action_IPv6, ui.action_2, ui.action_3, ui.action] for i in range(0, len(sources)): if sources[i].isChecked(): urlSources = urlSourcesList[i] @@ -372,7 +403,9 @@ if __name__ == "__main__": sourcesGroup.addAction(ui.actionGitlink) sourcesGroup.addAction(ui.actionGitee) sourcesGroup.addAction(ui.actionGithub) + sourcesGroup.addAction(ui.action_IPv6) sourcesGroup.addAction(ui.action_2) + sourcesGroup.addAction(ui.action_3) sourcesGroup.addAction(ui.action) sourcesGroup.triggered.connect(ChangeSources) sourcesGroup.setExclusive(True) diff --git a/Model/__pycache__/__init__.cpython-37.pyc b/Model/__pycache__/__init__.cpython-37.pyc old mode 100755 new mode 100644 index b0920eb..5bcc16f Binary files a/Model/__pycache__/__init__.cpython-37.pyc and b/Model/__pycache__/__init__.cpython-37.pyc differ diff --git a/UI/AutoConfig.py b/UI/AutoConfig.py index b53039b..379cebe 100755 --- a/UI/AutoConfig.py +++ b/UI/AutoConfig.py @@ -85,6 +85,9 @@ class Ui_MainWindow(object): self.action_2.setCheckable(True) self.action_2.setChecked(False) self.action_2.setObjectName("action_2") + self.action_3 = QtWidgets.QAction(MainWindow) + self.action_3.setCheckable(True) + self.action_3.setObjectName("action_3") self.menu.addAction(self.openFile) self.menu.addSeparator() self.menu.addAction(self.exitProgram) @@ -93,6 +96,7 @@ class Ui_MainWindow(object): self.menu_2.addAction(self.actionGithub) self.menu_2.addAction(self.action_IPv6) self.menu_2.addAction(self.action_2) + self.menu_2.addAction(self.action_3) self.menu_2.addAction(self.action) self.menubar.addAction(self.menu.menuAction()) self.menubar.addAction(self.menu_2.menuAction()) @@ -121,4 +125,5 @@ class Ui_MainWindow(object): self.action_IPv6.setText(_translate("MainWindow", "备用源1(只限IPv6用户)")) self.action.setText(_translate("MainWindow", "本地测试源(127.0.0.1)")) self.action_2.setText(_translate("MainWindow", "备用源2")) + self.action_3.setText(_translate("MainWindow", "备用源3")) diff --git a/UI/AutoConfig.ui b/UI/AutoConfig.ui index b8d5ca5..c793ce7 100755 --- a/UI/AutoConfig.ui +++ b/UI/AutoConfig.ui @@ -112,6 +112,7 @@