20 Commits

Author SHA1 Message Date
02edb186bb feat: Implement photo capture functionality
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.
2025-10-14 10:04:01 +02:00
47c1e6040a feat: Implement State pattern for camera logic
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.
2025-10-14 09:03:19 +02:00
c8d9029df7 refactor: Implement Singleton pattern for DatabaseManager
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.
2025-10-14 08:55:45 +02:00
96c2495a8b refactor(MainController): Simplify camera button signal handling
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.
2025-10-14 08:49:20 +02:00
bbdb7d3459 delete unused files 2025-10-14 08:27:40 +02:00
0bc6c01e7e refactor: enhance camera rotation functionality and integrate with live view 2025-10-13 20:54:04 +02:00
4d00f83083 refactor: update camera start button behavior to handle camera detection and live view 2025-10-13 19:39:34 +02:00
c6345c569d refactor: update camera control signals and improve live view handling 2025-10-13 05:14:27 +02:00
ce1b864b17 refactor: streamline MainController initialization and signal connections 2025-10-12 19:02:53 +02:00
d63d616675 working on camera-manager 2025-10-12 10:31:40 +02:00
c815762f72 refactor: enhance mock camera classes and update camera detection logic 2025-10-09 18:47:17 +02:00
ca25b06f99 refactor: implement CameraManager class with methods for detecting GPhoto and OpenCV cameras 2025-10-01 18:26:41 +02:00
19e2c7977c feat: read gphoto config 2025-09-21 18:46:38 +02:00
508930ae39 feat: implement camera management with GPhotoCamera and CameraManager classes 2025-09-21 08:38:26 +02:00
2187536c7d refactor: update camera handling with mock implementation and improve signal connections 2025-09-15 20:58:05 +02:00
e006fea037 add CameraWorker and CameraController classes for handling camera operations in a separate thread 2025-09-09 19:20:12 +02:00
6acb690f16 add split view widget and integrate photo button functionality in main controller 2025-09-09 19:19:50 +02:00
ab266c2767 connect thumbnail selection signal to main controller; enhance thumbnail handling with media ID 2025-09-07 20:32:56 +02:00
2072cd8c93 connect color selection and editing signals to main controller; enhance thumbnail loading 2025-09-07 20:00:38 +02:00
b9caf46104 refactor main controller and main window to streamline color loading and widget initialization 2025-09-07 13:23:22 +02:00