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