更新: 1. 添加 Cursor 版本号读取功能 2. 更新程序版本到 3.0.2
This commit is contained in:
@@ -53,6 +53,18 @@ class AccountSwitcher:
|
|||||||
self.hardware_id = get_hardware_id()
|
self.hardware_id = get_hardware_id()
|
||||||
self.registry = CursorRegistry() # 添加注册表操作工具类
|
self.registry = CursorRegistry() # 添加注册表操作工具类
|
||||||
|
|
||||||
|
def get_cursor_version(self) -> str:
|
||||||
|
"""获取Cursor版本号"""
|
||||||
|
try:
|
||||||
|
if self.package_json.exists():
|
||||||
|
with open(self.package_json, "r", encoding="utf-8") as f:
|
||||||
|
data = json.load(f)
|
||||||
|
return data.get("version", "未知")
|
||||||
|
return "未知"
|
||||||
|
except Exception as e:
|
||||||
|
logging.error(f"获取Cursor版本失败: {str(e)}")
|
||||||
|
return "未知"
|
||||||
|
|
||||||
def get_device_info(self) -> dict:
|
def get_device_info(self) -> dict:
|
||||||
"""获取设备信息"""
|
"""获取设备信息"""
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -10,13 +10,24 @@ sys.path.append(str(Path(__file__).parent.parent))
|
|||||||
from utils.config import Config
|
from utils.config import Config
|
||||||
from account_switcher import AccountSwitcher
|
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:
|
class MainWindow:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.config = Config()
|
self.config = Config()
|
||||||
self.switcher = AccountSwitcher()
|
self.switcher = AccountSwitcher()
|
||||||
|
|
||||||
self.root = tk.Tk()
|
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.geometry("600x500") # 调整窗口大小
|
||||||
self.root.resizable(True, True) # 允许调整窗口大小
|
self.root.resizable(True, True) # 允许调整窗口大小
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
3.0.1
|
3.0.2
|
||||||
Reference in New Issue
Block a user