mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 06:54:49 +08:00
[pprzcenter] add autosave on quit checkbox in menu
This commit is contained in:
@@ -160,6 +160,15 @@
|
|||||||
<signal name="activate" handler="on_save1_activate"/>
|
<signal name="activate" handler="on_save1_activate"/>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkCheckMenuItem" id="menu_item_always_keep_changes">
|
||||||
|
<property name="label">Autosave on quit</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="use_action_appearance">False</property>
|
||||||
|
<signal name="activate" handler="on_keep_changes_activate"/>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkImageMenuItem" id="menu_item_new_target">
|
<widget class="GtkImageMenuItem" id="menu_item_new_target">
|
||||||
<property name="label">New build target</property>
|
<property name="label">New build target</property>
|
||||||
|
|||||||
@@ -176,6 +176,10 @@ let quit_window_callback = fun gui ac_combo session_combo target_combo _ ->
|
|||||||
quit_button_callback gui ac_combo session_combo target_combo ~confirm_quit:false ();
|
quit_button_callback gui ac_combo session_combo target_combo ~confirm_quit:false ();
|
||||||
true
|
true
|
||||||
|
|
||||||
|
let keep_changes_callback = fun gui _ ->
|
||||||
|
always_keep_changes := gui#menu_item_always_keep_changes#active;
|
||||||
|
()
|
||||||
|
|
||||||
(************************** Main *********************************************)
|
(************************** Main *********************************************)
|
||||||
let () =
|
let () =
|
||||||
let session = ref ""
|
let session = ref ""
|
||||||
@@ -280,6 +284,9 @@ let () =
|
|||||||
|
|
||||||
let session_combo, execute_session = CP.supervision ~file gui log ac_combo target_combo in
|
let session_combo, execute_session = CP.supervision ~file gui log ac_combo target_combo in
|
||||||
|
|
||||||
|
(* Autosave on quit check box *)
|
||||||
|
ignore (gui#menu_item_always_keep_changes#connect#toggled ~callback:(keep_changes_callback gui));
|
||||||
|
|
||||||
(* Quit button *)
|
(* Quit button *)
|
||||||
ignore (gui#menu_item_quit#connect#activate ~callback:(quit_button_callback gui ac_combo session_combo target_combo));
|
ignore (gui#menu_item_quit#connect#activate ~callback:(quit_button_callback gui ac_combo session_combo target_combo));
|
||||||
|
|
||||||
@@ -342,6 +349,8 @@ let () =
|
|||||||
read_preferences gui Env.gconf_file ac_combo session_combo target_combo
|
read_preferences gui Env.gconf_file ac_combo session_combo target_combo
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
gui#menu_item_always_keep_changes#set_active !always_keep_changes;
|
||||||
|
|
||||||
(* Run the command line session *)
|
(* Run the command line session *)
|
||||||
if !session <> "" then begin
|
if !session <> "" then begin
|
||||||
Gtk_tools.select_in_combo session_combo !session;
|
Gtk_tools.select_in_combo session_combo !session;
|
||||||
|
|||||||
Reference in New Issue
Block a user