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 (string id) {
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             if (id == "") {
571         
572             }
573             var projects = rt.projects;
574             foreach(var project in projects) {
575             
576                 el.append(out iter);
577                 
578                 el.set_value(iter, 0, project.id);
579                 el.set_value(iter, 1,  project.name );
580                 if (id == project.id) {
581                            _this.milestone.el.set_active_iter(iter);
582                     }   
583                 
584             }
585             */
586             
587             _this.milestone_id.loading = false;
588              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
589                                              
590         }
591     }
592
593
594     public class Xcls_Label13 : Object
595     {
596         public Gtk.Label el;
597         private Ticket  _this;
598
599
600             // my vars (def)
601
602         // ctor
603         public Xcls_Label13(Ticket _owner )
604         {
605             _this = _owner;
606             this.el = new Gtk.Label( "Description" );
607
608             // my vars (dec)
609
610             // set gobject values
611             this.el.halign = Gtk.Align.START;
612         }
613
614         // user defined functions
615     }
616
617     public class Xcls_description : Object
618     {
619         public Gtk.TextView el;
620         private Ticket  _this;
621
622
623             // my vars (def)
624
625         // ctor
626         public Xcls_description(Ticket _owner )
627         {
628             _this = _owner;
629             _this.description = this;
630             this.el = new Gtk.TextView();
631
632             // my vars (dec)
633
634             // set gobject values
635             this.el.border_width = 1;
636         }
637
638         // user defined functions
639     }
640
641     public class Xcls_Label15 : Object
642     {
643         public Gtk.Label el;
644         private Ticket  _this;
645
646
647             // my vars (def)
648
649         // ctor
650         public Xcls_Label15(Ticket _owner )
651         {
652             _this = _owner;
653             this.el = new Gtk.Label( "Priority" );
654
655             // my vars (dec)
656
657             // set gobject values
658             this.el.halign = Gtk.Align.START;
659             this.el.xalign = 0.900000f;
660         }
661
662         // user defined functions
663     }
664
665     public class Xcls_priority_id : Object
666     {
667         public Gtk.ComboBox el;
668         private Ticket  _this;
669
670
671             // my vars (def)
672         public bool loading;
673
674         // ctor
675         public Xcls_priority_id(Ticket _owner )
676         {
677             _this = _owner;
678             _this.priority_id = this;
679             this.el = new Gtk.ComboBox.with_entry();
680
681             // my vars (dec)
682             this.loading = false;
683
684             // set gobject values
685             var child_0 = new Xcls_primodel( _this );
686             child_0.ref();
687             this.el.set_model (  child_0.el  );
688
689             // init method
690
691             this.el.set_entry_text_column(1);
692         }
693
694         // user defined functions
695         public string selectedPriorityId () {
696                 Gtk.TreeIter iter;
697                 Value val1;
698          
699          
700                 this.el.get_active_iter (out iter);
701                 _this.primodel.el.get_value (iter, 0, out val1);
702          
703         
704                 return  (string) val1;
705                 
706                 
707                 
708                 
709         }
710     }
711     public class Xcls_primodel : Object
712     {
713         public Gtk.ListStore el;
714         private Ticket  _this;
715
716
717             // my vars (def)
718
719         // ctor
720         public Xcls_primodel(Ticket _owner )
721         {
722             _this = _owner;
723             _this.primodel = this;
724             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
725
726             // my vars (dec)
727
728             // set gobject values
729         }
730
731         // user defined functions
732         public void loadPriority (string id) {
733         
734             var rt = RooTicket.singleton();
735            // rt.loadProjects();
736             
737             _this.priority_id.loading = true;
738         
739             this.el.clear();                                    
740             Gtk.TreeIter iter;
741             var el = this.el;
742             
743             el.append(out iter);
744         
745             
746             el.set_value(iter, 0, "");
747             el.set_value(iter, 1, "-- select priority --");
748            // if (id == "") {
749                     _this.priority_id.el.set_active_iter(iter);
750             //}
751             /*var projects = rt.projects;
752             foreach(var project in projects) {
753             
754                 el.append(out iter);
755                 
756                 el.set_value(iter, 0, project.id);
757                 el.set_value(iter, 1,  project.name );
758                 if (id == project.id) {
759                            _this.priority_id.el.set_active_iter(iter);
760                     }   
761                 
762             }
763             */
764             _this.priority_id.loading = false;
765                    
766                                              
767         }
768     }
769
770
771     public class Xcls_Label18 : Object
772     {
773         public Gtk.Label el;
774         private Ticket  _this;
775
776
777             // my vars (def)
778
779         // ctor
780         public Xcls_Label18(Ticket _owner )
781         {
782             _this = _owner;
783             this.el = new Gtk.Label( "Severity" );
784
785             // my vars (dec)
786
787             // set gobject values
788             this.el.halign = Gtk.Align.START;
789         }
790
791         // user defined functions
792     }
793
794     public class Xcls_severity_id : Object
795     {
796         public Gtk.ComboBox el;
797         private Ticket  _this;
798
799
800             // my vars (def)
801         public bool loading;
802
803         // ctor
804         public Xcls_severity_id(Ticket _owner )
805         {
806             _this = _owner;
807             _this.severity_id = this;
808             this.el = new Gtk.ComboBox.with_entry();
809
810             // my vars (dec)
811             this.loading = false;
812
813             // set gobject values
814             var child_0 = new Xcls_sevmodel( _this );
815             child_0.ref();
816             this.el.set_model (  child_0.el  );
817
818             // init method
819
820             this.el.set_entry_text_column(1);
821         }
822
823         // user defined functions
824         public string selectedSeverityId () {
825                 Gtk.TreeIter iter;
826                 Value val1;
827          
828          
829                 this.el.get_active_iter (out iter);
830                 _this.sevmodel.el.get_value (iter, 0, out val1);
831          
832         
833                 return  (string) val1;
834                 
835                 
836                 
837                 
838         }
839     }
840     public class Xcls_sevmodel : Object
841     {
842         public Gtk.ListStore el;
843         private Ticket  _this;
844
845
846             // my vars (def)
847
848         // ctor
849         public Xcls_sevmodel(Ticket _owner )
850         {
851             _this = _owner;
852             _this.sevmodel = this;
853             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
854
855             // my vars (dec)
856
857             // set gobject values
858         }
859
860         // user defined functions
861         public void loadProjects (string id) {
862         
863             var rt = RooTicket.singleton();
864             //rt.loadProjects();
865             
866             _this.severity_id.loading = true;
867         
868             this.el.clear();                                    
869             Gtk.TreeIter iter;
870             var el = this.el;
871             
872             el.append(out iter);
873         
874             
875             el.set_value(iter, 0, "");
876             el.set_value(iter, 1, "-- select severity --");
877            // if (id == "") {
878                     _this.severity_id.el.set_active_iter(iter);
879            // }
880            /*
881             var projects = rt.projects;
882             foreach(var project in projects) {
883             
884                 el.append(out iter);
885                 
886                 el.set_value(iter, 0, project.id);
887                 el.set_value(iter, 1,  project.name );
888                 if (id == project.id) {
889                            _this.projectsel.el.set_active_iter(iter);
890                     }   
891                 
892             }
893             */
894             _this.severity_id.loading = false;
895              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
896                                              
897         }
898     }
899
900
901     public class Xcls_Label21 : Object
902     {
903         public Gtk.Label el;
904         private Ticket  _this;
905
906
907             // my vars (def)
908
909         // ctor
910         public Xcls_Label21(Ticket _owner )
911         {
912             _this = _owner;
913             this.el = new Gtk.Label( "Classification" );
914
915             // my vars (dec)
916
917             // set gobject values
918             this.el.halign = Gtk.Align.START;
919         }
920
921         // user defined functions
922     }
923
924     public class Xcls_classification_id : Object
925     {
926         public Gtk.ComboBox el;
927         private Ticket  _this;
928
929
930             // my vars (def)
931         public bool loading;
932
933         // ctor
934         public Xcls_classification_id(Ticket _owner )
935         {
936             _this = _owner;
937             _this.classification_id = this;
938             this.el = new Gtk.ComboBox.with_entry();
939
940             // my vars (dec)
941             this.loading = false;
942
943             // set gobject values
944             var child_0 = new Xcls_clmodel( _this );
945             child_0.ref();
946             this.el.set_model (  child_0.el  );
947
948             // init method
949
950             this.el.set_entry_text_column(1);
951         }
952
953         // user defined functions
954         public string selectedProjectId () {
955                 Gtk.TreeIter iter;
956                 Value val1;
957          
958          
959                 this.el.get_active_iter (out iter);
960                 _this.prmodel.el.get_value (iter, 0, out val1);
961          
962         
963                 return  (string) val1;
964                 
965                 
966                 
967                 
968         }
969     }
970     public class Xcls_clmodel : Object
971     {
972         public Gtk.ListStore el;
973         private Ticket  _this;
974
975
976             // my vars (def)
977
978         // ctor
979         public Xcls_clmodel(Ticket _owner )
980         {
981             _this = _owner;
982             _this.clmodel = this;
983             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
984
985             // my vars (dec)
986
987             // set gobject values
988         }
989
990         // user defined functions
991         public void loadClassifications (string id) {
992         
993             var rt = RooTicket.singleton();
994             // rt.loadProjects();
995             
996             _this.classification_id.loading = true;
997         
998             this.el.clear();                                    
999             Gtk.TreeIter iter;
1000             var el = this.el;
1001             
1002             el.append(out iter);
1003         
1004             
1005             el.set_value(iter, 0, "");
1006             el.set_value(iter, 1, "-- select a project --");
1007             if (id == "") {
1008                     _this.classification_id.el.set_active_iter(iter);
1009             }
1010             /*
1011             var projects = rt.projects;
1012             foreach(var project in projects) {
1013             
1014                 el.append(out iter);
1015                 
1016                 el.set_value(iter, 0, project.id);
1017                 el.set_value(iter, 1,  project.name );
1018                 if (id == project.id) {
1019                            _this.classification_id.el.set_active_iter(iter);
1020                     }   
1021                 
1022             }
1023             */
1024             _this.classification_id.loading = false;
1025              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
1026                                              
1027         }
1028     }
1029
1030
1031     public class Xcls_Label24 : Object
1032     {
1033         public Gtk.Label el;
1034         private Ticket  _this;
1035
1036
1037             // my vars (def)
1038
1039         // ctor
1040         public Xcls_Label24(Ticket _owner )
1041         {
1042             _this = _owner;
1043             this.el = new Gtk.Label( "Assign to" );
1044
1045             // my vars (dec)
1046
1047             // set gobject values
1048             this.el.halign = Gtk.Align.START;
1049         }
1050
1051         // user defined functions
1052     }
1053
1054     public class Xcls_developer_id : Object
1055     {
1056         public Gtk.ComboBox el;
1057         private Ticket  _this;
1058
1059
1060             // my vars (def)
1061         public bool loading;
1062
1063         // ctor
1064         public Xcls_developer_id(Ticket _owner )
1065         {
1066             _this = _owner;
1067             _this.developer_id = this;
1068             this.el = new Gtk.ComboBox.with_entry();
1069
1070             // my vars (dec)
1071             this.loading = false;
1072
1073             // set gobject values
1074             var child_0 = new Xcls_devmodel( _this );
1075             child_0.ref();
1076             this.el.set_model (  child_0.el  );
1077
1078             // init method
1079
1080             this.el.set_entry_text_column(1);
1081         }
1082
1083         // user defined functions
1084         public string selectedDeveloperId () {
1085                 Gtk.TreeIter iter;
1086                 Value val1;
1087          
1088          
1089                 this.el.get_active_iter (out iter);
1090                 _this.devmodel.el.get_value (iter, 0, out val1);
1091          
1092         
1093                 return  (string) val1;
1094                 
1095                 
1096                 
1097                 
1098         }
1099     }
1100     public class Xcls_devmodel : Object
1101     {
1102         public Gtk.ListStore el;
1103         private Ticket  _this;
1104
1105
1106             // my vars (def)
1107
1108         // ctor
1109         public Xcls_devmodel(Ticket _owner )
1110         {
1111             _this = _owner;
1112             _this.devmodel = this;
1113             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
1114
1115             // my vars (dec)
1116
1117             // set gobject values
1118         }
1119
1120         // user defined functions
1121         public void loadDevelopers (string id) {
1122         
1123             var rt = RooTicket.singleton();
1124             //rt.loadProjects();
1125             
1126             _this.developer_id.loading = true;
1127         
1128             this.el.clear();                                    
1129             Gtk.TreeIter iter;
1130             var el = this.el;
1131             
1132             el.append(out iter);
1133         
1134             
1135             el.set_value(iter, 0, "");
1136             el.set_value(iter, 1, "-- select a project --");
1137             if (id == "") {
1138                     _this.developer_id.el.set_active_iter(iter);
1139             }
1140             /*
1141             var projects = rt.projects;
1142             foreach(var project in projects) {
1143             
1144                 el.append(out iter);
1145                 
1146                 el.set_value(iter, 0, project.id);
1147                 el.set_value(iter, 1,  project.name );
1148                 if (id == project.id) {
1149                            _this.projectsel.el.set_active_iter(iter);
1150                     }   
1151                 
1152             }
1153             */
1154             _this.developer_id.loading = false;
1155              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
1156                                              
1157         }
1158     }
1159
1160
1161     public class Xcls_Button27 : Object
1162     {
1163         public Gtk.Button el;
1164         private Ticket  _this;
1165
1166
1167             // my vars (def)
1168
1169         // ctor
1170         public Xcls_Button27(Ticket _owner )
1171         {
1172             _this = _owner;
1173             this.el = new Gtk.Button();
1174
1175             // my vars (dec)
1176
1177             // set gobject values
1178             this.el.label = "Create Ticket";
1179
1180             // init method
1181
1182             {
1183                this.el.get_style_context().add_class("suggested-action");
1184             }
1185
1186             //listeners
1187             this.el.clicked.connect( () => {
1188                 GLib.debug("fire response = 1");
1189                 _this.el.response(1);
1190             });
1191         }
1192
1193         // user defined functions
1194     }
1195
1196
1197
1198 }