feat: add loadout selection dialog when starting session
- Modified on_start_session to show LoadoutSelectionDialog first - Added _on_loadout_selected_for_session callback - User can now select a loadout or skip before session starts - Selected loadout info is logged and stored for session
This commit is contained in:
parent
fb0d1b4e40
commit
c71f6a8647
|
|
@ -1165,8 +1165,29 @@ class MainWindow(QMainWindow):
|
||||||
self.log_error("EventQueue", f"Error processing event: {e}")
|
self.log_error("EventQueue", f"Error processing event: {e}")
|
||||||
|
|
||||||
def on_start_session(self):
|
def on_start_session(self):
|
||||||
"""Handle start session button."""
|
"""Handle start session button - shows loadout selection first."""
|
||||||
if self.current_project and self.session_state == SessionState.IDLE:
|
if self.current_project and self.session_state == SessionState.IDLE:
|
||||||
|
# Show loadout selection dialog
|
||||||
|
from ui.loadout_selection_dialog import LoadoutSelectionDialog
|
||||||
|
dialog = LoadoutSelectionDialog(self)
|
||||||
|
dialog.loadout_selected.connect(self._on_loadout_selected_for_session)
|
||||||
|
dialog.rejected.connect(lambda: self.log_info("Session", "Session start cancelled - no loadout selected"))
|
||||||
|
dialog.exec()
|
||||||
|
|
||||||
|
def _on_loadout_selected_for_session(self, loadout_id: int, loadout_name: str):
|
||||||
|
"""Handle loadout selection and start session."""
|
||||||
|
if loadout_id > 0:
|
||||||
|
self.log_info("Session", f"Starting session with loadout: {loadout_name} (ID: {loadout_id})")
|
||||||
|
# Store the selected loadout ID for use in start_session
|
||||||
|
self._session_loadout_id = loadout_id
|
||||||
|
self._session_loadout_name = loadout_name
|
||||||
|
else:
|
||||||
|
self.log_info("Session", "Starting session without loadout")
|
||||||
|
self._session_loadout_id = None
|
||||||
|
self._session_loadout_name = None
|
||||||
|
|
||||||
|
# Now start the session
|
||||||
|
if self.current_project:
|
||||||
self.start_session(self.current_project.id)
|
self.start_session(self.current_project.id)
|
||||||
|
|
||||||
def on_stop_session(self):
|
def on_stop_session(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue