NewBranch.bjs
[gitlive] / Clones.vala
index b152f76..fba05f5 100644 (file)
@@ -70,47 +70,47 @@ public class Clones : Object
 
     // user defined functions
     public void loadAndShow () {
-       
-       _this.el.show_all();
-       
-       _this.toolbar.el.hide();
-       _this.scrolled.el.hide();
-       _this.spinner.el.show();
-       _this.spinner.el.start();       
-       
-       GitRepo.updateAll("show_clones");
        this.el.set_deletable(true);
         this.el.set_gravity(Gdk.Gravity.NORTH);
-        this.el.move((Gdk.Screen.width() / 2 ) -400 ,0);
+        this.el.move((Gdk.Screen.width() / 2 ) - (int.min(1280,Gdk.Screen.width()) / 2) ,0);
          this.el.set_keep_above(true);
         this.el.set_default_size(
-                       int.min(1024,Gdk.Screen.width()),
-                       int.max(500,Gdk.Screen.height() - 300)
+                       int.min(1280,Gdk.Screen.width()),
+                       int.max(500,Gdk.Screen.height() - 200)
        );
+       this.el.show_all();
+       
+       this.toolbar.el.hide();
+       this.scrolled.el.hide();
+       this.spinner.el.show();
+       this.spinner.el.start();        
+       
+       GitRepo.updateAllAsync("show_clones");
+       
          
      
        
        
     }
     public void show ()    {
-    
-        this.el.show_all();
-       _this.spinner.el.stop();
-       _this.spinner.el.hide();        
-       _this.toolbar.el.show();
-       _this.scrolled.el.show();       
-     
-        this.el.set_deletable(true);
+    this.el.set_deletable(true);
         this.el.set_gravity(Gdk.Gravity.NORTH);
-        this.el.move((Gdk.Screen.width() / 2 ) -400 ,0);
+        this.el.move((Gdk.Screen.width() / 2 ) - (int.max(1280,Gdk.Screen.width()) / 2) ,0);
          this.el.set_keep_above(true);
-        this.el.set_default_size(
-                       int.min(1024,Gdk.Screen.width()),
-                       int.max(500,Gdk.Screen.height() - 300)
+       this.el.set_default_size(
+                       int.max(1280,Gdk.Screen.width()),
+                       int.max(500,Gdk.Screen.height() - 100)
        );
+        this.el.show_all();
+       this.spinner.el.stop();
+       this.spinner.el.hide(); 
+       this.toolbar.el.show();
+       this.scrolled.el.show();        
+     
+        
          
     
-        _this.reposStore.load();
+        this.reposStore.load();
        
         GLib.debug("show clones = run?");
         this.el.run();
@@ -349,7 +349,7 @@ public class Clones : Object
             //listeners
             this.el.row_activated.connect( (path, col)  =>  {
             
-               if (col.title != "Current Branch") {
+               if (col.title == "Auto Commit" || col.title == "Auto Push" || col.title == "Auto Branch") {
                        return;
                }
                
@@ -361,7 +361,7 @@ public class Clones : Object
                 _this.reposStore.el.get_value(iter, 6, out val);
                 var git_working_dir = (string)val;
                 
-                var repo = GitRepo.singleton().get(git_working_dir);
+                var repo = GitRepo.singleton().get_sync(git_working_dir);
                 
                 Gdk.Rectangle rect;
                 _this.reposView.el.get_cell_area(path, col, out rect);
@@ -577,11 +577,9 @@ public class Clones : Object
                _this.reposStore.el.set_value(iter, 4, !bval);
                GLib.debug("got repopath? %s", repopath);
                
-               var repo = GitRepo.get(repopath);
+               var repo = GitRepo.get_sync(repopath);
                repo.set_autocommit(!bval);
-               
-               
-               
+                
               
             });
         }
@@ -656,7 +654,7 @@ public class Clones : Object
                var repopath = (string)rval;
                var bval = (bool)val;
                _this.reposStore.el.set_value(iter, 5, !bval);
-               var repo = GitRepo.get(repopath);
+               var repo = GitRepo.get_sync(repopath);
                repo.set_autopush(!bval);
                
                
@@ -735,7 +733,7 @@ public class Clones : Object
                var repopath = (string)rval;
                var bval = (bool)val;
                _this.reposStore.el.set_value(iter, 8, !bval);
-               var repo = GitRepo.get(repopath);
+               var repo = GitRepo.get_sync(repopath);
                repo.set_auto_branch(!bval);