From 4dd48b527359b1918188e6762459c13a2308c449 Mon Sep 17 00:00:00 2001 From: gfdgd xi <3025613752@qq.com> Date: Mon, 16 Aug 2021 09:35:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=87=8D=E5=90=AF=20uengine?= =?UTF-8?q?=20=E6=9C=8D=E5=8A=A1=E3=80=81=E6=B3=A8=E9=87=8A=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E6=96=87?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/main.py b/main.py index 2d237b6..5800baf 100755 --- a/main.py +++ b/main.py @@ -405,31 +405,46 @@ def BackUengineClean()->"清空 uengine 数据": return print("Choose False") -def UengineBridgeStart(): +def UengineBridgeStart()->"启用 uengine 网络桥接": DisabledAndEnbled(True) os.system("pkexec uengine-bridge.sh start") DisabledAndEnbled(False) -def UengineBridgeStop(): +def UengineBridgeStop()->"关闭 uengine 网络桥接": DisabledAndEnbled(True) os.system("pkexec uengine-bridge.sh stop") DisabledAndEnbled(False) -def UengineBridgeRestart(): +def UengineBridgeRestart()->"重启 uengine 网络桥接": DisabledAndEnbled(True) os.system("pkexec uengine-bridge.sh restart") DisabledAndEnbled(False) -def UengineBridgeReload(): +def UengineBridgeReload()->"加载 uengine 网络桥接": DisabledAndEnbled(True) os.system("pkexec uengine-bridge.sh reload") DisabledAndEnbled(False) -def UengineBridgeForceReload(): +def UengineBridgeForceReload()->"强制加载 uengine 网络桥接": DisabledAndEnbled(True) os.system("pkexec uengine-bridge.sh force-reload") DisabledAndEnbled(False) +def StartUengine()->"启用 uengine 服务": + DisabledAndEnbled(True) + os.system("systemctl enable uengine-container uengine-session && systemctl start uengine-container uengine-session") + DisabledAndEnbled(False) + +def StopUengine()->"关闭 uengine 服务": + DisabledAndEnbled(True) + os.system("systemctl disable uengine-container uengine-session") + DisabledAndEnbled(False) + +def UengineRestart()->"重启 uengine 服务": + DisabledAndEnbled(True) + os.system("systemctl restart uengine*") + DisabledAndEnbled(False) + class InstallWindow(): def ShowWindows(command): global message @@ -501,12 +516,6 @@ def get_desktop_path()->"获取用户桌面目录": def get_home()->"获取用户主目录": return os.path.expanduser('~') -def StartUengine(): - os.system("systemctl enable uengine-container uengine-session && systemctl start uengine-container uengine-session") - -def StopUengine(): - os.system("systemctl disable uengine-container uengine-session") - ########################### # 程序信息 ########################### @@ -760,8 +769,9 @@ programmenu.add_command(label="退出程序", command=window.quit) # 设置“ uengine.add_command(label="发送 uengine 应用列表到桌面", command=SendUengineAndroidListForDesktop) uengine.add_command(label="发送 uengine 应用列表到启动器", command=SendUengineAndroidListForLauncher) uengine.add_separator() -uengine.add_command(label="启用 uengine", command=StartUengine) -uengine.add_command(label="禁用 uengine", command=StopUengine) +uengine.add_command(label="启用 uengine 服务", command=StartUengine) +uengine.add_command(label="关闭 uengine 服务", command=StopUengine) +uengine.add_command(label="重启 uengine 服务", command=UengineRestart) uengine.add_separator() uengine.add_command(label="启用 uengine 网络桥接", command=UengineBridgeStart) uengine.add_command(label="关闭 uengine 网络桥接", command=UengineBridgeStop)