开始精简主窗口

This commit is contained in:
2023-01-16 16:01:33 +08:00
parent 328cb39ed0
commit dc063f21ac
12 changed files with 0 additions and 325 deletions

3
.idea/.gitignore generated vendored
View File

@@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.10" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
.idea/misc.xml generated
View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml generated
View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/deepin-wine-run.iml" filepath="$PROJECT_DIR$/.idea/deepin-wine-run.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -1,52 +0,0 @@
version: '1.0'
name: branch-pipeline
displayName: BranchPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@python
name: build_python
displayName: Python 构建
pythonVersion: '3.9'
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
path:
- ./
commands:
- python3 -m pip install --upgrade pip
- pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
- pip3 install -r requirements.txt
- python3 ./main.py
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_python
- stage:
name: release
displayName: 发布
steps:
- step: publish@release_artifacts
name: publish_release_artifacts
displayName: '发布'
# 上游上传制品任务的产出
dependArtifact: output
# 发布制品版本号
version: '1.0.0.0'
# 是否开启版本号自增,默认开启
autoIncrement: true
triggers:
push:
branches:
exclude:
- master
include:
- .*

View File

@@ -1,50 +0,0 @@
version: '1.0'
name: master-pipeline
displayName: MasterPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@python
name: build_python
displayName: Python 构建
pythonVersion: '3.9'
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
path:
- ./
commands:
- python3 -m pip install --upgrade pip
- pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
- pip3 install -r requirements.txt
- python3 ./main.py
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_python
- stage:
name: release
displayName: 发布
steps:
- step: publish@release_artifacts
name: publish_release_artifacts
displayName: '发布'
# 上游上传制品任务的产出
dependArtifact: output
# 发布制品版本号
version: '1.0.0.0'
# 是否开启版本号自增,默认开启
autoIncrement: true
triggers:
push:
branches:
include:
- master

View File

@@ -1,37 +0,0 @@
version: '1.0'
name: pr-pipeline
displayName: PRPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@python
name: build_python
displayName: Python 构建
pythonVersion: '3.9'
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
path:
- ./
commands:
- python3 -m pip install --upgrade pip
- pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
- pip3 install -r requirements.txt
- python3 ./main.py
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_python
triggers:
pr:
branches:
include:
- master

View File

@@ -1,104 +0,0 @@
#!/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
# 读取文本文档
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 OpenGitlinkIssues():
webbrowser.open_new_tab("https://www.gitlink.org.cn/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")
gitlinkButton = QtWidgets.QPushButton("Gitlink Issues")
otherUpload.addWidget(QtWidgets.QLabel("如果无法正常反馈,可以用其他方式反馈:"))
otherUpload.addWidget(giteeButton)
otherUpload.addWidget(githubButton)
otherUpload.addWidget(gitlinkButton)
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)
gitlinkButton.clicked.connect(OpenGitlinkIssues)
updateButton.clicked.connect(UpdateButtonClick)
widget.setLayout(widgetLayout)
window.setCentralWidget(widget)
window.setWindowTitle(f"Wine 运行器 {version} 问题/建议反馈")
window.setWindowIcon(QtGui.QIcon(iconPath))
window.show()
sys.exit(app.exec_())

View File

@@ -28,11 +28,6 @@ import urllib.parse as parse
import PyQt5.QtGui as QtGui import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore import PyQt5.QtCore as QtCore
import PyQt5.QtWidgets as QtWidgets import PyQt5.QtWidgets as QtWidgets
try:
import PyQt5.QtWebEngineWidgets as QtWebEngineWidgets
bad = False
except:
bad = True
from trans import * from trans import *
from Model import * from Model import *
@@ -417,15 +412,6 @@ def about_this_program()->"显示“关于这个程序”窗口":
QT.message.resize(int(messageWidget.frameGeometry().width() * 1.5), int(messageWidget.frameGeometry().height() * 1.5)) QT.message.resize(int(messageWidget.frameGeometry().width() * 1.5), int(messageWidget.frameGeometry().height() * 1.5))
QT.message.show() QT.message.show()
# 显示“提示”窗口
def helps():
global tips
QtWidgets.QMessageBox.information(widget, "提示", tips)
# 显示更新内容窗口
def UpdateThings():
QtWidgets.QMessageBox.information(widget, "更新内容", updateThings)
# 生成 desktop 文件在启动器 # 生成 desktop 文件在启动器
def make_desktop_on_launcher(): def make_desktop_on_launcher():
try: try:
@@ -1906,27 +1892,6 @@ def SaveLog():
traceback.print_exc() traceback.print_exc()
QtWidgets.QMessageBox.critical(window, "错误", traceback.format_exc()) QtWidgets.QMessageBox.critical(window, "错误", traceback.format_exc())
def GetNewInformation():
try:
text = requests.get("https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/information/index.html").text
except:
traceback.print_exc()
text = """<p>无法连接到服务器</p>
<hr/>
<p>你可以尝试:</p>
<p>1. 判断使用的是否使用吾爱版本,如果使用吾爱版本则无法连接</p>
<p>2. 判断是否能正常连接网络</p>"""
global webInformation
if bad:
webInformation = QtWidgets.QTextBrowser()
else:
webInformation = QtWebEngineWidgets.QWebEngineView()
webInformation.setHtml(text)
webInformation.setWindowTitle("获取程序公告")
webInformation.setWindowIcon(QtGui.QIcon(iconPath))
webInformation.resize(int(webInformation.frameGeometry().width() * 1.3), int(webInformation.frameGeometry().height() * 1.1))
webInformation.show()
def getFileFolderSize(fileOrFolderPath): def getFileFolderSize(fileOrFolderPath):
"""get size for file or folder""" """get size for file or folder"""
totalSize = 0 totalSize = 0
@@ -2906,12 +2871,9 @@ if len(qemuBottleList) >= 1:
help = menu.addMenu(transla.transe("U", "帮助(&H)")) help = menu.addMenu(transla.transe("U", "帮助(&H)"))
runStatusWebSize = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(20), transla.transe("U", "查询程序在 Wine 的运行情况")) runStatusWebSize = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(20), transla.transe("U", "查询程序在 Wine 的运行情况"))
h1 = help.addMenu(QtWidgets.QApplication.style().standardIcon(20), transla.transe("U", "程序官网")) h1 = help.addMenu(QtWidgets.QApplication.style().standardIcon(20), transla.transe("U", "程序官网"))
h2 = QtWidgets.QAction(transla.transe("U", "小提示"))
wineRunnerHelp = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(20), transla.transe("U", "Wine运行器和Wine打包器傻瓜式使用教程小白专用 By 鹤舞白沙")) wineRunnerHelp = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(20), transla.transe("U", "Wine运行器和Wine打包器傻瓜式使用教程小白专用 By 鹤舞白沙"))
h3 = QtWidgets.QAction(transla.transe("U", "更新内容"))
h4 = QtWidgets.QAction(transla.transe("U", "鸣谢名单")) h4 = QtWidgets.QAction(transla.transe("U", "鸣谢名单"))
h5 = QtWidgets.QAction(transla.transe("U", "更新这个程序")) h5 = QtWidgets.QAction(transla.transe("U", "更新这个程序"))
programInformation = QtWidgets.QAction(transla.transe("U", "获取程序公告"))
h6 = QtWidgets.QAction(transla.transe("U", "反馈这个程序的建议和问题")) h6 = QtWidgets.QAction(transla.transe("U", "反馈这个程序的建议和问题"))
fenUpload = QtWidgets.QAction(transla.transe("U", "程序评分")) fenUpload = QtWidgets.QAction(transla.transe("U", "程序评分"))
h7 = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(9), transla.transe("U", "关于这个程序")) h7 = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(9), transla.transe("U", "关于这个程序"))
@@ -2934,8 +2896,6 @@ help.addAction(forumWebsize)
help.addAction(wineRunnerHelp) help.addAction(wineRunnerHelp)
help.addAction(runStatusWebSize) help.addAction(runStatusWebSize)
help.addSeparator() help.addSeparator()
help.addAction(h2)
help.addAction(h3)
help.addAction(h4) help.addAction(h4)
help.addSeparator() help.addSeparator()
wikiHelp = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(20), transla.transe("U", "程序 Wiki")) wikiHelp = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(20), transla.transe("U", "程序 Wiki"))
@@ -2949,7 +2909,6 @@ help.addSeparator()
help.addAction(h5) help.addAction(h5)
help.addAction(h6) help.addAction(h6)
help.addAction(fenUpload) help.addAction(fenUpload)
help.addAction(programInformation)
help.addAction(h7) help.addAction(h7)
help.addAction(h8) help.addAction(h8)
help.addSeparator() help.addSeparator()
@@ -2964,8 +2923,6 @@ gitlab.triggered.connect(lambda: webbrowser.open_new_tab("https://gitlab.com/gfd
jihu.triggered.connect(lambda: webbrowser.open_new_tab("https://jihulab.com//gfdgd-xi/deep-wine-runner")) jihu.triggered.connect(lambda: webbrowser.open_new_tab("https://jihulab.com//gfdgd-xi/deep-wine-runner"))
runStatusWebSize.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdgd-xi.github.io/wine-runner-info")) runStatusWebSize.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdgd-xi.github.io/wine-runner-info"))
forumWebsize.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdgdxi.flarum.cloud/")) forumWebsize.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdgdxi.flarum.cloud/"))
h2.triggered.connect(helps)
h3.triggered.connect(UpdateThings)
wineRunnerHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://bbs.deepin.org/post/246837")) wineRunnerHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://bbs.deepin.org/post/246837"))
h4.triggered.connect(ThankWindow) h4.triggered.connect(ThankWindow)
wikiHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdgd-xi.github.io/wine-runner-wiki")) wikiHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdgd-xi.github.io/wine-runner-wiki"))
@@ -2977,7 +2934,6 @@ fenUpload.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"p
h7.triggered.connect(about_this_program) h7.triggered.connect(about_this_program)
h8.triggered.connect(lambda: QtWidgets.QMessageBox.aboutQt(widget)) h8.triggered.connect(lambda: QtWidgets.QMessageBox.aboutQt(widget))
hm1_1.triggered.connect(lambda: webbrowser.open_new_tab("https://gitee.com/gfdgd-xi/uengine-runner")) hm1_1.triggered.connect(lambda: webbrowser.open_new_tab("https://gitee.com/gfdgd-xi/uengine-runner"))
programInformation.triggered.connect(GetNewInformation)
# 异同步获取信息 # 异同步获取信息
#threading.Thread(target=GetVersion).start() #threading.Thread(target=GetVersion).start()
GetVersion() GetVersion()

View File

@@ -1,3 +0,0 @@
下面将会详细标注违反本程序 GPLV3 开源协议的应用以及其违反代码和来源
# 超级 Wine