Commit 47bc4f57 authored by MARCHE Claude's avatar MARCHE Claude
Browse files

IDE: config saved with a "Save&Close" button in preferences window

parent 4dacced6
...@@ -33,8 +33,10 @@ bug fixes: ...@@ -33,8 +33,10 @@ bug fixes:
o IDE: display warnings after reload o IDE: display warnings after reload
IDE: IDE:
o conf file not automatically saved anymore at exit o config file not automatically saved anymore at exit. Configuration
o right part of main window organized in tabs is saved on disk for future sessions if, and only if, preferences
window is exited by hitting the "Save&Close" button
o right part of main window organized in tabs.
version 0.85, September 17, 2014 version 0.85, September 17, 2014
================================ ================================
......
...@@ -594,18 +594,6 @@ let general_settings (c : t) (notebook:GPack.notebook) = ...@@ -594,18 +594,6 @@ let general_settings (c : t) (notebook:GPack.notebook) =
nb_processes_spin#connect#value_changed ~callback: nb_processes_spin#connect#value_changed ~callback:
(fun () -> c.session_nb_processes <- nb_processes_spin#value_as_int) (fun () -> c.session_nb_processes <- nb_processes_spin#value_as_int)
in in
let hb = GPack.hbox ~homogeneous:false ~packing:vb#add () in
let save_for_future = ref false in
let save =
GButton.check_button
~label:"save settings above for future sessions"
~packing:hb#add ()
~active:false
in
let (_ : GtkSignal.id) =
save#connect#toggled ~callback:
(fun () -> save_for_future := not !save_for_future)
in
let display_options_frame = let display_options_frame =
GBin.frame ~label:"Display options" ~packing:page_pack () GBin.frame ~label:"Display options" ~packing:page_pack ()
in in
...@@ -714,7 +702,7 @@ let general_settings (c : t) (notebook:GPack.notebook) = ...@@ -714,7 +702,7 @@ let general_settings (c : t) (notebook:GPack.notebook) =
let (_ : GPack.box) = let (_ : GPack.box) =
GPack.vbox ~packing:page_pack () GPack.vbox ~packing:page_pack ()
in in
save_for_future ()
(* Page "Provers" *) (* Page "Provers" *)
...@@ -913,7 +901,7 @@ let preferences (c : t) = ...@@ -913,7 +901,7 @@ let preferences (c : t) =
let vbox = dialog#vbox in let vbox = dialog#vbox in
let notebook = GPack.notebook ~packing:vbox#add () in let notebook = GPack.notebook ~packing:vbox#add () in
(** page "general settings" **) (** page "general settings" **)
let save_for_future_session = general_settings c notebook in general_settings c notebook;
(*** page "editors" **) (*** page "editors" **)
editors_page c notebook; editors_page c notebook;
(** page "Provers" **) (** page "Provers" **)
...@@ -935,18 +923,18 @@ let preferences (c : t) = ...@@ -935,18 +923,18 @@ let preferences (c : t) =
in in
*) *)
(** bottom button **) (** bottom button **)
dialog#add_button "Save&Close" `SAVE ;
dialog#add_button "Close" `CLOSE ; dialog#add_button "Close" `CLOSE ;
let ( _ : GWindow.Buttons.about) = dialog#run () in let ( answer : [`SAVE | `CLOSE | `DELETE_EVENT ]) = dialog#run () in
(* let config = set_main config *) begin
(* (set_limits (get_main config) *) match answer with
(* t.time_limit t.mem_limit t.max_running_processes) *) | `SAVE ->
(* in *) c.config <- Whyconf.set_main c.config
(Whyconf.set_limits (Whyconf.get_main c.config)
if !save_for_future_session then c.session_time_limit c.session_mem_limit c.session_nb_processes);
c.config <- Whyconf.set_main c.config save_config ()
(Whyconf.set_limits (Whyconf.get_main c.config) | `CLOSE | `DELETE_EVENT -> ()
c.session_time_limit c.session_mem_limit c.session_nb_processes); end;
save_config ();
dialog#destroy () dialog#destroy ()
(* (*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment