From 87faa319b2e49567b35e8fcc8258c9253ff3f107 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Sat, 27 Jul 2024 13:33:49 +0200 Subject: [PATCH 1/3] Update ChooseResolutionDialoque.qml --- .../configpopup/openhd_settings/ChooseResolutionDialoque.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml b/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml index 2f7f30c5f..4ad7ad990 100644 --- a/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml +++ b/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml @@ -15,7 +15,7 @@ Card { anchors.centerIn: parent cardName: "Resolution Selection" cardNameColor: "black" - visible: false + visible: true property string m_current_resolution_fps: "1920x1080@30" property bool m_is_for_secondary: false @@ -197,11 +197,14 @@ Card { console.log("Setting "+(m_is_for_secondary ? "CAM2" : "CAM1")+" to {"+selected_res_fps+"}"); if(m_is_for_secondary){ success=_airCameraSettingsModel2.try_update_parameter_string("RESOLUTION_FPS",selected_res_fps)==="" + console.log("debug1"); }else{ success=_airCameraSettingsModel.try_update_parameter_string("RESOLUTION_FPS",selected_res_fps)==="" + console.log("debug2"); } if(success){ _messageBoxInstance.set_text_and_show("Saved "+selected_res_fps); + console.log("debug3"); close(); }else{ _messageBoxInstance.set_text_and_show("Failed,please try again"); From 4cf6aa035dd19b7b9cef5e701f1cfe32cfd6cdca Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Sat, 27 Jul 2024 15:49:51 +0200 Subject: [PATCH 2/3] revert --- .../ChooseResolutionDialoque.qml | 96 +++++++------------ 1 file changed, 37 insertions(+), 59 deletions(-) diff --git a/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml b/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml index 4ad7ad990..009eba370 100644 --- a/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml +++ b/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml @@ -15,7 +15,7 @@ Card { anchors.centerIn: parent cardName: "Resolution Selection" cardNameColor: "black" - visible: true + visible: false property string m_current_resolution_fps: "1920x1080@30" property bool m_is_for_secondary: false @@ -92,23 +92,13 @@ Card { } - cardBody: Column { + cardBody: Column{ spacing: 10 padding: 10 - Text { + Text{ width: 200 - text: { - var camType = m_cam_type_as_string; - if (camType.length > 18) { - var underscoreIndex = camType.indexOf('_'); - if (underscoreIndex !== -1) { - camType = camType.substring(underscoreIndex + 1); - } - } - return "Your Camera: " + camType; - } + text: "Your Camera: "+m_cam_type_as_string; } - Text{ width: 200 text: "Default Resolution: "+m_default_resolution_fps @@ -168,58 +158,46 @@ Card { } } hasFooter: true - Item { + cardFooter: Item { anchors.fill: parent - anchors.top: parent.top - anchors.topMargin: 285 - - Rectangle { - width: parent.width - height: parent.height - color: "transparent" - - RowLayout { - anchors.centerIn: parent - - Button { - Layout.preferredWidth: 150 - text: "CANCEL" - onPressed: { + RowLayout{ + anchors.fill: parent + + Button{ + Layout.preferredWidth: 150 + text: "CANCEL" + onPressed: { + close(); + } + } + Button{ + Layout.preferredWidth: 150 + text: "SAVE" + onPressed: { + var success=false; + const selected_res_fps=get_user_selected_resolution(); + console.log("Setting "+(m_is_for_secondary ? "CAM2" : "CAM1")+" to {"+selected_res_fps+"}"); + if(m_is_for_secondary){ + success=_airCameraSettingsModel2.try_update_parameter_string("RESOLUTION_FPS",selected_res_fps)==="" + }else{ + success=_airCameraSettingsModel.try_update_parameter_string("RESOLUTION_FPS",selected_res_fps)==="" + } + if(success){ + _messageBoxInstance.set_text_and_show("Saved "+selected_res_fps); close(); + }else{ + _messageBoxInstance.set_text_and_show("Failed,please try again"); } } - Button{ - Layout.preferredWidth: 150 - text: "SAVE" - onPressed: { - var success=false; - const selected_res_fps=get_user_selected_resolution(); - console.log("Setting "+(m_is_for_secondary ? "CAM2" : "CAM1")+" to {"+selected_res_fps+"}"); - if(m_is_for_secondary){ - success=_airCameraSettingsModel2.try_update_parameter_string("RESOLUTION_FPS",selected_res_fps)==="" - console.log("debug1"); - }else{ - success=_airCameraSettingsModel.try_update_parameter_string("RESOLUTION_FPS",selected_res_fps)==="" - console.log("debug2"); - } - if(success){ - _messageBoxInstance.set_text_and_show("Saved "+selected_res_fps); - console.log("debug3"); - close(); - }else{ - _messageBoxInstance.set_text_and_show("Failed,please try again"); - } - } - enabled: { - if(argh_is_changing_model){ - return false; - } - const selected_res_fps=get_user_selected_resolution(); - return _cameraStreamModelPrimary.is_valid_resolution_fps_string(selected_res_fps) && selected_res_fps!=m_current_resolution_fps; + enabled: { + if(argh_is_changing_model){ + return false; } + const selected_res_fps=get_user_selected_resolution(); + return _cameraStreamModelPrimary.is_valid_resolution_fps_string(selected_res_fps) && selected_res_fps!=m_current_resolution_fps; } } } } - } + From 829f5e298b96aec9c9d13817b38300b2637e5b03 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Sat, 27 Jul 2024 16:40:50 +0200 Subject: [PATCH 3/3] fix ui bug --- .../openhd_settings/ChooseResolutionDialoque.qml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml b/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml index 009eba370..e83c24489 100644 --- a/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml +++ b/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml @@ -158,16 +158,18 @@ Card { } } hasFooter: true - cardFooter: Item { - anchors.fill: parent - RowLayout{ - anchors.fill: parent - - Button{ + cardFooter: + Item { + anchors.horizontalCenter: parent.horizontalCenter + RowLayout { + anchors.horizontalCenter: parent.horizontalCenter // Center the RowLayout horizontally within the parent + spacing: 20 // Add spacing between the buttons (optional) + + Button { Layout.preferredWidth: 150 text: "CANCEL" onPressed: { - close(); + close(); } } Button{