mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-01-27 16:38:06 +08:00
Qemu Chroot 镜像下载
This commit is contained in:
parent
e724d19663
commit
a5352c6942
@ -67,8 +67,8 @@ class Ui_MainWindow(object):
|
|||||||
#self.deleteZip.setTristate(False)
|
#self.deleteZip.setTristate(False)
|
||||||
#self.deleteZip.setObjectName("deleteZip")
|
#self.deleteZip.setObjectName("deleteZip")
|
||||||
#self.horizontalLayout.addWidget(self.deleteZip)
|
#self.horizontalLayout.addWidget(self.deleteZip)
|
||||||
self.addOtherWine = QtWidgets.QPushButton(self.centralWidget)
|
#self.addOtherWine = QtWidgets.QPushButton(self.centralWidget)
|
||||||
self.horizontalLayout.addWidget(self.addOtherWine)
|
#self.horizontalLayout.addWidget(self.addOtherWine)
|
||||||
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||||
self.horizontalLayout.addItem(spacerItem2)
|
self.horizontalLayout.addItem(spacerItem2)
|
||||||
self.verticalLayout_2.addLayout(self.horizontalLayout)
|
self.verticalLayout_2.addLayout(self.horizontalLayout)
|
||||||
@ -101,7 +101,7 @@ class Ui_MainWindow(object):
|
|||||||
self.delButton.setText(_translate("MainWindow", ">>"))
|
self.delButton.setText(_translate("MainWindow", ">>"))
|
||||||
#self.unzip.setText(_translate("MainWindow", "不解压Wine资源文件"))
|
#self.unzip.setText(_translate("MainWindow", "不解压Wine资源文件"))
|
||||||
#self.deleteZip.setText(_translate("MainWindow", "删除下载的资源包,只解压保留(两个选项都选相互抵消)"))
|
#self.deleteZip.setText(_translate("MainWindow", "删除下载的资源包,只解压保留(两个选项都选相互抵消)"))
|
||||||
self.addOtherWine.setText(_translate("MainWindow", "导入自己的Wine"))
|
#self.addOtherWine.setText(_translate("MainWindow", "导入自己的Wine"))
|
||||||
|
|
||||||
def ReadLocalInformation():
|
def ReadLocalInformation():
|
||||||
try:
|
try:
|
||||||
@ -248,7 +248,7 @@ class DownloadThread(QtCore.QThread):
|
|||||||
rfile.close()
|
rfile.close()
|
||||||
# C++ 版注释:不直接用 readwrite 是因为不能覆盖写入
|
# C++ 版注释:不直接用 readwrite 是因为不能覆盖写入
|
||||||
file = open(f"{homePath}/.deepin-wine-runner-ubuntu-images/lists.json", "w")
|
file = open(f"{homePath}/.deepin-wine-runner-ubuntu-images/lists.json", "w")
|
||||||
list.append(self.fileSaveName.replace(".7z", ""))
|
list.append(self.fileSaveName.replace(".tar.gz", ""))
|
||||||
file.write(json.dumps(list))
|
file.write(json.dumps(list))
|
||||||
file.close()
|
file.close()
|
||||||
# 读取配置文件
|
# 读取配置文件
|
||||||
@ -256,11 +256,11 @@ class DownloadThread(QtCore.QThread):
|
|||||||
self.localJsonList = list
|
self.localJsonList = list
|
||||||
# 解压文件
|
# 解压文件
|
||||||
shellCommand = ""
|
shellCommand = ""
|
||||||
if self.downloadUnzip:
|
path = f"{homePath}/.deepin-wine-runner-ubuntu-images/{arch}/{self.fileSaveName.replace('.tar.gz', '')}/"
|
||||||
path = f"{homePath}/.deepin-wine-runner-ubuntu-images/{arch}/{self.fileSaveName.replace('.tar.gz', '')}/"
|
#path = f"{programPath}/{self.fileSaveName.replace('.7z', '')}"
|
||||||
#path = f"{programPath}/{self.fileSaveName.replace('.7z', '')}"
|
shellCommand += f"""#!/bin/bash
|
||||||
shellCommand += f"""mkdir -p \"{path}\"
|
mkdir -p \"{path}\"
|
||||||
tar -xzvf \"{savePath}\" -C \"{path}\"
|
tar -xvf \"{savePath}\" -C \"{path}\"
|
||||||
rm \"{savePath}\"
|
rm \"{savePath}\"
|
||||||
"""
|
"""
|
||||||
#if self.downloadDeleteZip:
|
#if self.downloadDeleteZip:
|
||||||
@ -268,10 +268,10 @@ rm \"{savePath}\"
|
|||||||
shellFile = open("/tmp/depein-wine-runner-wine-install.sh", "w")
|
shellFile = open("/tmp/depein-wine-runner-wine-install.sh", "w")
|
||||||
shellFile.write(shellCommand)
|
shellFile.write(shellCommand)
|
||||||
shellFile.close()
|
shellFile.close()
|
||||||
#process = QtCore.QProcess()
|
process = QtCore.QProcess()
|
||||||
#command = ["deepin-terminal", "-e", "bash", "/tmp/depein-wine-runner-wine-install.sh"]
|
command = ["deepin-terminal", "-e", "bash", "/tmp/depein-wine-runner-wine-install.sh"]
|
||||||
#process.start(f"{programPath}/../launch.sh", command)
|
process.start(f"{programPath}/../launch.sh", command)
|
||||||
#process.waitForFinished()
|
process.waitForFinished()
|
||||||
OpenTerminal("bash /tmp/depein-wine-runner-wine-install.sh")
|
OpenTerminal("bash /tmp/depein-wine-runner-wine-install.sh")
|
||||||
self.Finish.emit()
|
self.Finish.emit()
|
||||||
except:
|
except:
|
||||||
@ -302,7 +302,7 @@ def on_addButton_clicked():
|
|||||||
downloadName = internetJsonList[choose][1]
|
downloadName = internetJsonList[choose][1]
|
||||||
ReadLocalInformation()
|
ReadLocalInformation()
|
||||||
for i in localJsonList:
|
for i in localJsonList:
|
||||||
if i == internetJsonList[choose][0]:
|
if i.replace(".tar.gz", "") == internetJsonList[choose][0]:
|
||||||
QtWidgets.QMessageBox.information(window, "提示", "您已经安装了这个镜像了!无需重复安装!")
|
QtWidgets.QMessageBox.information(window, "提示", "您已经安装了这个镜像了!无需重复安装!")
|
||||||
return
|
return
|
||||||
#if(ui.deleteZip.isChecked() + ui.unzip.isChecked() == 2):
|
#if(ui.deleteZip.isChecked() + ui.unzip.isChecked() == 2):
|
||||||
@ -340,10 +340,20 @@ def on_delButton_clicked():
|
|||||||
QtWidgets.QMessageBox.information(window, "提示", "您未选择任何项")
|
QtWidgets.QMessageBox.information(window, "提示", "您未选择任何项")
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
name = f"{programPath}/{localJsonList[ui.localWineList.currentIndex().row()]}"
|
# {localJsonList[ui.localWineList.currentIndex().row()]}
|
||||||
|
path = f"{homePath}/.deepin-wine-runner-ubuntu-images/"
|
||||||
|
changed = False
|
||||||
|
for i in os.listdir(path):
|
||||||
|
if os.path.exists(f"{path}/{i}/{localJsonList[ui.localWineList.currentIndex().row()]}"):
|
||||||
|
changed = True
|
||||||
|
name = f"{path}/{i}/{localJsonList[ui.localWineList.currentIndex().row()]}".replace(".tar.gz", "")
|
||||||
|
if not changed:
|
||||||
|
name = f"{path}/i386/{localJsonList[ui.localWineList.currentIndex().row()]}".replace(".tar.gz", "")
|
||||||
|
print(name)
|
||||||
|
#name = f"{homePath}/.deepin-wine-runner-ubuntu-images/{localJsonList[ui.localWineList.currentIndex().row()]}"
|
||||||
dir = QtCore.QDir(name)
|
dir = QtCore.QDir(name)
|
||||||
dir.removeRecursively()
|
dir.removeRecursively()
|
||||||
QtCore.QFile.remove(name + ".7z")
|
QtCore.QFile.remove(name + ".tar.gz")
|
||||||
del localJsonList[ui.localWineList.currentIndex().row()]
|
del localJsonList[ui.localWineList.currentIndex().row()]
|
||||||
file = open(f"{homePath}/.deepin-wine-runner-ubuntu-images/lists.json", "w")
|
file = open(f"{homePath}/.deepin-wine-runner-ubuntu-images/lists.json", "w")
|
||||||
file.write(json.dumps(localJsonList))
|
file.write(json.dumps(localJsonList))
|
||||||
@ -364,8 +374,8 @@ if __name__ == "__main__":
|
|||||||
internetJsonList = []
|
internetJsonList = []
|
||||||
internetWineSourceList = [
|
internetWineSourceList = [
|
||||||
"https://code.gitlink.org.cn/gfdgd_xi/deepin-wine-runner-ubuntu-image/raw/branch/master/Sandbox",
|
"https://code.gitlink.org.cn/gfdgd_xi/deepin-wine-runner-ubuntu-image/raw/branch/master/Sandbox",
|
||||||
"http://gfdgdxi.msns.cn/wine-mirrors/", # 备用源,纯 IPv6 源
|
"http://gfdgdxi.msns.cn/deepin-wine-runner-ubuntu-image/Sandbox", # 备用源,纯 IPv6 源
|
||||||
"http://127.0.0.1/wine-mirrors/" # 本地测试源
|
"http://127.0.0.1/deepin-wine-runner-ubuntu-image/Sandbox/" # 本地测试源
|
||||||
]
|
]
|
||||||
internetWineSource = internetWineSourceList[0]
|
internetWineSource = internetWineSourceList[0]
|
||||||
app = QtWidgets.QApplication(sys.argv)
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
@ -394,7 +404,7 @@ if __name__ == "__main__":
|
|||||||
# 连接信号
|
# 连接信号
|
||||||
ui.addButton.clicked.connect(on_addButton_clicked)
|
ui.addButton.clicked.connect(on_addButton_clicked)
|
||||||
ui.delButton.clicked.connect(on_delButton_clicked)
|
ui.delButton.clicked.connect(on_delButton_clicked)
|
||||||
ui.addOtherWine.clicked.connect(InstallOtherWine)
|
#ui.addOtherWine.clicked.connect(InstallOtherWine)
|
||||||
ui.changeSourcesGroup.triggered.connect(ChangeSources)
|
ui.changeSourcesGroup.triggered.connect(ChangeSources)
|
||||||
## 加载内容
|
## 加载内容
|
||||||
# 设置列表双击不会编辑
|
# 设置列表双击不会编辑
|
||||||
|
Loading…
x
Reference in New Issue
Block a user