9857b7ffa54f5301be2d3cd9a7ed9ebb762bc62f
[gitlive] / Ticket.vala
1 static Ticket  _Ticket;
2
3 public class Ticket : Object
4 {
5     public Gtk.Dialog el;
6     private Ticket  _this;
7
8     public static Ticket singleton()
9     {
10         if (_Ticket == null) {
11             _Ticket= new Ticket();
12         }
13         return _Ticket;
14     }
15     public Xcls_project_id project_id;
16     public Xcls_prcellrenderer prcellrenderer;
17     public Xcls_prmodel prmodel;
18     public Xcls_summary summary;
19     public Xcls_milestone_id milestone_id;
20     public Xcls_msmodel msmodel;
21     public Xcls_description description;
22     public Xcls_priority_id priority_id;
23     public Xcls_primodel primodel;
24     public Xcls_severity_id severity_id;
25     public Xcls_sevmodel sevmodel;
26     public Xcls_classification_id classification_id;
27     public Xcls_clmodel clmodel;
28     public Xcls_developer_id developer_id;
29     public Xcls_devmodel devmodel;
30
31         // my vars (def)
32     public GitRepo? repo;
33     public bool running;
34
35     // ctor
36     public Ticket()
37     {
38         _this = this;
39         this.el = new Gtk.Dialog();
40
41         // my vars (dec)
42         this.repo = null;
43         this.running = false;
44
45         // set gobject values
46         this.el.title = "Create a Ticket";
47         this.el.default_height = 200;
48         this.el.default_width = 500;
49         this.el.deletable = true;
50         this.el.modal = true;
51         var child_0 = new Xcls_VBox2( _this );
52         child_0.ref();
53         this.el.get_content_area().add (  child_0.el  );
54
55         //listeners
56         this.el.delete_event.connect( (self, event) => {
57             this.el.hide();
58             return true; 
59             //test  
60         });
61         this.el.response.connect( (self, response_id) =>  { 
62           
63                 GLib.debug("got %d", (int) response_id);
64                 if (response_id < 1) {
65                     _this.el.hide();    
66                     this.running = false; 
67                         return;
68                 }
69                  
70                  
71                 var tid = RooTicket.singleton().createTicket(
72                 
73                         _this.project_id.selectedProjectId(),
74                 
75                         _this.milestone_id.selectedMilestoneId(),
76                         _this.priority_id.selectedPriorityId() ,
77                         _this.classification_id.selectedClassificationId() ,
78                         _this.developer_id.selectedDeveloperId(),
79                         _this.summary.el.get_text() ,
80                         _this.description.el.buffer.text 
81                 );
82                 
83                 if (this.repo != null) {
84                         NewBranch.singleton().show(this.repo, new Gee.ArrayList<GitMonitorQueue>(), tid);
85                 }
86                  
87         
88                  
89         });
90     }
91
92     // user defined functions
93     public   void show ( GitRepo? repo   ) 
94     {
95          // this.el.set_gravity(Gdk.Gravity.NORTH);
96         if (this.running) { // should not happen!!
97                 GLib.error("new branch show called, when already being displayed?");
98         }
99      
100         
101         this.running  = true;
102         //GitMonitor.gitmonitor.stop();
103         
104         this.repo = repo;
105         
106         
107         
108         
109         this.el.move((Gdk.Screen.width() / 2)- 250 ,0);
110         this.el.set_default_size( 500,200); // not sure why it grows..
111         GLib.debug("Loading tickets"); 
112          
113     
114         this.el.show_all();
115         this.el.set_keep_above(true);
116        
117     
118         RooProject? curproj = null;
119         if (this.repo != null) {
120             curproj = RooTicket.singleton().getProjectByRepo(this.repo);
121         }
122         _this.prmodel.loadProjects(curproj == null ? "" : curproj.id);
123         
124      
125         this.el.run();
126     
127     }
128     public class Xcls_VBox2 : Object
129     {
130         public Gtk.VBox el;
131         private Ticket  _this;
132
133
134             // my vars (def)
135
136         // ctor
137         public Xcls_VBox2(Ticket _owner )
138         {
139             _this = _owner;
140             this.el = new Gtk.VBox( true, 0 );
141
142             // my vars (dec)
143
144             // set gobject values
145             var child_0 = new Xcls_Table3( _this );
146             child_0.ref();
147             this.el.pack_start (  child_0.el , false,false,0 );
148         }
149
150         // user defined functions
151     }
152     public class Xcls_Table3 : Object
153     {
154         public Gtk.Table el;
155         private Ticket  _this;
156
157
158             // my vars (def)
159
160         // ctor
161         public Xcls_Table3(Ticket _owner )
162         {
163             _this = _owner;
164             this.el = new Gtk.Table( 14, 4, true );
165
166             // my vars (dec)
167
168             // set gobject values
169             this.el.expand = false;
170             this.el.margin = 2;
171             this.el.column_spacing = 4;
172             this.el.vexpand = false;
173             var child_0 = new Xcls_Label4( _this );
174             child_0.ref();
175             this.el.attach_defaults (  child_0.el , 0,1,0,1 );
176             var child_1 = new Xcls_Label5( _this );
177             child_1.ref();
178             this.el.attach_defaults (  child_1.el , 1,2,0,1 );
179             var child_2 = new Xcls_project_id( _this );
180             child_2.ref();
181             this.el.attach_defaults (  child_2.el , 0,1,1,2 );
182             var child_3 = new Xcls_summary( _this );
183             child_3.ref();
184             this.el.attach_defaults (  child_3.el , 1,4,1,2 );
185             var child_4 = new Xcls_Label10( _this );
186             child_4.ref();
187             this.el.attach_defaults (  child_4.el , 0,1,2,3 );
188             var child_5 = new Xcls_milestone_id( _this );
189             child_5.ref();
190             this.el.attach_defaults (  child_5.el , 0,1,3,4 );
191             var child_6 = new Xcls_Label13( _this );
192             child_6.ref();
193             this.el.attach_defaults (  child_6.el , 1,4,2,3 );
194             var child_7 = new Xcls_description( _this );
195             child_7.ref();
196             this.el.attach_defaults (  child_7.el , 1,4,3,12 );
197             var child_8 = new Xcls_Label15( _this );
198             child_8.ref();
199             this.el.attach_defaults (  child_8.el , 0,1,4,5 );
200             var child_9 = new Xcls_priority_id( _this );
201             child_9.ref();
202             this.el.attach_defaults (  child_9.el , 0,1,5,6 );
203             var child_10 = new Xcls_Label18( _this );
204             child_10.ref();
205             this.el.attach_defaults (  child_10.el , 0,1,6,7 );
206             var child_11 = new Xcls_severity_id( _this );
207             child_11.ref();
208             this.el.attach_defaults (  child_11.el , 0,1,7,8 );
209             var child_12 = new Xcls_Label21( _this );
210             child_12.ref();
211             this.el.attach_defaults (  child_12.el , 0,1,8,9 );
212             var child_13 = new Xcls_classification_id( _this );
213             child_13.ref();
214             this.el.attach_defaults (  child_13.el , 0,1,9,10 );
215             var child_14 = new Xcls_Label24( _this );
216             child_14.ref();
217             this.el.attach_defaults (  child_14.el , 0,1,10,11 );
218             var child_15 = new Xcls_developer_id( _this );
219             child_15.ref();
220             this.el.attach_defaults (  child_15.el , 0,1,11,12 );
221             var child_16 = new Xcls_Button27( _this );
222             child_16.ref();
223             this.el.attach_defaults (  child_16.el , 0,4,13,14 );
224         }
225
226         // user defined functions
227     }
228     public class Xcls_Label4 : Object
229     {
230         public Gtk.Label el;
231         private Ticket  _this;
232
233
234             // my vars (def)
235
236         // ctor
237         public Xcls_Label4(Ticket _owner )
238         {
239             _this = _owner;
240             this.el = new Gtk.Label( "Project" );
241
242             // my vars (dec)
243
244             // set gobject values
245             this.el.halign = Gtk.Align.START;
246             this.el.visible = true;
247         }
248
249         // user defined functions
250     }
251
252     public class Xcls_Label5 : Object
253     {
254         public Gtk.Label el;
255         private Ticket  _this;
256
257
258             // my vars (def)
259
260         // ctor
261         public Xcls_Label5(Ticket _owner )
262         {
263             _this = _owner;
264             this.el = new Gtk.Label( "Summary" );
265
266             // my vars (dec)
267
268             // set gobject values
269             this.el.halign = Gtk.Align.START;
270             this.el.visible = true;
271         }
272
273         // user defined functions
274     }
275
276     public class Xcls_project_id : Object
277     {
278         public Gtk.ComboBox el;
279         private Ticket  _this;
280
281
282             // my vars (def)
283         public bool loading;
284
285         // ctor
286         public Xcls_project_id(Ticket _owner )
287         {
288             _this = _owner;
289             _this.project_id = this;
290             this.el = new Gtk.ComboBox.with_entry();
291
292             // my vars (dec)
293             this.loading = false;
294
295             // set gobject values
296             var child_0 = new Xcls_prcellrenderer( _this );
297             child_0.ref();
298             this.el.pack_start (  child_0.el , true );
299             var child_1 = new Xcls_prmodel( _this );
300             child_1.ref();
301             this.el.set_model (  child_1.el  );
302
303             // init method
304
305             this.el.set_entry_text_column(1);
306
307             //listeners
308             this.el.changed.connect( () => {
309                 if (this.loading) {
310                         return;
311                 }
312                 var project_id = this.selectedProjectId();
313                 
314                 var rt = RooTicket.singleton();
315                 rt.loadProjectOptions(project_id);
316                 
317                 _this.msmodel.loadMilestones();
318                 _this.primodel.loadPriorities();
319                 _this.sevmodel.loadSeverities();
320                 _this.clmodel.loadClassifications();    
321                 _this.devmodel.loadDevelopers();        
322                 
323                 // affects projects and milestones..
324                 
325                 
326                 /*if (this.loading) {
327                         return;
328                 }
329                 var ticket_id = this.selectedTicketId();
330                 
331                 var name = RooTicket.singleton().usernameLocal();
332                 
333                 if (ticket_id == "" || ticket_id == null) {
334                 
335                         var dt = new  DateTime.now_local();
336                         _this.name.el.set_text("wip_%s_%s".printf(name,dt.format("%Y_%b_%d")));
337                         return;
338                 }
339                 
340                 
341                 var ticket = RooTicket.singleton().getById(ticket_id);
342                
343                 _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
344                 
345                 //GLib.debug (//"Selection: %s, %s\n", (string) val1, (string) val2);
346                 */
347             });
348         }
349
350         // user defined functions
351         public string selectedProjectId () {
352                 Gtk.TreeIter iter;
353                 Value val1;
354          
355          
356                 this.el.get_active_iter (out iter);
357                 _this.prmodel.el.get_value (iter, 0, out val1);
358          
359         
360                 return  (string) val1;
361                 
362                 
363                 
364                 
365         }
366     }
367     public class Xcls_prcellrenderer : Object
368     {
369         public Gtk.CellRendererText el;
370         private Ticket  _this;
371
372
373             // my vars (def)
374
375         // ctor
376         public Xcls_prcellrenderer(Ticket _owner )
377         {
378             _this = _owner;
379             _this.prcellrenderer = this;
380             this.el = new Gtk.CellRendererText();
381
382             // my vars (dec)
383
384             // set gobject values
385         }
386
387         // user defined functions
388     }
389
390     public class Xcls_prmodel : Object
391     {
392         public Gtk.ListStore el;
393         private Ticket  _this;
394
395
396             // my vars (def)
397
398         // ctor
399         public Xcls_prmodel(Ticket _owner )
400         {
401             _this = _owner;
402             _this.prmodel = this;
403             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
404
405             // my vars (dec)
406
407             // set gobject values
408         }
409
410         // user defined functions
411         public void loadProjects (string id) {
412         
413             var rt = RooTicket.singleton();
414             rt.loadProjects();
415             
416             _this.project_id.loading = true;
417         
418             this.el.clear();                                    
419             Gtk.TreeIter iter;
420             var el = this.el;
421             
422             el.append(out iter);
423         
424             
425             el.set_value(iter, 0, "");
426             el.set_value(iter, 1, "-- select a project --");
427             if (id == "") {
428                     _this.project_id.el.set_active_iter(iter);
429             }
430             var projects = rt.projects;
431             foreach(var project in projects) {
432             
433                 el.append(out iter);
434                 
435                 el.set_value(iter, 0, project.id);
436                 el.set_value(iter, 1,  project.name );
437                 if (id == project.id) {
438                            _this.project_id.el.set_active_iter(iter);
439                     }   
440                 
441             }
442             
443             _this.project_id.loading = false;
444              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
445                                              
446         }
447     }
448
449
450     public class Xcls_summary : Object
451     {
452         public Gtk.Entry el;
453         private Ticket  _this;
454
455
456             // my vars (def)
457
458         // ctor
459         public Xcls_summary(Ticket _owner )
460         {
461             _this = _owner;
462             _this.summary = this;
463             this.el = new Gtk.Entry();
464
465             // my vars (dec)
466
467             // set gobject values
468             this.el.visible = true;
469         }
470
471         // user defined functions
472     }
473
474     public class Xcls_Label10 : Object
475     {
476         public Gtk.Label el;
477         private Ticket  _this;
478
479
480             // my vars (def)
481
482         // ctor
483         public Xcls_Label10(Ticket _owner )
484         {
485             _this = _owner;
486             this.el = new Gtk.Label( "Milestone" );
487
488             // my vars (dec)
489
490             // set gobject values
491             this.el.halign = Gtk.Align.START;
492             this.el.justify = Gtk.Justification.RIGHT;
493             this.el.xalign = 0.900000f;
494         }
495
496         // user defined functions
497     }
498
499     public class Xcls_milestone_id : Object
500     {
501         public Gtk.ComboBox el;
502         private Ticket  _this;
503
504
505             // my vars (def)
506         public bool loading;
507
508         // ctor
509         public Xcls_milestone_id(Ticket _owner )
510         {
511             _this = _owner;
512             _this.milestone_id = this;
513             this.el = new Gtk.ComboBox.with_entry();
514
515             // my vars (dec)
516             this.loading = false;
517
518             // set gobject values
519             var child_0 = new Xcls_msmodel( _this );
520             child_0.ref();
521             this.el.set_model (  child_0.el  );
522
523             // init method
524
525             this.el.set_entry_text_column(1);
526         }
527
528         // user defined functions
529         public string selectedMilestoneId () {
530                 Gtk.TreeIter iter;
531                 Value val1;
532          
533          
534                 this.el.get_active_iter (out iter);
535                 _this.msmodel.el.get_value (iter, 0, out val1);
536          
537         
538                 return  (string) val1;
539                 
540                 
541                 
542                 
543         }
544     }
545     public class Xcls_msmodel : Object
546     {
547         public Gtk.ListStore el;
548         private Ticket  _this;
549
550
551             // my vars (def)
552
553         // ctor
554         public Xcls_msmodel(Ticket _owner )
555         {
556             _this = _owner;
557             _this.msmodel = this;
558             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
559
560             // my vars (dec)
561
562             // set gobject values
563         }
564
565         // user defined functions
566         public void loadMilestones ( ) {
567         
568             var rt = RooTicket.singleton();
569            // rt.loadProjects();
570             
571             _this.milestone_id.loading = true;
572         
573             this.el.clear();                                    
574             Gtk.TreeIter iter;
575             var el = this.el;
576             
577             el.append(out iter);
578         
579             
580             el.set_value(iter, 0, "");
581             el.set_value(iter, 1, "-- select a milestone --");
582             _this.milestone_id.el.set_active_iter(iter);    
583              
584             var projects = rt.milestones;
585             foreach(var project in projects) {
586             
587                 el.append(out iter);
588                 
589                 el.set_value(iter, 0, project.id);
590                 el.set_value(iter, 1,  project.display_name );
591               //  if (id == project.id) {
592                  //        _this.milestone.el.set_active_iter(iter);
593                  //   }   
594                 
595             }
596             
597             
598             _this.milestone_id.loading = false;
599              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
600                                              
601         }
602     }
603
604
605     public class Xcls_Label13 : Object
606     {
607         public Gtk.Label el;
608         private Ticket  _this;
609
610
611             // my vars (def)
612
613         // ctor
614         public Xcls_Label13(Ticket _owner )
615         {
616             _this = _owner;
617             this.el = new Gtk.Label( "Description" );
618
619             // my vars (dec)
620
621             // set gobject values
622             this.el.halign = Gtk.Align.START;
623         }
624
625         // user defined functions
626     }
627
628     public class Xcls_description : Object
629     {
630         public Gtk.TextView el;
631         private Ticket  _this;
632
633
634             // my vars (def)
635
636         // ctor
637         public Xcls_description(Ticket _owner )
638         {
639             _this = _owner;
640             _this.description = this;
641             this.el = new Gtk.TextView();
642
643             // my vars (dec)
644
645             // set gobject values
646             this.el.border_width = 1;
647         }
648
649         // user defined functions
650     }
651
652     public class Xcls_Label15 : Object
653     {
654         public Gtk.Label el;
655         private Ticket  _this;
656
657
658             // my vars (def)
659
660         // ctor
661         public Xcls_Label15(Ticket _owner )
662         {
663             _this = _owner;
664             this.el = new Gtk.Label( "Priority" );
665
666             // my vars (dec)
667
668             // set gobject values
669             this.el.halign = Gtk.Align.START;
670             this.el.xalign = 0.900000f;
671         }
672
673         // user defined functions
674     }
675
676     public class Xcls_priority_id : Object
677     {
678         public Gtk.ComboBox el;
679         private Ticket  _this;
680
681
682             // my vars (def)
683         public bool loading;
684
685         // ctor
686         public Xcls_priority_id(Ticket _owner )
687         {
688             _this = _owner;
689             _this.priority_id = this;
690             this.el = new Gtk.ComboBox.with_entry();
691
692             // my vars (dec)
693             this.loading = false;
694
695             // set gobject values
696             var child_0 = new Xcls_primodel( _this );
697             child_0.ref();
698             this.el.set_model (  child_0.el  );
699
700             // init method
701
702             this.el.set_entry_text_column(1);
703         }
704
705         // user defined functions
706         public string selectedPriorityId () {
707                 Gtk.TreeIter iter;
708                 Value val1;
709          
710          
711                 this.el.get_active_iter (out iter);
712                 _this.primodel.el.get_value (iter, 0, out val1);
713          
714         
715                 return  (string) val1;
716                 
717                 
718                 
719                 
720         }
721     }
722     public class Xcls_primodel : Object
723     {
724         public Gtk.ListStore el;
725         private Ticket  _this;
726
727
728             // my vars (def)
729
730         // ctor
731         public Xcls_primodel(Ticket _owner )
732         {
733             _this = _owner;
734             _this.primodel = this;
735             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
736
737             // my vars (dec)
738
739             // set gobject values
740         }
741
742         // user defined functions
743         public void loadPriorities ( ) {
744         
745             var rt = RooTicket.singleton();
746            // rt.loadProjects();
747             
748             _this.priority_id.loading = true;
749         
750             this.el.clear();                                    
751             Gtk.TreeIter iter;
752             var el = this.el;
753             
754             
755            var projects = rt.priorities;
756             foreach(var project in projects) {
757             
758                 el.append(out iter);
759                 
760                 el.set_value(iter, 0, project.id);
761                 el.set_value(iter, 1,  project.display_name );
762                 if ("normal" == project.name) {
763                            _this.priority_id.el.set_active_iter(iter);
764                     }   
765                 
766             }
767             
768             _this.priority_id.loading = false;
769                    
770                                              
771         }
772     }
773
774
775     public class Xcls_Label18 : Object
776     {
777         public Gtk.Label el;
778         private Ticket  _this;
779
780
781             // my vars (def)
782
783         // ctor
784         public Xcls_Label18(Ticket _owner )
785         {
786             _this = _owner;
787             this.el = new Gtk.Label( "Severity" );
788
789             // my vars (dec)
790
791             // set gobject values
792             this.el.halign = Gtk.Align.START;
793         }
794
795         // user defined functions
796     }
797
798     public class Xcls_severity_id : Object
799     {
800         public Gtk.ComboBox el;
801         private Ticket  _this;
802
803
804             // my vars (def)
805         public bool loading;
806
807         // ctor
808         public Xcls_severity_id(Ticket _owner )
809         {
810             _this = _owner;
811             _this.severity_id = this;
812             this.el = new Gtk.ComboBox.with_entry();
813
814             // my vars (dec)
815             this.loading = false;
816
817             // set gobject values
818             var child_0 = new Xcls_sevmodel( _this );
819             child_0.ref();
820             this.el.set_model (  child_0.el  );
821
822             // init method
823
824             this.el.set_entry_text_column(1);
825         }
826
827         // user defined functions
828         public string selectedSeverityId () {
829                 Gtk.TreeIter iter;
830                 Value val1;
831          
832          
833                 this.el.get_active_iter (out iter);
834                 _this.sevmodel.el.get_value (iter, 0, out val1);
835          
836         
837                 return  (string) val1;
838                 
839                 
840                 
841                 
842         }
843     }
844     public class Xcls_sevmodel : Object
845     {
846         public Gtk.ListStore el;
847         private Ticket  _this;
848
849
850             // my vars (def)
851
852         // ctor
853         public Xcls_sevmodel(Ticket _owner )
854         {
855             _this = _owner;
856             _this.sevmodel = this;
857             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
858
859             // my vars (dec)
860
861             // set gobject values
862         }
863
864         // user defined functions
865         public void loadSeverities () {
866         
867             var rt = RooTicket.singleton();
868             //rt.loadProjects();
869             
870             _this.severity_id.loading = true;
871         
872             this.el.clear();                                    
873             Gtk.TreeIter iter;
874             var el = this.el;
875              
876             var projects = rt.serverities;
877             foreach(var project in projects) {
878             
879                 el.append(out iter);
880                 
881                 el.set_value(iter, 0, project.id);
882                 el.set_value(iter, 1,  project.display_name );
883                 if ("normal" == project.name) {
884                            _this.severity_id.el.set_active_iter(iter);
885                     }   
886                 
887             }
888            
889             _this.severity_id.loading = false;
890              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
891                                              
892         }
893     }
894
895
896     public class Xcls_Label21 : Object
897     {
898         public Gtk.Label el;
899         private Ticket  _this;
900
901
902             // my vars (def)
903
904         // ctor
905         public Xcls_Label21(Ticket _owner )
906         {
907             _this = _owner;
908             this.el = new Gtk.Label( "Classification" );
909
910             // my vars (dec)
911
912             // set gobject values
913             this.el.halign = Gtk.Align.START;
914         }
915
916         // user defined functions
917     }
918
919     public class Xcls_classification_id : Object
920     {
921         public Gtk.ComboBox el;
922         private Ticket  _this;
923
924
925             // my vars (def)
926         public bool loading;
927
928         // ctor
929         public Xcls_classification_id(Ticket _owner )
930         {
931             _this = _owner;
932             _this.classification_id = this;
933             this.el = new Gtk.ComboBox.with_entry();
934
935             // my vars (dec)
936             this.loading = false;
937
938             // set gobject values
939             var child_0 = new Xcls_clmodel( _this );
940             child_0.ref();
941             this.el.set_model (  child_0.el  );
942
943             // init method
944
945             this.el.set_entry_text_column(1);
946         }
947
948         // user defined functions
949         public string selectedClassificationId () {
950                 Gtk.TreeIter iter;
951                 Value val1;
952          
953          
954                 this.el.get_active_iter (out iter);
955                 _this.clmodel.el.get_value (iter, 0, out val1);
956          
957         
958                 return  (string) val1;
959                 
960                 
961                 
962                 
963         }
964     }
965     public class Xcls_clmodel : Object
966     {
967         public Gtk.ListStore el;
968         private Ticket  _this;
969
970
971             // my vars (def)
972
973         // ctor
974         public Xcls_clmodel(Ticket _owner )
975         {
976             _this = _owner;
977             _this.clmodel = this;
978             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
979
980             // my vars (dec)
981
982             // set gobject values
983         }
984
985         // user defined functions
986         public void loadClassifications ( ) {
987         
988             var rt = RooTicket.singleton();
989             // rt.loadProjects();
990             
991             _this.classification_id.loading = true;
992         
993             this.el.clear();                                    
994             Gtk.TreeIter iter;
995             var el = this.el;
996             
997             el.append(out iter);
998         
999              
1000             var projects = rt.classifications;
1001             foreach(var project in projects) {
1002             
1003                 el.append(out iter);
1004                 
1005                 el.set_value(iter, 0, project.id);
1006                 el.set_value(iter, 1,  project.display_name );
1007                 if ("bug" == project.name) {
1008                            _this.classification_id.el.set_active_iter(iter);
1009                     }   
1010                 
1011             }
1012             
1013             _this.classification_id.loading = false;
1014              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
1015                                              
1016         }
1017     }
1018
1019
1020     public class Xcls_Label24 : Object
1021     {
1022         public Gtk.Label el;
1023         private Ticket  _this;
1024
1025
1026             // my vars (def)
1027
1028         // ctor
1029         public Xcls_Label24(Ticket _owner )
1030         {
1031             _this = _owner;
1032             this.el = new Gtk.Label( "Assign to" );
1033
1034             // my vars (dec)
1035
1036             // set gobject values
1037             this.el.halign = Gtk.Align.START;
1038         }
1039
1040         // user defined functions
1041     }
1042
1043     public class Xcls_developer_id : Object
1044     {
1045         public Gtk.ComboBox el;
1046         private Ticket  _this;
1047
1048
1049             // my vars (def)
1050         public bool loading;
1051
1052         // ctor
1053         public Xcls_developer_id(Ticket _owner )
1054         {
1055             _this = _owner;
1056             _this.developer_id = this;
1057             this.el = new Gtk.ComboBox.with_entry();
1058
1059             // my vars (dec)
1060             this.loading = false;
1061
1062             // set gobject values
1063             var child_0 = new Xcls_devmodel( _this );
1064             child_0.ref();
1065             this.el.set_model (  child_0.el  );
1066
1067             // init method
1068
1069             this.el.set_entry_text_column(1);
1070         }
1071
1072         // user defined functions
1073         public string selectedDeveloperId () {
1074                 Gtk.TreeIter iter;
1075                 Value val1;
1076          
1077          
1078                 this.el.get_active_iter (out iter);
1079                 _this.devmodel.el.get_value (iter, 0, out val1);
1080          
1081         
1082                 return  (string) val1;
1083                 
1084                 
1085                 
1086                 
1087         }
1088     }
1089     public class Xcls_devmodel : Object
1090     {
1091         public Gtk.ListStore el;
1092         private Ticket  _this;
1093
1094
1095             // my vars (def)
1096
1097         // ctor
1098         public Xcls_devmodel(Ticket _owner )
1099         {
1100             _this = _owner;
1101             _this.devmodel = this;
1102             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
1103
1104             // my vars (dec)
1105
1106             // set gobject values
1107         }
1108
1109         // user defined functions
1110         public void loadDevelopers ( ) {
1111         
1112             var rt = RooTicket.singleton();
1113             //rt.loadProjects();
1114             
1115             _this.developer_id.loading = true;
1116         
1117             this.el.clear();                                    
1118             Gtk.TreeIter iter;
1119             var el = this.el;
1120             
1121             el.append(out iter);
1122         
1123             
1124             el.set_value(iter, 0, "");
1125             el.set_value(iter, 1, "-- select a developer --");
1126           //  if (id == "") {
1127                     _this.developer_id.el.set_active_iter(iter);
1128            // }
1129             
1130             var projects = rt.developers;
1131             foreach(var project in projects) {
1132             
1133                 el.append(out iter);
1134                 
1135                 el.set_value(iter, 0, project.id);
1136                 el.set_value(iter, 1,  project.display_name );
1137         //        if (id == project.id) {
1138                 //         _this.projectsel.el.set_active_iter(iter);
1139         //          }   
1140                 
1141             }
1142          
1143             _this.developer_id.loading = false;
1144              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
1145                                              
1146         }
1147     }
1148
1149
1150     public class Xcls_Button27 : Object
1151     {
1152         public Gtk.Button el;
1153         private Ticket  _this;
1154
1155
1156             // my vars (def)
1157
1158         // ctor
1159         public Xcls_Button27(Ticket _owner )
1160         {
1161             _this = _owner;
1162             this.el = new Gtk.Button();
1163
1164             // my vars (dec)
1165
1166             // set gobject values
1167             this.el.label = "Create Ticket";
1168
1169             // init method
1170
1171             {
1172                this.el.get_style_context().add_class("suggested-action");
1173             }
1174
1175             //listeners
1176             this.el.clicked.connect( () => {
1177                 GLib.debug("fire response = 1");
1178                 
1179                 
1180                 var invalid = false;
1181                 
1182                 // validate first...
1183                 _this.project_id.el.get_child().get_style_context().remove_class("warning");    
1184                 if (_this.project_id.selectedProjectId() == "") {
1185                         _this.project_id.el.get_child().get_style_context().add_class("warning");
1186                         invalid = true;
1187                 }
1188                 
1189                 _this.milestone_id.el.get_child().get_style_context().remove_class("warning");  
1190                 if (_this.milestone_id.selectedMilestoneId() == "") {
1191                         _this.milestone_id.el.get_child().get_style_context().add_class("warning");
1192                         invalid = true;
1193                 }
1194             
1195                 _this.priority_id.el.get_child().get_style_context().remove_class("warning");   
1196                 if (_this.priority_id.selectedPriorityId() == "") {
1197                         _this.priority_id.el.get_child().get_style_context().add_class("warning");
1198                         invalid = true;
1199                 }
1200                 
1201                 _this.classification_id.el.get_child().get_style_context().remove_class("warning");     
1202                 if (_this.classification_id.selectedClassificationId() == "") {
1203                         _this.classification_id.el.get_child().get_style_context().add_class("warning");
1204                         invalid = true;
1205                 }
1206                 
1207                 _this.developer_id.el.get_child().get_style_context().remove_class("warning");  
1208                 if (_this.developer_id.selectedDeveloperId() == "") {
1209                         _this.developer_id.el.get_child().get_style_context().add_class("warning");
1210                         invalid = true;
1211                 }
1212                 
1213                 _this.summary.el.get_style_context().remove_class("warning");   
1214                 if (_this.summary.el.get_text() == "") {
1215                         _this.summary.el.get_style_context().add_class("warning");
1216                         invalid = true;
1217                 }
1218                 
1219                 _this.description.el.get_style_context().remove_class("warning");       
1220                 if (_this.description.el.buffer.text == "") {
1221                         _this.description.el.get_style_context().add_class("warning");
1222                         invalid = true;
1223                 }
1224                 
1225                 
1226                 if (invalid) {
1227                         return;
1228                 }
1229                 GLib.debug("for is valid");
1230                 
1231                 _this.el.response(1);
1232             });
1233         }
1234
1235         // user defined functions
1236     }
1237
1238
1239
1240 }