Clone.bjs
[gitlive] / Clone.vala
index 7a3a53c..087a88e 100644 (file)
@@ -14,10 +14,9 @@ public class Clone : Object
     }
     public Xcls_reposel reposel;
     public Xcls_prcellrenderer prcellrenderer;
-    public Xcls_prmodel prmodel;
+    public Xcls_repomodel repomodel;
 
         // my vars (def)
-    public GitRepo repo;
 
     // ctor
     public Clone()
@@ -33,16 +32,16 @@ public class Clone : Object
         this.el.position = Gtk.PositionType.RIGHT;
         var child_0 = new Xcls_Box2( _this );
         child_0.ref();
-        this.el.pack_end (  child_0.el , false,false,0 );
+        this.el.add (  child_0.el  );
     }
 
     // user defined functions
-    public void show (Gtk.Widget btn, GitRepo repo) {
+    public void show (Gtk.Widget btn) {
      
                //console.log('show all');
        this.el.set_modal(true);
        this.el.set_relative_to(btn);
-      
+       this.repomodel.loadRepos();
        //this.el.set_position(Gtk.PositionType.RIGHT);
     
        // window + header?
@@ -71,7 +70,7 @@ public class Clone : Object
             this.el.vexpand = false;
             var child_0 = new Xcls_reposel( _this );
             child_0.ref();
-            this.el.attach_defaults (  child_0.el , 0,1,1,2 );
+            this.el.add (  child_0.el  );
             var child_1 = new Xcls_Button6( _this );
             child_1.ref();
             this.el.add (  child_1.el  );
@@ -103,7 +102,7 @@ public class Clone : Object
             var child_0 = new Xcls_prcellrenderer( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , true );
-            var child_1 = new Xcls_prmodel( _this );
+            var child_1 = new Xcls_repomodel( _this );
             child_1.ref();
             this.el.set_model (  child_1.el  );
 
@@ -152,7 +151,7 @@ public class Clone : Object
         // user defined functions
     }
 
-    public class Xcls_prmodel : Object
+    public class Xcls_repomodel : Object
     {
         public Gtk.ListStore el;
         private Clone  _this;
@@ -161,10 +160,10 @@ public class Clone : Object
             // my vars (def)
 
         // ctor
-        public Xcls_prmodel(Clone _owner )
+        public Xcls_repomodel(Clone _owner )
         {
             _this = _owner;
-            _this.prmodel = this;
+            _this.repomodel = this;
             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
 
             // my vars (dec)
@@ -173,7 +172,7 @@ public class Clone : Object
         }
 
         // user defined functions
-        public void loadProjects (string id) {
+        public void loadRepos () {
         
             var rt = RooTicket.singleton();
             var gr = GitRepo.singleton();
@@ -195,16 +194,17 @@ public class Clone : Object
             foreach(var newrepo in rt.repos) {
                var has_repo = false;
                foreach(var repo in gr.cache.values) {
-                       if (newrepo.name == repo.shortname) {
+                       if (newrepo.shortname == repo.name) {
                                has_repo = true;
+                       }
                }
                if (has_repo) {
                        continue;
                        }
                 el.append(out iter);
                 
-                el.set_value(iter, 0, repo.name);
-                el.set_value(iter, 1,  "%s : %s".printf(repo.shortname, repo.description) );
+                el.set_value(iter, 0, newrepo.shortname);
+                el.set_value(iter, 1,  "%s : %s".printf(newrepo.shortname, newrepo.description) );
                
                 
             }