Added a Start/Stop button to the training window, allowing users to configure their training settings before starting a session.
Previously, the training session would start immediately when the training window opened or settings were changed. This didn't give users time to:
- Review and adjust session settings
- Select the appropriate session number
- Choose the practice type (Characters, Words, Q-Codes, Mixed)
- Configure Random Blocks mode parameters
- Select Sending vs Listening practice mode
Added a training session state that separates configuration from active training:
- Configuration Mode (session not started): Users can adjust all settings
- Active Training Mode (session started): Practice exercises are displayed
- Added
training_session_active: booltoAppState - Default value:
false(not started)
- Large, prominent button in the center of the training window
- Green color when stopped: "▶ Start Training Session"
- Red color when active: "⏹ Stop Training Session"
- Toggles between configuration and active training modes
- All training settings now grouped in a configuration panel
- Settings remain accessible but won't regenerate content until session is started
- Settings include:
- Session selection (1-26)
- Practice type selection
- Random Blocks mode toggle and settings
- Training mode selection (Sending/Listening)
When clicking "Start Training Session":
training_session_active=truetraining_mode=true(enables training features)- Clears any previous training state
- Generates first training item based on settings
- Shows training content area
- Training exercises are displayed
- Configuration settings still visible but changes only apply to new items
- User can practice sending or listening
- Statistics are tracked
When clicking "Stop Training Session":
training_session_active=falsetraining_mode=false- Clears all training state (decoded text, answers, timers)
- Returns to configuration mode
- Hides training content
- Before Start: Shows message "Configure your training settings above, then click Start!"
- After Start: Shows full training interface (practice text, play buttons, statistics, etc.)
-
Open Training Window
- Click "🎓 Open Training Window" in main window
-
Configure Settings
- Select Session (e.g., Session 5)
- Choose Practice Type (e.g., "Mixed")
- Optional: Enable Random Blocks mode
- Choose Training Mode (Sending or Listening)
-
Start Session
- Click "▶ Start Training Session" button
- Training content appears immediately
- First exercise is generated
-
Practice
- For Sending: Practice sending the displayed text
- For Listening: Play morse code and decode it
- Statistics are tracked automatically
-
Stop Session (Optional)
- Click "⏹ Stop Training Session" to end
- Can reconfigure settings and start a new session
- No Rushed Configuration: Take time to set up training parameters properly
- Clear Intent: Explicit action required to start training
- Easy Reset: Stop and restart with new settings anytime
- Better UX: Separates setup from active practice
- No Accidental Starts: Training won't begin until user is ready
- Session Control: Clear start and stop points for training sessions
training_session_activecontrols visibility of training content- Separate from
training_modewhich controls broader training features - Both must be true for active training
- Settings changes during active session only affect new items
- Previous training state is preserved during configuration changes
- Fresh start when session is stopped and restarted
- State changes are properly synchronized with Arc<Mutex>
- Lock is dropped before spawning audio playback threads
Possible improvements:
- Session timer (how long user has been practicing)
- Session statistics summary on stop
- Auto-save last session configuration
- Session pause/resume functionality
- Multiple session presets