1 Star 0 Fork 26

laranlan/Wine 运行器

forked from gfdgd xi/Wine 运行器 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
deepin-wine-runner-update-bug 4.45 KB
一键复制 编辑 原始数据 按行查看 历史
gfdgd xi 提交于 2023-09-02 10:16 . 新增交流群入口
#!/usr/bin/env python3
import os
import sys
import json
import base64
import req as requests
import traceback
import webbrowser
import urllib.parse as parse
import PyQt5.QtGui as QtGui
import PyQt5.QtWidgets as QtWidgets
from DefaultSetting import *
# 读取文本文档
def readtxt(path: "路径")->"读取文本文档":
f = open(path, "r") # 设置文件对象
str = f.read() # 获取内容
f.close() # 关闭文本对象
return str # 返回结果
def Update(name, stars, contact, things, version):
# post 内容
data = {
"Name": name,
"Starts": stars,
"Contact": contact,
"Things": things,
"Version": version
}
try:
QtWidgets.QMessageBox.information(widget, "提示", requests.post(parse.unquote(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9idWcvdXBsb2FkLnBocA==").decode("utf-8")), data=data).text)
except:
traceback.print_exc()
QtWidgets.QMessageBox.critical(widget, "错误", f"服务器疑似出现错误,可以进行以下尝试:①多尝试几次;②使用其他反馈途径\n错误信息:{traceback.format_exc()}")
def UpdateButtonClick():
#判断是否为空
if nameThings.text() == "" or starMenu.currentText() == "" or contactThings.text() == "" or updateThings.toPlainText().replace(" ", "").replace("\n", "") == "":
QtWidgets.QMessageBox.critical(widget, "错误", "反馈信息未填写完整!")
return
Update(name=nameThings.text(), stars=starMenu.currentText(), contact=contactThings.text(), things=updateThings.toPlainText(), version=version)
def OpenGiteeIssues():
webbrowser.open_new_tab("https://gitee.com/gfdgd-xi/deep-wine-runner/issues")
def OpenGithubIssues():
webbrowser.open_new_tab("https://github.com/gfdgd-xi/deep-wine-runner/issues")
# 获取用户主目录
def get_home()->"获取用户主目录":
return os.path.expanduser('~')
###########################
# 程序信息
###########################
iconPath = "{}/deepin-wine-runner.svg".format(os.path.split(os.path.realpath(__file__))[0])
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
information = json.loads(readtxt(programPath + "/information.json"))
version = information["Version"]
###########################
# 窗口创建
###########################
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QMainWindow()
widget = QtWidgets.QWidget()
widgetLayout = QtWidgets.QGridLayout()
nameThings = QtWidgets.QLineEdit()
contactThings = QtWidgets.QLineEdit()
starMenu = QtWidgets.QComboBox()
updateThings = QtWidgets.QTextEdit()
updateButton = QtWidgets.QPushButton("提交")
otherUpload = QtWidgets.QHBoxLayout()
giteeButton = QtWidgets.QPushButton("Gitee Issues")
githubButton = QtWidgets.QPushButton("Github Issues")
otherUpload.addWidget(QtWidgets.QLabel("如果无法正常反馈,可以用其他方式反馈:"))
otherUpload.addWidget(giteeButton)
otherUpload.addWidget(githubButton)
otherUpload.addSpacerItem(QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum))
starMenu.addItems(["5分", "4分", "3分", "2分", "1分"])
widgetLayout.addWidget(QtWidgets.QLabel("你的昵称:"), 0, 0, 1, 1)
widgetLayout.addWidget(QtWidgets.QLabel("联系方式(电子邮箱):"), 0, 2, 1, 1)
widgetLayout.addWidget(QtWidgets.QLabel("评分:"), 0, 4, 1, 1)
widgetLayout.addWidget(QtWidgets.QLabel("反馈内容(支持 Markdown 格式):"), 1, 0, 1, 2)
widgetLayout.addWidget(nameThings, 0, 1, 1, 1)
widgetLayout.addWidget(contactThings, 0, 3, 1, 1)
widgetLayout.addWidget(starMenu, 0, 5, 1, 1)
widgetLayout.addWidget(updateThings, 2, 0, 1, 6)
widgetLayout.addLayout(otherUpload, 3, 0, 1, 5)
widgetLayout.addWidget(updateButton, 3, 5, 1, 1)
giteeButton.clicked.connect(OpenGiteeIssues)
githubButton.clicked.connect(OpenGithubIssues)
updateButton.clicked.connect(UpdateButtonClick)
# 禁用 bug 提交,引导到 Gitee 提交 bug
nameThings.setDisabled(True)
contactThings.setDisabled(True)
starMenu.setDisabled(True)
#updateThings.setDisabled(True)
updateThings.setReadOnly(True)
updateButton.setDisabled(True)
updateThings.setText("请移步到 Gitee 或 Github 提交 Bug(推荐使用 Gitee)\nWine 运行器 QQ 交流群:762985460")
widget.setLayout(widgetLayout)
window.setCentralWidget(widget)
window.setWindowTitle(f"Wine 运行器 {version} 问题/建议反馈")
window.setWindowIcon(QtGui.QIcon(iconPath))
window.show()
# 设置字体
SetFont(app)
sys.exit(app.exec_())
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ChaoYouAi/deep-wine-runner.git
git@gitee.com:ChaoYouAi/deep-wine-runner.git
ChaoYouAi
deep-wine-runner
Wine 运行器
main

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385