Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix segfault #712

Merged
merged 3 commits into from
Jul 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
}
}

}

Loading