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             el.append(out iter);
741         
742             
743             el.set_value(iter, 0, "");
744             el.set_value(iter, 1, "-- select priority --");
745            // if (id == "") {
746                     _this.priority_id.el.set_active_iter(iter);
747             //}
748            var projects = rt.priorities;
749             foreach(var project in projects) {
750             
751                 el.append(out iter);
752                 
753                 el.set_value(iter, 0, project.id);
754                 el.set_value(iter, 1,  project.display_name );
755                 //if (id == project.id) {
756                            _this.priority_id.el.set_active_iter(iter);
757                     //}   
758                 
759             }
760             
761             _this.priority_id.loading = false;
762                    
763                                              
764         }
765     }
766
767
768     public class Xcls_Label18 : Object
769     {
770         public Gtk.Label el;
771         private Ticket  _this;
772
773
774             // my vars (def)
775
776         // ctor
777         public Xcls_Label18(Ticket _owner )
778         {
779             _this = _owner;
780             this.el = new Gtk.Label( "Severity" );
781
782             // my vars (dec)
783
784             // set gobject values
785             this.el.halign = Gtk.Align.START;
786         }
787
788         // user defined functions
789     }
790
791     public class Xcls_severity_id : Object
792     {
793         public Gtk.ComboBox el;
794         private Ticket  _this;
795
796
797             // my vars (def)
798         public bool loading;
799
800         // ctor
801         public Xcls_severity_id(Ticket _owner )
802         {
803             _this = _owner;
804             _this.severity_id = this;
805             this.el = new Gtk.ComboBox.with_entry();
806
807             // my vars (dec)
808             this.loading = false;
809
810             // set gobject values
811             var child_0 = new Xcls_sevmodel( _this );
812             child_0.ref();
813             this.el.set_model (  child_0.el  );
814
815             // init method
816
817             this.el.set_entry_text_column(1);
818         }
819
820         // user defined functions
821         public string selectedSeverityId () {
822                 Gtk.TreeIter iter;
823                 Value val1;
824          
825          
826                 this.el.get_active_iter (out iter);
827                 _this.sevmodel.el.get_value (iter, 0, out val1);
828          
829         
830                 return  (string) val1;
831                 
832                 
833                 
834                 
835         }
836     }
837     public class Xcls_sevmodel : Object
838     {
839         public Gtk.ListStore el;
840         private Ticket  _this;
841
842
843             // my vars (def)
844
845         // ctor
846         public Xcls_sevmodel(Ticket _owner )
847         {
848             _this = _owner;
849             _this.sevmodel = this;
850             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
851
852             // my vars (dec)
853
854             // set gobject values
855         }
856
857         // user defined functions
858         public void loadSeverities () {
859         
860             var rt = RooTicket.singleton();
861             //rt.loadProjects();
862             
863             _this.severity_id.loading = true;
864         
865             this.el.clear();                                    
866             Gtk.TreeIter iter;
867             var el = this.el;
868             
869             el.append(out iter);
870         
871             
872             el.set_value(iter, 0, "");
873             el.set_value(iter, 1, "-- select severity --");
874            // if (id == "") {
875                     _this.severity_id.el.set_active_iter(iter);
876            // }
877            
878             var projects = rt.serverities;
879             foreach(var project in projects) {
880             
881                 el.append(out iter);
882                 
883                 el.set_value(iter, 0, project.id);
884                 el.set_value(iter, 1,  project.display_name );
885                 //if (id == project.id) {
886                         //   _this.severity_id.el.set_active_iter(iter);
887                     //}   
888                 
889             }
890            
891             _this.severity_id.loading = false;
892              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
893                                              
894         }
895     }
896
897
898     public class Xcls_Label21 : Object
899     {
900         public Gtk.Label el;
901         private Ticket  _this;
902
903
904             // my vars (def)
905
906         // ctor
907         public Xcls_Label21(Ticket _owner )
908         {
909             _this = _owner;
910             this.el = new Gtk.Label( "Classification" );
911
912             // my vars (dec)
913
914             // set gobject values
915             this.el.halign = Gtk.Align.START;
916         }
917
918         // user defined functions
919     }
920
921     public class Xcls_classification_id : Object
922     {
923         public Gtk.ComboBox el;
924         private Ticket  _this;
925
926
927             // my vars (def)
928         public bool loading;
929
930         // ctor
931         public Xcls_classification_id(Ticket _owner )
932         {
933             _this = _owner;
934             _this.classification_id = this;
935             this.el = new Gtk.ComboBox.with_entry();
936
937             // my vars (dec)
938             this.loading = false;
939
940             // set gobject values
941             var child_0 = new Xcls_clmodel( _this );
942             child_0.ref();
943             this.el.set_model (  child_0.el  );
944
945             // init method
946
947             this.el.set_entry_text_column(1);
948         }
949
950         // user defined functions
951         public string selectedProjectId () {
952                 Gtk.TreeIter iter;
953                 Value val1;
954          
955          
956                 this.el.get_active_iter (out iter);
957                 _this.prmodel.el.get_value (iter, 0, out val1);
958          
959         
960                 return  (string) val1;
961                 
962                 
963                 
964                 
965         }
966     }
967     public class Xcls_clmodel : Object
968     {
969         public Gtk.ListStore el;
970         private Ticket  _this;
971
972
973             // my vars (def)
974
975         // ctor
976         public Xcls_clmodel(Ticket _owner )
977         {
978             _this = _owner;
979             _this.clmodel = this;
980             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
981
982             // my vars (dec)
983
984             // set gobject values
985         }
986
987         // user defined functions
988         public void loadClassifications ( ) {
989         
990             var rt = RooTicket.singleton();
991             // rt.loadProjects();
992             
993             _this.classification_id.loading = true;
994         
995             this.el.clear();                                    
996             Gtk.TreeIter iter;
997             var el = this.el;
998             
999             el.append(out iter);
1000         
1001             
1002             el.set_value(iter, 0, "");
1003             el.set_value(iter, 1, "-- select a project --");
1004             if (id == "") {
1005                     _this.classification_id.el.set_active_iter(iter);
1006             }
1007             
1008             var projects = rt.classifications;
1009             foreach(var project in projects) {
1010             
1011                 el.append(out iter);
1012                 
1013                 el.set_value(iter, 0, project.id);
1014                 el.set_value(iter, 1,  project.display_name );
1015             //    if (id == project.id) {
1016                 //         _this.classification_id.el.set_active_iter(iter);
1017                 //    }   
1018                 
1019             }
1020             
1021             _this.classification_id.loading = false;
1022              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
1023                                              
1024         }
1025     }
1026
1027
1028     public class Xcls_Label24 : Object
1029     {
1030         public Gtk.Label el;
1031         private Ticket  _this;
1032
1033
1034             // my vars (def)
1035
1036         // ctor
1037         public Xcls_Label24(Ticket _owner )
1038         {
1039             _this = _owner;
1040             this.el = new Gtk.Label( "Assign to" );
1041
1042             // my vars (dec)
1043
1044             // set gobject values
1045             this.el.halign = Gtk.Align.START;
1046         }
1047
1048         // user defined functions
1049     }
1050
1051     public class Xcls_developer_id : Object
1052     {
1053         public Gtk.ComboBox el;
1054         private Ticket  _this;
1055
1056
1057             // my vars (def)
1058         public bool loading;
1059
1060         // ctor
1061         public Xcls_developer_id(Ticket _owner )
1062         {
1063             _this = _owner;
1064             _this.developer_id = this;
1065             this.el = new Gtk.ComboBox.with_entry();
1066
1067             // my vars (dec)
1068             this.loading = false;
1069
1070             // set gobject values
1071             var child_0 = new Xcls_devmodel( _this );
1072             child_0.ref();
1073             this.el.set_model (  child_0.el  );
1074
1075             // init method
1076
1077             this.el.set_entry_text_column(1);
1078         }
1079
1080         // user defined functions
1081         public string selectedDeveloperId () {
1082                 Gtk.TreeIter iter;
1083                 Value val1;
1084          
1085          
1086                 this.el.get_active_iter (out iter);
1087                 _this.devmodel.el.get_value (iter, 0, out val1);
1088          
1089         
1090                 return  (string) val1;
1091                 
1092                 
1093                 
1094                 
1095         }
1096     }
1097     public class Xcls_devmodel : Object
1098     {
1099         public Gtk.ListStore el;
1100         private Ticket  _this;
1101
1102
1103             // my vars (def)
1104
1105         // ctor
1106         public Xcls_devmodel(Ticket _owner )
1107         {
1108             _this = _owner;
1109             _this.devmodel = this;
1110             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
1111
1112             // my vars (dec)
1113
1114             // set gobject values
1115         }
1116
1117         // user defined functions
1118         public void loadDevelopers ( ) {
1119         
1120             var rt = RooTicket.singleton();
1121             //rt.loadProjects();
1122             
1123             _this.developer_id.loading = true;
1124         
1125             this.el.clear();                                    
1126             Gtk.TreeIter iter;
1127             var el = this.el;
1128             
1129             el.append(out iter);
1130         
1131             
1132             el.set_value(iter, 0, "");
1133             el.set_value(iter, 1, "-- select a project --");
1134           //  if (id == "") {
1135                     _this.developer_id.el.set_active_iter(iter);
1136            // }
1137             
1138             var projects = rt.developers;
1139             foreach(var project in projects) {
1140             
1141                 el.append(out iter);
1142                 
1143                 el.set_value(iter, 0, project.id);
1144                 el.set_value(iter, 1,  project.display_name );
1145         //        if (id == project.id) {
1146                 //         _this.projectsel.el.set_active_iter(iter);
1147         //          }   
1148                 
1149             }
1150          
1151             _this.developer_id.loading = false;
1152              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
1153                                              
1154         }
1155     }
1156
1157
1158     public class Xcls_Button27 : Object
1159     {
1160         public Gtk.Button el;
1161         private Ticket  _this;
1162
1163
1164             // my vars (def)
1165
1166         // ctor
1167         public Xcls_Button27(Ticket _owner )
1168         {
1169             _this = _owner;
1170             this.el = new Gtk.Button();
1171
1172             // my vars (dec)
1173
1174             // set gobject values
1175             this.el.label = "Create Ticket";
1176
1177             // init method
1178
1179             {
1180                this.el.get_style_context().add_class("suggested-action");
1181             }
1182
1183             //listeners
1184             this.el.clicked.connect( () => {
1185                 GLib.debug("fire response = 1");
1186                 _this.el.response(1);
1187             });
1188         }
1189
1190         // user defined functions
1191     }
1192
1193
1194
1195 }