resources/Editors/Editor.Roo.grid.Grid.bjs
[app.Builder.js] / src / Project / Project.vala
index a03fee2..b8b3bd8 100644 (file)
@@ -41,8 +41,8 @@ namespace Project {
                //tree : false,
                public  string xtype;
                
-               public JSON.Object json_project_data;
-               
+               public Json.Object json_project_data;
+               public Palete.RooDatabase roo_database;
                 
                bool is_scanned; 
           
@@ -50,7 +50,7 @@ namespace Project {
                public Project (string path) {
                    
                        this.name = GLib.Path.get_basename(path); // default..
-                       this.json_project_data = new JSON.Object();
+                       this.json_project_data = new Json.Object();
                        
                        this.is_scanned = false;
                        this.paths = new Gee.HashMap<string,string>();
@@ -60,12 +60,17 @@ namespace Project {
                        if (path.length > 0) {
                                this.paths.set(path, "dir");
                        }
+                       // dummy roo database...
+                       this.initRooDatabase();
                        
                    
                    
                }
-
-        
+               public void  initRooDatabase()
+               {
+                        
+                       this.roo_database = new Palete.RooDatabase.from_project(this);
+               }
         
         
                
@@ -151,7 +156,7 @@ namespace Project {
 
                        
                        var proj = factory(xtype, fpath);
-                       
+
                        proj.json_project_data  = obj; // store the original object...
                        
                        proj.fn =  Path.get_basename(jsonfile).split(".")[0];
@@ -176,7 +181,13 @@ namespace Project {
                        paths.foreach_member((sobj, key, val) => {
                                proj.paths.set(key, "dir");
                        });
+                       proj.initRooDatabase();
+                       
                        projects.set(proj.id,proj);
+                       
+                       
+                       
+                       
                }
                
                
@@ -519,6 +530,19 @@ namespace Project {
                    }
                    
                }
+               // wrapper around the javascript data...
+               public string get_string_member(string key) {
+                       
+                       if (!this.json_project_data.has_member(key)) {
+                               return "";
+                       }
+                       var  ret = this.json_project_data.get_string_member(key);
+                       if (ret == null) {
+                               return "";
+                       }
+                       return ret;
+                       
+               }
                  
        }
 }