]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matitaMathView.ml
various updates, removed proofs for now because they are the real bottleneck!!
[helm.git] / helm / matita / matitaMathView.ml
index 776a9ada579ce8748e8867ad98a1e22e27809ed5..f913639f945e2f0c2919dfd2e77355d195f0144d 100644 (file)
@@ -76,25 +76,24 @@ class clickableMathView obj =
     method set_href_callback f = href_callback <- f
 
     initializer
-      current_font_size := default_font_size ();
       self#set_font_size !current_font_size;
       ignore (self#connect#selection_changed self#choose_selection);
       ignore (self#connect#click (fun (gdome_elt, _, _, _) ->
         match gdome_elt with
         | Some elt  (* element is an hyperlink, use href_callback on it *)
-          when elt#hasAttributeNS ~namespaceURI:Misc.xlink_ns ~localName:href ->
+          when elt#hasAttributeNS ~namespaceURI:DomMisc.xlink_ns ~localName:href ->
             (match href_callback with
             | None -> ()
             | Some f ->
                 let uri =
-                  elt#getAttributeNS ~namespaceURI:Misc.xlink_ns ~localName:href
+                  elt#getAttributeNS ~namespaceURI:DomMisc.xlink_ns ~localName:href
                 in
                 f (uri#to_string))
         | Some elt -> ignore (self#action_toggle elt)
         | None -> ()))
     method private choose_selection gdome_elt =
       let rec aux elt =
-        if elt#hasAttributeNS ~namespaceURI:Misc.helm_ns ~localName:xref then
+        if elt#hasAttributeNS ~namespaceURI:DomMisc.helm_ns ~localName:xref then
           self#set_selection (Some elt)
         else
           try
@@ -134,7 +133,7 @@ class sequentViewer obj =
         (fun node ->
           let xpath =
             ((node : Gdome.element)#getAttributeNS
-              ~namespaceURI:Misc.helm_ns
+              ~namespaceURI:DomMisc.helm_ns
               ~localName:(Gdome.domString "xref"))#to_string
           in
           if xpath = "" then assert false (* "ERROR: No xref found!!!" *)
@@ -151,7 +150,7 @@ class sequentViewer obj =
         (fun node ->
           let xpath =
             ((node : Gdome.element)#getAttributeNS
-              ~namespaceURI:Misc.helm_ns
+              ~namespaceURI:DomMisc.helm_ns
               ~localName:(Gdome.domString "xref"))#to_string
           in
           if xpath = "" then assert false (* "ERROR: No xref found!!!" *)
@@ -170,7 +169,7 @@ class sequentViewer obj =
     current_infos <- Some (ids_to_terms, ids_to_father_ids, ids_to_hypotheses);
 (*
     debug_print "load_sequent: dumping MathML to ./prova";
-    ignore (Misc.domImpl#saveDocumentToFile ~name:"./prova" ~doc:mathml ());
+    ignore (DomMisc.domImpl#saveDocumentToFile ~name:"./prova" ~doc:mathml ());
 *)
     self#load_root ~root:mathml#get_documentElement
  end
@@ -351,9 +350,8 @@ class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history)
   in
   let toplevel = win#toplevel in
   let mathView = sequentViewer ~packing:win#scrolledBrowser#add () in
-  let fail msg =
-    ignore (MatitaGtkMisc.ask_confirmation ~gui:(MatitaGui.instance ())
-      ~title:"Cic browser" ~msg ~cancel:false ());
+  let fail message = 
+    MatitaGtkMisc.report_error ~title:"Cic browser" ~message ()  
   in
   let tags =
     [ "dir", GdkPixbuf.from_file (MatitaMisc.image_path "matita-folder.png");
@@ -363,7 +361,7 @@ class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history)
     try
       f ()
     with exn ->
-      fail (sprintf "Uncaught exception:\n%s" (Printexc.to_string exn))
+      fail (MatitaExcPp.to_string exn)
   in
   let handle_error' f = (fun () -> handle_error (fun () -> f ())) in
   object (self)