diff --git a/AutoConfig.py b/AutoConfig.py index d61f4d6..cad74e5 100755 --- a/AutoConfig.py +++ b/AutoConfig.py @@ -20,11 +20,14 @@ import PyQt5.QtWidgets as QtWidgets from UI.AutoConfig import * from Model import * -urlSources = [ - "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/auto", +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/", # 备用源,纯 IPv6 源 "http://127.0.0.1/wine-runner-list/auto/" # 本地测试源 -][0] +] +urlSources = urlSourcesList[0] lists = [] class ProgramRunStatusUpload(): msgWindow = None @@ -323,6 +326,26 @@ def readtxt(path): f.close() # 关闭文本对象 return str # 返回结果 +def ChangeSources(): + global urlSources + sources = [ui.actionGitlink, ui.actionGitee, ui.actionGithub, ui.action_IPv6, ui.action] + for i in range(0, len(sources)): + if sources[i].isChecked(): + urlSources = urlSourcesList[i] + # 解析云列表 + try: + # 获取列表 + lists = json.loads(requests.get(f"{urlSources}/list.json").text) + # 解释列表并显示在 GUI 上 + nmodel = QtGui.QStandardItemModel(window) + for i in lists: + nmodel.appendRow(QtGui.QStandardItem(i[0])) + ui.searchList.setModel(nmodel) + except: + traceback.print_exc() + QtWidgets.QMessageBox.critical(window, "提示", "无法连接服务器") + break + if __name__ == "__main__": homePath = os.path.expanduser('~') programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string @@ -343,6 +366,18 @@ if __name__ == "__main__": window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg")) iconPath = "{}/deepin-wine-runner.svg".format(programPath) window.show() + #ui.actionGitlink.setExclusive(True) + sourcesGroup = QtWidgets.QActionGroup(window) + sourcesGroup.addAction(ui.actionGitlink) + sourcesGroup.addAction(ui.actionGitee) + sourcesGroup.addAction(ui.actionGithub) + sourcesGroup.addAction(ui.action_IPv6) + sourcesGroup.addAction(ui.action) + sourcesGroup.triggered.connect(ChangeSources) + sourcesGroup.setExclusive(True) + #for i in [ui.actionGitlink, ui.actionGitee, ui.actionGithub, ui.action_IPv6, ui.action]: + #i.triggered.connect(ChangeSources) + #pass # 连接信号和槽 ui.saerchBotton.clicked.connect(Connect.SearchBotton_Clicked) ui.uploadFen.clicked.connect(UploadFen) diff --git a/UI/AutoConfig.py b/UI/AutoConfig.py index 5defa7b..3f8e282 100644 --- a/UI/AutoConfig.py +++ b/UI/AutoConfig.py @@ -50,10 +50,12 @@ class Ui_MainWindow(object): self.verticalLayout_3.addLayout(self.horizontalLayout_2) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 33)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 36)) self.menubar.setObjectName("menubar") self.menu = QtWidgets.QMenu(self.menubar) self.menu.setObjectName("menu") + self.menu_2 = QtWidgets.QMenu(self.menubar) + self.menu_2.setObjectName("menu_2") MainWindow.setMenuBar(self.menubar) self.about = QtWidgets.QAction(MainWindow) self.about.setObjectName("about") @@ -63,10 +65,32 @@ class Ui_MainWindow(object): self.help.setObjectName("help") self.openFile = QtWidgets.QAction(MainWindow) self.openFile.setObjectName("openFile") + self.actionGitlink = QtWidgets.QAction(MainWindow) + self.actionGitlink.setCheckable(True) + self.actionGitlink.setChecked(True) + self.actionGitlink.setObjectName("actionGitlink") + self.actionGitee = QtWidgets.QAction(MainWindow) + self.actionGitee.setCheckable(True) + self.actionGitee.setObjectName("actionGitee") + self.actionGithub = QtWidgets.QAction(MainWindow) + self.actionGithub.setCheckable(True) + self.actionGithub.setObjectName("actionGithub") + self.action_IPv6 = QtWidgets.QAction(MainWindow) + self.action_IPv6.setCheckable(True) + self.action_IPv6.setObjectName("action_IPv6") + self.action = QtWidgets.QAction(MainWindow) + self.action.setCheckable(True) + self.action.setObjectName("action") self.menu.addAction(self.openFile) self.menu.addSeparator() self.menu.addAction(self.exitProgram) + self.menu_2.addAction(self.actionGitlink) + self.menu_2.addAction(self.actionGitee) + self.menu_2.addAction(self.actionGithub) + self.menu_2.addAction(self.action_IPv6) + self.menu_2.addAction(self.action) self.menubar.addAction(self.menu.menuAction()) + self.menubar.addAction(self.menu_2.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -81,8 +105,14 @@ class Ui_MainWindow(object): self.uploadFen.setText(_translate("MainWindow", "提交选中项的评分")) self.runBotton.setText(_translate("MainWindow", "部署此方案")) self.menu.setTitle(_translate("MainWindow", "程序")) + self.menu_2.setTitle(_translate("MainWindow", "切换源")) self.about.setText(_translate("MainWindow", "关于")) self.exitProgram.setText(_translate("MainWindow", "退出程序")) self.help.setText(_translate("MainWindow", "帮助")) self.openFile.setText(_translate("MainWindow", "打开本地部署脚本")) + self.actionGitlink.setText(_translate("MainWindow", "Gitlink 源")) + self.actionGitee.setText(_translate("MainWindow", "Gitee 源")) + self.actionGithub.setText(_translate("MainWindow", "Github 源")) + self.action_IPv6.setText(_translate("MainWindow", "备用源(只限IPv6用户)")) + self.action.setText(_translate("MainWindow", "本地测试源")) diff --git a/UI/AutoConfig.ui b/UI/AutoConfig.ui index 7c90566..ba0b8f1 100644 --- a/UI/AutoConfig.ui +++ b/UI/AutoConfig.ui @@ -92,7 +92,7 @@ 0 0 800 - 33 + 36 @@ -103,7 +103,18 @@ + + + 切换源 + + + + + + + + @@ -125,6 +136,49 @@ 打开本地部署脚本 + + + true + + + true + + + Gitlink 源 + + + + + true + + + Gitee 源 + + + + + true + + + Github 源 + + + + + true + + + 备用源(只限IPv6用户) + + + + + true + + + 本地测试源 + + diff --git a/UI/__pycache__/AutoConfig.cpython-37.pyc b/UI/__pycache__/AutoConfig.cpython-37.pyc index 1ecf0d4..51e2a89 100644 Binary files a/UI/__pycache__/AutoConfig.cpython-37.pyc and b/UI/__pycache__/AutoConfig.cpython-37.pyc differ diff --git a/demo/CheckVB6/Form1.frm b/demo/CheckVB6/Form1.frm new file mode 100644 index 0000000..06cd766 --- /dev/null +++ b/demo/CheckVB6/Form1.frm @@ -0,0 +1,126 @@ +VERSION 5.00 +Begin VB.Form Form1 + Caption = "Form1" + ClientHeight = 3600 + ClientLeft = 60 + ClientTop = 345 + ClientWidth = 5880 + BeginProperty Font + EndProperty + Font = "Form1.frx":0000 + LinkTopic = "Form1" + ScaleHeight = 3600 + ScaleWidth = 5880 + StartUpPosition = 3 'ȱʡ + Begin VB.DriveListBox Drive1 + BeginProperty Font + EndProperty + Font = "Form1.frx":000F + Height = 300 + Left = 4080 + TabIndex = 8 + Top = 1680 + Width = 975 + End + Begin VB.ComboBox Combo1 + BeginProperty Font + EndProperty + Font = "Form1.frx":001E + Height = 300 + Left = 4920 + TabIndex = 7 + Text = "Combo1" + Top = 840 + Width = 855 + End + Begin VB.ListBox List1 + BeginProperty Font + EndProperty + Font = "Form1.frx":002D + Height = 420 + Left = 3720 + TabIndex = 6 + Top = 720 + Width = 975 + End + Begin VB.OptionButton Option2 + Caption = "Option2" + BeginProperty Font + EndProperty + Font = "Form1.frx":003C + Height = 255 + Left = 1920 + TabIndex = 5 + Top = 3240 + Width = 975 + End + Begin VB.OptionButton Option1 + Caption = "Option1" + BeginProperty Font + EndProperty + Font = "Form1.frx":004B + Height = 255 + Left = 480 + TabIndex = 4 + Top = 3240 + Width = 975 + End + Begin VB.CheckBox Check1 + Caption = "Check1" + BeginProperty Font + EndProperty + Font = "Form1.frx":005A + Height = 375 + Left = 2400 + TabIndex = 3 + Top = 2520 + Width = 855 + End + Begin VB.TextBox Text1 + BeginProperty Font + EndProperty + Font = "Form1.frx":0069 + Height = 495 + Left = 2520 + TabIndex = 2 + Text = "Text1" + Top = 1680 + Width = 1335 + End + Begin VB.CommandButton Command1 + Caption = "Command1" + BeginProperty Font + EndProperty + Font = "Form1.frx":0078 + Height = 615 + Left = 2520 + TabIndex = 1 + Top = 720 + Width = 855 + End + Begin VB.Image Image1 + BorderStyle = 1 'Fixed Single + Height = 1905 + Left = 240 + Picture = "Form1.frx":0087 + Stretch = -1 'True + Top = 840 + Width = 1905 + End + Begin VB.Label Label1 + Caption = "˳ж Wine Ƿȷ Visual Basic 6 " + BeginProperty Font + EndProperty + Font = "Form1.frx":558B + Height = 375 + Left = 120 + TabIndex = 0 + Top = 120 + Width = 5655 + End +End +Attribute VB_Name = "Form1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False diff --git a/demo/CheckVB6/Form1.frx b/demo/CheckVB6/Form1.frx new file mode 100644 index 0000000..b4250e0 Binary files /dev/null and b/demo/CheckVB6/Form1.frx differ diff --git a/demo/CheckVB6/工程1.exe b/demo/CheckVB6/工程1.exe new file mode 100755 index 0000000..1945430 Binary files /dev/null and b/demo/CheckVB6/工程1.exe differ diff --git a/demo/CheckVB6/工程1.vbp b/demo/CheckVB6/工程1.vbp new file mode 100644 index 0000000..2dd61cc --- /dev/null +++ b/demo/CheckVB6/工程1.vbp @@ -0,0 +1,29 @@ +Type=Exe +Form=Form1.frm +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\windows\system32\stdole2.tlb#OLE Automation +Startup="Form1" +Command32="" +Name="1" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="FREE" +CompilationType=0 +OptimizationType=0 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 diff --git a/spark-deepin-wine-runner-new.png b/spark-deepin-wine-runner-new.png new file mode 100644 index 0000000..772cb6d Binary files /dev/null and b/spark-deepin-wine-runner-new.png differ