mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 16:42:47 +08:00
Catching the XML window savage destroy
This commit is contained in:
@@ -480,10 +480,18 @@ module Edit = struct
|
||||
| None -> f ()
|
||||
|
||||
|
||||
let close_fp = fun geomap () ->
|
||||
match !current_fp with
|
||||
None -> () (* Nothing to close *)
|
||||
| Some (fp, filename) ->
|
||||
fp#destroy ();
|
||||
current_fp := None
|
||||
|
||||
let load_xml_fp = fun geomap ?(xml_file=path_fps) xml ->
|
||||
set_georef_if_none geomap (georef_of_fp xml);
|
||||
let fp = new MapFP.flight_plan geomap "red" fp_dtd xml in
|
||||
fp#show_xml ();
|
||||
fp#window#show ();
|
||||
ignore (fp#window#connect#destroy ~callback:(close_fp geomap));
|
||||
current_fp := Some (fp,xml_file);
|
||||
fp
|
||||
|
||||
@@ -544,12 +552,6 @@ module Edit = struct
|
||||
| Some (fp,_) ->
|
||||
ignore (fp#add_waypoint geo)
|
||||
|
||||
let close_fp = fun geomap () ->
|
||||
match !current_fp with
|
||||
None -> () (* Nothing to close *)
|
||||
| Some (fp, filename) ->
|
||||
fp#destroy ();
|
||||
current_fp := None
|
||||
|
||||
let save_fp = fun geomap () ->
|
||||
match !current_fp with
|
||||
|
||||
@@ -113,7 +113,7 @@ class flight_plan = fun geomap color fp_dtd xml ->
|
||||
object
|
||||
val mutable max_dist_from_home = max_dist_from_home
|
||||
method georef = ref_wgs84
|
||||
method show_xml () = xml_window#show ()
|
||||
method window = xml_window
|
||||
method destroy () =
|
||||
wpts_group#group#destroy ();
|
||||
xml_window#destroy ()
|
||||
|
||||
@@ -38,7 +38,7 @@ class flight_plan :
|
||||
method hide : unit -> unit
|
||||
method index : XmlEdit.node -> int * MapWaypoints.waypoint
|
||||
method show : unit -> unit
|
||||
method show_xml : unit -> unit
|
||||
method window : GWindow.window
|
||||
method waypoints : XmlEdit.node list
|
||||
method xml : Xml.xml
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user