Skip to content

Commit 1556ac3

Browse files
committed
修复了计算器退出太慢的问题
1 parent adb40ab commit 1556ac3

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

libs/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import os
2-
import sys
31
from libs.windows.Calculator import *
42
from PyQt6.QtGui import *
53
from PyQt6.QtCore import *
64

7-
def restart(title, text):
5+
def exit_app(title, text):
86
QMessageBox.information(calculator, title, text)
9-
sys.exit(0)
7+
calculator.setVisible(False)
8+
app.quit()

plugins/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
def enable():
1919
def _enable(plugin):
2020
os.rename("plugins/%s.disabled"%plugin, "plugins/%s.py"%plugin)
21-
restart("重启", "已启用此插件,本次操作需要手动重启程序")
21+
exit_app("重启", "已启用此插件,本次操作需要手动重启程序")
2222
return _enable
2323

2424
def info():
@@ -29,7 +29,7 @@ def _info(i):
2929

3030
def disable(plugin):
3131
os.rename("plugins/%s.py"%plugin, "plugins/%s.disabled"%plugin)
32-
restart("重启", "已禁用此插件,本次操作需要手动重启程序")
32+
exit_app("重启", "已禁用此插件,本次操作需要手动重启程序")
3333

3434
return {
3535
"name": plugins[i].__name__,

0 commit comments

Comments
 (0)