Partial Fix #5560 - Gitlive - branching wip
[gitlive] / NewBranch.vala
index 74d09e0..602922e 100644 (file)
@@ -20,6 +20,7 @@ public class NewBranch : Object
         // my vars (def)
     public GitRepo? repo;
     public bool running;
+    public Gee.ArrayList<GitMonitorQueue> queue;
 
     // ctor
     public NewBranch()
@@ -30,6 +31,7 @@ public class NewBranch : Object
         // my vars (dec)
         this.repo = null;
         this.running = false;
+        this.queue = null;
 
         // set gobject values
         this.el.title = "Create a working branch ";
@@ -50,7 +52,6 @@ public class NewBranch : Object
         //listeners
         this.el.delete_event.connect( (self, event) => {
             this.el.hide();
-            this.running = false;
             return true; 
             //test  
         });
@@ -60,7 +61,6 @@ public class NewBranch : Object
                if (response_id == 0) {
                    _this.el.hide();    
                    this.running = false; 
-                       GitMonitor.gitmonitor.start();      
                        return;
                }
                 
@@ -78,13 +78,13 @@ public class NewBranch : Object
                if (ticket_id != "" ) {
                                this.repo.setActiveTicket( RooTicket.singleton().getById(ticket_id), bn);
                        } else {
-                               this.repo.createBranchNamed(bn);
+                               this.repo.setActiveTicket( RooTicket.singleton().getById("-1"), bn);
                        }
             }
-               GitMonitor.gitmonitor.start();
-                           this.running = false; 
         
-                
+            this.running = false; 
+        
+               this.el.hide();
                 
                 
         
@@ -98,12 +98,14 @@ public class NewBranch : Object
     }
 
     // user defined functions
-    public   void show ( GitRepo repo ) 
+    public   void show ( GitRepo repo, Gee.ArrayList<GitMonitorQueue> queue ) 
     {
          // this.el.set_gravity(Gdk.Gravity.NORTH);
-        if (this.running) {
-               return;
+        if (this.running) { // should not happen!!
+               GLib.error("new branch show called, when already being displayed?");
        }
+       this.queue = queue;
+       
        this.running  = true;
        GitMonitor.gitmonitor.stop();