mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 03:27:33 +08:00
[release] remove useless empty conf strings and prevent addgin them to non-released airframes. Solves #2177 (#2178)
This commit is contained in:
committed by
Gautier Hattenberger
parent
d3110685cd
commit
62bb3cafaa
@@ -170,9 +170,7 @@ let save_callback = fun ?user_save gui ac_combo tree tree_modules () ->
|
|||||||
GToolbox.message_box ~title:"Error on A/C id" "A/C id must be a non null number less than 255"
|
GToolbox.message_box ~title:"Error on A/C id" "A/C id must be a non null number less than 255"
|
||||||
else
|
else
|
||||||
let color = !current_color in
|
let color = !current_color in
|
||||||
let aircraft =
|
let attribs = ["name", ac_name;
|
||||||
Xml.Element ("aircraft",
|
|
||||||
[ "name", ac_name;
|
|
||||||
"ac_id", ac_id;
|
"ac_id", ac_id;
|
||||||
"airframe", gui#label_airframe#text;
|
"airframe", gui#label_airframe#text;
|
||||||
"radio", gui#label_radio#text;
|
"radio", gui#label_radio#text;
|
||||||
@@ -180,9 +178,9 @@ let save_callback = fun ?user_save gui ac_combo tree tree_modules () ->
|
|||||||
"flight_plan", gui#label_flight_plan#text;
|
"flight_plan", gui#label_flight_plan#text;
|
||||||
"settings", Gtk_tools.tree_values ~only_checked:false tree;
|
"settings", Gtk_tools.tree_values ~only_checked:false tree;
|
||||||
"settings_modules", Gtk_tools.tree_values ~only_checked:false tree_modules;
|
"settings_modules", Gtk_tools.tree_values ~only_checked:false tree_modules;
|
||||||
"gui_color", color;
|
"gui_color", color ] in
|
||||||
"release", gui#label_release#text ],
|
let attribs = if gui#label_release#text = "" then attribs else attribs @ ["release", gui#label_release#text ] in
|
||||||
[]) in
|
let aircraft = Xml.Element ("aircraft", attribs, []) in
|
||||||
begin try Hashtbl.remove Utils.aircrafts ac_name with _ -> () end;
|
begin try Hashtbl.remove Utils.aircrafts ac_name with _ -> () end;
|
||||||
Hashtbl.add Utils.aircrafts ac_name aircraft
|
Hashtbl.add Utils.aircrafts ac_name aircraft
|
||||||
end;
|
end;
|
||||||
|
|||||||
Reference in New Issue
Block a user