WindowLog.js
[gitlive] / Clones.js
index 0acbc94..4372341 100644 (file)
--- a/Clones.js
+++ b/Clones.js
@@ -382,10 +382,32 @@ Clones=new XObject({
                                             // highlight color.
                                             var cb = tr[i].currentBranch;
                                             //print(JSON.stringify(cb,null,4));
-                                            var col = ((cb.lastrev == cb.remoterev) && !tr[0].hasLocalChanges) ? '#ffffff' : '#ff0000';
+                                            var col = '#ffffff';
+                                            if (cb.lastrev != cb.remoterev) {
+                                                col =  '#ff0000';
+                                            }
+                                            if (tr[i].hasLocalChanges) {
+                                                col =  '#0000ff';
+                                            }
+                                            if  ((cb.lastrev != cb.remoterev) && (tr[i].hasLocalChanges)) {
+                                                col =  '#ff00ff';
+                                            }
+                                            
                                             this.el.set_value(ret.iter, 7, col  );      
                                             
                                         }     
+                                    },
+                                    pathToRepo : function(path) {
+                                    
+                                        var tr= this.repos;
+                                    
+                                        
+                                        for(var i =0 ; i < tr.length; i++) {
+                                            if (tr[i].repopath == path) {
+                                                return tr[i];
+                                            }
+                                        } 
+                                        return false; 
                                     }
                                 },
                                 {
@@ -413,6 +435,12 @@ Clones=new XObject({
                                                     //print(JSON.stringify(value));
                                                     store.el.set_value(ret.iter,4, !value);
                                                     
+                                                     var path =  store.el.get_value(ret.iter, 6).value.get_string();
+                                                     var repo = imports.Scm.Repo.Repo.get(path);
+                                                     repo.autocommit(!value);
+                                                     
+                                                    
+                                                    
                                                 }
                                             },
                                             pack : "pack_start",
@@ -443,7 +471,10 @@ Clones=new XObject({
                                                                                                                  
                                                     //print(JSON.stringify(value));
                                                     store.el.set_value(ret.iter,5, !value);
-                                                    
+                                                      var path =  store.el.get_value(ret.iter, 6).value.get_string();
+                                                     var repo = imports.Scm.Repo.Repo.get(path);
+                                                     repo.autopush(!value);
+                                                     
                                                 }
                                             },
                                             pack : "pack_start",