@@ -1,4 +1,5 @@
 | 
			
		||||
import os
 | 
			
		||||
import sys
 | 
			
		||||
import webbrowser
 | 
			
		||||
import threading
 | 
			
		||||
import tkinter as tk
 | 
			
		||||
@@ -85,7 +86,7 @@ class App(tk.Tk):
 | 
			
		||||
    def __init__(self, start_path):  # 初始化
 | 
			
		||||
        super().__init__()
 | 
			
		||||
        self.withdraw()
 | 
			
		||||
        self.title("目录扫描器 V1.4.2")
 | 
			
		||||
        self.title("目录扫描器 V1.4.3")
 | 
			
		||||
        self.start_path = start_path
 | 
			
		||||
        self.queue = Queue()
 | 
			
		||||
        self.progress_queue = Queue()
 | 
			
		||||
@@ -234,7 +235,7 @@ class App(tk.Tk):
 | 
			
		||||
    def show_about(self):
 | 
			
		||||
        messagebox.showinfo(
 | 
			
		||||
            "关于",
 | 
			
		||||
            "一款开源的文件/目录扫描工具\n可以直观地展示目录的文件结构以及文件大小\n\n软件版本 V1.4.2\n作者 ahdoawhfo\n",
 | 
			
		||||
            "一款开源的文件/目录扫描工具\n可以直观地展示目录的文件结构以及文件大小\n\n软件版本 V1.4.3\n作者 ahdoawhfo\n",
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def on_double_click(self, event):  # V1.2 Update:当双击的是文件时,打开文件
 | 
			
		||||
@@ -465,8 +466,7 @@ class App(tk.Tk):
 | 
			
		||||
    def on_close(self):  # 关闭程序
 | 
			
		||||
        if self.scanner.is_alive():
 | 
			
		||||
            self.scanner.join()
 | 
			
		||||
        root.destroy()
 | 
			
		||||
        exit()
 | 
			
		||||
        sys.exit(0)
 | 
			
		||||
 | 
			
		||||
    def set_window_size(self):  # 设置窗口大小
 | 
			
		||||
        screen_width = self.winfo_screenwidth()
 | 
			
		||||
@@ -529,7 +529,7 @@ class UpdateManager:
 | 
			
		||||
        repo_owner = "ahdoawhfo"
 | 
			
		||||
        repo_name = "SpaceSniffer"
 | 
			
		||||
        base_url = "https://git.a6.wiki/api/v1/repos"
 | 
			
		||||
        current_version = "1.4.2"  # 替换成你的当前软件版本
 | 
			
		||||
        current_version = "1.4.3"  # 替换成你的当前软件版本
 | 
			
		||||
 | 
			
		||||
        try:
 | 
			
		||||
            # 发送 GET 请求获取最新的 Release
 | 
			
		||||
@@ -578,8 +578,6 @@ class UpdateManager:
 | 
			
		||||
    def show_message(self, title, message):
 | 
			
		||||
        if self.root:
 | 
			
		||||
            messagebox.showinfo(title, message)
 | 
			
		||||
        else:
 | 
			
		||||
            print(f"{title}: {message}")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def clear_log_file():
 | 
			
		||||
@@ -587,9 +585,8 @@ def clear_log_file():
 | 
			
		||||
    try:
 | 
			
		||||
        with open(log_file, "w", encoding="utf-8") as f:
 | 
			
		||||
            f.truncate(0)  # 清空文件内容
 | 
			
		||||
        print(f"已清空日志文件 {log_file} 的内容")
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
        print(f"清空日志文件内容时发生错误: {e}")
 | 
			
		||||
        messagebox.showinfo("Error", f"清空日志文件内容时发生错误: {e}")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
@@ -599,13 +596,12 @@ if __name__ == "__main__":
 | 
			
		||||
    update_manager = UpdateManager(root, is_startup=True)
 | 
			
		||||
    proceed = update_manager.check_latest_release()
 | 
			
		||||
    if not proceed:
 | 
			
		||||
        root.destroy()
 | 
			
		||||
        exit()
 | 
			
		||||
        sys.exit(0)
 | 
			
		||||
    messagebox.showinfo("提示", "请选择你要扫描的目录")
 | 
			
		||||
    start_path = filedialog.askdirectory()
 | 
			
		||||
    if start_path:
 | 
			
		||||
        app = App(start_path)
 | 
			
		||||
        app.mainloop()
 | 
			
		||||
    else:
 | 
			
		||||
        messagebox.showinfo("提示", "没有选中任何目录,程序即将退出")
 | 
			
		||||
        root.destroy()
 | 
			
		||||
        exit()
 | 
			
		||||
        sys.exit(0)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user