fix commits
[gitlive] / NewBranch.vala
index c2800e8..bd6fedd 100644 (file)
@@ -59,11 +59,9 @@ public class NewBranch : Object
         this.el.response.connect( (self, response_id) =>  { 
           
                GLib.debug("got %d", (int) response_id);
-               if (response_id < 1) {
-                   _this.el.hide();    
-                   this.running = false; 
-                       return;
-               }
+               
+                
+               
                 
                // have they selected a ticket..
                // make that the current active ticket?
@@ -72,6 +70,14 @@ public class NewBranch : Object
                // -- each repo would have their active ticket (only one per repo)
                // -- so we could just store that in there
                // -- initial load can check the contents of the ticket files on first scan.
+        
+                
+               if (response_id < 1) {
+                   _this.el.hide();    
+                   this.running = false; 
+                       return;
+               }
+               
                var ticket_id = _this.ticketsel.selectedTicketId();
                
             if (this.repo != null) {
@@ -86,7 +92,7 @@ public class NewBranch : Object
                                 
                         }
             }
-            
+             
         
             this.running = false; 
         
@@ -127,13 +133,13 @@ public class NewBranch : Object
          _this.prmodel.loadProjects(curproj == null ? "" : curproj.id);
         
        _this.dbmodel.loadTickets(curproj == null ? "": curproj.id, tid);
-    
-       if (tid != "") {
+       _this.ticketsel.el.get_child().get_style_context().remove_class("warning");
+       if (tid != "") { 
                var name = RooTicket.singleton().usernameLocal();
                var ticket = RooTicket.singleton().getById(tid);
                _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
-    
-    
+       } else {
+               _this.ticketsel.el.get_child().get_style_context().add_class("warning");
        }
         _this.view.loadTicket(tid);
        this.el.run();
@@ -472,11 +478,15 @@ public class NewBranch : Object
                
                var name = RooTicket.singleton().usernameLocal();
                
+               this.el.get_child().get_style_context().remove_class("warning");
                if (ticket_id == "" || ticket_id == null) {
                
                        var dt = new  DateTime.now_local();
                        _this.name.el.set_text("wip_%s_%s".printf(name,dt.format("%Y_%b_%d")));
                        _this.view.loadTicket("");              
+                       
+                       this.el.get_child().get_style_context().add_class("warning");
+                       
                        return;
                }
                
@@ -705,7 +715,16 @@ public class NewBranch : Object
 
             //listeners
             this.el.clicked.connect( () => {
+            
                GLib.debug("fire response = 1");
+               
+               var ticket_id = _this.ticketsel.selectedTicketId();
+               
+               if (ticket_id == "") {
+                       _this.ticketsel.el.get_child().get_style_context().add_class("warning");
+                       return;
+               }
+                
                _this.el.response(1);
             });
         }