From f03da23b56bed065dace3cf3e7bf027f700e1085 Mon Sep 17 00:00:00 2001 From: Utkarsh Tiwari Date: Sun, 7 Aug 2022 00:34:30 +0530 Subject: qcam: Use QDialog for selection of cameras at startup Currently we use QInputDialog convenience dialogs to allow the user to select a camera. This doesn't allow adding of more information (such as camera location, model etc). Create a QDialog with a QFormLayout that shows a QComboBox with camera Ids. Use a QDialogButtonBox to provide buttons for accepting and cancelling the action. The CameraSelectorDialog is only initialized the first time when the MainWindow is created. From this commit we cease to auto select the camera if only a single camera is available to libcamera. We would always display the selection dialog with the exception being that being if the camera is supplied on the command line. Signed-off-by: Utkarsh Tiwari Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/qcam/main_window.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/qcam/main_window.h') diff --git a/src/qcam/main_window.h b/src/qcam/main_window.h index fc70920f..e17c8010 100644 --- a/src/qcam/main_window.h +++ b/src/qcam/main_window.h @@ -33,6 +33,7 @@ class QAction; class QComboBox; +class CameraSelectorDialog; class Image; class HotplugEvent; @@ -99,6 +100,8 @@ private: QString title_; QTimer titleTimer_; + CameraSelectorDialog *cameraSelectorDialog_; + /* Options */ const OptionsParser::Options &options_; -- cgit v1.2.1