Skip to content

Commit

Permalink
修复了计算器退出太慢的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
MCTF-Alpha-27 committed Aug 16, 2022
1 parent adb40ab commit 1556ac3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions libs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import os
import sys
from libs.windows.Calculator import *
from PyQt6.QtGui import *
from PyQt6.QtCore import *

def restart(title, text):
def exit_app(title, text):
QMessageBox.information(calculator, title, text)
sys.exit(0)
calculator.setVisible(False)
app.quit()
4 changes: 2 additions & 2 deletions plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
def enable():
def _enable(plugin):
os.rename("plugins/%s.disabled"%plugin, "plugins/%s.py"%plugin)
restart("重启", "已启用此插件,本次操作需要手动重启程序")
exit_app("重启", "已启用此插件,本次操作需要手动重启程序")
return _enable

def info():
Expand All @@ -29,7 +29,7 @@ def _info(i):

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

return {
"name": plugins[i].__name__,
Expand Down

0 comments on commit 1556ac3

Please sign in to comment.