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