78f86ca3645ff6a86dbf2b19a513148a35455bea
[gitlive] / Clones.vala
1 static Clones  _Clones;
2
3 public class Clones : Object
4 {
5     public Gtk.Dialog el;
6     private Clones  _this;
7
8     public static Clones singleton()
9     {
10         if (_Clones == null) {
11             _Clones= new Clones();
12         }
13         return _Clones;
14     }
15     public Xcls_reposView reposView;
16     public Xcls_reposStore reposStore;
17     public Xcls_tv_autocommit tv_autocommit;
18     public Xcls_cr_autocommit cr_autocommit;
19     public Xcls_tv_autopush tv_autopush;
20     public Xcls_cr_autopush cr_autopush;
21     public Xcls_tv_autobranch tv_autobranch;
22     public Xcls_cr_autobranch cr_autobranch;
23     public Xcls_tv_repo tv_repo;
24     public Xcls_cr_repo cr_repo;
25     public Xcls_tv_active_ticket tv_active_ticket;
26     public Xcls_cr_active_ticket cr_active_ticket;
27     public Xcls_tv_current_branch tv_current_branch;
28     public Xcls_cr_current_branch cr_current_branch;
29     public Xcls_tv_last_updated tv_last_updated;
30     public Xcls_cr_last_updated cr_last_updated;
31     public Xcls_tv_all_branches tv_all_branches;
32     public Xcls_cr_all_branches cr_all_branches;
33
34         // my vars (def)
35
36     // ctor
37     public Clones()
38     {
39         _this = this;
40         this.el = new Gtk.Dialog();
41
42         // my vars (dec)
43
44         // set gobject values
45         this.el.title = "Manage Clones";
46         this.el.border_width = 3;
47         this.el.default_height = 500;
48         this.el.default_width = 1024;
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
55         //listeners
56         this.el.delete_event.connect( (self, event) => {
57             this.el.hide();
58             return true; 
59             //test  
60         });
61         this.el.response.connect( (self, response_id) =>  { 
62          
63                 this.el.hide();
64           
65         });
66     }
67
68     // user defined functions
69     public void show ()    {
70     
71         
72         this.el.set_deletable(true);
73         this.el.set_gravity(Gdk.Gravity.NORTH);
74         this.el.move((Gdk.Screen.width() / 2 ) -400 ,0);
75         
76         this.el.set_default_size(
77                         int.min(1024,Gdk.Screen.width()),
78                         int.max(500,Gdk.Screen.width() - 300)
79         );
80         
81         this.el.show_all();
82         _this.reposStore.load();
83         this.el.set_keep_above(true);
84         this.el.run();
85         // load clones..
86     //     this.get('/reposStore').load();
87         
88         //this.get('/ok_button').el.set_sensitive(false);
89         
90         // block until we return.
91     //    var run_ret = this.el.run();
92     //    if (run_ret < 1 ) {
93     //        return  "DONE";
94     //    }
95     //    print("RUN RETURN : " + run_ret);
96     //    return "DONE";
97         //print(JSON.stringify(this.get('bug').getValue()));
98        // return this.get('bug').getValue();
99         //this.success = c.success;
100     }
101     public class Xcls_Box2 : Object
102     {
103         public Gtk.Box el;
104         private Clones  _this;
105
106
107             // my vars (def)
108
109         // ctor
110         public Xcls_Box2(Clones _owner )
111         {
112             _this = _owner;
113             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
114
115             // my vars (dec)
116
117             // set gobject values
118             var child_0 = new Xcls_Box3( _this );
119             child_0.ref();
120             this.el.pack_start (  child_0.el , false,false,0 );
121             var child_1 = new Xcls_ScrolledWindow9( _this );
122             child_1.ref();
123             this.el.pack_end (  child_1.el , true,true,0 );
124         }
125
126         // user defined functions
127     }
128     public class Xcls_Box3 : Object
129     {
130         public Gtk.Box el;
131         private Clones  _this;
132
133
134             // my vars (def)
135
136         // ctor
137         public Xcls_Box3(Clones _owner )
138         {
139             _this = _owner;
140             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
141
142             // my vars (dec)
143
144             // set gobject values
145             this.el.homogeneous = true;
146             var child_0 = new Xcls_Button4( _this );
147             child_0.ref();
148             this.el.add (  child_0.el  );
149             var child_1 = new Xcls_Button5( _this );
150             child_1.ref();
151             this.el.add (  child_1.el  );
152             var child_2 = new Xcls_Button6( _this );
153             child_2.ref();
154             this.el.add (  child_2.el  );
155             var child_3 = new Xcls_Button7( _this );
156             child_3.ref();
157             this.el.add (  child_3.el  );
158             var child_4 = new Xcls_Button8( _this );
159             child_4.ref();
160             this.el.add (  child_4.el  );
161         }
162
163         // user defined functions
164     }
165     public class Xcls_Button4 : Object
166     {
167         public Gtk.Button el;
168         private Clones  _this;
169
170
171             // my vars (def)
172
173         // ctor
174         public Xcls_Button4(Clones _owner )
175         {
176             _this = _owner;
177             this.el = new Gtk.Button();
178
179             // my vars (dec)
180
181             // set gobject values
182             this.el.label = "Add Repository";
183
184             //listeners
185             this.el.clicked.connect( () => {
186             
187             /*    var rv = this.get('/reposView');
188                 var rs = this.get('/reposStore');
189                 if (rv.el.get_selection().count_selected_rows() != 1) {
190                     //nothing?
191                     // error condition.
192                     return;
193                 }
194                 var Remotes =     imports.Remotes.Remotes;
195                 
196              
197                 var ret = {};       
198                 var s = rv.el.get_selection();
199                 var path = '';
200                 s.selected_foreach(function(model,p,iter) {
201                                                                 
202                    path = model.get_value(iter, 6).value.get_string();
203                  
204                 }); 
205             
206                 var repo = false;
207                 rs.repos.forEach(function(r) {
208                     if (r.repopath == path) {
209                         repo = r;
210                     
211                     }
212                 
213                 });
214                 Remotes.repo = repo;
215                 Remotes.el.set_transient_for(Clones.el);
216                 Clones.el.set_title("Manage Clones - " + repo.repopath);
217                 Remotes.show();
218                 Clones.el.set_title("Manage Clones");
219             
220               */   
221                 
222                  
223             
224                    
225                 
226                 
227             });
228         }
229
230         // user defined functions
231     }
232
233     public class Xcls_Button5 : Object
234     {
235         public Gtk.Button el;
236         private Clones  _this;
237
238
239             // my vars (def)
240
241         // ctor
242         public Xcls_Button5(Clones _owner )
243         {
244             _this = _owner;
245             this.el = new Gtk.Button();
246
247             // my vars (dec)
248
249             // set gobject values
250             this.el.label = "Branches";
251             this.el.visible = false;
252
253             //listeners
254             this.el.clicked.connect( () => {
255             // 
256             
257                 //NewBranch.singleton().show();
258             
259             /*
260                 var rv = this.get('/reposView');
261                 var rs = this.get('/reposStore');
262                 if (rv.el.get_selection().count_selected_rows() != 1) {
263                     //nothing?
264                     // error condition.
265                     return;
266                 }
267                 var Branches =     imports.Branches.Branches;
268                 
269              
270                 var ret = {};       
271                 var s = rv.el.get_selection();
272                 var path = '';
273                 s.selected_foreach(function(model,p,iter) {
274                                                                 
275                    path = model.get_value(iter, 6).value.get_string();
276                  
277                 }); 
278             
279                 var repo = false;
280                 rs.repos.forEach(function(r) {
281                     if (r.repopath == path) {
282                         repo = r;
283                     
284                     }
285                 
286                 });
287                 Branches.repo = repo;
288                 Branches.el.set_transient_for(Clones.el);
289                 Clones.el.set_title("Manage Clones - " + repo.repopath);
290                 Branches.show();
291                 Clones.el.set_title("Manage Clones");
292             
293                  
294                 
295                 
296                 
297             
298                    
299              */   
300                 
301             });
302         }
303
304         // user defined functions
305     }
306
307     public class Xcls_Button6 : Object
308     {
309         public Gtk.Button el;
310         private Clones  _this;
311
312
313             // my vars (def)
314
315         // ctor
316         public Xcls_Button6(Clones _owner )
317         {
318             _this = _owner;
319             this.el = new Gtk.Button();
320
321             // my vars (dec)
322
323             // set gobject values
324             this.el.label = "Merge";
325
326             //listeners
327             this.el.clicked.connect( () =>  {
328             
329                 var rv = _this.reposView;
330                 var rs = _this.reposStore;
331                 var s =rv.el.get_selection();
332                 if (s.count_selected_rows() != 1) {
333                         return;
334                 }
335                 Gtk.TreeIter iter;
336                 Gtk.TreeModel tm;
337                 s.get_selected(out tm, out iter);
338                 GLib.Value val;
339                 tm.get_value(iter, 6, out val);
340                 var git_working_dir = (string)val;
341                 
342                 var repo = GitRepo.singleton().get(git_working_dir);
343                 
344                 // if you hit merge.... in master..
345                 // ignore..
346                 if (repo.currentBranch.name == "master") {
347                         return;
348                 }
349                 MergeBranch.singleton().show(repo.activeTicket, repo);
350                 _this.reposStore.load();
351                 
352              
353                 
354             });
355         }
356
357         // user defined functions
358     }
359
360     public class Xcls_Button7 : Object
361     {
362         public Gtk.Button el;
363         private Clones  _this;
364
365
366             // my vars (def)
367
368         // ctor
369         public Xcls_Button7(Clones _owner )
370         {
371             _this = _owner;
372             this.el = new Gtk.Button();
373
374             // my vars (dec)
375
376             // set gobject values
377             this.el.label = "Switch Branch";
378             this.el.visible = false;
379
380             //listeners
381             this.el.clicked.connect( () => {
382                 
383                 
384              
385                    
386                 
387                 
388             });
389         }
390
391         // user defined functions
392     }
393
394     public class Xcls_Button8 : Object
395     {
396         public Gtk.Button el;
397         private Clones  _this;
398
399
400             // my vars (def)
401
402         // ctor
403         public Xcls_Button8(Clones _owner )
404         {
405             _this = _owner;
406             this.el = new Gtk.Button();
407
408             // my vars (dec)
409
410             // set gobject values
411             this.el.label = "Pull";
412
413             //listeners
414             this.el.clicked.connect( () =>  {
415             
416                 var rv = _this.reposView;
417                 var rs = _this.reposStore;
418                 var s =rv.el.get_selection();
419                 if (s.count_selected_rows() != 1) {
420                         return;
421                 }
422                 Gtk.TreeIter iter;
423                 Gtk.TreeModel tm;
424                 s.get_selected(out tm, out iter);
425                 GLib.Value val;
426                 tm.get_value(iter, 6, out val);
427                 var git_working_dir = (string)val;
428                 
429                 var repo = GitRepo.singleton().get(git_working_dir);
430                 GitMonitor.gitmonitor.pause();    
431                 repo.pull();
432                 repo.loadStatus();
433                 _this.reposStore.load();
434                 GitMonitor.gitmonitor.start(); 
435             
436              
437                 
438             });
439         }
440
441         // user defined functions
442     }
443
444
445     public class Xcls_ScrolledWindow9 : Object
446     {
447         public Gtk.ScrolledWindow el;
448         private Clones  _this;
449
450
451             // my vars (def)
452
453         // ctor
454         public Xcls_ScrolledWindow9(Clones _owner )
455         {
456             _this = _owner;
457             this.el = new Gtk.ScrolledWindow( null, null );
458
459             // my vars (dec)
460
461             // set gobject values
462             this.el.expand = true;
463             this.el.hexpand = true;
464             this.el.shadow_type = Gtk.ShadowType.IN;
465             var child_0 = new Xcls_reposView( _this );
466             child_0.ref();
467             this.el.add (  child_0.el  );
468
469             // init method
470
471             {
472               
473                this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
474             }
475         }
476
477         // user defined functions
478     }
479     public class Xcls_reposView : Object
480     {
481         public Gtk.TreeView el;
482         private Clones  _this;
483
484
485             // my vars (def)
486
487         // ctor
488         public Xcls_reposView(Clones _owner )
489         {
490             _this = _owner;
491             _this.reposView = this;
492             this.el = new Gtk.TreeView();
493
494             // my vars (dec)
495
496             // set gobject values
497             this.el.search_column = 0;
498             this.el.activate_on_single_click = true;
499             this.el.enable_grid_lines = Gtk.TreeViewGridLines.HORIZONTAL;
500             var child_0 = new Xcls_reposStore( _this );
501             child_0.ref();
502             this.el.set_model (  child_0.el  );
503             var child_1 = new Xcls_tv_autocommit( _this );
504             child_1.ref();
505             this.el.append_column (  child_1.el  );
506             var child_2 = new Xcls_tv_autopush( _this );
507             child_2.ref();
508             this.el.append_column (  child_2.el  );
509             var child_3 = new Xcls_tv_autobranch( _this );
510             child_3.ref();
511             this.el.append_column (  child_3.el  );
512             var child_4 = new Xcls_tv_repo( _this );
513             child_4.ref();
514             this.el.append_column (  child_4.el  );
515             var child_5 = new Xcls_tv_active_ticket( _this );
516             child_5.ref();
517             this.el.append_column (  child_5.el  );
518             var child_6 = new Xcls_tv_current_branch( _this );
519             child_6.ref();
520             this.el.append_column (  child_6.el  );
521             var child_7 = new Xcls_tv_last_updated( _this );
522             child_7.ref();
523             this.el.append_column (  child_7.el  );
524             var child_8 = new Xcls_tv_all_branches( _this );
525             child_8.ref();
526             this.el.append_column (  child_8.el  );
527
528             // init method
529
530             {
531                 var selection = this.el.get_selection();
532                 selection.set_mode( Gtk.SelectionMode.SINGLE);
533             
534             
535                 var description = new Pango.FontDescription();
536                 description.set_size(10000);
537                 this.el.override_font(description);
538              
539             }
540
541             //listeners
542             this.el.row_activated.connect( (path, col)  =>  {
543             
544                 if (col.title != "Current Branch") {
545                         return;
546                 }
547                 
548                 //
549                 
550                 Gtk.TreeIter iter;
551                 _this.reposStore.el.get_iter(out iter, path);
552                 GLib.Value val;
553                 _this.reposStore.el.get_value(iter, 6, out val);
554                 var git_working_dir = (string)val;
555                 
556                 var repo = GitRepo.singleton().get(git_working_dir);
557                 
558                 Gdk.Rectangle rect;
559                 _this.reposView.el.get_cell_area(path, col, out rect);
560                 RepoStatusPopover.singleton().show(this.el, rect, repo);
561                 
562                  
563                 
564             });
565             this.el.cursor_changed.connect( ()  => {
566               // SEE SELECTION.CHANGED
567               /*
568               
569               return;
570               
571                 if (this.el.get_selection().count_selected_rows() < 1) {
572                     //nothing? - clea it?
573                     return;
574                 }
575                     var ret = {};         
576                 var model = this.get('/changedFilesStore');
577             
578                  var s = this.el.get_selection();
579                  var files = [];
580                 s.selected_foreach(function(model,p,iter) {
581                 
582                    files.push( model.get_value(iter, 0).value.get_string());
583                  
584                 });
585                 this.get('/patchview').showDiff(files); 
586                 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
587                  //print("OUT?" + value);// id..
588                 // load the list in the right grid..
589                  
590                 return true;
591             */
592             });
593         }
594
595         // user defined functions
596     }
597     public class Xcls_reposStore : Object
598     {
599         public Gtk.ListStore el;
600         private Clones  _this;
601
602
603             // my vars (def)
604
605         // ctor
606         public Xcls_reposStore(Clones _owner )
607         {
608             _this = _owner;
609             _this.reposStore = this;
610             this.el = new Gtk.ListStore( 10,      typeof(string),  // 0 repo
611      typeof(string),  // 1 current branch
612      typeof(string),  // 2 all branch
613      typeof(string),  // 3 updated
614      typeof(bool),   // 4 auto commit
615      typeof(bool),   // 5 auto push
616      typeof(string),   // 6 repopath
617       typeof(string),   // 7 color highlighting?
618        typeof(bool),   // 8 auto branch,
619       typeof(string)   // 9 active Ticket
620        );
621
622             // my vars (dec)
623
624             // set gobject values
625         }
626
627         // user defined functions
628         public void load ()
629         {
630             //this.insert(citer,iter,0);
631             print("getting list");
632             var tr = GitRepo.list();
633             
634             this.el.clear();
635             
636             // fixme .. sort by last updated ...
637             
638             
639             for(var i =0 ; i < tr.length; i++) {
640                     var repo = tr.index(i);
641                     // this is done before we display stuff...
642                     //repo.loadBranches();
643                     //repo.loadStatus();
644                     
645                     Gtk.TreeIter iter;
646                     this.el.append(out iter);
647              
648                 //print(JSON.stringify(ret,null,4));
649                  //tr[i].getBranches();
650                  //tr[i].getStatus();
651                  //var hi;
652                  //try {
653                      //tr[i].debug=1;
654                  //     hi = tr[i].history('/', 1, 'branch', tr[i].currentBranch.name );
655         //             print(JSON.stringify(hi,null,4));
656                 // } catch(e) { print(e);}
657                   
658                 this.el.set_value(iter, 0,   repo.name );
659                 this.el.set_value( iter, 1, repo.currentBranch.name   );
660                 this.el.set_value( iter, 2,  repo.branchesToString()   );
661         //        this.el.set_value(ret.iter, 2, '' + repo.branches.map(
662         //                        function(e) { return e.name; 
663         //                    }).join(', ') 
664          //        );
665         //        this.el.set_value(iter, 3, '' +  (!hi  ? '??' : hi[0].changed_raw));        
666                 this.el.set_value(iter, 4, repo.is_autocommit() );                
667                 this.el.set_value(iter, 5, repo.is_autopush() );                        
668                 this.el.set_value(iter, 6,  repo.git_working_dir );  
669                 // highlight color.
670                 var cb = repo.currentBranch;
671                 //print(JSON.stringify(cb,null,4));
672                 var col = "#ffffff";
673                 
674                 if (cb.lastrev != cb.remoterev) {
675                     col =  "#f2dede";
676                     this.el.set_value( iter, 1, repo.currentBranch.name +"\n" +
677                         (repo.ahead_or_behind == "B" ? "Local is BEHIND remote" : "Local is AHEAD of remote")
678                     
679                        );
680                 }
681                 if (repo.has_local_changes) {
682                     col =  "#d9edf7";
683                     this.el.set_value( iter, 1, repo.currentBranch.name +"\nHas uncommitted changes"   );
684                 }
685                 if  ((cb.lastrev != cb.remoterev) && (repo.has_local_changes)) {
686                     col =  "#fcf8e3";
687                     this.el.set_value( iter, 1, repo.currentBranch.name +"\n" + 
688                     (repo.ahead_or_behind == "B" ? "Local is BEHIND remote" : "Local is AHEAD of remote") +
689                     "\nHas uncommitted changes"   );            
690                 }
691                 
692                 this.el.set_value(iter, 7, col  );      
693                 var ticket = repo.activeTicket;
694                 
695                 this.el.set_value(iter, 8, repo.is_auto_branch()  );      
696                 this.el.set_value(iter, 9, ticket == null ? "" : ticket.id  );      
697                 
698                 
699             }     
700             this.el.set_sort_column_id (0, Gtk.SortType.ASCENDING);
701         }
702     }
703
704     public class Xcls_tv_autocommit : Object
705     {
706         public Gtk.TreeViewColumn el;
707         private Clones  _this;
708
709
710             // my vars (def)
711
712         // ctor
713         public Xcls_tv_autocommit(Clones _owner )
714         {
715             _this = _owner;
716             _this.tv_autocommit = this;
717             this.el = new Gtk.TreeViewColumn();
718
719             // my vars (dec)
720
721             // set gobject values
722             this.el.title = "Auto Commit";
723             this.el.min_width = 50;
724             var child_0 = new Xcls_cr_autocommit( _this );
725             child_0.ref();
726             this.el.pack_start (  child_0.el , false );
727
728             // init method
729
730             //    this.items[0].el.set_activatable(true);
731              this.el.add_attribute(_this.cr_autocommit.el , "active", 4 );
732         }
733
734         // user defined functions
735     }
736     public class Xcls_cr_autocommit : Object
737     {
738         public Gtk.CellRendererToggle el;
739         private Clones  _this;
740
741
742             // my vars (def)
743
744         // ctor
745         public Xcls_cr_autocommit(Clones _owner )
746         {
747             _this = _owner;
748             _this.cr_autocommit = this;
749             this.el = new Gtk.CellRendererToggle();
750
751             // my vars (dec)
752
753             // set gobject values
754             this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
755
756             //listeners
757             this.el.toggled.connect( (self, path)  => {
758               
759                 Gtk.TreeIter iter;
760                 _this.reposStore.el.get_iter_from_string(out iter, path);
761                 
762                 GLib.Value val;
763                 GLib.Value rval;
764                 _this.reposStore.el.get_value(iter, 4, out val);
765                 _this.reposStore.el.get_value(iter, 6, out rval);
766                 
767                 var repopath = (string)rval;
768                 var bval = (bool)val;
769                 _this.reposStore.el.set_value(iter, 4, !bval);
770                 GLib.debug("got repopath? %s", repopath);
771                 
772                 var repo = GitRepo.get(repopath);
773                 repo.set_autocommit(!bval);
774                 
775                 
776                 
777               
778             });
779         }
780
781         // user defined functions
782     }
783
784
785     public class Xcls_tv_autopush : Object
786     {
787         public Gtk.TreeViewColumn el;
788         private Clones  _this;
789
790
791             // my vars (def)
792
793         // ctor
794         public Xcls_tv_autopush(Clones _owner )
795         {
796             _this = _owner;
797             _this.tv_autopush = this;
798             this.el = new Gtk.TreeViewColumn();
799
800             // my vars (dec)
801
802             // set gobject values
803             this.el.title = "Auto Push";
804             this.el.min_width = 50;
805             var child_0 = new Xcls_cr_autopush( _this );
806             child_0.ref();
807             this.el.pack_start (  child_0.el , false );
808
809             // init method
810
811             this.el.add_attribute(_this.cr_autopush.el , "active", 5 );
812             //      this.items[0].el.set_activatable(true);
813         }
814
815         // user defined functions
816     }
817     public class Xcls_cr_autopush : Object
818     {
819         public Gtk.CellRendererToggle el;
820         private Clones  _this;
821
822
823             // my vars (def)
824
825         // ctor
826         public Xcls_cr_autopush(Clones _owner )
827         {
828             _this = _owner;
829             _this.cr_autopush = this;
830             this.el = new Gtk.CellRendererToggle();
831
832             // my vars (dec)
833
834             // set gobject values
835             this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
836
837             //listeners
838             this.el.toggled.connect( (self, path)  => {
839               
840                 Gtk.TreeIter iter;
841                 _this.reposStore.el.get_iter_from_string(out iter, path);
842                 
843                 GLib.Value val;
844                 GLib.Value rval;
845                 _this.reposStore.el.get_value(iter, 5, out val);
846                 _this.reposStore.el.get_value(iter, 6, out rval);
847                 
848                 var repopath = (string)rval;
849                 var bval = (bool)val;
850                 _this.reposStore.el.set_value(iter, 5, !bval);
851                 var repo = GitRepo.get(repopath);
852                 repo.set_autopush(!bval);
853                 
854                 
855                 
856               
857             });
858         }
859
860         // user defined functions
861     }
862
863
864     public class Xcls_tv_autobranch : Object
865     {
866         public Gtk.TreeViewColumn el;
867         private Clones  _this;
868
869
870             // my vars (def)
871
872         // ctor
873         public Xcls_tv_autobranch(Clones _owner )
874         {
875             _this = _owner;
876             _this.tv_autobranch = this;
877             this.el = new Gtk.TreeViewColumn();
878
879             // my vars (dec)
880
881             // set gobject values
882             this.el.title = "Auto Branch";
883             this.el.min_width = 50;
884             var child_0 = new Xcls_cr_autobranch( _this );
885             child_0.ref();
886             this.el.pack_start (  child_0.el , false );
887
888             // init method
889
890             this.el.add_attribute(_this.cr_autobranch.el , "active", 8 );
891             //      this.items[0].el.set_activatable(true);
892         }
893
894         // user defined functions
895     }
896     public class Xcls_cr_autobranch : Object
897     {
898         public Gtk.CellRendererToggle el;
899         private Clones  _this;
900
901
902             // my vars (def)
903
904         // ctor
905         public Xcls_cr_autobranch(Clones _owner )
906         {
907             _this = _owner;
908             _this.cr_autobranch = this;
909             this.el = new Gtk.CellRendererToggle();
910
911             // my vars (dec)
912
913             // set gobject values
914             this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
915
916             //listeners
917             this.el.toggled.connect( (self, path)  => {
918               
919                 Gtk.TreeIter iter;
920                 _this.reposStore.el.get_iter_from_string(out iter, path);
921                 
922                 GLib.Value val;
923                 GLib.Value rval;
924                 _this.reposStore.el.get_value(iter, 8, out val);
925                 _this.reposStore.el.get_value(iter, 6, out rval);
926                 
927                 var repopath = (string)rval;
928                 var bval = (bool)val;
929                 _this.reposStore.el.set_value(iter, 8, !bval);
930                 var repo = GitRepo.get(repopath);
931                 repo.set_auto_branch(!bval);
932                 
933                 
934                 
935               
936             });
937         }
938
939         // user defined functions
940     }
941
942
943     public class Xcls_tv_repo : Object
944     {
945         public Gtk.TreeViewColumn el;
946         private Clones  _this;
947
948
949             // my vars (def)
950
951         // ctor
952         public Xcls_tv_repo(Clones _owner )
953         {
954             _this = _owner;
955             _this.tv_repo = this;
956             this.el = new Gtk.TreeViewColumn();
957
958             // my vars (dec)
959
960             // set gobject values
961             this.el.sort_column_id = 0;
962             this.el.title = "Repo";
963             this.el.min_width = 200;
964             this.el.sort_order = Gtk.SortType.ASCENDING;
965             this.el.resizable = true;
966             var child_0 = new Xcls_cr_repo( _this );
967             child_0.ref();
968             this.el.pack_start (  child_0.el , false );
969
970             // init method
971
972             this.el.add_attribute(_this.cr_repo.el , "markup", 0 );
973         }
974
975         // user defined functions
976     }
977     public class Xcls_cr_repo : Object
978     {
979         public Gtk.CellRendererText el;
980         private Clones  _this;
981
982
983             // my vars (def)
984
985         // ctor
986         public Xcls_cr_repo(Clones _owner )
987         {
988             _this = _owner;
989             _this.cr_repo = this;
990             this.el = new Gtk.CellRendererText();
991
992             // my vars (dec)
993
994             // set gobject values
995         }
996
997         // user defined functions
998     }
999
1000
1001     public class Xcls_tv_active_ticket : Object
1002     {
1003         public Gtk.TreeViewColumn el;
1004         private Clones  _this;
1005
1006
1007             // my vars (def)
1008
1009         // ctor
1010         public Xcls_tv_active_ticket(Clones _owner )
1011         {
1012             _this = _owner;
1013             _this.tv_active_ticket = this;
1014             this.el = new Gtk.TreeViewColumn();
1015
1016             // my vars (dec)
1017
1018             // set gobject values
1019             this.el.title = "Active Ticket";
1020             this.el.min_width = 50;
1021             var child_0 = new Xcls_cr_active_ticket( _this );
1022             child_0.ref();
1023             this.el.pack_start (  child_0.el , false );
1024
1025             // init method
1026
1027             this.el.add_attribute(_this.cr_active_ticket.el , "markup", 9 );
1028         }
1029
1030         // user defined functions
1031     }
1032     public class Xcls_cr_active_ticket : Object
1033     {
1034         public Gtk.CellRendererText el;
1035         private Clones  _this;
1036
1037
1038             // my vars (def)
1039
1040         // ctor
1041         public Xcls_cr_active_ticket(Clones _owner )
1042         {
1043             _this = _owner;
1044             _this.cr_active_ticket = this;
1045             this.el = new Gtk.CellRendererText();
1046
1047             // my vars (dec)
1048
1049             // set gobject values
1050         }
1051
1052         // user defined functions
1053     }
1054
1055
1056     public class Xcls_tv_current_branch : Object
1057     {
1058         public Gtk.TreeViewColumn el;
1059         private Clones  _this;
1060
1061
1062             // my vars (def)
1063
1064         // ctor
1065         public Xcls_tv_current_branch(Clones _owner )
1066         {
1067             _this = _owner;
1068             _this.tv_current_branch = this;
1069             this.el = new Gtk.TreeViewColumn();
1070
1071             // my vars (dec)
1072
1073             // set gobject values
1074             this.el.title = "Current Branch";
1075             this.el.min_width = 50;
1076             var child_0 = new Xcls_cr_current_branch( _this );
1077             child_0.ref();
1078             this.el.pack_start (  child_0.el , false );
1079
1080             // init method
1081
1082             this.el.add_attribute(_this.cr_current_branch.el , "markup", 1 );
1083                  this.el.add_attribute(_this.cr_current_branch.el, "cell-background", 7 );
1084         }
1085
1086         // user defined functions
1087     }
1088     public class Xcls_cr_current_branch : Object
1089     {
1090         public Gtk.CellRendererText el;
1091         private Clones  _this;
1092
1093
1094             // my vars (def)
1095
1096         // ctor
1097         public Xcls_cr_current_branch(Clones _owner )
1098         {
1099             _this = _owner;
1100             _this.cr_current_branch = this;
1101             this.el = new Gtk.CellRendererText();
1102
1103             // my vars (dec)
1104
1105             // set gobject values
1106         }
1107
1108         // user defined functions
1109     }
1110
1111
1112     public class Xcls_tv_last_updated : Object
1113     {
1114         public Gtk.TreeViewColumn el;
1115         private Clones  _this;
1116
1117
1118             // my vars (def)
1119
1120         // ctor
1121         public Xcls_tv_last_updated(Clones _owner )
1122         {
1123             _this = _owner;
1124             _this.tv_last_updated = this;
1125             this.el = new Gtk.TreeViewColumn();
1126
1127             // my vars (dec)
1128
1129             // set gobject values
1130             this.el.title = "Last updated";
1131             this.el.min_width = 50;
1132             var child_0 = new Xcls_cr_last_updated( _this );
1133             child_0.ref();
1134             this.el.pack_start (  child_0.el , false );
1135
1136             // init method
1137
1138             this.el.add_attribute(_this.cr_last_updated.el , "markup", 3 );
1139         }
1140
1141         // user defined functions
1142     }
1143     public class Xcls_cr_last_updated : Object
1144     {
1145         public Gtk.CellRendererText el;
1146         private Clones  _this;
1147
1148
1149             // my vars (def)
1150
1151         // ctor
1152         public Xcls_cr_last_updated(Clones _owner )
1153         {
1154             _this = _owner;
1155             _this.cr_last_updated = this;
1156             this.el = new Gtk.CellRendererText();
1157
1158             // my vars (dec)
1159
1160             // set gobject values
1161         }
1162
1163         // user defined functions
1164     }
1165
1166
1167     public class Xcls_tv_all_branches : Object
1168     {
1169         public Gtk.TreeViewColumn el;
1170         private Clones  _this;
1171
1172
1173             // my vars (def)
1174
1175         // ctor
1176         public Xcls_tv_all_branches(Clones _owner )
1177         {
1178             _this = _owner;
1179             _this.tv_all_branches = this;
1180             this.el = new Gtk.TreeViewColumn();
1181
1182             // my vars (dec)
1183
1184             // set gobject values
1185             this.el.title = "All Branches";
1186             this.el.min_width = 50;
1187             this.el.resizable = false;
1188             var child_0 = new Xcls_cr_all_branches( _this );
1189             child_0.ref();
1190             this.el.pack_start (  child_0.el , false );
1191
1192             // init method
1193
1194             this.el.add_attribute(_this.cr_all_branches.el , "markup", 2 );
1195         }
1196
1197         // user defined functions
1198     }
1199     public class Xcls_cr_all_branches : Object
1200     {
1201         public Gtk.CellRendererText el;
1202         private Clones  _this;
1203
1204
1205             // my vars (def)
1206
1207         // ctor
1208         public Xcls_cr_all_branches(Clones _owner )
1209         {
1210             _this = _owner;
1211             _this.cr_all_branches = this;
1212             this.el = new Gtk.CellRendererText();
1213
1214             // my vars (dec)
1215
1216             // set gobject values
1217         }
1218
1219         // user defined functions
1220     }
1221
1222
1223
1224
1225
1226 }