Commit 38a8862f authored by Bruno Guillaume's avatar Bruno Guillaume
parent 981d2848
......@@ -96,9 +96,11 @@ module Resources = struct
match !current_corpus_file with
| None -> ()
| Some file ->
Log.fmessage "Loading gr file: '%s'" file;
Log.fmessage "Loading corpus file: '%s'" file;
let domain = domain () in
current_corpus := Some (Corpus.get_graphs ?domain file)
match Corpus.get_graphs ?domain file with
| [||] -> error "The file \"%s\" is empty" file
| corpus -> current_corpus := Some corpus
(* -------------------------------------------------------------------------------- *)
exception Found of int
......@@ -378,16 +380,17 @@ let init () =
match !Resources.current_graph with
| None -> graph_top_webkit#load_html_string empty_html ""
| Some graph ->
Grew_rew_display.graph_map := [("init", (graph, ("", "", None)))];
Grew_rew_display.current_top_graph := "init";
let domain = Resources.domain () in
let svg_file =
if grew_window#btn_gr_top_dot#active
then Grew_rew_display.svg_dot_temp_file ?domain ~main_feat graph
else Grew_rew_display.svg_dep_temp_file ?domain ~main_feat graph in
grew_window#vpaned_corpus#misc#show ();
grew_window#err_view_scroll#misc#hide ();
graph_top_webkit#load_uri ("file://"^svg_file) in
reset ();
Grew_rew_display.graph_map := [("init", (graph, ("", "", None)))];
Grew_rew_display.current_top_graph := "init";
let domain = Resources.domain () in
let svg_file =
if grew_window#btn_gr_top_dot#active
then Grew_rew_display.svg_dot_temp_file ?domain ~main_feat graph
else Grew_rew_display.svg_dep_temp_file ?domain ~main_feat graph in
grew_window#vpaned_corpus#misc#show ();
grew_window#err_view_scroll#misc#hide ();
graph_top_webkit#load_uri ("file://"^svg_file) in
let _ = treeview#connect#row_activated ~callback: (
fun tree_path _ ->
......@@ -402,7 +405,7 @@ let init () =
(* -------------------------------------------------------------------------------- *)
let load_corpus () =
reset();
messages := []; reset();
error_handling Resources.load_corpus ();
Resources.update_graph ();
match (!Resources.current_corpus, !Resources.current_corpus_file) with
......
Markdown is supported
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