Sync from development - prepare for v0.2.0.8

This commit is contained in:
Omni
2025-12-29 19:55:38 +00:00
parent 5869a896a8
commit 2511c9334c
8 changed files with 321 additions and 137 deletions

View File

@@ -32,6 +32,7 @@ def debug_print(message):
class ConfigureExistingModlistScreen(QWidget):
steam_restart_finished = Signal(bool, str)
resize_request = Signal(str)
def __init__(self, stacked_widget=None, main_menu_index=0):
super().__init__()
debug_print("DEBUG: ConfigureExistingModlistScreen __init__ called")
@@ -220,27 +221,49 @@ class ConfigureExistingModlistScreen(QWidget):
if self.debug:
user_config_widget.setStyleSheet("border: 2px solid orange;")
user_config_widget.setToolTip("USER_CONFIG_WIDGET")
# Right: Activity window (FileProgressList widget)
# Fixed size policy to prevent shrinking when window expands
# Right: Tabbed interface with Activity and Process Monitor
# Both tabs are always available, user can switch between them
self.process_monitor = QTextEdit()
self.process_monitor.setReadOnly(True)
self.process_monitor.setTextInteractionFlags(Qt.TextSelectableByMouse | Qt.TextSelectableByKeyboard)
self.process_monitor.setMinimumSize(QSize(300, 20))
self.process_monitor.setStyleSheet(f"background: #222; color: {JACKIFY_COLOR_BLUE}; font-family: monospace; font-size: 11px; border: 1px solid #444;")
self.process_monitor_heading = QLabel("<b>[Process Monitor]</b>")
self.process_monitor_heading.setStyleSheet(f"color: {JACKIFY_COLOR_BLUE}; font-size: 13px; margin-bottom: 2px;")
self.process_monitor_heading.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
process_vbox = QVBoxLayout()
process_vbox.setContentsMargins(0, 0, 0, 0)
process_vbox.setSpacing(2)
process_vbox.addWidget(self.process_monitor_heading)
process_vbox.addWidget(self.process_monitor)
process_monitor_widget = QWidget()
process_monitor_widget.setLayout(process_vbox)
process_monitor_widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
if self.debug:
process_monitor_widget.setStyleSheet("border: 2px solid purple;")
process_monitor_widget.setToolTip("PROCESS_MONITOR")
self.process_monitor_widget = process_monitor_widget
# Set up File Progress List (Activity tab)
self.file_progress_list.setMinimumSize(QSize(300, 20))
self.file_progress_list.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
activity_widget = QWidget()
activity_layout = QVBoxLayout()
activity_layout.setContentsMargins(0, 0, 0, 0)
activity_layout.setSpacing(0)
activity_layout.addWidget(self.file_progress_list)
activity_widget.setLayout(activity_layout)
# Create tab widget to hold both Activity and Process Monitor
self.activity_tabs = QTabWidget()
self.activity_tabs.setStyleSheet("QTabWidget::pane { background: #222; border: 1px solid #444; } QTabBar::tab { background: #222; color: #ccc; padding: 6px 16px; } QTabBar::tab:selected { background: #333; color: #3fd0ea; } QTabWidget { margin: 0px; padding: 0px; } QTabBar { margin: 0px; padding: 0px; }")
self.activity_tabs.setContentsMargins(0, 0, 0, 0)
self.activity_tabs.setDocumentMode(False)
self.activity_tabs.setTabPosition(QTabWidget.North)
if self.debug:
activity_widget.setStyleSheet("border: 2px solid purple;")
activity_widget.setToolTip("ACTIVITY_WINDOW")
upper_hbox.addWidget(user_config_widget, stretch=11)
upper_hbox.addWidget(activity_widget, stretch=9)
self.activity_tabs.setStyleSheet("border: 2px solid cyan;")
self.activity_tabs.setToolTip("ACTIVITY_TABS")
# Keep legacy process monitor hidden (for compatibility with existing code)
self.process_monitor = QTextEdit()
self.process_monitor.setReadOnly(True)
self.process_monitor.setVisible(False) # Hidden in compact mode
# Add both widgets as tabs
self.activity_tabs.addTab(self.file_progress_list, "Activity")
self.activity_tabs.addTab(process_monitor_widget, "Process Monitor")
upper_hbox.addWidget(user_config_widget, stretch=11)
upper_hbox.addWidget(self.activity_tabs, stretch=9)
upper_hbox.setAlignment(Qt.AlignTop)
upper_section_widget = QWidget()
upper_section_widget.setLayout(upper_hbox)
@@ -490,6 +513,42 @@ class ConfigureExistingModlistScreen(QWidget):
except Exception:
pass
def _handle_progress_update(self, text):
"""Handle progress updates - update console, activity window, and progress indicator"""
# Always append to console
self._safe_append_text(text)
# Parse the message to update UI widgets
message_lower = text.lower()
# Update progress indicator based on key status messages
if "creating steam shortcut" in message_lower:
self.progress_indicator.set_status("Creating Steam shortcut...", 10)
elif "restarting steam" in message_lower or "restart steam" in message_lower:
self.progress_indicator.set_status("Restarting Steam...", 20)
elif "steam restart" in message_lower and "success" in message_lower:
self.progress_indicator.set_status("Steam restarted successfully", 30)
elif "creating proton prefix" in message_lower or "prefix creation" in message_lower:
self.progress_indicator.set_status("Creating Proton prefix...", 50)
elif "prefix created" in message_lower or "prefix creation" in message_lower and "success" in message_lower:
self.progress_indicator.set_status("Proton prefix created", 70)
elif "verifying" in message_lower:
self.progress_indicator.set_status("Verifying setup...", 80)
elif "steam integration complete" in message_lower or "configuration complete" in message_lower:
self.progress_indicator.set_status("Configuration complete", 95)
elif "complete" in message_lower and not "prefix" in message_lower:
self.progress_indicator.set_status("Finishing up...", 90)
# Update activity window with generic configuration status
# Only update if message contains meaningful progress (not blank lines or separators)
if text.strip() and not text.strip().startswith('='):
# Show generic "Configuring modlist..." in activity window
self.file_progress_list.update_files(
[],
current_phase="Configuring",
summary_info={"current": 1, "total": 1, "label": "Setting up modlist"}
)
def _safe_append_text(self, text):
"""Append text with professional auto-scroll behavior"""
# Write all messages to log file
@@ -660,7 +719,7 @@ class ConfigureExistingModlistScreen(QWidget):
# Create and start the configuration thread
self.config_thread = ConfigurationThread(modlist_name, install_dir, resolution)
self.config_thread.progress_update.connect(self._safe_append_text)
self.config_thread.progress_update.connect(self._handle_progress_update)
self.config_thread.configuration_complete.connect(self.on_configuration_complete)
self.config_thread.error_occurred.connect(self.on_configuration_error)
self.config_thread.start()