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