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