Skip to content

Commit

Permalink
fix segfault (#712)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle authored Jul 27, 2024
1 parent 9341c9a commit 2f11a31
Showing 1 changed file with 39 additions and 56 deletions.
95 changes: 39 additions & 56 deletions qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -168,55 +158,48 @@ Card {
}
}
hasFooter: true
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: {
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();
}
}
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)===""
}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");
}
}
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;
}
}
}
}

}

0 comments on commit 2f11a31

Please sign in to comment.