mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-06-05 14:49:49 +08:00
快捷方式工具、wine安装器支持import
This commit is contained in:
parent
1d59f6b4f1
commit
b6f8145fa5
@ -12,6 +12,7 @@
|
|||||||
#################
|
#################
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import globalenv
|
||||||
import traceback
|
import traceback
|
||||||
import updatekiller
|
import updatekiller
|
||||||
import PyQt5.QtGui as QtGui
|
import PyQt5.QtGui as QtGui
|
||||||
@ -101,7 +102,10 @@ homePath = os.getenv("HOME")
|
|||||||
iconPath = "{}/deepin-wine-runner.svg".format(programPath)
|
iconPath = "{}/deepin-wine-runner.svg".format(programPath)
|
||||||
#GetDesktopList(f"{homePath}/.local/share/applications")
|
#GetDesktopList(f"{homePath}/.local/share/applications")
|
||||||
#print(desktopList)
|
#print(desktopList)
|
||||||
|
if (__name__ == "__main__"):
|
||||||
app = QtWidgets.QApplication(sys.argv)
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
|
else:
|
||||||
|
app = globalenv.get_value("app")
|
||||||
window = QtWidgets.QMainWindow()
|
window = QtWidgets.QMainWindow()
|
||||||
widget = QtWidgets.QWidget()
|
widget = QtWidgets.QWidget()
|
||||||
layout = QtWidgets.QGridLayout()
|
layout = QtWidgets.QGridLayout()
|
||||||
@ -118,6 +122,7 @@ window.setCentralWidget(widget)
|
|||||||
window.setWindowTitle("图标管理")
|
window.setWindowTitle("图标管理")
|
||||||
window.resize(int(window.frameGeometry().width() * 1.5), int(window.frameGeometry().height() * 1.2))
|
window.resize(int(window.frameGeometry().width() * 1.5), int(window.frameGeometry().height() * 1.2))
|
||||||
window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg"))
|
window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg"))
|
||||||
window.show()
|
|
||||||
GetDesktopThread()
|
GetDesktopThread()
|
||||||
|
if (__name__ == "__main__"):
|
||||||
|
window.show()
|
||||||
app.exec_()
|
app.exec_()
|
7
test.py
7
test.py
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import globalenv
|
import globalenv
|
||||||
import PyQt5.QtWidgets as QtWidgets
|
import PyQt5.QtWidgets as QtWidgets
|
||||||
@ -8,8 +9,10 @@ globalenv._init()
|
|||||||
globalenv.set_value("app", app) # 用于将该部分的 app 给子模块的 Qt 控件调用以解决 UI 异常以及其它问题
|
globalenv.set_value("app", app) # 用于将该部分的 app 给子模块的 Qt 控件调用以解决 UI 异常以及其它问题
|
||||||
#import deepin_wine_packager
|
#import deepin_wine_packager
|
||||||
#modules = __import__("deepin-wine-packager")
|
#modules = __import__("deepin-wine-packager")
|
||||||
modules = __import__("deepin-wine-easy-packager") # 使用该方法可以引入带 - 文件名的模块
|
#modules = __import__("deepin-wine-easy-packager")
|
||||||
#import mainwindow
|
#import mainwindow
|
||||||
window.setCentralWidget(modules.window)
|
# 使用 __import__ 可以引入带 - 文件名的模块
|
||||||
|
import wine.installwine
|
||||||
|
window.setCentralWidget(wine.installwine.window)
|
||||||
window.show()
|
window.show()
|
||||||
app.exec_()
|
app.exec_()
|
@ -21,6 +21,7 @@ import webbrowser
|
|||||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||||
sys.path.append(f"{programPath}/../")
|
sys.path.append(f"{programPath}/../")
|
||||||
from Model import *
|
from Model import *
|
||||||
|
import globalenv
|
||||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||||
# UI 布局(自动生成)
|
# UI 布局(自动生成)
|
||||||
@ -584,7 +585,7 @@ def on_downloadWineFromCloudDisk_clicked():
|
|||||||
def get_now_lang()->"获取当前语言":
|
def get_now_lang()->"获取当前语言":
|
||||||
return os.getenv('LANG')
|
return os.getenv('LANG')
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
localJsonList = []
|
localJsonList = []
|
||||||
internetJsonList = []
|
internetJsonList = []
|
||||||
internetWineSourceList = [
|
internetWineSourceList = [
|
||||||
@ -595,7 +596,10 @@ if __name__ == "__main__":
|
|||||||
"http://127.0.0.1/wine-mirrors/" # 本地测试源
|
"http://127.0.0.1/wine-mirrors/" # 本地测试源
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (__name__ == "__main__"):
|
||||||
app = QtWidgets.QApplication(sys.argv)
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
|
else:
|
||||||
|
app = globalenv.get_value("app")
|
||||||
# 读取翻译
|
# 读取翻译
|
||||||
if not get_now_lang() == "zh_CN.UTF-8":
|
if not get_now_lang() == "zh_CN.UTF-8":
|
||||||
trans = QtCore.QTranslator()
|
trans = QtCore.QTranslator()
|
||||||
@ -608,6 +612,7 @@ if __name__ == "__main__":
|
|||||||
ui = Ui_MainWindow()
|
ui = Ui_MainWindow()
|
||||||
window.setWindowIcon(QtGui.QIcon(f"{programPath}/../deepin-wine-runner.svg"))
|
window.setWindowIcon(QtGui.QIcon(f"{programPath}/../deepin-wine-runner.svg"))
|
||||||
ui.setupUi(window)
|
ui.setupUi(window)
|
||||||
|
if (__name__ == "__main__"):
|
||||||
window.show()
|
window.show()
|
||||||
# 隐藏选项
|
# 隐藏选项
|
||||||
ui.unzip.setVisible(False)
|
ui.unzip.setVisible(False)
|
||||||
@ -644,5 +649,5 @@ if __name__ == "__main__":
|
|||||||
ReadInternetInformation()
|
ReadInternetInformation()
|
||||||
# 图标
|
# 图标
|
||||||
ui.centralWidget.setWindowIcon(QtGui.QIcon(f"{programPath}/../deepin-wine-runner.svg"))
|
ui.centralWidget.setWindowIcon(QtGui.QIcon(f"{programPath}/../deepin-wine-runner.svg"))
|
||||||
|
if (__name__ == "__main__"):
|
||||||
app.exec_()
|
app.exec_()
|
1
wine/installwine.py
Symbolic link
1
wine/installwine.py
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
installwine
|
Loading…
x
Reference in New Issue
Block a user