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