修复action的对钩问题

This commit is contained in:
gfdgd_xi 2023-01-24 15:08:36 +08:00
parent 6ab330418e
commit 911cca5373
3 changed files with 4 additions and 0 deletions

View File

@ -42,6 +42,7 @@ urlSourcesList = [
"http://gfdgdxi.free.idcfengye.com/uengine-runner-list/auto/", # 备用源 3
"http://127.0.0.1/uengine-runner-list/auto/" # 本地测试源
]
urlSourcesIndex = 0
urlSources = urlSourcesList[0]
lists = []
@ -522,6 +523,7 @@ def readtxt(path):
def ChangeSources():
global urlSources
global urlSourcesIndex
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():
@ -535,7 +537,9 @@ def ChangeSources():
for i in lists:
nmodel.appendRow(QtGui.QStandardItem(i[0]))
ui.searchList.setModel(nmodel)
urlSourcesIndex = i
except:
[ui.actionGitlink, ui.actionGitee, ui.actionGithub, ui.action_IPv6, ui.action_2, ui.action_3, ui.action][urlSourcesIndex].setChecked(True)
traceback.print_exc()
QtWidgets.QMessageBox.critical(window, "提示", "无法连接服务器")
break