]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matitaGui.ml
New files AUTHORS and LICENSE.
[helm.git] / helm / matita / matitaGui.ml
index f884bee2eba41145b2b9f7b33182701f6eba6c1f..90826e98f9f6e72265313c65495798849b5913a3 100644 (file)
@@ -107,7 +107,6 @@ let ask_unsaved parent =
 class gui () =
     (* creation order _is_ relevant for windows placement *)
   let main = new mainWin () in
-  let about = new aboutWin () in
   let fileSel = new fileSelectionWin () in
   let findRepl = new findReplWin () in
   let develList = new develListWin () in
@@ -142,7 +141,7 @@ class gui () =
         (* glade's check widgets *)
       List.iter (fun w -> w#check_widgets ())
         (let c w = (w :> <check_widgets: unit -> unit>) in
-        [ c about; c fileSel; c main; c findRepl]);
+        [ c fileSel; c main; c findRepl]);
         (* key bindings *)
       List.iter (* global key bindings *)
         (fun (key, callback) -> self#addKeyBinding key callback)
@@ -154,13 +153,33 @@ class gui () =
 *)
         [ ];
         (* about win *)
-      ignore (about#aboutWin#event#connect#delete (fun _ -> true));
-      ignore (main#aboutMenuItem#connect#activate (fun _ ->
-        about#aboutWin#show ()));
-      connect_button about#aboutDismissButton (fun _ ->
-        about#aboutWin#misc#hide ());
-      about#aboutLabel#set_label (Pcre.replace ~pat:"@VERSION@"
-        ~templ:BuildTimeConf.version about#aboutLabel#label);
+      let parse_txt_file file =
+       let ch = open_in file in
+       let l_rev = ref [] in
+       try
+        while true do
+         l_rev := input_line ch :: !l_rev;
+        done;
+        assert false
+       with
+        End_of_file ->
+         close_in ch;
+         List.rev !l_rev in 
+      let about_dialog =
+       GWindow.about_dialog
+        ~authors:(parse_txt_file "AUTHORS")
+        ~comments:"comments"
+        ~copyright:"Copyright (C) 2005, the HELM team"
+        ~license:(String.concat "\n" (parse_txt_file "LICENSE"))
+        (*?logo:GdkPixbuf.pixbuf*)
+        (*?logo_icon_name:string*)
+        ~name:"Matita"
+        ~version:BuildTimeConf.version
+        ~website:"http://helm.cs.unibo.it"
+        ()
+      in
+      ignore (main#aboutMenuItem#connect#activate
+       (fun _ -> about_dialog#present ()));
         (* findRepl win *)
       let show_find_Repl () = 
         findRepl#toplevel#misc#show ();
@@ -721,7 +740,6 @@ class gui () =
 
     method console = console
     method sourceView: GSourceView.source_view = (source_view: GSourceView.source_view)
-    method about = about
     method fileSel = fileSel
     method findRepl = findRepl
     method main = main