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