src/Builder4/ValaProjectSettings.bjs
[app.Builder.js] / src / Builder4 / ValaProjectSettings.vala
index 767837a..28c3e6a 100644 (file)
@@ -385,7 +385,8 @@ public class ValaProjectSettings : Object
 
             // init method 
 
-            this.el.add_attribute(_this.packages_render.el , "text", 0 );        }
+            this.el.add_attribute(_this.packages_render.el , "text", 0 );
+        }
 
         // user defined functions 
     }
@@ -439,7 +440,8 @@ public class ValaProjectSettings : Object
 
             {
              this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
-             }        }
+             }
+        }
 
         // user defined functions 
     }
@@ -661,7 +663,8 @@ public class ValaProjectSettings : Object
 
             // init method 
 
-            this.el.add_attribute(_this.directory_render.el , "text", 0 );        }
+            this.el.add_attribute(_this.directory_render.el , "text", 0 );
+        }
 
         // user defined functions 
     }
@@ -931,7 +934,8 @@ public class ValaProjectSettings : Object
             {  
             this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
             
-            }        }
+            }
+        }
 
         // user defined functions 
     }
@@ -1153,7 +1157,7 @@ public class ValaProjectSettings : Object
                    
                    _this.build_pack_target.el.set_text(cg.target_bin);
                    _this.build_compile_flags.el.set_text(cg.compile_flags);
-                   
+                   _this.set_vbox.cgroup = cg;
                    //_this.files_tree_store.updatesel(cg);
                    // load the srouces
                    
@@ -1208,7 +1212,7 @@ public class ValaProjectSettings : Object
                 //this.el.set_value(citer, 1,   items.get(i) );
             };
             this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
-            
+            _this.set_vbox.el.hide();
         }
     }
     public class Xcls_TreeViewColumn35 : Object 
@@ -1238,7 +1242,8 @@ public class ValaProjectSettings : Object
 
             {
                  this.el.add_attribute(_this.targets_render.el , "text", 0 );
-             }        }
+             }
+        }
 
         // user defined functions 
     }
@@ -1290,6 +1295,7 @@ public class ValaProjectSettings : Object
 
 
             // my vars (def)
+        public Project.GtkValaSettings cgroup;
 
         // ctor 
         public Xcls_set_vbox(ValaProjectSettings _owner )
@@ -1299,6 +1305,7 @@ public class ValaProjectSettings : Object
             this.el = new Gtk.VBox( false, 0 );
 
             // my vars (dec)
+            this.cgroup = null;
 
             // set gobject values
             var child_0 = new Xcls_Label38( _this );
@@ -1567,6 +1574,28 @@ public class ValaProjectSettings : Object
             }
             this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
             
+        }
+        public void update () {
+        
+        
+            Gtk.TreeIter citer;
+        
+            for(var i =0 ; i < this.el.iter_n_children(null); i++) {
+                this.el.iter_nth_child(citer,null,i);
+        
+                GLib.Value val;
+                this.el.get_value(iter,0, out val);
+                var fn = (string) val;
+                
+                var active = false;
+                if (_this.set_vbox.cgroup.sources.contains(fn)) {
+                    active = true;
+                }
+                
+                this.el.set_value(citer, 3,   active ); // checked 
+            }
+        
+        
         }
     }
     public class Xcls_TreeViewColumn46 : Object 
@@ -1597,7 +1626,8 @@ public class ValaProjectSettings : Object
             this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
              
             /*  this.el.add_attribute(_this.files_render.el , "markup", 2 );
-            */        }
+            */
+        }
 
         // user defined functions 
     }
@@ -1651,7 +1681,8 @@ public class ValaProjectSettings : Object
 
             {
              this.el.add_attribute(_this.files_render_use.el , "active", 3 );
-             }        }
+             }
+        }
 
         // user defined functions 
     }
@@ -1693,23 +1724,24 @@ public class ValaProjectSettings : Object
                m.get_value(iter, 2, out ftval);
                var ftype = (string)ftval;   
                
-               // full name...
+               // full name...  
                GLib.Value fval;     
                m.get_value(iter, 0, out fval);
                var fn = (string)fval;
                 
+                
+                var cg =   _this.set_vbox.cgroup;
                 // what's the sleected target?
                 // update the list..
                 // if ftype is a dir == then toggle all the bellow.
                 // if ftype is a file .. see if all the files in that directory are check and check the dir.
-                return;
-                var def = _this.project.compilegroups.get("_default_");
-                var items  = def.packages;
+            
+                 
                 if ((bool)val) {
                     // renive
-                    items.remove(fn);
+                    cg.sources.remove(fn);
                 } else {
-                    items.add(fn);
+                    cg.sources.add(fn);
                 }
                 
             });