MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / GUILauncher

Class GUILauncher

gui/app.py:55–1773  ·  view source on GitHub ↗

Modern GUI Launcher with CustomTkinter and bilingual support.

Source from the content-addressed store, hash-verified

53
54
55class GUILauncher:
56 """Modern GUI Launcher with CustomTkinter and bilingual support."""
57
58 def __init__(self):
59 # Load configuration first
60 self.config = self._load_config()
61
62 # Apply theme with saved appearance mode
63 appearance_mode = self.config.get("appearance_mode", "dark")
64 apply_theme(appearance_mode=appearance_mode)
65
66 # Initialize EnvManager for advanced settings
67 self.env_manager = get_env_manager(ENV_FILE, ENV_EXAMPLE_FILE)
68
69 # Create main window
70 self.root = ctk.CTk()
71 self.root.geometry("1100x800")
72 self.root.minsize(900, 650)
73
74 # Set language from config
75 set_language(self.config.get("language", "en"))
76
77 # Set window title
78 self.root.title(get_text("title"))
79
80 # Initialize variables
81 self._init_variables()
82
83 # Process state
84 self.process: Optional[subprocess.Popen] = None
85 self.log_thread: Optional[threading.Thread] = None
86 self.running = False
87
88 # Tray icon
89 self.tray = TrayIcon(self)
90
91 # Create log directory
92 LOG_FILE.parent.mkdir(parents=True, exist_ok=True)
93
94 # Build UI
95 self._create_main_ui()
96
97 # Load accounts
98 self._load_accounts()
99
100 # Bind keyboard shortcuts
101 self._bind_shortcuts()
102
103 # Start tray icon
104 if self.config.get("minimize_to_tray", True):
105 self.tray.create_icon()
106
107 # Close handler
108 self.root.protocol("WM_DELETE_WINDOW", self._minimize_to_tray)
109
110 def _init_variables(self):
111 """Initialize tkinter variables."""
112 self.selected_account = ctk.StringVar(value=self.config.get("last_account", ""))

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected