Clones.bjs
[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                 
417              
418                    
419                 
420                 
421             });
422         }
423
424         // user defined functions
425     }
426
427
428     public class Xcls_ScrolledWindow9 : Object
429     {
430         public Gtk.ScrolledWindow el;
431         private Clones  _this;
432
433
434             // my vars (def)
435
436         // ctor
437         public Xcls_ScrolledWindow9(Clones _owner )
438         {
439             _this = _owner;
440             this.el = new Gtk.ScrolledWindow( null, null );
441
442             // my vars (dec)
443
444             // set gobject values
445             this.el.expand = true;
446             this.el.hexpand = true;
447             this.el.shadow_type = Gtk.ShadowType.IN;
448             var child_0 = new Xcls_reposView( _this );
449             child_0.ref();
450             this.el.add (  child_0.el  );
451
452             // init method
453
454             {
455               
456                this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
457             }
458         }
459
460         // user defined functions
461     }
462     public class Xcls_reposView : Object
463     {
464         public Gtk.TreeView el;
465         private Clones  _this;
466
467
468             // my vars (def)
469
470         // ctor
471         public Xcls_reposView(Clones _owner )
472         {
473             _this = _owner;
474             _this.reposView = this;
475             this.el = new Gtk.TreeView();
476
477             // my vars (dec)
478
479             // set gobject values
480             this.el.search_column = 0;
481             this.el.activate_on_single_click = true;
482             this.el.enable_grid_lines = Gtk.TreeViewGridLines.HORIZONTAL;
483             var child_0 = new Xcls_reposStore( _this );
484             child_0.ref();
485             this.el.set_model (  child_0.el  );
486             var child_1 = new Xcls_tv_autocommit( _this );
487             child_1.ref();
488             this.el.append_column (  child_1.el  );
489             var child_2 = new Xcls_tv_autopush( _this );
490             child_2.ref();
491             this.el.append_column (  child_2.el  );
492             var child_3 = new Xcls_tv_autobranch( _this );
493             child_3.ref();
494             this.el.append_column (  child_3.el  );
495             var child_4 = new Xcls_tv_repo( _this );
496             child_4.ref();
497             this.el.append_column (  child_4.el  );
498             var child_5 = new Xcls_tv_active_ticket( _this );
499             child_5.ref();
500             this.el.append_column (  child_5.el  );
501             var child_6 = new Xcls_tv_current_branch( _this );
502             child_6.ref();
503             this.el.append_column (  child_6.el  );
504             var child_7 = new Xcls_tv_last_updated( _this );
505             child_7.ref();
506             this.el.append_column (  child_7.el  );
507             var child_8 = new Xcls_tv_all_branches( _this );
508             child_8.ref();
509             this.el.append_column (  child_8.el  );
510
511             // init method
512
513             {
514                 var selection = this.el.get_selection();
515                 selection.set_mode( Gtk.SelectionMode.SINGLE);
516             
517             
518                 var description = new Pango.FontDescription();
519                 description.set_size(10000);
520                 this.el.override_font(description);
521              
522             }
523
524             //listeners
525             this.el.row_activated.connect( (path, col)  =>  {
526             
527                 if (col.title != "Active Ticket") {
528                         return;
529                 }
530                 
531                 //
532                 
533                 Gtk.TreeIter iter;
534                 _this.reposStore.el.get_iter(out iter, path);
535                 GLib.Value val;
536                 _this.reposStore.el.get_value(iter, 6, out val);
537                 var git_working_dir = (string)val;
538                 
539                 var repo = GitRepo.singleton().get(git_working_dir);
540                 
541                 Gdk.Rectangle rect;
542                 _this.reposView.el.get_cell_area(path, col, out rect);
543                 RepoStatusPopover.singleton().show(this.el, rect, repo);
544                 
545                  
546                 
547             });
548             this.el.cursor_changed.connect( ()  => {
549               // SEE SELECTION.CHANGED
550               /*
551               
552               return;
553               
554                 if (this.el.get_selection().count_selected_rows() < 1) {
555                     //nothing? - clea it?
556                     return;
557                 }
558                     var ret = {};         
559                 var model = this.get('/changedFilesStore');
560             
561                  var s = this.el.get_selection();
562                  var files = [];
563                 s.selected_foreach(function(model,p,iter) {
564                 
565                    files.push( model.get_value(iter, 0).value.get_string());
566                  
567                 });
568                 this.get('/patchview').showDiff(files); 
569                 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
570                  //print("OUT?" + value);// id..
571                 // load the list in the right grid..
572                  
573                 return true;
574             */
575             });
576         }
577
578         // user defined functions
579     }
580     public class Xcls_reposStore : Object
581     {
582         public Gtk.ListStore el;
583         private Clones  _this;
584
585
586             // my vars (def)
587
588         // ctor
589         public Xcls_reposStore(Clones _owner )
590         {
591             _this = _owner;
592             _this.reposStore = this;
593             this.el = new Gtk.ListStore( 10,      typeof(string),  // 0 repo
594      typeof(string),  // 1 current branch
595      typeof(string),  // 2 all branch
596      typeof(string),  // 3 updated
597      typeof(bool),   // 4 auto commit
598      typeof(bool),   // 5 auto push
599      typeof(string),   // 6 repopath
600       typeof(string),   // 7 color highlighting?
601        typeof(bool),   // 8 auto branch,
602       typeof(string)   // 9 active Ticket
603        );
604
605             // my vars (dec)
606
607             // set gobject values
608         }
609
610         // user defined functions
611         public void load ()
612         {
613             //this.insert(citer,iter,0);
614             print("getting list");
615             var tr = GitRepo.list();
616             
617             this.el.clear();
618             
619             // fixme .. sort by last updated ...
620             
621             
622             for(var i =0 ; i < tr.length; i++) {
623                     var repo = tr.index(i);
624                     // this is done before we display stuff...
625                     //repo.loadBranches();
626                     //repo.loadStatus();
627                     
628                     Gtk.TreeIter iter;
629                     this.el.append(out iter);
630              
631                 //print(JSON.stringify(ret,null,4));
632                  //tr[i].getBranches();
633                  //tr[i].getStatus();
634                  //var hi;
635                  //try {
636                      //tr[i].debug=1;
637                  //     hi = tr[i].history('/', 1, 'branch', tr[i].currentBranch.name );
638         //             print(JSON.stringify(hi,null,4));
639                 // } catch(e) { print(e);}
640                   
641                 this.el.set_value(iter, 0,   repo.name );
642                 this.el.set_value( iter, 1, repo.currentBranch.name   );
643                 this.el.set_value( iter, 2,  repo.branchesToString()   );
644         //        this.el.set_value(ret.iter, 2, '' + repo.branches.map(
645         //                        function(e) { return e.name; 
646         //                    }).join(', ') 
647          //        );
648         //        this.el.set_value(iter, 3, '' +  (!hi  ? '??' : hi[0].changed_raw));        
649                 this.el.set_value(iter, 4, repo.is_autocommit() );                
650                 this.el.set_value(iter, 5, repo.is_autopush() );                        
651                 this.el.set_value(iter, 6,  repo.git_working_dir );  
652                 // highlight color.
653                 var cb = repo.currentBranch;
654                 //print(JSON.stringify(cb,null,4));
655                 var col = "#ffffff";
656                 
657                 if (cb.lastrev != cb.remoterev) {
658                     col =  "#f2dede";
659                     this.el.set_value( iter, 1, repo.currentBranch.name +"\n" +
660                         (repo.ahead_or_behind == "B" ? "Local is BEHIND remote" : "Local is AHEAD of remote")
661                     
662                        );
663                 }
664                 if (repo.has_local_changes) {
665                     col =  "#d9edf7";
666                     this.el.set_value( iter, 1, repo.currentBranch.name +"\nHas uncommitted changes"   );
667                 }
668                 if  ((cb.lastrev != cb.remoterev) && (repo.has_local_changes)) {
669                     col =  "#fcf8e3";
670                     this.el.set_value( iter, 1, repo.currentBranch.name +"\n" + 
671                     (repo.ahead_or_behind == "B" ? "Local is BEHIND remote" : "Local is AHEAD of remote") +
672                     "\nHas uncommitted changes"   );            
673                 }
674                 
675                 this.el.set_value(iter, 7, col  );      
676                 var ticket = repo.activeTicket;
677                 
678                 this.el.set_value(iter, 8, repo.is_auto_branch()  );      
679                 this.el.set_value(iter, 9, ticket == null ? "" : ticket.id  );      
680                 
681                 
682             }     
683             this.el.set_sort_column_id (0, Gtk.SortType.ASCENDING);
684         }
685     }
686
687     public class Xcls_tv_autocommit : Object
688     {
689         public Gtk.TreeViewColumn el;
690         private Clones  _this;
691
692
693             // my vars (def)
694
695         // ctor
696         public Xcls_tv_autocommit(Clones _owner )
697         {
698             _this = _owner;
699             _this.tv_autocommit = this;
700             this.el = new Gtk.TreeViewColumn();
701
702             // my vars (dec)
703
704             // set gobject values
705             this.el.title = "Auto Commit";
706             this.el.min_width = 50;
707             var child_0 = new Xcls_cr_autocommit( _this );
708             child_0.ref();
709             this.el.pack_start (  child_0.el , false );
710
711             // init method
712
713             //    this.items[0].el.set_activatable(true);
714              this.el.add_attribute(_this.cr_autocommit.el , "active", 4 );
715         }
716
717         // user defined functions
718     }
719     public class Xcls_cr_autocommit : Object
720     {
721         public Gtk.CellRendererToggle el;
722         private Clones  _this;
723
724
725             // my vars (def)
726
727         // ctor
728         public Xcls_cr_autocommit(Clones _owner )
729         {
730             _this = _owner;
731             _this.cr_autocommit = this;
732             this.el = new Gtk.CellRendererToggle();
733
734             // my vars (dec)
735
736             // set gobject values
737             this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
738
739             //listeners
740             this.el.toggled.connect( (self, path)  => {
741               
742                 Gtk.TreeIter iter;
743                 _this.reposStore.el.get_iter_from_string(out iter, path);
744                 
745                 GLib.Value val;
746                 GLib.Value rval;
747                 _this.reposStore.el.get_value(iter, 4, out val);
748                 _this.reposStore.el.get_value(iter, 6, out rval);
749                 
750                 var repopath = (string)rval;
751                 var bval = (bool)val;
752                 _this.reposStore.el.set_value(iter, 4, !bval);
753                 GLib.debug("got repopath? %s", repopath);
754                 
755                 var repo = GitRepo.get(repopath);
756                 repo.set_autocommit(!bval);
757                 
758                 
759                 
760               
761             });
762         }
763
764         // user defined functions
765     }
766
767
768     public class Xcls_tv_autopush : Object
769     {
770         public Gtk.TreeViewColumn el;
771         private Clones  _this;
772
773
774             // my vars (def)
775
776         // ctor
777         public Xcls_tv_autopush(Clones _owner )
778         {
779             _this = _owner;
780             _this.tv_autopush = this;
781             this.el = new Gtk.TreeViewColumn();
782
783             // my vars (dec)
784
785             // set gobject values
786             this.el.title = "Auto Push";
787             this.el.min_width = 50;
788             var child_0 = new Xcls_cr_autopush( _this );
789             child_0.ref();
790             this.el.pack_start (  child_0.el , false );
791
792             // init method
793
794             this.el.add_attribute(_this.cr_autopush.el , "active", 5 );
795             //      this.items[0].el.set_activatable(true);
796         }
797
798         // user defined functions
799     }
800     public class Xcls_cr_autopush : Object
801     {
802         public Gtk.CellRendererToggle el;
803         private Clones  _this;
804
805
806             // my vars (def)
807
808         // ctor
809         public Xcls_cr_autopush(Clones _owner )
810         {
811             _this = _owner;
812             _this.cr_autopush = this;
813             this.el = new Gtk.CellRendererToggle();
814
815             // my vars (dec)
816
817             // set gobject values
818             this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
819
820             //listeners
821             this.el.toggled.connect( (self, path)  => {
822               
823                 Gtk.TreeIter iter;
824                 _this.reposStore.el.get_iter_from_string(out iter, path);
825                 
826                 GLib.Value val;
827                 GLib.Value rval;
828                 _this.reposStore.el.get_value(iter, 5, out val);
829                 _this.reposStore.el.get_value(iter, 6, out rval);
830                 
831                 var repopath = (string)rval;
832                 var bval = (bool)val;
833                 _this.reposStore.el.set_value(iter, 5, !bval);
834                 var repo = GitRepo.get(repopath);
835                 repo.set_autopush(!bval);
836                 
837                 
838                 
839               
840             });
841         }
842
843         // user defined functions
844     }
845
846
847     public class Xcls_tv_autobranch : Object
848     {
849         public Gtk.TreeViewColumn el;
850         private Clones  _this;
851
852
853             // my vars (def)
854
855         // ctor
856         public Xcls_tv_autobranch(Clones _owner )
857         {
858             _this = _owner;
859             _this.tv_autobranch = this;
860             this.el = new Gtk.TreeViewColumn();
861
862             // my vars (dec)
863
864             // set gobject values
865             this.el.title = "Auto Branch";
866             this.el.min_width = 50;
867             var child_0 = new Xcls_cr_autobranch( _this );
868             child_0.ref();
869             this.el.pack_start (  child_0.el , false );
870
871             // init method
872
873             this.el.add_attribute(_this.cr_autobranch.el , "active", 8 );
874             //      this.items[0].el.set_activatable(true);
875         }
876
877         // user defined functions
878     }
879     public class Xcls_cr_autobranch : Object
880     {
881         public Gtk.CellRendererToggle el;
882         private Clones  _this;
883
884
885             // my vars (def)
886
887         // ctor
888         public Xcls_cr_autobranch(Clones _owner )
889         {
890             _this = _owner;
891             _this.cr_autobranch = this;
892             this.el = new Gtk.CellRendererToggle();
893
894             // my vars (dec)
895
896             // set gobject values
897             this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
898
899             //listeners
900             this.el.toggled.connect( (self, path)  => {
901               
902                 Gtk.TreeIter iter;
903                 _this.reposStore.el.get_iter_from_string(out iter, path);
904                 
905                 GLib.Value val;
906                 GLib.Value rval;
907                 _this.reposStore.el.get_value(iter, 8, out val);
908                 _this.reposStore.el.get_value(iter, 6, out rval);
909                 
910                 var repopath = (string)rval;
911                 var bval = (bool)val;
912                 _this.reposStore.el.set_value(iter, 8, !bval);
913                 var repo = GitRepo.get(repopath);
914                 repo.set_auto_branch(!bval);
915                 
916                 
917                 
918               
919             });
920         }
921
922         // user defined functions
923     }
924
925
926     public class Xcls_tv_repo : Object
927     {
928         public Gtk.TreeViewColumn el;
929         private Clones  _this;
930
931
932             // my vars (def)
933
934         // ctor
935         public Xcls_tv_repo(Clones _owner )
936         {
937             _this = _owner;
938             _this.tv_repo = this;
939             this.el = new Gtk.TreeViewColumn();
940
941             // my vars (dec)
942
943             // set gobject values
944             this.el.sort_column_id = 0;
945             this.el.title = "Repo";
946             this.el.min_width = 200;
947             this.el.sort_order = Gtk.SortType.ASCENDING;
948             this.el.resizable = true;
949             var child_0 = new Xcls_cr_repo( _this );
950             child_0.ref();
951             this.el.pack_start (  child_0.el , false );
952
953             // init method
954
955             this.el.add_attribute(_this.cr_repo.el , "markup", 0 );
956         }
957
958         // user defined functions
959     }
960     public class Xcls_cr_repo : Object
961     {
962         public Gtk.CellRendererText el;
963         private Clones  _this;
964
965
966             // my vars (def)
967
968         // ctor
969         public Xcls_cr_repo(Clones _owner )
970         {
971             _this = _owner;
972             _this.cr_repo = this;
973             this.el = new Gtk.CellRendererText();
974
975             // my vars (dec)
976
977             // set gobject values
978         }
979
980         // user defined functions
981     }
982
983
984     public class Xcls_tv_active_ticket : Object
985     {
986         public Gtk.TreeViewColumn el;
987         private Clones  _this;
988
989
990             // my vars (def)
991
992         // ctor
993         public Xcls_tv_active_ticket(Clones _owner )
994         {
995             _this = _owner;
996             _this.tv_active_ticket = this;
997             this.el = new Gtk.TreeViewColumn();
998
999             // my vars (dec)
1000
1001             // set gobject values
1002             this.el.title = "Active Ticket";
1003             this.el.min_width = 50;
1004             var child_0 = new Xcls_cr_active_ticket( _this );
1005             child_0.ref();
1006             this.el.pack_start (  child_0.el , false );
1007
1008             // init method
1009
1010             this.el.add_attribute(_this.cr_active_ticket.el , "markup", 9 );
1011         }
1012
1013         // user defined functions
1014     }
1015     public class Xcls_cr_active_ticket : Object
1016     {
1017         public Gtk.CellRendererText el;
1018         private Clones  _this;
1019
1020
1021             // my vars (def)
1022
1023         // ctor
1024         public Xcls_cr_active_ticket(Clones _owner )
1025         {
1026             _this = _owner;
1027             _this.cr_active_ticket = this;
1028             this.el = new Gtk.CellRendererText();
1029
1030             // my vars (dec)
1031
1032             // set gobject values
1033         }
1034
1035         // user defined functions
1036     }
1037
1038
1039     public class Xcls_tv_current_branch : Object
1040     {
1041         public Gtk.TreeViewColumn el;
1042         private Clones  _this;
1043
1044
1045             // my vars (def)
1046
1047         // ctor
1048         public Xcls_tv_current_branch(Clones _owner )
1049         {
1050             _this = _owner;
1051             _this.tv_current_branch = this;
1052             this.el = new Gtk.TreeViewColumn();
1053
1054             // my vars (dec)
1055
1056             // set gobject values
1057             this.el.title = "Current Branch";
1058             this.el.min_width = 50;
1059             var child_0 = new Xcls_cr_current_branch( _this );
1060             child_0.ref();
1061             this.el.pack_start (  child_0.el , false );
1062
1063             // init method
1064
1065             this.el.add_attribute(_this.cr_current_branch.el , "markup", 1 );
1066                  this.el.add_attribute(_this.cr_current_branch.el, "cell-background", 7 );
1067         }
1068
1069         // user defined functions
1070     }
1071     public class Xcls_cr_current_branch : Object
1072     {
1073         public Gtk.CellRendererText el;
1074         private Clones  _this;
1075
1076
1077             // my vars (def)
1078
1079         // ctor
1080         public Xcls_cr_current_branch(Clones _owner )
1081         {
1082             _this = _owner;
1083             _this.cr_current_branch = this;
1084             this.el = new Gtk.CellRendererText();
1085
1086             // my vars (dec)
1087
1088             // set gobject values
1089         }
1090
1091         // user defined functions
1092     }
1093
1094
1095     public class Xcls_tv_last_updated : Object
1096     {
1097         public Gtk.TreeViewColumn el;
1098         private Clones  _this;
1099
1100
1101             // my vars (def)
1102
1103         // ctor
1104         public Xcls_tv_last_updated(Clones _owner )
1105         {
1106             _this = _owner;
1107             _this.tv_last_updated = this;
1108             this.el = new Gtk.TreeViewColumn();
1109
1110             // my vars (dec)
1111
1112             // set gobject values
1113             this.el.title = "Last updated";
1114             this.el.min_width = 50;
1115             var child_0 = new Xcls_cr_last_updated( _this );
1116             child_0.ref();
1117             this.el.pack_start (  child_0.el , false );
1118
1119             // init method
1120
1121             this.el.add_attribute(_this.cr_last_updated.el , "markup", 3 );
1122         }
1123
1124         // user defined functions
1125     }
1126     public class Xcls_cr_last_updated : Object
1127     {
1128         public Gtk.CellRendererText el;
1129         private Clones  _this;
1130
1131
1132             // my vars (def)
1133
1134         // ctor
1135         public Xcls_cr_last_updated(Clones _owner )
1136         {
1137             _this = _owner;
1138             _this.cr_last_updated = this;
1139             this.el = new Gtk.CellRendererText();
1140
1141             // my vars (dec)
1142
1143             // set gobject values
1144         }
1145
1146         // user defined functions
1147     }
1148
1149
1150     public class Xcls_tv_all_branches : Object
1151     {
1152         public Gtk.TreeViewColumn el;
1153         private Clones  _this;
1154
1155
1156             // my vars (def)
1157
1158         // ctor
1159         public Xcls_tv_all_branches(Clones _owner )
1160         {
1161             _this = _owner;
1162             _this.tv_all_branches = this;
1163             this.el = new Gtk.TreeViewColumn();
1164
1165             // my vars (dec)
1166
1167             // set gobject values
1168             this.el.title = "All Branches";
1169             this.el.min_width = 50;
1170             this.el.resizable = false;
1171             var child_0 = new Xcls_cr_all_branches( _this );
1172             child_0.ref();
1173             this.el.pack_start (  child_0.el , false );
1174
1175             // init method
1176
1177             this.el.add_attribute(_this.cr_all_branches.el , "markup", 2 );
1178         }
1179
1180         // user defined functions
1181     }
1182     public class Xcls_cr_all_branches : Object
1183     {
1184         public Gtk.CellRendererText el;
1185         private Clones  _this;
1186
1187
1188             // my vars (def)
1189
1190         // ctor
1191         public Xcls_cr_all_branches(Clones _owner )
1192         {
1193             _this = _owner;
1194             _this.cr_all_branches = this;
1195             this.el = new Gtk.CellRendererText();
1196
1197             // my vars (dec)
1198
1199             // set gobject values
1200         }
1201
1202         // user defined functions
1203     }
1204
1205
1206
1207
1208
1209 }