完成主界面的QT转换以及核心两大功能安装和卸载的实现
This commit is contained in:
parent
b34877538a
commit
27c39d96a9
235
main.py
235
main.py
|
@ -42,66 +42,104 @@ import tkinter.filedialog as filedialog
|
||||||
import tkinter.simpledialog as simpledialog
|
import tkinter.simpledialog as simpledialog
|
||||||
from getxmlimg import getsavexml
|
from getxmlimg import getsavexml
|
||||||
|
|
||||||
|
class UninstallProgram(QtCore.QThread):
|
||||||
|
info = QtCore.pyqtSignal(str)
|
||||||
|
error = QtCore.pyqtSignal(str)
|
||||||
|
combo = QtCore.pyqtSignal(int)
|
||||||
|
|
||||||
# 卸载程序
|
def __init__(self, package) -> None:
|
||||||
def UninstallProgram(package: "apk 包名")->"卸载程序":
|
self.package = package
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
package = self.package
|
||||||
try:
|
try:
|
||||||
global fineUninstallApkHistory
|
global fineUninstallApkHistory
|
||||||
Return = GetCommandReturn("pkexec /usr/bin/uengine-session-launch-helper -- uengine uninstall --pkg='{}'".format(package))
|
Return = os.system("pkexec /usr/bin/uengine-session-launch-helper -- uengine uninstall --pkg='{}'".format(package))
|
||||||
print(Return)
|
print(Return)
|
||||||
|
if Return != 0:
|
||||||
|
self.error.emit("疑似卸载失败,请检查 UEngine 是否正常安装、运行以及 APK 文件或包名是否正确、完整")
|
||||||
|
DisabledAndEnbled(False)
|
||||||
|
return
|
||||||
if os.path.exists("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), package)):
|
if os.path.exists("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), package)):
|
||||||
os.remove("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), package))
|
os.remove("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), package))
|
||||||
if os.path.exists("{}/{}.desktop".format(get_desktop_path(), package)):
|
if os.path.exists("{}/{}.desktop".format(get_desktop_path(), package)):
|
||||||
os.remove("{}/{}.desktop".format(get_desktop_path(), package))
|
os.remove("{}/{}.desktop".format(get_desktop_path(), package))
|
||||||
findApkHistory.append(ComboInstallPath.get())
|
findApkHistory.append(ComboInstallPath.currentText())
|
||||||
ComboInstallPath['value'] = findApkHistory
|
self.combo.emit(0)
|
||||||
write_txt(get_home() + "/.config/uengine-runner/FindApkHistory.json", str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入
|
write_txt(get_home() + "/.config/uengine-runner/FindApkHistory.json", str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入
|
||||||
messagebox.showinfo(message="操作执行完毕!", title="提示")
|
self.info.emit("操作执行完毕!")
|
||||||
DisabledAndEnbled(False)
|
DisabledAndEnbled(False)
|
||||||
return Return
|
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
messagebox.showerror(title="错误", message=traceback.format_exc())
|
self.error.emit(title="错误", message=traceback.format_exc())
|
||||||
DisabledAndEnbled(False)
|
DisabledAndEnbled(False)
|
||||||
|
# 卸载程序
|
||||||
|
#def UninstallProgram(package: "apk 包名")->"卸载程序":
|
||||||
|
# pass
|
||||||
|
|
||||||
# 卸载按钮事件
|
# 卸载按钮事件
|
||||||
def ButtonClick8():
|
def ButtonClick8():
|
||||||
if ComboInstallPath.get() is "":
|
if ComboInstallPath.currentText() is "":
|
||||||
messagebox.showerror(title="提示", message=langFile[lang]["Main"]["MainWindow"]["Error"]["UninstallError"])
|
QtWidgets.QMessageBox.information(widget, "提示", langFile[lang]["Main"]["MainWindow"]["Error"]["UninstallError"])
|
||||||
|
|
||||||
return
|
return
|
||||||
DisabledAndEnbled(True)
|
DisabledAndEnbled(True)
|
||||||
if os.path.exists(ComboInstallPath.get()):
|
if os.path.exists(ComboInstallPath.currentText()):
|
||||||
path = GetApkPackageName(ComboInstallPath.get())
|
path = GetApkPackageName(ComboInstallPath.currentText())
|
||||||
else:
|
else:
|
||||||
path = ComboInstallPath.get()
|
path = ComboInstallPath.currentText()
|
||||||
print(path)
|
print(path)
|
||||||
threading.Thread(target=UninstallProgram, args=[path]).start()
|
QT.installRun = UninstallProgram(path)
|
||||||
|
QT.installRun.error.connect(ErrorBox)
|
||||||
|
QT.installRun.info.connect(InformationBox)
|
||||||
|
QT.installRun.combo.connect(UpdateCombobox)
|
||||||
|
QT.installRun.start()
|
||||||
|
#threading.Thread(target=UninstallProgram, args=[path]).start()
|
||||||
|
|
||||||
# 浏览窗口
|
# 浏览窗口
|
||||||
temppath=""
|
temppath=""
|
||||||
def FindApk()->"浏览窗口":
|
def FindApk()->"浏览窗口":
|
||||||
path = filedialog.askopenfilename(title="选择 Apk", filetypes=[("APK 文件", "*.apk"), ("所有文件", "*.*")], initialdir=json.loads(readtxt(get_home() + "/.config/uengine-runner/FindApk.json"))["path"])
|
path = QtWidgets.QFileDialog.getOpenFileName(widget, "选择 Apk", json.loads(readtxt(get_home() + "/.config/uengine-runner/FindApk.json"))["path"], "APK 文件(*.apk);;所有文件(*.*)")[0]
|
||||||
global temppath
|
global temppath
|
||||||
temppath = path
|
temppath = path
|
||||||
print("apk path is find:" + path)
|
print("apk path is find:" + path)
|
||||||
if path != "" and path != "()":
|
if path != "" and path != "()":
|
||||||
try:
|
try:
|
||||||
ComboInstallPath.set(path)
|
ComboInstallPath.setEditText(path)
|
||||||
write_txt(get_home() + "/.config/uengine-runner/FindApk.json", json.dumps({"path": os.path.dirname(path)})) # 写入配置文件
|
write_txt(get_home() + "/.config/uengine-runner/FindApk.json", json.dumps({"path": os.path.dirname(path)})) # 写入配置文件
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class QT:
|
||||||
|
installRun = None
|
||||||
|
|
||||||
# 安装按钮事件
|
# 安装按钮事件
|
||||||
def Button3Install():
|
def Button3Install():
|
||||||
if ComboInstallPath.get() is "" or not os.path.exists(ComboInstallPath.get()):
|
if ComboInstallPath.currentText() is "" or not os.path.exists(ComboInstallPath.currentText()):
|
||||||
messagebox.showerror(title="提示", message=langFile[lang]["Main"]["MainWindow"]["Error"]["InstallError"])
|
QtWidgets.QMessageBox.information(widget, "提示", langFile[lang]["Main"]["MainWindow"]["Error"]["InstallError"])
|
||||||
return
|
return
|
||||||
DisabledAndEnbled(True)
|
DisabledAndEnbled(True)
|
||||||
threading.Thread(target=InstallApk, args=(ComboInstallPath.get(),)).start()
|
#threading.Thread(target=InstallApk, args=(ComboInstallPath.get(),)).start()
|
||||||
|
QT.installRun = InstallApk(ComboInstallPath.currentText())
|
||||||
|
QT.installRun.infor.connect(InformationBox)
|
||||||
|
QT.installRun.error.connect(ErrorBox)
|
||||||
|
QT.installRun.combo.connect(UpdateCombobox)
|
||||||
|
QT.installRun.start()
|
||||||
|
|
||||||
# 安装应用
|
# 安装应用
|
||||||
def InstallApk(path: "apk 路径", quit: "是否静默安装" = False):
|
class InstallApk(QtCore.QThread):
|
||||||
|
infor = QtCore.pyqtSignal(str)
|
||||||
|
error = QtCore.pyqtSignal(str)
|
||||||
|
combo = QtCore.pyqtSignal(int)
|
||||||
|
|
||||||
|
def __init__(self, path, quit = False) -> None:
|
||||||
|
self.path = path
|
||||||
|
self.quit = quit
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
path = self.path
|
||||||
|
quit = self.quit
|
||||||
try:
|
try:
|
||||||
if not os.path.exists("/tmp/uengine-runner"):
|
if not os.path.exists("/tmp/uengine-runner"):
|
||||||
os.makedirs("/tmp/uengine-runner")
|
os.makedirs("/tmp/uengine-runner")
|
||||||
|
@ -125,7 +163,7 @@ def InstallApk(path: "apk 路径", quit: "是否静默安装" = False):
|
||||||
if setting["SaveApk"]:
|
if setting["SaveApk"]:
|
||||||
shutil.copy(path, "/tmp/uengine-runner/bak.apk")
|
shutil.copy(path, "/tmp/uengine-runner/bak.apk")
|
||||||
except:
|
except:
|
||||||
if not messagebox.askyesno(title="错误", message="无法备份安装包,是否不备份安装包继续安装?\n提示:新版UEngine安装后会自动删除安装包"):
|
if QtWidgets.QMessageBox.critical(widget, "错误", "无法备份安装包,是否不备份安装包继续安装?\n提示:新版UEngine安装后会自动删除安装包") == QtWidgets.QMessageBox.No:
|
||||||
DisabledAndEnbled(False)
|
DisabledAndEnbled(False)
|
||||||
return
|
return
|
||||||
setting["SaveApk"] = False
|
setting["SaveApk"] = False
|
||||||
|
@ -135,41 +173,54 @@ def InstallApk(path: "apk 路径", quit: "是否静默安装" = False):
|
||||||
print("start install apk3")
|
print("start install apk3")
|
||||||
BuildUengineDesktop(GetApkPackageName(path), GetApkActivityName(path), GetApkChineseLabel(path), iconSavePath,
|
BuildUengineDesktop(GetApkPackageName(path), GetApkActivityName(path), GetApkChineseLabel(path), iconSavePath,
|
||||||
"{}/.local/share/applications/uengine/{}.desktop".format(get_home(), GetApkPackageName(path)))
|
"{}/.local/share/applications/uengine/{}.desktop".format(get_home(), GetApkPackageName(path)))
|
||||||
commandReturn = GetCommandReturn("pkexec /usr/bin/uengine-session-launch-helper -- uengine install --apk='{}'".format(path))
|
commandReturn = os.system("pkexec /usr/bin/uengine-session-launch-helper -- uengine install --apk='{}'".format(path))
|
||||||
print(commandReturn)
|
|
||||||
try:
|
try:
|
||||||
if setting["SaveApk"]:
|
if setting["SaveApk"]:
|
||||||
shutil.copy("/tmp/uengine-runner/bak.apk", path)
|
shutil.copy("/tmp/uengine-runner/bak.apk", path)
|
||||||
except:
|
except:
|
||||||
messagebox.showerror(title="错误", message=langFile[lang]["Main"]["MainWindow"]["Error"]["BackApkError"])
|
self.error.emit(langFile[lang]["Main"]["MainWindow"]["Error"]["BackApkError"])
|
||||||
|
if commandReturn != 0:
|
||||||
|
self.error.emit("疑似 APK 安装失败,请检查 UEngine 是否正常安装、运行以及 APK 文件是否正确、完整")
|
||||||
|
DisabledAndEnbled(False)
|
||||||
|
return
|
||||||
print("\nprint install complete")
|
print("\nprint install complete")
|
||||||
if quit:
|
if quit:
|
||||||
print(commandReturn)
|
|
||||||
return
|
return
|
||||||
messagebox.showinfo(title="提示", message="操作完成!")
|
self.infor.emit("操作完成!")
|
||||||
findApkHistory.append(ComboInstallPath.get())
|
findApkHistory.append(ComboInstallPath.currentText())
|
||||||
ComboInstallPath['value'] = findApkHistory
|
self.combo.emit(0)
|
||||||
write_txt(get_home() + "/.config/uengine-runner/FindApkHistory.json", str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入
|
write_txt(get_home() + "/.config/uengine-runner/FindApkHistory.json", str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
messagebox.showerror(title="错误", message=traceback.format_exc())
|
self.error.emit(traceback.format_exc())
|
||||||
DisabledAndEnbled(False)
|
DisabledAndEnbled(False)
|
||||||
|
|
||||||
|
def UpdateCombobox(tmp):
|
||||||
|
ComboInstallPath.clear()
|
||||||
|
ComboInstallPath.addItems(findApkHistory)
|
||||||
|
ComboInstallPath.setEditText(findApkHistory[-1])
|
||||||
|
|
||||||
|
def ErrorBox(error):
|
||||||
|
QtWidgets.QMessageBox.critical(widget, "错误", error)
|
||||||
|
|
||||||
|
def InformationBox(info):
|
||||||
|
QtWidgets.QMessageBox.information(widget, "提示", info)
|
||||||
|
|
||||||
# 禁用或启动所有控件
|
# 禁用或启动所有控件
|
||||||
def DisabledAndEnbled(choose: "启动或者禁用")->"禁用或启动所有控件":
|
def DisabledAndEnbled(choose: "启动或者禁用")->"禁用或启动所有控件":
|
||||||
userChoose = {True: tk.DISABLED, False: tk.NORMAL}
|
userChoose = {True: tk.DISABLED, False: tk.NORMAL}
|
||||||
a = userChoose[choose]
|
a = userChoose[choose]
|
||||||
ComboInstallPath.configure(state=a)
|
ComboInstallPath.setDisabled(choose)
|
||||||
#ComboUninstallPath.configure(state=a)
|
#ComboUninstallPath.configure(state=a)
|
||||||
BtnFindApk.configure(state=a)
|
BtnFindApk.setDisabled(choose)
|
||||||
BtnInstall.configure(state=a)
|
BtnInstall.setDisabled(choose)
|
||||||
BtnShowUengineApp.configure(state=a)
|
BtnShowUengineApp.setDisabled(choose)
|
||||||
#BtnUninstallApkBrowser.configure(state=a)
|
#BtnUninstallApkBrowser.configure(state=a)
|
||||||
BtnUninstall.configure(state=a)
|
BtnUninstall.setDisabled(choose)
|
||||||
Btngeticon.configure(state=a)
|
Btngeticon.setDisabled(choose)
|
||||||
BtnSaveApk.configure(state=a)
|
BtnSaveApk.setDisabled(choose)
|
||||||
BtnApkInformation.configure(state=a)
|
BtnApkInformation.setDisabled(choose)
|
||||||
LabApkPath.configure(state=a)
|
LabApkPath.setDisabled(choose)
|
||||||
|
|
||||||
# 需引入 subprocess
|
# 需引入 subprocess
|
||||||
# 运行系统命令并获取返回值
|
# 运行系统命令并获取返回值
|
||||||
|
@ -415,11 +466,11 @@ def KeyboardToMouse():
|
||||||
|
|
||||||
# 用户自行保存APK
|
# 用户自行保存APK
|
||||||
def SaveIconToOtherPath():
|
def SaveIconToOtherPath():
|
||||||
apkPath = ComboInstallPath.get()
|
apkPath = ComboInstallPath.currentText()
|
||||||
if apkPath == "":
|
if apkPath == "":
|
||||||
messagebox.showerror(title="错误", message=langFile[lang]["Main"]["MainWindow"]["Error"]["ChooseApkError"])
|
QtWidgets.QMessageBox.critical(widget, "错误", langFile[lang]["Main"]["MainWindow"]["Error"]["ChooseApkError"])
|
||||||
return
|
return
|
||||||
path = filedialog.asksaveasfilename(title="保存图标", filetypes=[("PNG 图片", "*.png"), ("所有文件", "*.*")], initialdir=json.loads(readtxt(get_home() + "/.config/uengine-runner/SaveApkIcon.json"))["path"])
|
path = filedialog.asksaveasfilename(title="保存图标", filetypes=[("PNG 图片", "*.png"), ("所有文件", "*.*")], initialdir=json.loads(readtxt(get_home() + "/.config/uengine-runner/SaveApkIcon.json"))["path"])[0]
|
||||||
if not path == "":
|
if not path == "":
|
||||||
try:
|
try:
|
||||||
SaveApkIcon(apkPath, path)
|
SaveApkIcon(apkPath, path)
|
||||||
|
@ -1424,6 +1475,17 @@ BtnApkInformation = QtWidgets.QPushButton(langFile[lang]["Main"]["MainWindow"]["
|
||||||
FrmInstallWidget.setLayout(FrmInstall)
|
FrmInstallWidget.setLayout(FrmInstall)
|
||||||
FrmInstallWidget.setSizePolicy(size)
|
FrmInstallWidget.setSizePolicy(size)
|
||||||
BtnShowUengineApp.setSizePolicy(size)
|
BtnShowUengineApp.setSizePolicy(size)
|
||||||
|
ComboInstallPath.setEditable(True)
|
||||||
|
ComboInstallPath.addItems(findApkHistory)
|
||||||
|
ComboInstallPath.setFixedSize(ComboInstallPath.frameSize().width() * 5, ComboInstallPath.frameSize().height())
|
||||||
|
# 绑定信号
|
||||||
|
BtnFindApk.clicked.connect(FindApk)
|
||||||
|
BtnInstall.clicked.connect(Button3Install)
|
||||||
|
BtnShowUengineApp.clicked.connect(Button5Click)
|
||||||
|
BtnUninstall.clicked.connect(ButtonClick8)
|
||||||
|
Btngeticon.clicked.connect(SaveIconToOtherPath)
|
||||||
|
BtnSaveApk.clicked.connect(SaveInstallUengineApp)
|
||||||
|
BtnApkInformation.clicked.connect(ApkInformation.ShowWindows)
|
||||||
# 布局控件
|
# 布局控件
|
||||||
widgetLayout.addWidget(LabApkPath, 0, 0, 1, 2)
|
widgetLayout.addWidget(LabApkPath, 0, 0, 1, 2)
|
||||||
widgetLayout.addWidget(ComboInstallPath, 1, 0, 1, 2)
|
widgetLayout.addWidget(ComboInstallPath, 1, 0, 1, 2)
|
||||||
|
@ -1449,6 +1511,10 @@ programmenu.addAction(cleanProgramHistory)
|
||||||
programmenu.addAction(settingWindow)
|
programmenu.addAction(settingWindow)
|
||||||
programmenu.addSeparator()
|
programmenu.addSeparator()
|
||||||
programmenu.addAction(exitProgram)
|
programmenu.addAction(exitProgram)
|
||||||
|
# 绑定事件
|
||||||
|
exitProgram.triggered.connect(CleanProgramHistory)
|
||||||
|
exitProgram.triggered.connect(SettingWindow.ShowWindow)
|
||||||
|
exitProgram.triggered.connect(window.close)
|
||||||
|
|
||||||
adbUengineConnect = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][0])
|
adbUengineConnect = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][0])
|
||||||
adbConnectDevice = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][2])
|
adbConnectDevice = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][2])
|
||||||
|
@ -1475,15 +1541,31 @@ adbKillAdbProgress = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Men
|
||||||
uengineConnectAdb = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][8]["Menu"][0])
|
uengineConnectAdb = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][8]["Menu"][0])
|
||||||
uengineUseAdb = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][8]["Menu"][1])
|
uengineUseAdb = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][8]["Menu"][1])
|
||||||
uengineDoNotUseAdb = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][8]["Menu"][2])
|
uengineDoNotUseAdb = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][8]["Menu"][2])
|
||||||
|
# 绑定信号
|
||||||
|
uengineConnectAdb.triggered.connect(UengineConnectAdb)
|
||||||
|
adbConnectDevice.triggered.connect(AdbConnectDeviceShow)
|
||||||
|
adbChangeUengineDisplaySize.triggered.connect(AdbChangeUengineDisplaySize.ShowWindows)
|
||||||
|
adbAndroidInstallAppList.triggered.connect(AdbAndroidInstallAppList)
|
||||||
|
adbTop.triggered.connect(AdbCPUAndRAWShowInTer)
|
||||||
|
adbShell.triggered.connect(AdbShellShowInTer)
|
||||||
|
adbScrcpyConnectUengine.triggered.connect(ScrcpyConnectUengine)
|
||||||
|
|
||||||
adbServer.addAction(adbStartServer)
|
adbServer.addAction(adbStartServer)
|
||||||
adbServer.addAction(adbStopServer)
|
adbServer.addAction(adbStopServer)
|
||||||
adbServer.addAction(adbKillAdbProgress)
|
adbServer.addAction(adbKillAdbProgress)
|
||||||
|
# 绑定信号
|
||||||
|
adbStartServer.triggered.connect(AdbStartServer)
|
||||||
|
adbStopServer.triggered.connect(AdbStopServer)
|
||||||
|
adbKillAdbProgress.triggered.connect(AdbKillAdbProgress)
|
||||||
|
|
||||||
uengineUseAdbm.addAction(uengineConnectAdb)
|
uengineUseAdbm.addAction(uengineConnectAdb)
|
||||||
uengineUseAdbm.addAction(uengineUseAdb)
|
uengineUseAdbm.addAction(uengineUseAdb)
|
||||||
uengineUseAdbm.addSeparator()
|
uengineUseAdbm.addSeparator()
|
||||||
uengineUseAdbm.addAction(uengineDoNotUseAdb)
|
uengineUseAdbm.addAction(uengineDoNotUseAdb)
|
||||||
|
# 绑定信号
|
||||||
|
uengineConnectAdb.triggered.connect(UengineConnectAdb)
|
||||||
|
uengineUseAdb.triggered.connect(UengineUseAdb)
|
||||||
|
uengineDoNotUseAdb.triggered.connect(UengineDoNotUseAdb)
|
||||||
|
|
||||||
uengineAllowOrDisallowUpdateAndroidApp = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][13])
|
uengineAllowOrDisallowUpdateAndroidApp = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][13])
|
||||||
uengineSetHttpProxy = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][15])
|
uengineSetHttpProxy = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][15])
|
||||||
|
@ -1507,7 +1589,18 @@ uengine.addMenu(uengineUseAdbm)
|
||||||
uengineData = uengine.addMenu(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][6]["Name"])
|
uengineData = uengine.addMenu(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][6]["Name"])
|
||||||
uengine.addAction(uengineDeleteUengineCheck)
|
uengine.addAction(uengineDeleteUengineCheck)
|
||||||
uengine.addAction(uengineReinstall)
|
uengine.addAction(uengineReinstall)
|
||||||
|
uengineRoot = uengine.addMenu(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][11]["Name"])
|
||||||
uengine.addAction(uengineUbuntuInstall)
|
uengine.addAction(uengineUbuntuInstall)
|
||||||
|
# 绑定信号
|
||||||
|
uengineAllowOrDisallowUpdateAndroidApp.triggered.connect(AllowOrDisallowUpdateAndroidApp)
|
||||||
|
uengineSetHttpProxy.triggered.connect(SetHttpProxy)
|
||||||
|
uengineOpenDebBuilder.triggered.connect(OpenUengineDebBuilder)
|
||||||
|
uengineKeyboardToMouse.triggered.connect(KeyboardToMouse)
|
||||||
|
uengineCheckCpu.triggered.connect(UengineCheckCpu)
|
||||||
|
uengineUbuntuInstall.triggered.connect(UengineUbuntuInstall)
|
||||||
|
uengineDeleteUengineCheck.triggered.connect(DelUengineCheck)
|
||||||
|
uengineReinstall.triggered.connect(ReinstallUengine)
|
||||||
|
uengineUbuntuInstall.triggered.connect(UbuntuInstallUengine)
|
||||||
|
|
||||||
uengineStart = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][0])
|
uengineStart = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][0])
|
||||||
uengineStop = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][1])
|
uengineStop = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][1])
|
||||||
|
@ -1515,6 +1608,10 @@ uengineRestart = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][
|
||||||
uengineService.addAction(uengineStart)
|
uengineService.addAction(uengineStart)
|
||||||
uengineService.addAction(uengineStop)
|
uengineService.addAction(uengineStop)
|
||||||
uengineService.addAction(uengineRestart)
|
uengineService.addAction(uengineRestart)
|
||||||
|
# 绑定信号
|
||||||
|
uengineStart.triggered.connect(StartUengine)
|
||||||
|
uengineStop.triggered.connect(StopUengine)
|
||||||
|
uengineRestart.triggered.connect(UengineRestart)
|
||||||
|
|
||||||
uengineBridgeStart = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][3]["Menu"][0])
|
uengineBridgeStart = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][3]["Menu"][0])
|
||||||
uengineBridgeStop = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][3]["Menu"][1])
|
uengineBridgeStop = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][3]["Menu"][1])
|
||||||
|
@ -1526,6 +1623,12 @@ uengineInternet.addAction(uengineBridgeStop)
|
||||||
uengineInternet.addAction(uengineReinstall)
|
uengineInternet.addAction(uengineReinstall)
|
||||||
uengineInternet.addAction(uengineBridgeReload)
|
uengineInternet.addAction(uengineBridgeReload)
|
||||||
uengineInternet.addAction(uengineBridgeForceReload)
|
uengineInternet.addAction(uengineBridgeForceReload)
|
||||||
|
# 绑定信号
|
||||||
|
uengineBridgeStart.triggered.connect(UengineBridgeStart)
|
||||||
|
uengineBridgeStop.triggered.connect(UengineBridgeStop)
|
||||||
|
uengineBridgeRestart.triggered.connect(UengineBridgeRestart)
|
||||||
|
uengineBridgeReload.triggered.connect(UengineBridgeReload)
|
||||||
|
uengineBridgeForceReload.triggered.connect(UengineBridgeForceReload)
|
||||||
|
|
||||||
uengineSendUengineAndroidListForDesktop = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][4]["Menu"][0])
|
uengineSendUengineAndroidListForDesktop = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][4]["Menu"][0])
|
||||||
uengineSendUengineAndroidListForLauncher = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][4]["Menu"][1])
|
uengineSendUengineAndroidListForLauncher = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][4]["Menu"][1])
|
||||||
|
@ -1537,15 +1640,61 @@ uengineIcon.addSeparator()
|
||||||
uengineIcon.addAction(uengineAddNewUengineDesktopLink)
|
uengineIcon.addAction(uengineAddNewUengineDesktopLink)
|
||||||
uengineIcon.addSeparator()
|
uengineIcon.addSeparator()
|
||||||
uengineIcon.addAction(uengineCleanAllUengineDesktopLink)
|
uengineIcon.addAction(uengineCleanAllUengineDesktopLink)
|
||||||
|
# 绑定信号
|
||||||
|
uengineSendUengineAndroidListForDesktop.triggered.connect(SendUengineAndroidListForDesktop)
|
||||||
|
uengineSendUengineAndroidListForLauncher.triggered.connect(SendUengineAndroidListForLauncher)
|
||||||
|
uengineAddNewUengineDesktopLink.triggered.connect(AddNewUengineDesktopLink.ShowWindow)
|
||||||
|
uengineCleanAllUengineDesktopLink.triggered.connect(CleanAllUengineDesktopLink)
|
||||||
|
|
||||||
#uengineData
|
#uengineData
|
||||||
|
uengineOpenRootData = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][6]["Menu"][0])
|
||||||
|
uengineOpenUserData = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][6]["Menu"][1])
|
||||||
|
uengineBackClean = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][6]["Menu"][2])
|
||||||
|
uengineData.addAction(uengineOpenRootData)
|
||||||
|
uengineData.addAction(uengineOpenUserData)
|
||||||
|
uengineData.addSeparator()
|
||||||
|
uengineData.addAction(uengineBackClean)
|
||||||
|
# 绑定信号
|
||||||
|
uengineOpenRootData.triggered.connect(OpenUengineRootData)
|
||||||
|
uengineOpenUserData.triggered.connect(OpenUengineUserData)
|
||||||
|
uengineBackClean.triggered.connect(BackUengineClean)
|
||||||
|
|
||||||
#uengineRoot
|
#uengineRoot
|
||||||
|
uengineInstallRootUengineImage = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][11]["Menu"][0])
|
||||||
|
uengineBuildRootUengineImage = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][11]["Menu"][1])
|
||||||
|
uengineReinstallUengineImage = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][11]["Menu"][2])
|
||||||
|
uengineRoot.addAction(uengineInstallRootUengineImage)
|
||||||
|
uengineRoot.addAction(uengineBuildRootUengineImage)
|
||||||
|
uengineRoot.addSeparator()
|
||||||
|
uengineRoot.addAction(uengineReinstallUengineImage)
|
||||||
|
# 绑定信号
|
||||||
|
uengineInstallRootUengineImage.triggered.connect(InstallRootUengineImage)
|
||||||
|
uengineBuildRootUengineImage.triggered.connect(BuildRootUengineImage)
|
||||||
|
uengineReinstallUengineImage.triggered.connect(ReinstallUengineImage)
|
||||||
|
|
||||||
|
helpOpenProgramUrl = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][0])
|
||||||
|
helpUengineRunnerBugUpload = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][2])
|
||||||
|
helpShowHelp = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][4])
|
||||||
|
helpRunnerUpdate = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][3])
|
||||||
|
helpAbout = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][1])
|
||||||
|
help.addAction(helpOpenProgramUrl)
|
||||||
|
help.addAction(helpUengineRunnerBugUpload)
|
||||||
|
help.addAction(helpShowHelp)
|
||||||
|
help.addAction(helpRunnerUpdate)
|
||||||
|
help.addAction(helpAbout)
|
||||||
|
# 绑定信号
|
||||||
|
helpOpenProgramUrl.triggered.connect(OpenProgramURL)
|
||||||
|
helpUengineRunnerBugUpload.triggered.connect(UengineRunnerBugUpload)
|
||||||
|
helpShowHelp.triggered.connect(ShowHelp)
|
||||||
|
helpRunnerUpdate.triggered.connect(UpdateWindow.ShowWindow)
|
||||||
|
helpAbout.triggered.connect(showhelp)
|
||||||
|
|
||||||
# 设置窗口
|
# 设置窗口
|
||||||
widget.setLayout(widgetLayout)
|
widget.setLayout(widgetLayout)
|
||||||
window.setCentralWidget(widget)
|
window.setCentralWidget(widget)
|
||||||
window.setWindowTitle(title)
|
window.setWindowTitle(title)
|
||||||
window.show()
|
window.show()
|
||||||
window.setFixedSize(window.frameSize().width() * 1.5, window.frameSize().height())
|
window.setFixedSize(window.frameSize().width(), window.frameSize().height())
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
|
|
||||||
# 设置窗口
|
# 设置窗口
|
||||||
|
|
Loading…
Reference in New Issue