NewBranch.bjs
[gitlive] / NewBranch.vala
1 static NewBranch  _NewBranch;
2
3 public class NewBranch : Object
4 {
5     public Gtk.Dialog el;
6     private NewBranch  _this;
7
8     public static NewBranch singleton()
9     {
10         if (_NewBranch == null) {
11             _NewBranch= new NewBranch();
12         }
13         return _NewBranch;
14     }
15     public Xcls_projectsel projectsel;
16     public Xcls_prcellrenderer prcellrenderer;
17     public Xcls_prmodel prmodel;
18     public Xcls_ticketsel ticketsel;
19     public Xcls_dbcellrenderer dbcellrenderer;
20     public Xcls_dbmodel dbmodel;
21     public Xcls_name name;
22     public Xcls_createbtn createbtn;
23     public Xcls_btn_not_me btn_not_me;
24     public Xcls_btn_closed btn_closed;
25     public Xcls_scrolled_window scrolled_window;
26     public Xcls_view view;
27     public Xcls_label_select_ticket label_select_ticket;
28     public Xcls_label_crete_ticket label_crete_ticket;
29     public Xcls_label_quick_commit label_quick_commit;
30
31         // my vars (def)
32     public GitRepo? repo;
33     public bool running;
34     public Gee.ArrayList<GitMonitorQueue> queue;
35
36     // ctor
37     public NewBranch()
38     {
39         _this = this;
40         this.el = new Gtk.Dialog();
41
42         // my vars (dec)
43         this.repo = null;
44         this.running = false;
45         this.queue = null;
46
47         // set gobject values
48         this.el.title = "Create a working branch ";
49         this.el.default_height = 500;
50         this.el.default_width = 500;
51         this.el.deletable = true;
52         this.el.modal = true;
53         var child_0 = new Xcls_Box2( _this );
54         child_0.ref();
55         this.el.get_content_area().add (  child_0.el  );
56         var child_1 = new Xcls_Notebook22( _this );
57         child_1.ref();
58         this.el.add (  child_1.el  );
59
60         //listeners
61         this.el.delete_event.connect( (self, event) => {
62             this.el.hide();
63             return true; 
64             //test  
65         });
66         this.el.response.connect( (self, response_id) =>  { 
67           
68                 GLib.debug("got %d", (int) response_id);
69                 
70                  
71                 
72                  
73                 // have they selected a ticket..
74                 // make that the current active ticket?
75                 // we really need to store locally what ticket is being worked on..
76                 // in theory we could be working on multiple project and not merging..
77                 // -- each repo would have their active ticket (only one per repo)
78                 // -- so we could just store that in there
79                 // -- initial load can check the contents of the ticket files on first scan.
80         
81                  
82                 if (response_id < 1) {
83                     _this.el.hide();    
84                     this.running = false; 
85                         return;
86                 }
87                 
88                 var ticket_id = _this.ticketsel.selectedTicketId();
89                 
90             if (this.repo != null) {
91                 var bn = _this.name.el.get_text();
92         
93                         var res = this.repo.setActiveTicket(                    
94                                  RooTicket.singleton().getById(ticket_id != "" ? ticket_id : "-1"), bn
95                          );
96                          if (res) {
97                                 // start the monitoring..
98                                  GitMonitor.gitmonitor.start();
99                                  
100                          }
101             }
102              
103         
104             this.running = false; 
105         
106                 this.el.hide();
107                  
108                  
109         
110                  
111         });
112     }
113
114     // user defined functions
115     public   void show ( GitRepo repo, Gee.ArrayList<GitMonitorQueue> queue, string tid = "" ) 
116     {
117          // this.el.set_gravity(Gdk.Gravity.NORTH);
118         if (this.running) { // should not happen!!
119                 GLib.error("new branch show called, when already being displayed?");
120         }
121         this.queue = queue;
122         
123         this.running  = true;
124         GitMonitor.gitmonitor.stop();
125         
126         this.repo = repo;
127         
128          
129         
130         this.el.move((Gdk.Screen.width() / 2)- 250 ,0);
131         this.el.set_default_size( 500,200); // not sure why it grows..
132         GLib.debug("Loading tickets"); 
133          
134     
135         this.el.show_all();
136         this.el.set_keep_above(true);
137        
138         
139         var curproj = RooProject.getProjectByRepo(this.repo);
140          _this.prmodel.loadProjects(curproj == null ? "" : curproj.id);
141         
142         _this.dbmodel.loadTickets(curproj == null ? "": curproj.id, tid);
143         _this.createbtn.updateState();
144         
145         _this.ticketsel.el.get_child().get_style_context().remove_class("warning");
146         if (tid != "") { 
147                 var name = RooTicket.singleton().usernameLocal();
148                 var ticket = RooTicket.singleton().getById(tid);
149                 _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
150         } else {
151                 _this.ticketsel.el.get_child().get_style_context().add_class("warning");
152         }
153         _this.view.loadTicket(tid);
154         this.el.run();
155     
156     }
157     public class Xcls_Box2 : Object
158     {
159         public Gtk.Box el;
160         private NewBranch  _this;
161
162
163             // my vars (def)
164
165         // ctor
166         public Xcls_Box2(NewBranch _owner )
167         {
168             _this = _owner;
169             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
170
171             // my vars (dec)
172
173             // set gobject values
174             var child_0 = new Xcls_Table3( _this );
175             child_0.ref();
176             this.el.pack_start (  child_0.el , false,false,0 );
177             var child_1 = new Xcls_scrolled_window( _this );
178             child_1.ref();
179             this.el.add (  child_1.el  );
180         }
181
182         // user defined functions
183     }
184     public class Xcls_Table3 : Object
185     {
186         public Gtk.Table el;
187         private NewBranch  _this;
188
189
190             // my vars (def)
191
192         // ctor
193         public Xcls_Table3(NewBranch _owner )
194         {
195             _this = _owner;
196             this.el = new Gtk.Table( 5, 5, true );
197
198             // my vars (dec)
199
200             // set gobject values
201             this.el.expand = false;
202             this.el.margin = 2;
203             this.el.column_spacing = 4;
204             this.el.vexpand = false;
205             var child_0 = new Xcls_Label4( _this );
206             child_0.ref();
207             this.el.attach_defaults (  child_0.el , 0,1,0,1 );
208             var child_1 = new Xcls_Label5( _this );
209             child_1.ref();
210             this.el.attach_defaults (  child_1.el , 1,2,0,1 );
211             var child_2 = new Xcls_projectsel( _this );
212             child_2.ref();
213             this.el.attach_defaults (  child_2.el , 0,1,1,2 );
214             var child_3 = new Xcls_ticketsel( _this );
215             child_3.ref();
216             this.el.attach_defaults (  child_3.el , 1,4,1,2 );
217             var child_4 = new Xcls_Button12( _this );
218             child_4.ref();
219             this.el.attach_defaults (  child_4.el , 4,5,1,2 );
220             var child_5 = new Xcls_Label13( _this );
221             child_5.ref();
222             this.el.attach_defaults (  child_5.el , 0,1,3,4 );
223             var child_6 = new Xcls_name( _this );
224             child_6.ref();
225             this.el.attach_defaults (  child_6.el , 0,4,4,5 );
226             var child_7 = new Xcls_createbtn( _this );
227             child_7.ref();
228             this.el.attach_defaults (  child_7.el , 4,5,4,5 );
229             var child_8 = new Xcls_Box16( _this );
230             child_8.ref();
231             this.el.attach_defaults (  child_8.el , 0,5,2,3 );
232         }
233
234         // user defined functions
235     }
236     public class Xcls_Label4 : Object
237     {
238         public Gtk.Label el;
239         private NewBranch  _this;
240
241
242             // my vars (def)
243
244         // ctor
245         public Xcls_Label4(NewBranch _owner )
246         {
247             _this = _owner;
248             this.el = new Gtk.Label( "Project" );
249
250             // my vars (dec)
251
252             // set gobject values
253             this.el.halign = Gtk.Align.START;
254             this.el.justify = Gtk.Justification.RIGHT;
255             this.el.visible = true;
256         }
257
258         // user defined functions
259     }
260
261     public class Xcls_Label5 : Object
262     {
263         public Gtk.Label el;
264         private NewBranch  _this;
265
266
267             // my vars (def)
268
269         // ctor
270         public Xcls_Label5(NewBranch _owner )
271         {
272             _this = _owner;
273             this.el = new Gtk.Label( "Ticket" );
274
275             // my vars (dec)
276
277             // set gobject values
278             this.el.halign = Gtk.Align.START;
279             this.el.visible = true;
280         }
281
282         // user defined functions
283     }
284
285     public class Xcls_projectsel : Object
286     {
287         public Gtk.ComboBox el;
288         private NewBranch  _this;
289
290
291             // my vars (def)
292         public bool loading;
293
294         // ctor
295         public Xcls_projectsel(NewBranch _owner )
296         {
297             _this = _owner;
298             _this.projectsel = this;
299             this.el = new Gtk.ComboBox.with_entry();
300
301             // my vars (dec)
302             this.loading = false;
303
304             // set gobject values
305             var child_0 = new Xcls_prcellrenderer( _this );
306             child_0.ref();
307             this.el.pack_start (  child_0.el , true );
308             var child_1 = new Xcls_prmodel( _this );
309             child_1.ref();
310             this.el.set_model (  child_1.el  );
311
312             // init method
313
314             this.el.set_entry_text_column(1);
315
316             //listeners
317             this.el.changed.connect( () => {
318                 if (this.loading) {
319                         return;
320                 }
321                 var project_id = this.selectedProjectId();
322                 _this.dbmodel.loadTickets(project_id);
323                 
324                 
325                 /*if (this.loading) {
326                         return;
327                 }
328                 var ticket_id = this.selectedTicketId();
329                 
330                 var name = RooTicket.singleton().usernameLocal();
331                 
332                 if (ticket_id == "" || ticket_id == null) {
333                 
334                         var dt = new  DateTime.now_local();
335                         _this.name.el.set_text("wip_%s_%s".printf(name,dt.format("%Y_%b_%d")));
336                         return;
337                 }
338                 
339                 
340                 var ticket = RooTicket.singleton().getById(ticket_id);
341                
342                 _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
343                 
344                 //GLib.debug (//"Selection: %s, %s\n", (string) val1, (string) val2);
345                 */
346             });
347         }
348
349         // user defined functions
350         public string selectedProjectId () {
351                 Gtk.TreeIter iter;
352                 Value val1;
353          
354          
355                 this.el.get_active_iter (out iter);
356                 _this.prmodel.el.get_value (iter, 0, out val1);
357          
358         
359                 return  (string) val1;
360                 
361                 
362                 
363                 
364         }
365     }
366     public class Xcls_prcellrenderer : Object
367     {
368         public Gtk.CellRendererText el;
369         private NewBranch  _this;
370
371
372             // my vars (def)
373
374         // ctor
375         public Xcls_prcellrenderer(NewBranch _owner )
376         {
377             _this = _owner;
378             _this.prcellrenderer = this;
379             this.el = new Gtk.CellRendererText();
380
381             // my vars (dec)
382
383             // set gobject values
384         }
385
386         // user defined functions
387     }
388
389     public class Xcls_prmodel : Object
390     {
391         public Gtk.ListStore el;
392         private NewBranch  _this;
393
394
395             // my vars (def)
396
397         // ctor
398         public Xcls_prmodel(NewBranch _owner )
399         {
400             _this = _owner;
401             _this.prmodel = this;
402             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
403
404             // my vars (dec)
405
406             // set gobject values
407         }
408
409         // user defined functions
410         public void loadProjects (string id) {
411         
412         
413             
414             _this.projectsel.loading = true;
415         
416             this.el.clear();                                    
417             Gtk.TreeIter iter;
418             var el = this.el;
419             
420             el.append(out iter);
421         
422             
423             el.set_value(iter, 0, "");
424             el.set_value(iter, 1, "-- select a project --");
425             if (id == "") {
426                     _this.projectsel.el.set_active_iter(iter);
427             }
428           
429             foreach(var project in RooProject.projects()) {
430             
431                 el.append(out iter);
432                 
433                 el.set_value(iter, 0, project.id);
434                 el.set_value(iter, 1,  project.name );
435                 if (id == project.id) {
436                            _this.projectsel.el.set_active_iter(iter);
437                     }   
438                 
439             }
440             
441             _this.projectsel.loading = false;
442              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
443                                              
444         }
445     }
446
447
448     public class Xcls_ticketsel : Object
449     {
450         public Gtk.ComboBox el;
451         private NewBranch  _this;
452
453
454             // my vars (def)
455         public bool loading;
456
457         // ctor
458         public Xcls_ticketsel(NewBranch _owner )
459         {
460             _this = _owner;
461             _this.ticketsel = this;
462             this.el = new Gtk.ComboBox.with_entry();
463
464             // my vars (dec)
465             this.loading = false;
466
467             // set gobject values
468             var child_0 = new Xcls_dbcellrenderer( _this );
469             child_0.ref();
470             this.el.pack_start (  child_0.el , true );
471             var child_1 = new Xcls_dbmodel( _this );
472             child_1.ref();
473             this.el.set_model (  child_1.el  );
474
475             // init method
476
477             //this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
478             this.el.set_entry_text_column(1);
479             this.el.get_child().set_sensitive(false);
480
481             //listeners
482             this.el.changed.connect( () => {
483                 if (this.loading) {
484                         return;
485                 }
486                 var ticket_id = this.selectedTicketId();
487                 
488                 var name = RooTicket.singleton().usernameLocal();
489                 
490                 this.el.get_child().get_style_context().remove_class("warning");
491                 if (ticket_id == "" || ticket_id == null) {
492                 
493                         var dt = new  DateTime.now_local();
494                         _this.name.el.set_text("wip_%s_%s".printf(name,dt.format("%Y_%b_%d")));
495                         _this.view.loadTicket("");              
496                         
497                         this.el.get_child().get_style_context().add_class("warning");
498                         _this.createbtn.updateState();
499                         return;
500                 }
501                 
502                 
503                 var ticket = RooTicket.singleton().getById(ticket_id);
504                
505                 _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
506                 _this.scrolled_window.el.show();
507                  
508                 _this.view.loadTicket(ticket.id);
509                 _this.createbtn.updateState();
510                 
511                 //GLib.debug (//"Selection: %s, %s\n", (string) val1, (string) val2);
512             });
513         }
514
515         // user defined functions
516         public string selectedTicketId () {
517         Gtk.TreeIter iter;
518                 Value val1;
519          
520          
521                 this.el.get_active_iter (out iter);
522                 _this.dbmodel.el.get_value (iter, 0, out val1);
523          
524         
525                 return  (string) val1;
526                 
527                 
528                 
529                 
530         }
531     }
532     public class Xcls_dbcellrenderer : Object
533     {
534         public Gtk.CellRendererText el;
535         private NewBranch  _this;
536
537
538             // my vars (def)
539
540         // ctor
541         public Xcls_dbcellrenderer(NewBranch _owner )
542         {
543             _this = _owner;
544             _this.dbcellrenderer = this;
545             this.el = new Gtk.CellRendererText();
546
547             // my vars (dec)
548
549             // set gobject values
550         }
551
552         // user defined functions
553     }
554
555     public class Xcls_dbmodel : Object
556     {
557         public Gtk.ListStore el;
558         private NewBranch  _this;
559
560
561             // my vars (def)
562
563         // ctor
564         public Xcls_dbmodel(NewBranch _owner )
565         {
566             _this = _owner;
567             _this.dbmodel = this;
568             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
569
570             // my vars (dec)
571
572             // set gobject values
573         }
574
575         // user defined functions
576         public void loadTickets (string project_id , string tid = "") {
577         
578         
579             
580             // fixme .. get project id from selection..
581             
582              RooTicket.singleton().loadTickets(
583                                 project_id,
584                                 _this.btn_not_me.el.active ? RooTicket.Who.ANYBODY :  RooTicket.Who.ME,
585                                  _this.btn_closed.el.active ? RooTicket.Status.ALL :  RooTicket.Status.ACTIVE
586                          );
587                 
588             _this.ticketsel.loading = true;
589         
590             this.el.clear();                                    
591             Gtk.TreeIter iter;
592             var el = this.el;
593             
594             el.append(out iter);
595         
596             
597             el.set_value(iter, 0, "");
598             el.set_value(iter, 1, "-- select a ticket --");
599             
600             _this.ticketsel.el.set_active_iter(iter);
601             var tickets = RooTicket.singleton().tickets;
602             foreach(var ticket in tickets) {
603             
604                 el.append(out iter);
605                 
606                 el.set_value(iter, 0, ticket.id);
607                 el.set_value(iter, 1, "#%s %s".printf( ticket.id, ticket.summary));
608                 
609                 if (ticket.id == tid) {
610                             _this.ticketsel.el.set_active_iter(iter);
611                 }
612                 
613             }
614             
615             _this.ticketsel.loading = false;
616              //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
617                                              
618         }
619     }
620
621
622     public class Xcls_Button12 : Object
623     {
624         public Gtk.Button el;
625         private NewBranch  _this;
626
627
628             // my vars (def)
629
630         // ctor
631         public Xcls_Button12(NewBranch _owner )
632         {
633             _this = _owner;
634             this.el = new Gtk.Button();
635
636             // my vars (dec)
637
638             // set gobject values
639             this.el.expand = false;
640             this.el.label = "New Ticket";
641
642             //listeners
643             this.el.clicked.connect( () => {
644                 _this.el.response(-1);
645                 Ticket.singleton().show(_this.repo);
646             
647             });
648         }
649
650         // user defined functions
651     }
652
653     public class Xcls_Label13 : Object
654     {
655         public Gtk.Label el;
656         private NewBranch  _this;
657
658
659             // my vars (def)
660
661         // ctor
662         public Xcls_Label13(NewBranch _owner )
663         {
664             _this = _owner;
665             this.el = new Gtk.Label( "Use this as branch name" );
666
667             // my vars (dec)
668
669             // set gobject values
670             this.el.halign = Gtk.Align.START;
671             this.el.justify = Gtk.Justification.RIGHT;
672             this.el.xalign = 0.900000f;
673         }
674
675         // user defined functions
676     }
677
678     public class Xcls_name : Object
679     {
680         public Gtk.Entry el;
681         private NewBranch  _this;
682
683
684             // my vars (def)
685
686         // ctor
687         public Xcls_name(NewBranch _owner )
688         {
689             _this = _owner;
690             _this.name = this;
691             this.el = new Gtk.Entry();
692
693             // my vars (dec)
694
695             // set gobject values
696             this.el.visible = true;
697         }
698
699         // user defined functions
700     }
701
702     public class Xcls_createbtn : Object
703     {
704         public Gtk.Button el;
705         private NewBranch  _this;
706
707
708             // my vars (def)
709
710         // ctor
711         public Xcls_createbtn(NewBranch _owner )
712         {
713             _this = _owner;
714             _this.createbtn = this;
715             this.el = new Gtk.Button();
716
717             // my vars (dec)
718
719             // set gobject values
720             this.el.label = "Create Branch";
721
722             // init method
723
724             {
725                this.el.get_style_context().add_class("suggested-action");
726             }
727
728             //listeners
729             this.el.clicked.connect( () => {
730             
731                 GLib.debug("fire response = 1");
732                 
733                 var ticket_id = _this.ticketsel.selectedTicketId();
734                 
735                 if (ticket_id == "") {
736                         _this.ticketsel.el.get_child().get_style_context().add_class("warning");
737                         return;
738                 }
739                  
740                 _this.el.response(1);
741             });
742         }
743
744         // user defined functions
745         public void updateState () {
746         
747                 var ticket_id = _this.ticketsel.selectedTicketId();
748                 
749                 if (ticket_id == "") {
750                         this.el.set_sensitive(false);
751                         return;
752                 }
753          
754                 this.el.set_sensitive(true);
755          
756         }
757     }
758
759     public class Xcls_Box16 : Object
760     {
761         public Gtk.Box el;
762         private NewBranch  _this;
763
764
765             // my vars (def)
766
767         // ctor
768         public Xcls_Box16(NewBranch _owner )
769         {
770             _this = _owner;
771             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
772
773             // my vars (dec)
774
775             // set gobject values
776             var child_0 = new Xcls_btn_not_me( _this );
777             child_0.ref();
778             this.el.add (  child_0.el  );
779             var child_1 = new Xcls_btn_closed( _this );
780             child_1.ref();
781             this.el.add (  child_1.el  );
782             var child_2 = new Xcls_Label19( _this );
783             child_2.ref();
784             this.el.add (  child_2.el  );
785         }
786
787         // user defined functions
788     }
789     public class Xcls_btn_not_me : Object
790     {
791         public Gtk.CheckButton el;
792         private NewBranch  _this;
793
794
795             // my vars (def)
796
797         // ctor
798         public Xcls_btn_not_me(NewBranch _owner )
799         {
800             _this = _owner;
801             _this.btn_not_me = this;
802             this.el = new Gtk.CheckButton();
803
804             // my vars (dec)
805
806             // set gobject values
807             this.el.label = "Show tickets not assigned to me";
808
809             //listeners
810             this.el.toggled.connect( () => {
811                 var project_id = _this.projectsel.selectedProjectId();
812                 _this.dbmodel.loadTickets(project_id);  
813             });
814         }
815
816         // user defined functions
817     }
818
819     public class Xcls_btn_closed : Object
820     {
821         public Gtk.CheckButton el;
822         private NewBranch  _this;
823
824
825             // my vars (def)
826
827         // ctor
828         public Xcls_btn_closed(NewBranch _owner )
829         {
830             _this = _owner;
831             _this.btn_closed = this;
832             this.el = new Gtk.CheckButton();
833
834             // my vars (dec)
835
836             // set gobject values
837             this.el.label = "Show closed Tickets";
838
839             //listeners
840             this.el.toggled.connect( () => {
841                 var project_id = _this.projectsel.selectedProjectId();
842                 _this.dbmodel.loadTickets(project_id);  
843                  
844             });
845         }
846
847         // user defined functions
848     }
849
850     public class Xcls_Label19 : Object
851     {
852         public Gtk.Label el;
853         private NewBranch  _this;
854
855
856             // my vars (def)
857
858         // ctor
859         public Xcls_Label19(NewBranch _owner )
860         {
861             _this = _owner;
862             this.el = new Gtk.Label( "<a href=\"refresh\">Refresh Ticket list</a>" );
863
864             // my vars (dec)
865
866             // set gobject values
867             this.el.halign = Gtk.Align.END;
868             this.el.hexpand = true;
869             this.el.use_markup = true;
870
871             //listeners
872             this.el.activate_link.connect( (uri) => {
873                 if (uri == "refresh") {
874                         RooProject.reload();
875                         var curproj = RooProject.getProjectByRepo(_this.repo);
876                          _this.prmodel.loadProjects(curproj == null ? "": curproj.id);
877             
878                         _this.dbmodel.loadTickets(curproj == null ? "": curproj.id);            
879                 }
880                 return true;
881             });
882         }
883
884         // user defined functions
885     }
886
887
888
889     public class Xcls_scrolled_window : Object
890     {
891         public Gtk.ScrolledWindow el;
892         private NewBranch  _this;
893
894
895             // my vars (def)
896
897         // ctor
898         public Xcls_scrolled_window(NewBranch _owner )
899         {
900             _this = _owner;
901             _this.scrolled_window = this;
902             this.el = new Gtk.ScrolledWindow( null, null );
903
904             // my vars (dec)
905
906             // set gobject values
907             this.el.height_request = 500;
908             this.el.vexpand = true;
909             var child_0 = new Xcls_view( _this );
910             child_0.ref();
911             this.el.add (  child_0.el  );
912
913             // init method
914
915             {
916                 this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
917             }
918         }
919
920         // user defined functions
921     }
922     public class Xcls_view : Object
923     {
924         public WebKit.WebView el;
925         private NewBranch  _this;
926
927
928             // my vars (def)
929
930         // ctor
931         public Xcls_view(NewBranch _owner )
932         {
933             _this = _owner;
934             _this.view = this;
935             this.el = new WebKit.WebView();
936
937             // my vars (dec)
938
939             // set gobject values
940         }
941
942         // user defined functions
943         public void loadTicket (string tid) {
944                 int h,w;
945                 _this.el.get_size(out w, out h);
946                 
947                 if (tid == "") {
948                         _this.scrolled_window.el.hide();
949                         _this.el.resize(w, 150);
950                 } else {
951                         _this.scrolled_window.el.show();
952                         _this.el.resize(w, 800);
953                 }
954                 
955                 var rs =  RooTicket.singleton();                
956                 var uri = new WebKit.URIRequest("https://roojs.com/admin.php/MTrack/View/" + tid);
957                 var hd = uri.get_http_headers();
958                 var authCode = Base64.encode ("%s:%s".printf(rs.username, rs.password).data);
959                 hd.append("Authorization", "Basic %s".printf(authCode));
960                 
961                  this.el.load_request(uri);
962         }
963     }
964
965
966
967     public class Xcls_Notebook22 : Object
968     {
969         public Gtk.Notebook el;
970         private NewBranch  _this;
971
972
973             // my vars (def)
974
975         // ctor
976         public Xcls_Notebook22(NewBranch _owner )
977         {
978             _this = _owner;
979             this.el = new Gtk.Notebook();
980
981             // my vars (dec)
982
983             // set gobject values
984             this.el.vexpand = true;
985             var child_0 = new Xcls_label_select_ticket( _this );
986             child_0.ref();
987             var child_1 = new Xcls_label_crete_ticket( _this );
988             child_1.ref();
989             var child_2 = new Xcls_label_quick_commit( _this );
990             child_2.ref();
991         }
992
993         // user defined functions
994     }
995     public class Xcls_label_select_ticket : Object
996     {
997         public Gtk.Label el;
998         private NewBranch  _this;
999
1000
1001             // my vars (def)
1002
1003         // ctor
1004         public Xcls_label_select_ticket(NewBranch _owner )
1005         {
1006             _this = _owner;
1007             _this.label_select_ticket = this;
1008             this.el = new Gtk.Label( "Select Existing Ticket to work on" );
1009
1010             // my vars (dec)
1011
1012             // set gobject values
1013         }
1014
1015         // user defined functions
1016     }
1017
1018     public class Xcls_label_crete_ticket : Object
1019     {
1020         public Gtk.Label el;
1021         private NewBranch  _this;
1022
1023
1024             // my vars (def)
1025
1026         // ctor
1027         public Xcls_label_crete_ticket(NewBranch _owner )
1028         {
1029             _this = _owner;
1030             _this.label_crete_ticket = this;
1031             this.el = new Gtk.Label( "Create a new Ticket" );
1032
1033             // my vars (dec)
1034
1035             // set gobject values
1036         }
1037
1038         // user defined functions
1039     }
1040
1041     public class Xcls_label_quick_commit : Object
1042     {
1043         public Gtk.Label el;
1044         private NewBranch  _this;
1045
1046
1047             // my vars (def)
1048
1049         // ctor
1050         public Xcls_label_quick_commit(NewBranch _owner )
1051         {
1052             _this = _owner;
1053             _this.label_quick_commit = this;
1054             this.el = new Gtk.Label( "Quick Commit" );
1055
1056             // my vars (dec)
1057
1058             // set gobject values
1059         }
1060
1061         // user defined functions
1062     }
1063
1064
1065 }