Skip to content

display cleaner name in camera selection#242

Merged
saeugetier merged 1 commit into
developfrom
feature/235-readable-camera-names-in-settings-menu
Feb 15, 2026
Merged

display cleaner name in camera selection#242
saeugetier merged 1 commit into
developfrom
feature/235-readable-camera-names-in-settings-menu

Conversation

@saeugetier

Copy link
Copy Markdown
Owner

This pull request standardizes how camera devices are represented and selected throughout the application. It changes the camera lists from simple strings to structured objects with separate text (display name) and value (unique identifier) fields, ensuring consistency across the UI, QML, and C++ backend. This improves the handling of camera selection and display, especially as more camera types are supported.

Camera device representation and selection:

  • Changed all camera list representations (for both GPhoto and Libcamera devices) from QStringList to QVariantList of objects with text and value fields in both the C++ backend (e.g., GPhotoCameraDevice::availableCameras, LibcameraDevice::availableCameras) and QML frontend. This enables richer, more consistent camera information in the UI. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Updated the QML camera selection UI (SettingsMenuForm.ui.qml, SettingsMenu.qml) to use the new textRole and valueRole properties, and to populate the camera list with objects instead of strings. [1] [2]
  • Modified event handling and logic in QML (Application.qml, CameraSource.qml) to use the new currentValue property for camera selection, and to compare/select cameras by their value field rather than by string equality. [1] [2] [3]

Backend improvements:

  • Enhanced the camera list entries in the backend to include a user-friendly display name (e.g., prefixing with GPhoto - or Libcamera - and using the camera model name when available) and a unique identifier for each camera. [1] [2]

Build/compatibility:

  • Added necessary Qt includes for QVariantList and QVariantMap to support the new camera object representation. [1] [2] [3]

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors camera device representation throughout the application from simple strings to structured objects with separate text (display name) and value (unique identifier) fields. This standardization improves consistency between the UI layer and backend, enabling cleaner display names (e.g., "GPhoto - Canon EOS" or "Libcamera - Model Name") while maintaining unique identifiers for device selection.

Changes:

  • Updated C++ backend methods (availableCameras()) to return QVariantList of objects with text and value fields instead of QStringList
  • Modified QML UI components to use ComboBox textRole/valueRole properties and currentValue for camera selection
  • Enhanced camera display names with prefixes ("GPhoto - ", "Libcamera - ") and model information when available

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/libcameracamera.h Changed return types from QStringList to QVariantList; added QVariantList include
src/libcameracamera.cpp Implemented structured camera objects with text/value fields; added QVariantMap include and property retrieval
src/gphotocamera.h Changed return types from QStringList to QVariantList; added QVariantList include
src/gphotocamera.cpp Implemented structured camera objects with text/value fields for GPhoto devices
qml/content/CameraSource.qml Updated camera matching logic to use .value property; fixed loop variable shadowing
qml/SettingsMenuForm.ui.qml Added textRole and valueRole to ComboBox for proper display/value separation
qml/SettingsMenu.qml Updated camera list population to create objects with text/value properties
qml/Application.qml Changed event handler from onCurrentTextChanged to onCurrentValueChanged

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/gphotocamera.cpp
@saeugetier saeugetier merged commit 498d901 into develop Feb 15, 2026
8 checks passed
@saeugetier saeugetier linked an issue Feb 15, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Readable camera names in settings menu

2 participants