Implement the logic for capturing and saving photos from the live preview stream.
- Add `save_photo` method to `MediaRepository` to handle file saving and database updates.
- `MainController` now tracks the selected color and the latest camera frame.
- The "Take Photo" button is enabled only when a color is selected.
- Pressing the button saves the current preview frame to the correct media folder and refreshes the thumbnail list.
- Fixes indentation issues in `main_controller.py` caused by previous faulty replacements.
Refactor camera control logic in `MainController` to use the State design pattern.
- Create a new `core/camera/states.py` module with state classes (`NoCamerasState`, `DetectingState`, `ReadyToStreamState`, `StreamingState`).
- `MainController` now acts as a context, delegating actions to the current state object.
- This replaces complex conditional logic with a robust, scalable, and maintainable state machine, making it easier to manage camera behavior and add new states in the future.
Refactor the database handling to use a Singleton pattern for `DatabaseManager`.
- A single, module-level instance `db_manager` is created in `core/database.py` to ensure one database connection is used throughout the application.
- `MediaRepository` and `MainController` are updated to use this shared instance instead of creating their own.
- This simplifies dependency injection and prevents potential issues with multiple database connections.
- Also, update `review.md` to reflect the progress.
Refactor the signal handling for the camera start/stop button in `MainController` to simplify logic and improve reliability.
- Replaced the dynamic connect/disconnect pattern with a single, persistent signal connection to `_on_start_button_clicked`.
- Centralized UI state updates (e.g., button text) into a new `_update_start_button_state` method.
- This eliminates potential errors from mismatched signal connections and makes the control flow easier to follow.
- Also fixes major indentation errors caused by a previous faulty replacement.
Refactor the image rotation mechanism in the `SplitView` widget to prevent image quality degradation.
- The original reference pixmap is now stored in `self.original_ref_pixmap`.
- Rotations are always applied to the original, unmodified pixmap, using a cumulative rotation angle.
- This avoids sequential transformations that caused gradual quality loss.
- Also fixes indentation issues caused by previous automated replacements.
Create a new `settings.py` file to define and manage global application paths.
Modify UI components (`split_view_widget.py`, `view_settings_dialog.py`) to use the centralized `ICONS_DIR` path constant instead of hardcoded relative paths for icons. This improves maintainability and makes the application independent of the working directory.