Sync from development - prepare for v0.1.6.5

This commit is contained in:
Omni
2025-10-28 21:18:54 +00:00
parent 52806f4116
commit 06bd94d119
14 changed files with 266 additions and 52 deletions

View File

@@ -438,19 +438,37 @@ class SettingsDialog(QDialog):
advanced_layout.addWidget(resource_group)
# Component Installation Method Section
component_group = QGroupBox("Component Installation")
# Advanced Tool Options Section
component_group = QGroupBox("Advanced Tool Options")
component_group.setStyleSheet("QGroupBox { border: 1px solid #555; border-radius: 6px; margin-top: 8px; padding: 8px; background: #23282d; } QGroupBox:title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; font-weight: bold; color: #fff; }")
component_layout = QVBoxLayout()
component_group.setLayout(component_layout)
self.use_winetricks_checkbox = QCheckBox("Use winetricks for component installation (faster)")
self.use_winetricks_checkbox.setChecked(self.config_handler.get('use_winetricks_for_components', True))
self.use_winetricks_checkbox.setToolTip(
"When enabled: Uses winetricks for most components (faster) and protontricks for legacy .NET versions (dotnet40, dotnet472, dotnet48) which are more reliable.\n"
"When disabled: Uses protontricks for all components (legacy behavior, slower but more compatible)."
# Label for the toggle button
method_label = QLabel("Wine Components Installation:")
component_layout.addWidget(method_label)
# Toggle button for winetricks/protontricks selection
self.component_toggle = QPushButton("Winetricks")
self.component_toggle.setCheckable(True)
use_winetricks = self.config_handler.get('use_winetricks_for_components', True)
self.component_toggle.setChecked(use_winetricks)
# Function to update button text based on state
def update_button_text():
if self.component_toggle.isChecked():
self.component_toggle.setText("Winetricks")
else:
self.component_toggle.setText("Protontricks")
self.component_toggle.toggled.connect(update_button_text)
update_button_text() # Set initial text
self.component_toggle.setToolTip(
"Winetricks: Faster, uses bundled tools (Default)\n"
"Protontricks: Legacy mode, slower but system-compatible"
)
component_layout.addWidget(self.use_winetricks_checkbox)
component_layout.addWidget(self.component_toggle)
advanced_layout.addWidget(component_group)
advanced_layout.addStretch() # Add stretch to push content to top
@@ -726,7 +744,7 @@ class SettingsDialog(QDialog):
self.config_handler.set("game_proton_version", resolved_game_version)
# Save component installation method preference
self.config_handler.set("use_winetricks_for_components", self.use_winetricks_checkbox.isChecked())
self.config_handler.set("use_winetricks_for_components", self.component_toggle.isChecked())
# Force immediate save and verify
save_result = self.config_handler.save_config()

View File

@@ -37,7 +37,9 @@ class ConfigureExistingModlistScreen(QWidget):
self.refresh_paths()
# --- Detect Steam Deck ---
steamdeck = os.path.exists('/etc/os-release') and 'steamdeck' in open('/etc/os-release').read().lower()
from jackify.backend.services.platform_detection_service import PlatformDetectionService
platform_service = PlatformDetectionService.get_instance()
steamdeck = platform_service.is_steamdeck
self.shortcut_handler = ShortcutHandler(steamdeck=steamdeck)
# Initialize services early

View File

@@ -591,7 +591,9 @@ class ConfigureNewModlistScreen(QWidget):
return
# --- Shortcut creation will be handled by automated workflow ---
from jackify.backend.handlers.shortcut_handler import ShortcutHandler
steamdeck = os.path.exists('/etc/os-release') and 'steamdeck' in open('/etc/os-release').read().lower()
from jackify.backend.services.platform_detection_service import PlatformDetectionService
platform_service = PlatformDetectionService.get_instance()
steamdeck = platform_service.is_steamdeck
shortcut_handler = ShortcutHandler(steamdeck=steamdeck) # Still needed for Steam restart
# Check if auto-restart is enabled
@@ -723,16 +725,10 @@ class ConfigureNewModlistScreen(QWidget):
except Exception as e:
self.error_occurred.emit(str(e))
# Detect Steam Deck once
try:
import os
_is_steamdeck = False
if os.path.exists('/etc/os-release'):
with open('/etc/os-release') as f:
if 'steamdeck' in f.read().lower():
_is_steamdeck = True
except Exception:
_is_steamdeck = False
# Detect Steam Deck once using centralized service
from jackify.backend.services.platform_detection_service import PlatformDetectionService
platform_service = PlatformDetectionService.get_instance()
_is_steamdeck = platform_service.is_steamdeck
# Create and start the thread
self.automated_prefix_thread = AutomatedPrefixThread(modlist_name, install_dir, mo2_exe_path, _is_steamdeck)
@@ -928,7 +924,10 @@ class ConfigureNewModlistScreen(QWidget):
# Steam assigns a NEW AppID during restart, different from the one we initially created
self._safe_append_text(f"Re-detecting AppID for shortcut '{modlist_name}' after Steam restart...")
from jackify.backend.handlers.shortcut_handler import ShortcutHandler
shortcut_handler = ShortcutHandler(steamdeck=False)
from jackify.backend.services.platform_detection_service import PlatformDetectionService
platform_service = PlatformDetectionService.get_instance()
shortcut_handler = ShortcutHandler(steamdeck=platform_service.is_steamdeck)
current_appid = shortcut_handler.get_appid_for_shortcut(modlist_name, mo2_exe_path)
if not current_appid or not current_appid.isdigit():
@@ -952,7 +951,12 @@ class ConfigureNewModlistScreen(QWidget):
# Initialize ModlistHandler with correct parameters
path_handler = PathHandler()
modlist_handler = ModlistHandler(steamdeck=False, verbose=False)
# Use centralized Steam Deck detection
from jackify.backend.services.platform_detection_service import PlatformDetectionService
platform_service = PlatformDetectionService.get_instance()
modlist_handler = ModlistHandler(steamdeck=platform_service.is_steamdeck, verbose=False)
# Set required properties manually after initialization
modlist_handler.modlist_dir = install_dir

View File

@@ -2112,7 +2112,10 @@ class InstallModlistScreen(QWidget):
# Steam assigns a NEW AppID during restart, different from the one we initially created
self._safe_append_text(f"Re-detecting AppID for shortcut '{modlist_name}' after Steam restart...")
from jackify.backend.handlers.shortcut_handler import ShortcutHandler
shortcut_handler = ShortcutHandler(steamdeck=False)
from jackify.backend.services.platform_detection_service import PlatformDetectionService
platform_service = PlatformDetectionService.get_instance()
shortcut_handler = ShortcutHandler(steamdeck=platform_service.is_steamdeck)
current_appid = shortcut_handler.get_appid_for_shortcut(modlist_name, mo2_exe_path)
if not current_appid or not current_appid.isdigit():
@@ -2133,7 +2136,12 @@ class InstallModlistScreen(QWidget):
# Initialize ModlistHandler with correct parameters
path_handler = PathHandler()
modlist_handler = ModlistHandler(steamdeck=False, verbose=False)
# Use centralized Steam Deck detection
from jackify.backend.services.platform_detection_service import PlatformDetectionService
platform_service = PlatformDetectionService.get_instance()
modlist_handler = ModlistHandler(steamdeck=platform_service.is_steamdeck, verbose=False)
# Set required properties manually after initialization
modlist_handler.modlist_dir = install_dir
@@ -2351,15 +2359,21 @@ class InstallModlistScreen(QWidget):
self.context = updated_context # Ensure context is always set
debug_print(f"Updated context with new AppID: {new_appid}")
# Get Steam Deck detection once and pass to ConfigThread
from jackify.backend.services.platform_detection_service import PlatformDetectionService
platform_service = PlatformDetectionService.get_instance()
is_steamdeck = platform_service.is_steamdeck
# Create new config thread with updated context
class ConfigThread(QThread):
progress_update = Signal(str)
configuration_complete = Signal(bool, str, str)
error_occurred = Signal(str)
def __init__(self, context):
def __init__(self, context, is_steamdeck):
super().__init__()
self.context = context
self.is_steamdeck = is_steamdeck
def run(self):
try:
@@ -2368,8 +2382,8 @@ class InstallModlistScreen(QWidget):
from jackify.backend.models.modlist import ModlistContext
from pathlib import Path
# Initialize backend service
system_info = SystemInfo(is_steamdeck=False)
# Initialize backend service with passed Steam Deck detection
system_info = SystemInfo(is_steamdeck=self.is_steamdeck)
modlist_service = ModlistService(system_info)
# Convert context to ModlistContext for service
@@ -2416,7 +2430,7 @@ class InstallModlistScreen(QWidget):
self.error_occurred.emit(str(e))
# Start configuration thread
self.config_thread = ConfigThread(updated_context)
self.config_thread = ConfigThread(updated_context, is_steamdeck)
self.config_thread.progress_update.connect(self.on_configuration_progress)
self.config_thread.configuration_complete.connect(self.on_configuration_complete)
self.config_thread.error_occurred.connect(self.on_configuration_error)
@@ -2477,15 +2491,21 @@ class InstallModlistScreen(QWidget):
def _create_config_thread(self, context):
"""Create a new ConfigThread with proper lifecycle management"""
from PySide6.QtCore import QThread, Signal
# Get Steam Deck detection once
from jackify.backend.services.platform_detection_service import PlatformDetectionService
platform_service = PlatformDetectionService.get_instance()
is_steamdeck = platform_service.is_steamdeck
class ConfigThread(QThread):
progress_update = Signal(str)
configuration_complete = Signal(bool, str, str)
error_occurred = Signal(str)
def __init__(self, context, parent=None):
def __init__(self, context, is_steamdeck, parent=None):
super().__init__(parent)
self.context = context
self.is_steamdeck = is_steamdeck
def run(self):
try:
@@ -2494,8 +2514,8 @@ class InstallModlistScreen(QWidget):
from jackify.backend.models.modlist import ModlistContext
from pathlib import Path
# Initialize backend service
system_info = SystemInfo(is_steamdeck=False)
# Initialize backend service with passed Steam Deck detection
system_info = SystemInfo(is_steamdeck=self.is_steamdeck)
modlist_service = ModlistService(system_info)
# Convert context to ModlistContext for service
@@ -2544,7 +2564,7 @@ class InstallModlistScreen(QWidget):
self.progress_update.emit(f"DEBUG: {error_details}")
self.error_occurred.emit(str(e))
return ConfigThread(context, parent=self)
return ConfigThread(context, is_steamdeck, parent=self)
def handle_validation_failure(self, missing_text):
"""Handle failed validation with retry logic"""