]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/gtkmathview-bonobo/test/main.c
Partional first fase final.
[helm.git] / helm / gtkmathview-bonobo / test / main.c
index d0d646a946086e3e23bab8cebb6accf3adfcdb6b..41ec0a9fe4f3472587c4fd10494e54f8213c278b 100644 (file)
@@ -17,6 +17,18 @@ struct FileSelectionInfo {
 
 static struct FileSelectionInfo file_selection_info = { NULL, NULL };
 
+static void
+load_through_persist_file (const gchar *filename,
+                                          Bonobo_PersistFile pfile)
+{
+       CORBA_Environment ev;
+       CORBA_exception_init (&ev);
+       Bonobo_PersistFile_load (pfile, filename, &ev);
+       if (ev._major != CORBA_NO_EXCEPTION)
+                  g_warning ("Cannot load.");
+       CORBA_exception_free (&ev);
+}
+
 static void
 file_selection_ok_cb (GtkWidget *widget,
                      gpointer data)
@@ -39,8 +51,7 @@ file_selection_ok_cb (GtkWidget *widget,
   else         
     {
       const gchar *fname = gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_selection_info.widget));
-      /* load_through_persist_file (fname, interface); */
-      /* todo */
+      load_through_persist_file (fname, interface);
     }
   
   gtk_widget_destroy (file_selection_info.widget);
@@ -205,8 +216,7 @@ load_file (const gchar *fname)
   interface = Bonobo_Unknown_queryInterface (bonobo_widget_get_objref (BONOBO_WIDGET (control)),
                                             "IDL:Bonobo/PersistFile:1.0", &ev);
   CORBA_exception_free (&ev);
-  /* load_through_persist_file (fname, interface); */
-  /* TODO */
+  load_through_persist_file (fname, interface);
 
   return FALSE;
 }