修复了无法正常关闭程序的Bug
This commit is contained in:
parent
6675a46cb6
commit
ffc16830b5
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import webbrowser
|
import webbrowser
|
||||||
import threading
|
import threading
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
@ -465,8 +466,7 @@ class App(tk.Tk):
|
|||||||
def on_close(self): # 关闭程序
|
def on_close(self): # 关闭程序
|
||||||
if self.scanner.is_alive():
|
if self.scanner.is_alive():
|
||||||
self.scanner.join()
|
self.scanner.join()
|
||||||
root.destroy()
|
sys.exit(0)
|
||||||
exit()
|
|
||||||
|
|
||||||
def set_window_size(self): # 设置窗口大小
|
def set_window_size(self): # 设置窗口大小
|
||||||
screen_width = self.winfo_screenwidth()
|
screen_width = self.winfo_screenwidth()
|
||||||
@ -599,13 +599,11 @@ if __name__ == "__main__":
|
|||||||
update_manager = UpdateManager(root, is_startup=True)
|
update_manager = UpdateManager(root, is_startup=True)
|
||||||
proceed = update_manager.check_latest_release()
|
proceed = update_manager.check_latest_release()
|
||||||
if not proceed:
|
if not proceed:
|
||||||
root.destroy()
|
sys.exit(0)
|
||||||
exit()
|
|
||||||
start_path = filedialog.askdirectory()
|
start_path = filedialog.askdirectory()
|
||||||
if start_path:
|
if start_path:
|
||||||
app = App(start_path)
|
app = App(start_path)
|
||||||
app.mainloop()
|
app.mainloop()
|
||||||
else:
|
else:
|
||||||
messagebox.showinfo("提示", "没有选中任何目录,程序即将退出")
|
messagebox.showinfo("提示", "没有选中任何目录,程序即将退出")
|
||||||
root.destroy()
|
sys.exit(0)
|
||||||
exit()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user