Settings page is "fully" implementation.

This commit is contained in:
wei
2026-08-03 20:55:37 +08:00
parent ed9d25023d
commit 48b70c12af
16 changed files with 579 additions and 261 deletions
+15 -4
View File
@@ -4,7 +4,6 @@ import subprocess
import threading
import time
import traceback
import types
from collections.abc import Callable
from dataclasses import dataclass, field
from pathlib import Path
@@ -671,6 +670,7 @@ class LaunchManager:
self.java_mgr = java_manager
self.game_file_mgr = game_file_manager
self.account_mgr = account_manager
self.launching_profiles: set[str] = set()
self.launched_profiles: list[str] = []
self.signal = self.LaunchSignal()
@@ -879,12 +879,20 @@ class LaunchManager:
return result
def start_launch_task(self, profile: LaunchProfile) -> Thread:
def start_launch_task(self, profile: LaunchProfile) -> Thread | None:
def worker():
result = self.launch(profile)
self.signal.finished.emit(profile, result)
return result
profile_id = profile.profile_id
# Check if profile is in launching process
if profile_id in self.launching_profiles:
return None
self.launching_profiles.add(profile_id)
thread = threading.Thread(
target=worker,
name=f"launch-{profile.profile_id}",
@@ -893,8 +901,11 @@ class LaunchManager:
thread.start()
return thread
def is_profile_running(self, profile_id):
return profile_id in self.launched_profiles
def is_profile_running(self, profile_id: str) -> bool:
return (
profile_id in self.launching_profiles
or profile_id in self.launched_profiles
)
def profile_finished(self, profile_id: str, exit_code: int) -> None:
try: