mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-01-13 01:58:27 +08:00
※7、容器自动配置脚本支持评分功能
This commit is contained in:
parent
e3d944e448
commit
4a095393d8
129
AutoConfig.py
129
AutoConfig.py
@ -10,6 +10,7 @@
|
|||||||
#################
|
#################
|
||||||
# 引入所需的库
|
# 引入所需的库
|
||||||
#################
|
#################
|
||||||
|
from fileinput import filename
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
@ -21,6 +22,131 @@ from Model import *
|
|||||||
|
|
||||||
urlSources = "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/auto"
|
urlSources = "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/auto"
|
||||||
lists = []
|
lists = []
|
||||||
|
class ProgramRunStatusUpload():
|
||||||
|
msgWindow = None
|
||||||
|
starLayout = None
|
||||||
|
fen = None
|
||||||
|
starList = []
|
||||||
|
sha1Value = ""
|
||||||
|
programName = None
|
||||||
|
def ChangeStar():
|
||||||
|
if ProgramRunStatusUpload.fen.currentIndex() > 5:
|
||||||
|
for i in ProgramRunStatusUpload.starList:
|
||||||
|
i.setText(f"<img src='{programPath}/Icon/BadStar.svg' width=25>")
|
||||||
|
return
|
||||||
|
for i in range(ProgramRunStatusUpload.fen.currentIndex()):
|
||||||
|
ProgramRunStatusUpload.starList[i].setText(f"<img src='{programPath}/Icon/Star.svg' width=25>")
|
||||||
|
head = ProgramRunStatusUpload.fen.currentIndex()
|
||||||
|
end = len(ProgramRunStatusUpload.starList)
|
||||||
|
for i in range(head, end):
|
||||||
|
ProgramRunStatusUpload.starList[i].setText(f"<img src='{programPath}/Icon/UnStar.svg' width=25>")
|
||||||
|
|
||||||
|
def ShowWindow(sha="", title=""):
|
||||||
|
ProgramRunStatusUpload.starList = []
|
||||||
|
ProgramRunStatusUpload.sha1Value = sha
|
||||||
|
ProgramRunStatusUpload.msgWindow = QtWidgets.QMainWindow()
|
||||||
|
msgWidget = QtWidgets.QWidget()
|
||||||
|
msgWidgetLayout = QtWidgets.QGridLayout()
|
||||||
|
ProgramRunStatusUpload.programName = QtWidgets.QLineEdit()
|
||||||
|
ProgramRunStatusUpload.fen = QtWidgets.QComboBox()
|
||||||
|
ProgramRunStatusUpload.starLayout = QtWidgets.QHBoxLayout()
|
||||||
|
upload = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "上传"))
|
||||||
|
upload.clicked.connect(ProgramRunStatusUpload.Upload)
|
||||||
|
if title != "":
|
||||||
|
ProgramRunStatusUpload.programName.setText(title)
|
||||||
|
ProgramRunStatusUpload.programName.setDisabled(True)
|
||||||
|
# 生成星星列表
|
||||||
|
for i in [1, 1, 1, 1, 0]:
|
||||||
|
ProgramRunStatusUpload.starList.append(QtWidgets.QLabel(f"<img src='{programPath}/Icon/{['Un', ''][i]}Star.svg' width=25>"))
|
||||||
|
ProgramRunStatusUpload.starLayout.addWidget(ProgramRunStatusUpload.starList[-1])
|
||||||
|
ProgramRunStatusUpload.starLayout.addItem(QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum))
|
||||||
|
ProgramRunStatusUpload.programName.setPlaceholderText(QtCore.QCoreApplication.translate("U", "如果这个程序和程序名确实是合法还是检测到敏感词,改为“NULL”即可"))
|
||||||
|
ProgramRunStatusUpload.fen.addItems(["0分",
|
||||||
|
"1分",
|
||||||
|
"2分",
|
||||||
|
"3分",
|
||||||
|
"4分",
|
||||||
|
"5分"])
|
||||||
|
ProgramRunStatusUpload.fen.setCurrentIndex(4)
|
||||||
|
ProgramRunStatusUpload.fen.currentIndexChanged.connect(ProgramRunStatusUpload.ChangeStar)
|
||||||
|
msgWidgetLayout.addWidget(QtWidgets.QLabel(QtCore.QCoreApplication.translate("U", "程序名:")), 0, 0)
|
||||||
|
msgWidgetLayout.addWidget(QtWidgets.QLabel(QtCore.QCoreApplication.translate("U", "评分:")), 1, 0)
|
||||||
|
msgWidgetLayout.addWidget(ProgramRunStatusUpload.programName, 0, 1)
|
||||||
|
msgWidgetLayout.addWidget(ProgramRunStatusUpload.fen, 1, 1)
|
||||||
|
msgWidgetLayout.addLayout(ProgramRunStatusUpload.starLayout, 2, 1)
|
||||||
|
msgWidgetLayout.addWidget(upload, 3, 1)
|
||||||
|
msgWidget.setLayout(msgWidgetLayout)
|
||||||
|
ProgramRunStatusUpload.msgWindow.setCentralWidget(msgWidget)
|
||||||
|
ProgramRunStatusUpload.msgWindow.setWindowTitle(QtCore.QCoreApplication.translate("U", "上传程序运行情况"))
|
||||||
|
ProgramRunStatusUpload.msgWindow.setWindowIcon(QtGui.QIcon(iconPath))
|
||||||
|
ProgramRunStatusUpload.msgWindow.show()
|
||||||
|
|
||||||
|
def Upload():
|
||||||
|
try:
|
||||||
|
#if ProgramRunStatusUpload.sha1Value == "":
|
||||||
|
#ProgramRunStatusUpload.sha1Value = ProgramRunStatusUpload.GetSHA1(e2.currentText())
|
||||||
|
QtWidgets.QMessageBox.information(None, QtCore.QCoreApplication.translate("U", "提示"), json.loads(requests.post("http://120.25.153.144:30250/bash", {
|
||||||
|
"BashName": ProgramRunStatusUpload.programName.text(),
|
||||||
|
"Fen": ProgramRunStatusUpload.fen.currentIndex()
|
||||||
|
}).text)["Error"])
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
QtWidgets.QMessageBox.critical(None, QtCore.QCoreApplication.translate("U", "错误"), QtCore.QCoreApplication.translate("U", "数据上传失败!"))
|
||||||
|
|
||||||
|
class ProgramRunStatusShow():
|
||||||
|
msgWindow = None
|
||||||
|
def ShowWindow():
|
||||||
|
global lists
|
||||||
|
# 获取选中项
|
||||||
|
try:
|
||||||
|
choose = ui.searchList.selectionModel().selectedIndexes()[0].data()
|
||||||
|
except:
|
||||||
|
QtWidgets.QMessageBox.critical(window, "错误", "您未选择任何配置文件")
|
||||||
|
return
|
||||||
|
fileName = ""
|
||||||
|
for i in lists:
|
||||||
|
print(i)
|
||||||
|
if i[0] == choose:
|
||||||
|
fileName = i[1]
|
||||||
|
break
|
||||||
|
try:
|
||||||
|
fenlists = requests.get(f"http://120.25.153.144/spark-deepin-wine-runner/bashapp/{fileName}/all.json").json()
|
||||||
|
#r = requests.get(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9hcHAv").decode("utf-8") + sha + base64.b64decode("L3RpdGxlLnR4dA==").decode("utf-8"))
|
||||||
|
#r.encoding = "utf-8"
|
||||||
|
#title = r.text
|
||||||
|
tipsInfo = ""
|
||||||
|
except:
|
||||||
|
#traceback.print_exc()
|
||||||
|
fenlists = [0, 0, 0, 0, 0]
|
||||||
|
tipsInfo = "暂时无人提交此脚本运行情况,是否立即提交?"
|
||||||
|
|
||||||
|
maxHead = fenlists.index(max(fenlists))
|
||||||
|
ProgramRunStatusShow.msgWindow = QtWidgets.QMainWindow()
|
||||||
|
msgWidget = QtWidgets.QWidget()
|
||||||
|
msgWidgetLayout = QtWidgets.QGridLayout()
|
||||||
|
starLayout = QtWidgets.QHBoxLayout()
|
||||||
|
uploadButton = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "点此上传运行情况"))
|
||||||
|
uploadButton.clicked.connect(lambda: ProgramRunStatusUpload.ShowWindow(fileName, fileName))
|
||||||
|
msgWidgetLayout.addWidget(QtWidgets.QLabel(QtCore.QCoreApplication.translate("U", "综合评价:")), 0, 0)
|
||||||
|
msgWidgetLayout.addLayout(starLayout, 0, 1)
|
||||||
|
msgWidgetLayout.addWidget(QtWidgets.QLabel(tipsInfo), 1, 0, 1, 2)
|
||||||
|
#msgWidgetLayout.addWidget(QtWidgets.QLabel("" if dateVersion == "" else f"数据版本:{dateVersion}"), 2, 0, 1, 2)
|
||||||
|
msgWidgetLayout.addWidget(uploadButton, 3, 0, 1, 2)
|
||||||
|
end = 5
|
||||||
|
if maxHead > 5:
|
||||||
|
for i in range(end):
|
||||||
|
starLayout.addWidget(QtWidgets.QLabel(f"<img src='{programPath}/Icon/BadStar.svg' width=50>"))
|
||||||
|
else:
|
||||||
|
for i in range(maxHead):
|
||||||
|
starLayout.addWidget(QtWidgets.QLabel(f"<img src='{programPath}/Icon/Star.svg' width=50>"))
|
||||||
|
head = maxHead
|
||||||
|
for i in range(head, end):
|
||||||
|
starLayout.addWidget(QtWidgets.QLabel(f"<img src='{programPath}/Icon/UnStar.svg' width=50>"))
|
||||||
|
msgWidget.setLayout(msgWidgetLayout)
|
||||||
|
ProgramRunStatusShow.msgWindow.setCentralWidget(msgWidget)
|
||||||
|
ProgramRunStatusShow.msgWindow.setWindowIcon(QtGui.QIcon(iconPath))
|
||||||
|
#ProgramRunStatusShow.msgWindow.setWindowTitle(f"应用“{title}”的运行情况")
|
||||||
|
ProgramRunStatusShow.msgWindow.show()
|
||||||
|
|
||||||
class Connect:
|
class Connect:
|
||||||
def SearchBotton_Clicked():
|
def SearchBotton_Clicked():
|
||||||
@ -119,12 +245,14 @@ if __name__ == "__main__":
|
|||||||
ui.setupUi(window)
|
ui.setupUi(window)
|
||||||
window.setWindowTitle(f"Wine 运行器 {version}——容器自动配置部署脚本")
|
window.setWindowTitle(f"Wine 运行器 {version}——容器自动配置部署脚本")
|
||||||
window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg"))
|
window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg"))
|
||||||
|
iconPath = "{}/deepin-wine-runner.svg".format(programPath)
|
||||||
window.show()
|
window.show()
|
||||||
# 连接信号和槽
|
# 连接信号和槽
|
||||||
ui.saerchBotton.clicked.connect(Connect.SearchBotton_Clicked)
|
ui.saerchBotton.clicked.connect(Connect.SearchBotton_Clicked)
|
||||||
ui.runBotton.clicked.connect(Connect.RunBotton_Clicked)
|
ui.runBotton.clicked.connect(Connect.RunBotton_Clicked)
|
||||||
ui.openFile.triggered.connect(Connect.OpenFile_Triggered)
|
ui.openFile.triggered.connect(Connect.OpenFile_Triggered)
|
||||||
ui.exitProgram.triggered.connect(window.close)
|
ui.exitProgram.triggered.connect(window.close)
|
||||||
|
ui.getFen.clicked.connect(ProgramRunStatusShow.ShowWindow)
|
||||||
# 解析云列表
|
# 解析云列表
|
||||||
try:
|
try:
|
||||||
# 获取列表
|
# 获取列表
|
||||||
@ -137,4 +265,5 @@ if __name__ == "__main__":
|
|||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
QtWidgets.QMessageBox.critical(window, "提示", "无法连接服务器")
|
QtWidgets.QMessageBox.critical(window, "提示", "无法连接服务器")
|
||||||
|
|
||||||
app.exec_()
|
app.exec_()
|
@ -35,13 +35,19 @@ class Ui_MainWindow(object):
|
|||||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||||
self.horizontalLayout_2.addItem(spacerItem)
|
self.horizontalLayout_2.addItem(spacerItem)
|
||||||
|
self.getFen = QtWidgets.QPushButton(self.centralwidget)
|
||||||
|
self.getFen.setObjectName("getFen")
|
||||||
|
self.horizontalLayout_2.addWidget(self.getFen)
|
||||||
|
self.uploadFen = QtWidgets.QPushButton(self.centralwidget)
|
||||||
|
self.uploadFen.setObjectName("uploadFen")
|
||||||
|
self.horizontalLayout_2.addWidget(self.uploadFen)
|
||||||
self.runBotton = QtWidgets.QPushButton(self.centralwidget)
|
self.runBotton = QtWidgets.QPushButton(self.centralwidget)
|
||||||
self.runBotton.setObjectName("runBotton")
|
self.runBotton.setObjectName("runBotton")
|
||||||
self.horizontalLayout_2.addWidget(self.runBotton)
|
self.horizontalLayout_2.addWidget(self.runBotton)
|
||||||
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
|
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
|
||||||
MainWindow.setCentralWidget(self.centralwidget)
|
MainWindow.setCentralWidget(self.centralwidget)
|
||||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 36))
|
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 33))
|
||||||
self.menubar.setObjectName("menubar")
|
self.menubar.setObjectName("menubar")
|
||||||
self.menu = QtWidgets.QMenu(self.menubar)
|
self.menu = QtWidgets.QMenu(self.menubar)
|
||||||
self.menu.setObjectName("menu")
|
self.menu.setObjectName("menu")
|
||||||
@ -67,6 +73,8 @@ class Ui_MainWindow(object):
|
|||||||
MainWindow.setWindowTitle(_translate("MainWindow", "自动部署脚本"))
|
MainWindow.setWindowTitle(_translate("MainWindow", "自动部署脚本"))
|
||||||
self.searchTips.setText(_translate("MainWindow", "搜索内容(为空代表显示所有内容):"))
|
self.searchTips.setText(_translate("MainWindow", "搜索内容(为空代表显示所有内容):"))
|
||||||
self.saerchBotton.setText(_translate("MainWindow", "搜索"))
|
self.saerchBotton.setText(_translate("MainWindow", "搜索"))
|
||||||
|
self.getFen.setText(_translate("MainWindow", "获取选中项的评分"))
|
||||||
|
self.uploadFen.setText(_translate("MainWindow", "提交选中项的评分"))
|
||||||
self.runBotton.setText(_translate("MainWindow", "部署此方案"))
|
self.runBotton.setText(_translate("MainWindow", "部署此方案"))
|
||||||
self.menu.setTitle(_translate("MainWindow", "程序"))
|
self.menu.setTitle(_translate("MainWindow", "程序"))
|
||||||
self.about.setText(_translate("MainWindow", "关于"))
|
self.about.setText(_translate("MainWindow", "关于"))
|
||||||
|
@ -54,6 +54,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="getFen">
|
||||||
|
<property name="text">
|
||||||
|
<string>获取选中项的评分</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="uploadFen">
|
||||||
|
<property name="text">
|
||||||
|
<string>提交选中项的评分</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="runBotton">
|
<widget class="QPushButton" name="runBotton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -71,7 +85,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>800</width>
|
||||||
<height>36</height>
|
<height>33</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menu">
|
<widget class="QMenu" name="menu">
|
||||||
|
Binary file not shown.
@ -1850,6 +1850,7 @@ updateThingsString = '''※1、新增 VB Runtime 组件安装工具
|
|||||||
※4、修复在 arm 架构运行 Wine 时提示无法解压资源的问题
|
※4、修复在 arm 架构运行 Wine 时提示无法解压资源的问题
|
||||||
※5、修复右键无法找到 Wine 运行器打开方式的问题
|
※5、修复右键无法找到 Wine 运行器打开方式的问题
|
||||||
※6、修复了容器自动配置脚本 GUI 解析器无法指定 Wine、容器以及位数的功能
|
※6、修复了容器自动配置脚本 GUI 解析器无法指定 Wine、容器以及位数的功能
|
||||||
|
※7、容器自动配置脚本支持评分功能
|
||||||
'''
|
'''
|
||||||
for i in information["Thank"]:
|
for i in information["Thank"]:
|
||||||
thankText += f"{i}\n"
|
thankText += f"{i}\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user