更新: 1. 添加 Cursor 版本号读取功能 2. 更新程序版本到 3.0.2

This commit is contained in:
huangzhenpc
2025-02-12 10:05:04 +08:00
parent b531e9052b
commit 039cd06e43
3 changed files with 25 additions and 2 deletions

View File

@@ -10,13 +10,24 @@ sys.path.append(str(Path(__file__).parent.parent))
from utils.config import Config
from account_switcher import AccountSwitcher
def get_version():
try:
version_file = Path(__file__).parent.parent / 'version.txt'
with open(version_file, 'r', encoding='utf-8') as f:
return f.read().strip()
except Exception as e:
logging.error(f"读取版本号失败: {str(e)}")
return "未知版本"
class MainWindow:
def __init__(self):
self.config = Config()
self.switcher = AccountSwitcher()
self.root = tk.Tk()
self.root.title("听泉Cursor助手 v2.2.2 (本机Cursor版本: 0.45.11)")
version = get_version()
cursor_version = self.switcher.get_cursor_version()
self.root.title(f"听泉Cursor助手 v{version} (本机Cursor版本: {cursor_version})")
self.root.geometry("600x500") # 调整窗口大小
self.root.resizable(True, True) # 允许调整窗口大小