Ticket.bjs
[gitlive] / Ticket.vala
index a3f337f..ea18595 100644 (file)
@@ -932,7 +932,7 @@ public class Ticket : Object
         }
 
         // user defined functions
-        public string selectedProjectId () {
+        public string selectedClassificationId () {
                Gtk.TreeIter iter;
                Value val1;
          
@@ -1163,14 +1163,42 @@ public class Ticket : Object
                GLib.debug("fire response = 1");
                
                
-               var invalid = true;
+               var invalid = false;
                
                // validate first...
-               this.el.get_style_context().add_class("suggested-action");
+               _this.project_id.el.get_style_context().remove_class("warning");        
+               if (_this.project_id.selectedProjectId() == "") {
+                       _this.project_id.el.get_style_context().add_class("warning");
+                       invalid = true;
+               }
                
+               _this.milestone_id.el.get_style_context().remove_class("warning");      
+               if (_this.milestone_id.selectedMilestoneId() == "") {
+                       _this.milestone_id.el.get_style_context().add_class("warning");
+                       invalid = true;
+               }
+            
+               _this.priority_id.el.get_style_context().remove_class("warning");       
+               if (_this.priority_id.selectedPriorityId() == "") {
+                       _this.priority_id.el.get_style_context().add_class("warning");
+                       invalid = true;
+               }
                
+               _this.classification_id.el.get_style_context().remove_class("warning"); 
+               if (_this.classification_id.selectedClassificationId() == "") {
+                       _this.classification_id.el.get_style_context().add_class("warning");
+                       invalid = true;
+               }
                
+               _this.developer_id.el.get_style_context().remove_class("warning");      
+               if (_this.developer_id.selectedDeveloperId() == "") {
+                       _this.developer_id.el.get_style_context().add_class("warning");
+                       invalid = true;
+               }
                
+               if (invalid) {
+                       return;
+               }
                
                _this.el.response(1);
             });