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.msmodel.loadMilestones();
304                 _this.primodel.loadPriorities();
305                 _this.sevmodel.loadSeverities();
306                 _this.clmodel.loadClassifications();    
307                 _this.devmodel.loadDevelopers();        
308                 
309                 // affects projects and milestones..
310                 
311                 
312                 /*if (this.loading) {
313                         return;
314                 }
315                 var ticket_id = this.selectedTicketId();
316                 
317                 var name = RooTicket.singleton().usernameLocal();
318                 
319                 if (ticket_id == "" || ticket_id == null) {
320                 
321                         var dt = new  DateTime.now_local();
322                         _this.name.el.set_text("wip_%s_%s".printf(name,dt.format("%Y_%b_%d")));
323                         return;
324                 }
325                 
326                 
327                 var ticket = RooTicket.singleton().getById(ticket_id);
328                
329                 _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
330                 
331                 //GLib.debug (//"Selection: %s, %s\n", (string) val1, (string) val2);
332                 */
333             });
334         }
335
336         // user defined functions
337         public string selectedProjectId () {
338                 Gtk.TreeIter iter;
339                 Value val1;
340          
341          
342                 this.el.get_active_iter (out iter);
343                 _this.prmodel.el.get_value (iter, 0, out val1);
344          
345         
346                 return  (string) val1;
347                 
348                 
349                 
350                 
351         }
352     }
353     public class Xcls_prcellrenderer : Object
354     {
355         public Gtk.CellRendererText el;
356         private Ticket  _this;
357
358
359             // my vars (def)
360
361         // ctor
362         public Xcls_prcellrenderer(Ticket _owner )
363         {
364             _this = _owner;
365             _this.prcellrenderer = this;
366             this.el = new Gtk.CellRendererText();
367
368             // my vars (dec)
369
370             // set gobject values
371         }
372
373         // user defined functions
374     }
375
376     public class Xcls_prmodel : Object
377     {
378         public Gtk.ListStore el;
379         private Ticket  _this;
380
381
382             // my vars (def)
383
384         // ctor
385         public Xcls_prmodel(Ticket _owner )
386         {
387             _this = _owner;
388             _this.prmodel = this;
389             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
390
391             // my vars (dec)
392
393             // set gobject values
394         }
395
396         // user defined functions
397         public void loadProjects (string id) {
398         
399             var rt = RooTicket.singleton();
400             rt.loadProjects();
401             
402             _this.project_id.loading = true;
403         
404             this.el.clear();                                    
405             Gtk.TreeIter iter;
406             var el = this.el;
407             
408             el.append(out iter);
409         
410             
411             el.set_value(iter, 0, "");
412             el.set_value(iter, 1, "-- select a project --");
413             if (id == "") {
414                     _this.project_id.el.set_active_iter(iter);
415             }
416             var projects = rt.projects;
417             foreach(var project in projects) {
418             
419                 el.append(out iter);
420                 
421                 el.set_value(iter, 0, project.id);
422                 el.set_value(iter, 1,  project.name );
423                 if (id == project.id) {
424                            _this.project_id.el.set_active_iter(iter);
425                     }   
426                 
427             }
428             
429             _this.project_id.loading = false;
430              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
431                                              
432         }
433     }
434
435
436     public class Xcls_summary : Object
437     {
438         public Gtk.Entry el;
439         private Ticket  _this;
440
441
442             // my vars (def)
443
444         // ctor
445         public Xcls_summary(Ticket _owner )
446         {
447             _this = _owner;
448             _this.summary = this;
449             this.el = new Gtk.Entry();
450
451             // my vars (dec)
452
453             // set gobject values
454             this.el.visible = true;
455         }
456
457         // user defined functions
458     }
459
460     public class Xcls_Label10 : Object
461     {
462         public Gtk.Label el;
463         private Ticket  _this;
464
465
466             // my vars (def)
467
468         // ctor
469         public Xcls_Label10(Ticket _owner )
470         {
471             _this = _owner;
472             this.el = new Gtk.Label( "Milestone" );
473
474             // my vars (dec)
475
476             // set gobject values
477             this.el.halign = Gtk.Align.START;
478             this.el.justify = Gtk.Justification.RIGHT;
479             this.el.xalign = 0.900000f;
480         }
481
482         // user defined functions
483     }
484
485     public class Xcls_milestone_id : Object
486     {
487         public Gtk.ComboBox el;
488         private Ticket  _this;
489
490
491             // my vars (def)
492         public bool loading;
493
494         // ctor
495         public Xcls_milestone_id(Ticket _owner )
496         {
497             _this = _owner;
498             _this.milestone_id = this;
499             this.el = new Gtk.ComboBox.with_entry();
500
501             // my vars (dec)
502             this.loading = false;
503
504             // set gobject values
505             var child_0 = new Xcls_msmodel( _this );
506             child_0.ref();
507             this.el.set_model (  child_0.el  );
508
509             // init method
510
511             this.el.set_entry_text_column(1);
512         }
513
514         // user defined functions
515         public string selectedMilestoneId () {
516                 Gtk.TreeIter iter;
517                 Value val1;
518          
519          
520                 this.el.get_active_iter (out iter);
521                 _this.msmodel.el.get_value (iter, 0, out val1);
522          
523         
524                 return  (string) val1;
525                 
526                 
527                 
528                 
529         }
530     }
531     public class Xcls_msmodel : Object
532     {
533         public Gtk.ListStore el;
534         private Ticket  _this;
535
536
537             // my vars (def)
538
539         // ctor
540         public Xcls_msmodel(Ticket _owner )
541         {
542             _this = _owner;
543             _this.msmodel = this;
544             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
545
546             // my vars (dec)
547
548             // set gobject values
549         }
550
551         // user defined functions
552         public void loadMilestones ( ) {
553         
554             var rt = RooTicket.singleton();
555            // rt.loadProjects();
556             
557             _this.milestone_id.loading = true;
558         
559             this.el.clear();                                    
560             Gtk.TreeIter iter;
561             var el = this.el;
562             
563             el.append(out iter);
564         
565             
566             el.set_value(iter, 0, "");
567             el.set_value(iter, 1, "-- select a milestone --");
568             _this.milestone_id.el.set_active_iter(iter);    
569              
570             var projects = rt.milestones;
571             foreach(var project in projects) {
572             
573                 el.append(out iter);
574                 
575                 el.set_value(iter, 0, project.id);
576                 el.set_value(iter, 1,  project.display_name );
577               //  if (id == project.id) {
578                  //        _this.milestone.el.set_active_iter(iter);
579                  //   }   
580                 
581             }
582             
583             
584             _this.milestone_id.loading = false;
585              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
586                                              
587         }
588     }
589
590
591     public class Xcls_Label13 : Object
592     {
593         public Gtk.Label el;
594         private Ticket  _this;
595
596
597             // my vars (def)
598
599         // ctor
600         public Xcls_Label13(Ticket _owner )
601         {
602             _this = _owner;
603             this.el = new Gtk.Label( "Description" );
604
605             // my vars (dec)
606
607             // set gobject values
608             this.el.halign = Gtk.Align.START;
609         }
610
611         // user defined functions
612     }
613
614     public class Xcls_description : Object
615     {
616         public Gtk.TextView el;
617         private Ticket  _this;
618
619
620             // my vars (def)
621
622         // ctor
623         public Xcls_description(Ticket _owner )
624         {
625             _this = _owner;
626             _this.description = this;
627             this.el = new Gtk.TextView();
628
629             // my vars (dec)
630
631             // set gobject values
632             this.el.border_width = 1;
633         }
634
635         // user defined functions
636     }
637
638     public class Xcls_Label15 : Object
639     {
640         public Gtk.Label el;
641         private Ticket  _this;
642
643
644             // my vars (def)
645
646         // ctor
647         public Xcls_Label15(Ticket _owner )
648         {
649             _this = _owner;
650             this.el = new Gtk.Label( "Priority" );
651
652             // my vars (dec)
653
654             // set gobject values
655             this.el.halign = Gtk.Align.START;
656             this.el.xalign = 0.900000f;
657         }
658
659         // user defined functions
660     }
661
662     public class Xcls_priority_id : Object
663     {
664         public Gtk.ComboBox el;
665         private Ticket  _this;
666
667
668             // my vars (def)
669         public bool loading;
670
671         // ctor
672         public Xcls_priority_id(Ticket _owner )
673         {
674             _this = _owner;
675             _this.priority_id = this;
676             this.el = new Gtk.ComboBox.with_entry();
677
678             // my vars (dec)
679             this.loading = false;
680
681             // set gobject values
682             var child_0 = new Xcls_primodel( _this );
683             child_0.ref();
684             this.el.set_model (  child_0.el  );
685
686             // init method
687
688             this.el.set_entry_text_column(1);
689         }
690
691         // user defined functions
692         public string selectedPriorityId () {
693                 Gtk.TreeIter iter;
694                 Value val1;
695          
696          
697                 this.el.get_active_iter (out iter);
698                 _this.primodel.el.get_value (iter, 0, out val1);
699          
700         
701                 return  (string) val1;
702                 
703                 
704                 
705                 
706         }
707     }
708     public class Xcls_primodel : Object
709     {
710         public Gtk.ListStore el;
711         private Ticket  _this;
712
713
714             // my vars (def)
715
716         // ctor
717         public Xcls_primodel(Ticket _owner )
718         {
719             _this = _owner;
720             _this.primodel = this;
721             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
722
723             // my vars (dec)
724
725             // set gobject values
726         }
727
728         // user defined functions
729         public void loadPriorities ( ) {
730         
731             var rt = RooTicket.singleton();
732            // rt.loadProjects();
733             
734             _this.priority_id.loading = true;
735         
736             this.el.clear();                                    
737             Gtk.TreeIter iter;
738             var el = this.el;
739             
740             
741            var projects = rt.priorities;
742             foreach(var project in projects) {
743             
744                 el.append(out iter);
745                 
746                 el.set_value(iter, 0, project.id);
747                 el.set_value(iter, 1,  project.display_name );
748                 if ("normal" == project.name) {
749                            _this.priority_id.el.set_active_iter(iter);
750                     }   
751                 
752             }
753             
754             _this.priority_id.loading = false;
755                    
756                                              
757         }
758     }
759
760
761     public class Xcls_Label18 : Object
762     {
763         public Gtk.Label el;
764         private Ticket  _this;
765
766
767             // my vars (def)
768
769         // ctor
770         public Xcls_Label18(Ticket _owner )
771         {
772             _this = _owner;
773             this.el = new Gtk.Label( "Severity" );
774
775             // my vars (dec)
776
777             // set gobject values
778             this.el.halign = Gtk.Align.START;
779         }
780
781         // user defined functions
782     }
783
784     public class Xcls_severity_id : Object
785     {
786         public Gtk.ComboBox el;
787         private Ticket  _this;
788
789
790             // my vars (def)
791         public bool loading;
792
793         // ctor
794         public Xcls_severity_id(Ticket _owner )
795         {
796             _this = _owner;
797             _this.severity_id = this;
798             this.el = new Gtk.ComboBox.with_entry();
799
800             // my vars (dec)
801             this.loading = false;
802
803             // set gobject values
804             var child_0 = new Xcls_sevmodel( _this );
805             child_0.ref();
806             this.el.set_model (  child_0.el  );
807
808             // init method
809
810             this.el.set_entry_text_column(1);
811         }
812
813         // user defined functions
814         public string selectedSeverityId () {
815                 Gtk.TreeIter iter;
816                 Value val1;
817          
818          
819                 this.el.get_active_iter (out iter);
820                 _this.sevmodel.el.get_value (iter, 0, out val1);
821          
822         
823                 return  (string) val1;
824                 
825                 
826                 
827                 
828         }
829     }
830     public class Xcls_sevmodel : Object
831     {
832         public Gtk.ListStore el;
833         private Ticket  _this;
834
835
836             // my vars (def)
837
838         // ctor
839         public Xcls_sevmodel(Ticket _owner )
840         {
841             _this = _owner;
842             _this.sevmodel = this;
843             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
844
845             // my vars (dec)
846
847             // set gobject values
848         }
849
850         // user defined functions
851         public void loadSeverities () {
852         
853             var rt = RooTicket.singleton();
854             //rt.loadProjects();
855             
856             _this.severity_id.loading = true;
857         
858             this.el.clear();                                    
859             Gtk.TreeIter iter;
860             var el = this.el;
861              
862             var projects = rt.serverities;
863             foreach(var project in projects) {
864             
865                 el.append(out iter);
866                 
867                 el.set_value(iter, 0, project.id);
868                 el.set_value(iter, 1,  project.display_name );
869                 if ("normal" == project.name) {
870                            _this.severity_id.el.set_active_iter(iter);
871                     }   
872                 
873             }
874            
875             _this.severity_id.loading = false;
876              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
877                                              
878         }
879     }
880
881
882     public class Xcls_Label21 : Object
883     {
884         public Gtk.Label el;
885         private Ticket  _this;
886
887
888             // my vars (def)
889
890         // ctor
891         public Xcls_Label21(Ticket _owner )
892         {
893             _this = _owner;
894             this.el = new Gtk.Label( "Classification" );
895
896             // my vars (dec)
897
898             // set gobject values
899             this.el.halign = Gtk.Align.START;
900         }
901
902         // user defined functions
903     }
904
905     public class Xcls_classification_id : Object
906     {
907         public Gtk.ComboBox el;
908         private Ticket  _this;
909
910
911             // my vars (def)
912         public bool loading;
913
914         // ctor
915         public Xcls_classification_id(Ticket _owner )
916         {
917             _this = _owner;
918             _this.classification_id = this;
919             this.el = new Gtk.ComboBox.with_entry();
920
921             // my vars (dec)
922             this.loading = false;
923
924             // set gobject values
925             var child_0 = new Xcls_clmodel( _this );
926             child_0.ref();
927             this.el.set_model (  child_0.el  );
928
929             // init method
930
931             this.el.set_entry_text_column(1);
932         }
933
934         // user defined functions
935         public string selectedProjectId () {
936                 Gtk.TreeIter iter;
937                 Value val1;
938          
939          
940                 this.el.get_active_iter (out iter);
941                 _this.prmodel.el.get_value (iter, 0, out val1);
942          
943         
944                 return  (string) val1;
945                 
946                 
947                 
948                 
949         }
950     }
951     public class Xcls_clmodel : Object
952     {
953         public Gtk.ListStore el;
954         private Ticket  _this;
955
956
957             // my vars (def)
958
959         // ctor
960         public Xcls_clmodel(Ticket _owner )
961         {
962             _this = _owner;
963             _this.clmodel = this;
964             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
965
966             // my vars (dec)
967
968             // set gobject values
969         }
970
971         // user defined functions
972         public void loadClassifications ( ) {
973         
974             var rt = RooTicket.singleton();
975             // rt.loadProjects();
976             
977             _this.classification_id.loading = true;
978         
979             this.el.clear();                                    
980             Gtk.TreeIter iter;
981             var el = this.el;
982             
983             el.append(out iter);
984         
985              
986             var projects = rt.classifications;
987             foreach(var project in projects) {
988             
989                 el.append(out iter);
990                 
991                 el.set_value(iter, 0, project.id);
992                 el.set_value(iter, 1,  project.display_name );
993                 if ("bug" == project.name) {
994                            _this.classification_id.el.set_active_iter(iter);
995                     }   
996                 
997             }
998             
999             _this.classification_id.loading = false;
1000              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
1001                                              
1002         }
1003     }
1004
1005
1006     public class Xcls_Label24 : Object
1007     {
1008         public Gtk.Label el;
1009         private Ticket  _this;
1010
1011
1012             // my vars (def)
1013
1014         // ctor
1015         public Xcls_Label24(Ticket _owner )
1016         {
1017             _this = _owner;
1018             this.el = new Gtk.Label( "Assign to" );
1019
1020             // my vars (dec)
1021
1022             // set gobject values
1023             this.el.halign = Gtk.Align.START;
1024         }
1025
1026         // user defined functions
1027     }
1028
1029     public class Xcls_developer_id : Object
1030     {
1031         public Gtk.ComboBox el;
1032         private Ticket  _this;
1033
1034
1035             // my vars (def)
1036         public bool loading;
1037
1038         // ctor
1039         public Xcls_developer_id(Ticket _owner )
1040         {
1041             _this = _owner;
1042             _this.developer_id = this;
1043             this.el = new Gtk.ComboBox.with_entry();
1044
1045             // my vars (dec)
1046             this.loading = false;
1047
1048             // set gobject values
1049             var child_0 = new Xcls_devmodel( _this );
1050             child_0.ref();
1051             this.el.set_model (  child_0.el  );
1052
1053             // init method
1054
1055             this.el.set_entry_text_column(1);
1056         }
1057
1058         // user defined functions
1059         public string selectedDeveloperId () {
1060                 Gtk.TreeIter iter;
1061                 Value val1;
1062          
1063          
1064                 this.el.get_active_iter (out iter);
1065                 _this.devmodel.el.get_value (iter, 0, out val1);
1066          
1067         
1068                 return  (string) val1;
1069                 
1070                 
1071                 
1072                 
1073         }
1074     }
1075     public class Xcls_devmodel : Object
1076     {
1077         public Gtk.ListStore el;
1078         private Ticket  _this;
1079
1080
1081             // my vars (def)
1082
1083         // ctor
1084         public Xcls_devmodel(Ticket _owner )
1085         {
1086             _this = _owner;
1087             _this.devmodel = this;
1088             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
1089
1090             // my vars (dec)
1091
1092             // set gobject values
1093         }
1094
1095         // user defined functions
1096         public void loadDevelopers ( ) {
1097         
1098             var rt = RooTicket.singleton();
1099             //rt.loadProjects();
1100             
1101             _this.developer_id.loading = true;
1102         
1103             this.el.clear();                                    
1104             Gtk.TreeIter iter;
1105             var el = this.el;
1106             
1107             el.append(out iter);
1108         
1109             
1110             el.set_value(iter, 0, "");
1111             el.set_value(iter, 1, "-- select a project --");
1112           //  if (id == "") {
1113                     _this.developer_id.el.set_active_iter(iter);
1114            // }
1115             
1116             var projects = rt.developers;
1117             foreach(var project in projects) {
1118             
1119                 el.append(out iter);
1120                 
1121                 el.set_value(iter, 0, project.id);
1122                 el.set_value(iter, 1,  project.display_name );
1123         //        if (id == project.id) {
1124                 //         _this.projectsel.el.set_active_iter(iter);
1125         //          }   
1126                 
1127             }
1128          
1129             _this.developer_id.loading = false;
1130              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
1131                                              
1132         }
1133     }
1134
1135
1136     public class Xcls_Button27 : Object
1137     {
1138         public Gtk.Button el;
1139         private Ticket  _this;
1140
1141
1142             // my vars (def)
1143
1144         // ctor
1145         public Xcls_Button27(Ticket _owner )
1146         {
1147             _this = _owner;
1148             this.el = new Gtk.Button();
1149
1150             // my vars (dec)
1151
1152             // set gobject values
1153             this.el.label = "Create Ticket";
1154
1155             // init method
1156
1157             {
1158                this.el.get_style_context().add_class("suggested-action");
1159             }
1160
1161             //listeners
1162             this.el.clicked.connect( () => {
1163                 GLib.debug("fire response = 1");
1164                 _this.el.response(1);
1165             });
1166         }
1167
1168         // user defined functions
1169     }
1170
1171
1172
1173 }