Sync from development - prepare for v0.1.5

This commit is contained in:
Omni
2025-09-26 12:45:21 +01:00
parent c9bd6f60e6
commit f46ed2c0fe
26 changed files with 20459 additions and 2522 deletions

View File

@@ -131,7 +131,6 @@ DISCLAIMER_TEXT = (
MENU_ITEMS = [
("Modlist Tasks", "modlist_tasks"),
("Tuxborn Automatic Installer", "tuxborn_installer"),
("Hoolamike Tasks", "hoolamike_tasks"),
("Additional Tasks", "additional_tasks"),
("Exit Jackify", "exit_jackify"),
@@ -162,6 +161,8 @@ class SettingsDialog(QDialog):
try:
super().__init__(parent)
from jackify.backend.handlers.config_handler import ConfigHandler
import logging
self.logger = logging.getLogger(__name__)
self.config_handler = ConfigHandler()
self._original_debug_mode = self.config_handler.get('debug_mode', False)
self.setWindowTitle("Settings")
@@ -627,7 +628,18 @@ class SettingsDialog(QDialog):
self.config_handler.set("proton_path", resolved_path)
self.config_handler.set("proton_version", resolved_version)
self.config_handler.save_config()
# Force immediate save and verify
save_result = self.config_handler.save_config()
if not save_result:
self.logger.error("Failed to save Proton configuration")
else:
self.logger.info(f"Saved Proton config: path={resolved_path}, version={resolved_version}")
# Verify the save worked by reading it back
saved_path = self.config_handler.get("proton_path")
if saved_path != resolved_path:
self.logger.error(f"Config save verification failed: expected {resolved_path}, got {saved_path}")
else:
self.logger.debug("Config save verified successfully")
# Refresh cached paths in GUI screens if Jackify directory changed
self._refresh_gui_paths()
@@ -664,7 +676,6 @@ class SettingsDialog(QDialog):
getattr(main_window, 'install_modlist_screen', None),
getattr(main_window, 'configure_new_modlist_screen', None),
getattr(main_window, 'configure_existing_modlist_screen', None),
getattr(main_window, 'tuxborn_screen', None),
]
for screen in screens_to_refresh:
@@ -773,7 +784,7 @@ class JackifyMainWindow(QMainWindow):
# Create screens using refactored codebase
from jackify.frontends.gui.screens import (
MainMenu, TuxbornInstallerScreen, ModlistTasksScreen,
MainMenu, ModlistTasksScreen,
InstallModlistScreen, ConfigureNewModlistScreen, ConfigureExistingModlistScreen
)
@@ -785,31 +796,26 @@ class JackifyMainWindow(QMainWindow):
main_menu_index=0,
dev_mode=dev_mode
)
self.tuxborn_screen = TuxbornInstallerScreen(
stacked_widget=self.stacked_widget,
self.install_modlist_screen = InstallModlistScreen(
stacked_widget=self.stacked_widget,
main_menu_index=0
)
self.install_modlist_screen = InstallModlistScreen(
stacked_widget=self.stacked_widget,
main_menu_index=3
)
self.configure_new_modlist_screen = ConfigureNewModlistScreen(
stacked_widget=self.stacked_widget,
main_menu_index=3
stacked_widget=self.stacked_widget,
main_menu_index=0
)
self.configure_existing_modlist_screen = ConfigureExistingModlistScreen(
stacked_widget=self.stacked_widget,
main_menu_index=3
stacked_widget=self.stacked_widget,
main_menu_index=0
)
# Add screens to stacked widget
self.stacked_widget.addWidget(self.main_menu) # Index 0: Main Menu
self.stacked_widget.addWidget(self.tuxborn_screen) # Index 1: Tuxborn Installer
self.stacked_widget.addWidget(self.feature_placeholder) # Index 2: Placeholder
self.stacked_widget.addWidget(self.modlist_tasks_screen) # Index 3: Modlist Tasks
self.stacked_widget.addWidget(self.install_modlist_screen) # Index 4: Install Modlist
self.stacked_widget.addWidget(self.configure_new_modlist_screen) # Index 5: Configure New
self.stacked_widget.addWidget(self.configure_existing_modlist_screen) # Index 6: Configure Existing
self.stacked_widget.addWidget(self.feature_placeholder) # Index 1: Placeholder
self.stacked_widget.addWidget(self.modlist_tasks_screen) # Index 2: Modlist Tasks
self.stacked_widget.addWidget(self.install_modlist_screen) # Index 3: Install Modlist
self.stacked_widget.addWidget(self.configure_new_modlist_screen) # Index 4: Configure New
self.stacked_widget.addWidget(self.configure_existing_modlist_screen) # Index 5: Configure Existing
# Add debug tracking for screen changes
self.stacked_widget.currentChanged.connect(self._debug_screen_change)
@@ -887,12 +893,11 @@ class JackifyMainWindow(QMainWindow):
screen_names = {
0: "Main Menu",
1: "Tuxborn Installer",
2: "Feature Placeholder",
3: "Modlist Tasks Menu",
4: "Install Modlist Screen",
5: "Configure New Modlist",
6: "Configure Existing Modlist"
1: "Feature Placeholder",
2: "Modlist Tasks Menu",
3: "Install Modlist Screen",
4: "Configure New Modlist",
5: "Configure Existing Modlist"
}
screen_name = screen_names.get(index, f"Unknown Screen (Index {index})")
widget = self.stacked_widget.widget(index)
@@ -1002,7 +1007,7 @@ class JackifyMainWindow(QMainWindow):
# Clean up screen processes
screens = [
self.modlist_tasks_screen, self.tuxborn_screen, self.install_modlist_screen,
self.modlist_tasks_screen, self.install_modlist_screen,
self.configure_new_modlist_screen, self.configure_existing_modlist_screen
]
for screen in screens:
@@ -1072,7 +1077,18 @@ def main():
# Command-line --debug always takes precedence
if '--debug' in sys.argv or '-d' in sys.argv:
debug_mode = True
# Temporarily save CLI debug flag to config so engine can see it
config_handler.set('debug_mode', True)
print("[DEBUG] CLI --debug flag detected, saved debug_mode=True to config")
import logging
# Initialize file logging on root logger so all modules inherit it
from jackify.shared.logging import LoggingHandler
logging_handler = LoggingHandler()
# Rotate log file before setting up new logger
logging_handler.rotate_log_for_logger('jackify_gui', 'jackify-gui.log')
root_logger = logging_handler.setup_logger('', 'jackify-gui.log', is_general=True) # Empty name = root logger
if debug_mode:
logging.getLogger().setLevel(logging.DEBUG)
print("[Jackify] Debug mode enabled (from config or CLI)")

View File

@@ -5,7 +5,6 @@ Contains all the GUI screen components for Jackify.
"""
from .main_menu import MainMenu
from .tuxborn_installer import TuxbornInstallerScreen
from .modlist_tasks import ModlistTasksScreen
from .install_modlist import InstallModlistScreen
from .configure_new_modlist import ConfigureNewModlistScreen
@@ -13,7 +12,6 @@ from .configure_existing_modlist import ConfigureExistingModlistScreen
__all__ = [
'MainMenu',
'TuxbornInstallerScreen',
'ModlistTasksScreen',
'InstallModlistScreen',
'ConfigureNewModlistScreen',

View File

@@ -119,7 +119,7 @@ class ConfigureExistingModlistScreen(QWidget):
self.shortcut_combo.addItem("Please Select...")
self.shortcut_map = []
for shortcut in self.mo2_shortcuts:
display = f"{shortcut.get('AppName', 'Unknown')} ({shortcut.get('StartDir', '')})"
display = f"{shortcut.get('AppName', shortcut.get('appname', 'Unknown'))} ({shortcut.get('StartDir', shortcut.get('startdir', ''))})"
self.shortcut_combo.addItem(display)
self.shortcut_map.append(shortcut)
@@ -427,8 +427,8 @@ class ConfigureExistingModlistScreen(QWidget):
self._enable_controls_after_operation()
return
shortcut = self.shortcut_map[idx]
modlist_name = shortcut.get('AppName', '')
install_dir = shortcut.get('StartDir', '')
modlist_name = shortcut.get('AppName', shortcut.get('appname', ''))
install_dir = shortcut.get('StartDir', shortcut.get('startdir', ''))
if not modlist_name or not install_dir:
MessageService.critical(self, "Invalid Shortcut", "The selected shortcut is missing required information.", safety_level="medium")
self._enable_controls_after_operation()
@@ -710,7 +710,7 @@ class ConfigureExistingModlistScreen(QWidget):
self.shortcut_map.clear()
for shortcut in self.mo2_shortcuts:
display = f"{shortcut.get('AppName', 'Unknown')} ({shortcut.get('StartDir', '')})"
display = f"{shortcut.get('AppName', shortcut.get('appname', 'Unknown'))} ({shortcut.get('StartDir', shortcut.get('startdir', ''))})"
self.shortcut_combo.addItem(display)
self.shortcut_map.append(shortcut)

View File

@@ -481,7 +481,7 @@ class ConfigureNewModlistScreen(QWidget):
def go_back(self):
if self.stacked_widget:
self.stacked_widget.setCurrentIndex(3) # Return to Modlist Tasks menu
self.stacked_widget.setCurrentIndex(self.main_menu_index)
def update_top_panel(self):
try:

View File

@@ -1057,7 +1057,7 @@ class InstallModlistScreen(QWidget):
def go_back(self):
if self.stacked_widget:
self.stacked_widget.setCurrentIndex(3) # Return to Modlist Tasks menu
self.stacked_widget.setCurrentIndex(self.main_menu_index)
def update_top_panel(self):
try:
@@ -1746,7 +1746,7 @@ class InstallModlistScreen(QWidget):
# Save resolution for later use in configuration
resolution = self.resolution_combo.currentText()
self._current_resolution = resolution.split()[0] if resolution != "Leave unchanged" else "2560x1600"
self._current_resolution = resolution.split()[0] if resolution != "Leave unchanged" else None
# Use automated prefix creation instead of manual steps
debug_print("DEBUG: Starting automated prefix creation workflow")
@@ -2321,7 +2321,7 @@ class InstallModlistScreen(QWidget):
'mo2_exe_path': self._get_mo2_path(install_dir, modlist_name),
'modlist_value': None,
'modlist_source': None,
'resolution': getattr(self, '_current_resolution', '2560x1600'),
'resolution': getattr(self, '_current_resolution', None),
'skip_confirmation': True,
'manual_steps_completed': True, # Mark as completed since automated prefix is done
'appid': new_appid, # Use the NEW AppID from automated prefix creation
@@ -2360,7 +2360,7 @@ class InstallModlistScreen(QWidget):
nexus_api_key='', # Not needed for configuration
modlist_value=self.context.get('modlist_value'),
modlist_source=self.context.get('modlist_source', 'identifier'),
resolution=self.context.get('resolution', '2560x1600'),
resolution=self.context.get('resolution'),
skip_confirmation=True,
engine_installed=True # Skip path manipulation for engine workflows
)
@@ -2419,7 +2419,7 @@ class InstallModlistScreen(QWidget):
'mo2_exe_path': self._get_mo2_path(install_dir, modlist_name),
'modlist_value': None,
'modlist_source': None,
'resolution': getattr(self, '_current_resolution', '2560x1600'),
'resolution': getattr(self, '_current_resolution', None),
'skip_confirmation': True,
'manual_steps_completed': True, # Mark as completed
'appid': new_appid # Use the NEW AppID from Steam

View File

@@ -120,7 +120,7 @@ class MainMenu(QWidget):
msg.setIcon(QMessageBox.Information)
msg.exec()
elif action_id == "modlist_tasks" and self.stacked_widget:
self.stacked_widget.setCurrentIndex(3)
self.stacked_widget.setCurrentIndex(2)
elif action_id == "return_main_menu":
# This is the main menu, so do nothing
pass

View File

@@ -198,11 +198,11 @@ class ModlistTasksScreen(QWidget):
if action_id == "return_main_menu":
self.stacked_widget.setCurrentIndex(0)
elif action_id == "install_modlist":
self.stacked_widget.setCurrentIndex(4)
self.stacked_widget.setCurrentIndex(3)
elif action_id == "configure_new_modlist":
self.stacked_widget.setCurrentIndex(5)
self.stacked_widget.setCurrentIndex(4)
elif action_id == "configure_existing_modlist":
self.stacked_widget.setCurrentIndex(6)
self.stacked_widget.setCurrentIndex(5)
def go_back(self):
"""Return to main menu"""

File diff suppressed because it is too large Load Diff