3 public class Clones : Object
8 public static Clones singleton()
10 if (_Clones == null) {
11 _Clones= new Clones();
15 public Xcls_Clones Clones;
16 public Xcls_reposView reposView;
17 public Xcls_reposStore reposStore;
18 public Xcls_tv_autocommit tv_autocommit;
19 public Xcls_ok_button ok_button;
27 this.el = new Gtk.Dialog();
32 this.el.title = "Manage Clones";
33 this.el.border_width = 3;
34 this.el.default_height = 500;
35 this.el.default_width = 600;
36 this.el.deletable = true;
38 var child_0 = new Xcls_Clones( _this );
40 this.el.get_content_area().add ( child_0.el );
41 var child_1 = new Xcls_ok_button( _this );
43 this.el.add_action_widget ( child_1.el , 1 );
46 this.el.delete_event.connect( (self, event) => {
51 this.el.response.connect( (self, response_id) => {
58 // user defined functions
62 this.el.set_deletable(false);
65 // this.get('/reposStore').load();
67 //this.get('/ok_button').el.set_sensitive(false);
69 // block until we return.
70 // var run_ret = this.el.run();
71 // if (run_ret < 1 ) {
74 // print("RUN RETURN : " + run_ret);
76 //print(JSON.stringify(this.get('bug').getValue()));
77 // return this.get('bug').getValue();
78 //this.success = c.success;
80 public class Xcls_Clones : Object
89 public Xcls_Clones(Clones _owner )
93 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
98 var child_0 = new Xcls_Box3( _this );
100 this.el.pack_start ( child_0.el , false,false,0 );
101 var child_1 = new Xcls_ScrolledWindow9( _this );
103 this.el.pack_end ( child_1.el , true,true,0 );
106 // user defined functions
108 public class Xcls_Box3 : Object
111 private Clones _this;
117 public Xcls_Box3(Clones _owner )
120 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
124 // set gobject values
125 var child_0 = new Xcls_Button4( _this );
127 this.el.add ( child_0.el );
128 var child_1 = new Xcls_Button5( _this );
130 this.el.add ( child_1.el );
131 var child_2 = new Xcls_Button6( _this );
133 this.el.add ( child_2.el );
134 var child_3 = new Xcls_Button7( _this );
136 this.el.add ( child_3.el );
137 var child_4 = new Xcls_Button8( _this );
139 this.el.add ( child_4.el );
142 // user defined functions
144 public class Xcls_Button4 : Object
146 public Gtk.Button el;
147 private Clones _this;
153 public Xcls_Button4(Clones _owner )
156 this.el = new Gtk.Button();
160 // set gobject values
161 this.el.label = "Remotes / Clones";
164 this.el.clicked.connect( () => {
166 /* var rv = this.get('/reposView');
167 var rs = this.get('/reposStore');
168 if (rv.el.get_selection().count_selected_rows() != 1) {
173 var Remotes = imports.Remotes.Remotes;
177 var s = rv.el.get_selection();
179 s.selected_foreach(function(model,p,iter) {
181 path = model.get_value(iter, 6).value.get_string();
186 rs.repos.forEach(function(r) {
187 if (r.repopath == path) {
194 Remotes.el.set_transient_for(Clones.el);
195 Clones.el.set_title("Manage Clones - " + repo.repopath);
197 Clones.el.set_title("Manage Clones");
209 // user defined functions
212 public class Xcls_Button5 : Object
214 public Gtk.Button el;
215 private Clones _this;
221 public Xcls_Button5(Clones _owner )
224 this.el = new Gtk.Button();
228 // set gobject values
229 this.el.label = "Branches";
232 this.el.clicked.connect( () => {
234 var rv = this.get('/reposView');
235 var rs = this.get('/reposStore');
236 if (rv.el.get_selection().count_selected_rows() != 1) {
241 var Branches = imports.Branches.Branches;
245 var s = rv.el.get_selection();
247 s.selected_foreach(function(model,p,iter) {
249 path = model.get_value(iter, 6).value.get_string();
254 rs.repos.forEach(function(r) {
255 if (r.repopath == path) {
261 Branches.repo = repo;
262 Branches.el.set_transient_for(Clones.el);
263 Clones.el.set_title("Manage Clones - " + repo.repopath);
265 Clones.el.set_title("Manage Clones");
278 // user defined functions
281 public class Xcls_Button6 : Object
283 public Gtk.Button el;
284 private Clones _this;
290 public Xcls_Button6(Clones _owner )
293 this.el = new Gtk.Button();
297 // set gobject values
298 this.el.label = "Merge";
301 this.el.clicked.connect( () => {
303 var rv = this.get('/reposView');
304 var rs = this.get('/reposStore');
305 if (rv.el.get_selection().count_selected_rows() != 1) {
310 var Merger = imports.Merger.Merger;
314 var s = rv.el.get_selection();
316 s.selected_foreach(function(model,p,iter) {
318 path = model.get_value(iter, 6).value.get_string();
323 rs.repos.forEach(function(r) {
324 if (r.repopath == path) {
331 Merger.el.set_transient_for(Clones.el);
332 Clones.el.set_title("Manage Clones - " + repo.repopath);
334 Clones.el.set_title("Manage Clones");
348 // user defined functions
351 public class Xcls_Button7 : Object
353 public Gtk.Button el;
354 private Clones _this;
360 public Xcls_Button7(Clones _owner )
363 this.el = new Gtk.Button();
367 // set gobject values
368 this.el.label = "Switch Branch";
371 this.el.clicked.connect( () => {
381 // user defined functions
384 public class Xcls_Button8 : Object
386 public Gtk.Button el;
387 private Clones _this;
393 public Xcls_Button8(Clones _owner )
396 this.el = new Gtk.Button();
400 // set gobject values
401 this.el.label = "Pull";
404 this.el.clicked.connect( () => {
414 // user defined functions
418 public class Xcls_ScrolledWindow9 : Object
420 public Gtk.ScrolledWindow el;
421 private Clones _this;
427 public Xcls_ScrolledWindow9(Clones _owner )
430 this.el = new Gtk.ScrolledWindow( null, null );
434 // set gobject values
435 this.el.shadow_type = Gtk.ShadowType.IN;
436 var child_0 = new Xcls_reposView( _this );
438 this.el.add ( child_0.el );
439 var child_1 = new Xcls_TreeView24( _this );
446 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
450 // user defined functions
452 public class Xcls_reposView : Object
454 public Gtk.TreeView el;
455 private Clones _this;
461 public Xcls_reposView(Clones _owner )
464 _this.reposView = this;
465 this.el = new Gtk.TreeView();
469 // set gobject values
470 var child_0 = new Xcls_reposStore( _this );
472 this.el.set_model ( child_0.el );
473 var child_1 = new Xcls_tv_autocommit( _this );
475 this.el.append_column ( child_1.el );
476 var child_2 = new Xcls_TreeViewColumn14( _this );
478 this.el.append_column ( child_2.el );
479 var child_3 = new Xcls_TreeViewColumn16( _this );
481 this.el.append_column ( child_3.el );
482 var child_4 = new Xcls_TreeViewColumn18( _this );
484 this.el.append_column ( child_4.el );
485 var child_5 = new Xcls_TreeViewColumn20( _this );
487 this.el.append_column ( child_5.el );
488 var child_6 = new Xcls_TreeViewColumn22( _this );
490 this.el.append_column ( child_6.el );
495 var selection = this.el.get_selection();
496 selection.set_mode( Gtk.SelectionMode.SINGLE);
499 var description = new Pango.FontDescription();
500 description.set_size(10000);
501 this.el.override_font(description);
505 this.el.cursor_changed.connect( () => {
506 // SEE SELECTION.CHANGED
511 if (this.el.get_selection().count_selected_rows() < 1) {
512 //nothing? - clea it?
516 var model = this.get('/changedFilesStore');
518 var s = this.el.get_selection();
520 s.selected_foreach(function(model,p,iter) {
522 files.push( model.get_value(iter, 0).value.get_string());
525 this.get('/patchview').showDiff(files);
526 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
527 //print("OUT?" + value);// id..
528 // load the list in the right grid..
535 // user defined functions
537 public class Xcls_reposStore : Object
539 public Gtk.ListStore el;
540 private Clones _this;
546 public Xcls_reposStore(Clones _owner )
549 _this.reposStore = this;
550 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
551 typeof(string), // 1 current branch
552 typeof(string), // 2 all branch
553 typeof(string), // 3 updated
554 typeof(bool), // 4 auto commit
555 typeof(bool), // 5 auto push
556 typeof(string) // 7 repopath
557 typeof(string) // 8 color highlighting? );
561 // set gobject values
564 // user defined functions
567 public class Xcls_tv_autocommit : Object
569 public Gtk.TreeViewColumn el;
570 private Clones _this;
576 public Xcls_tv_autocommit(Clones _owner )
579 _this.tv_autocommit = this;
580 this.el = new Gtk.TreeViewColumn();
584 // set gobject values
585 this.el.title = "Auto Commit";
586 this.el.min_width = 50;
587 var child_0 = new Xcls_CellRendererToggle13( _this );
589 this.el.pack_start ( child_0.el , false );
593 // this.items[0].el.set_activatable(true);
594 this.el.add_attribute(_this.keyrender.el , "active", 4 );
597 // user defined functions
599 public class Xcls_CellRendererToggle13 : Object
601 public Gtk.CellRendererToggle el;
602 private Clones _this;
608 public Xcls_CellRendererToggle13(Clones _owner )
611 this.el = new Gtk.CellRendererToggle();
615 // set gobject values
616 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
619 this.el.toggled.connect( (self, path) => {
621 var store = this.get('/reposStore');
622 store.el.get_iter_from_string(ret, path);
624 var value = store.el.get_value(ret.iter,4).value.get_boolean();
626 //print(JSON.stringify(value));
627 store.el.set_value(ret.iter,4, !value);
629 var path = store.el.get_value(ret.iter, 6).value.get_string();
630 var repo = imports.Scm.Repo.Repo.get(path);
631 repo.autocommit(!value);
638 // user defined functions
642 public class Xcls_TreeViewColumn14 : Object
644 public Gtk.TreeViewColumn el;
645 private Clones _this;
651 public Xcls_TreeViewColumn14(Clones _owner )
654 this.el = new Gtk.TreeViewColumn();
658 // set gobject values
659 this.el.title = "Auto Push";
660 this.el.min_width = 50;
661 var child_0 = new Xcls_CellRendererToggle15( _this );
663 this.el.pack_start ( child_0.el );
667 this.el.add_attribute(this.items[0].el , 'active', 5 );
668 // this.items[0].el.set_activatable(true);
671 // user defined functions
673 public class Xcls_CellRendererToggle15 : Object
675 public Gtk.CellRendererToggle el;
676 private Clones _this;
682 public Xcls_CellRendererToggle15(Clones _owner )
685 this.el = new Gtk.CellRendererToggle();
689 // set gobject values
690 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
693 this.el.toggled.connect( function (self, path) {
695 var store = this.get('/reposStore');
696 store.el.get_iter_from_string(ret, path);
698 var value = store.el.get_value(ret.iter,5).value.get_boolean();
700 //print(JSON.stringify(value));
701 store.el.set_value(ret.iter,5, !value);
702 var path = store.el.get_value(ret.iter, 6).value.get_string();
703 var repo = imports.Scm.Repo.Repo.get(path);
704 repo.autopush(!value);
709 // user defined functions
713 public class Xcls_TreeViewColumn16 : Object
715 public Gtk.TreeViewColumn el;
716 private Clones _this;
722 public Xcls_TreeViewColumn16(Clones _owner )
725 this.el = new Gtk.TreeViewColumn();
729 // set gobject values
730 this.el.title = "Repo";
731 this.el.min_width = 200;
732 this.el.resizable = true;
733 var child_0 = new Xcls_CellRendererText17( _this );
735 this.el.pack_start ( child_0.el );
740 XObject.prototype.init.call(this);
741 this.el.add_attribute(this.items[0].el , 'markup', 0 );
746 // user defined functions
748 public class Xcls_CellRendererText17 : Object
750 public Gtk.CellRendererText el;
751 private Clones _this;
757 public Xcls_CellRendererText17(Clones _owner )
760 this.el = new Gtk.CellRendererText();
764 // set gobject values
767 // user defined functions
771 public class Xcls_TreeViewColumn18 : Object
773 public Gtk.TreeViewColumn el;
774 private Clones _this;
780 public Xcls_TreeViewColumn18(Clones _owner )
783 this.el = new Gtk.TreeViewColumn();
787 // set gobject values
788 this.el.title = "Current Branch";
789 this.el.min_width = 50;
790 var child_0 = new Xcls_CellRendererText19( _this );
792 this.el.pack_start ( child_0.el );
797 XObject.prototype.init.call(this);
798 this.el.add_attribute(this.items[0].el , 'markup', 1 );
799 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
804 // user defined functions
806 public class Xcls_CellRendererText19 : Object
808 public Gtk.CellRendererText el;
809 private Clones _this;
815 public Xcls_CellRendererText19(Clones _owner )
818 this.el = new Gtk.CellRendererText();
822 // set gobject values
825 // user defined functions
829 public class Xcls_TreeViewColumn20 : Object
831 public Gtk.TreeViewColumn el;
832 private Clones _this;
838 public Xcls_TreeViewColumn20(Clones _owner )
841 this.el = new Gtk.TreeViewColumn();
845 // set gobject values
846 this.el.title = "Last updated";
847 this.el.min_width = 50;
848 var child_0 = new Xcls_CellRendererText21( _this );
850 this.el.pack_start ( child_0.el );
855 XObject.prototype.init.call(this);
856 this.el.add_attribute(this.items[0].el , 'markup', 3 );
861 // user defined functions
863 public class Xcls_CellRendererText21 : Object
865 public Gtk.CellRendererText el;
866 private Clones _this;
872 public Xcls_CellRendererText21(Clones _owner )
875 this.el = new Gtk.CellRendererText();
879 // set gobject values
882 // user defined functions
886 public class Xcls_TreeViewColumn22 : Object
888 public Gtk.TreeViewColumn el;
889 private Clones _this;
895 public Xcls_TreeViewColumn22(Clones _owner )
898 this.el = new Gtk.TreeViewColumn();
902 // set gobject values
903 this.el.title = "All Branches";
904 this.el.min_width = 50;
905 this.el.resizable = false;
906 var child_0 = new Xcls_CellRendererText23( _this );
908 this.el.pack_start ( child_0.el );
913 XObject.prototype.init.call(this);
914 this.el.add_attribute(this.items[0].el , 'markup', 2 );
919 // user defined functions
921 public class Xcls_CellRendererText23 : Object
923 public Gtk.CellRendererText el;
924 private Clones _this;
930 public Xcls_CellRendererText23(Clones _owner )
933 this.el = new Gtk.CellRendererText();
937 // set gobject values
940 // user defined functions
945 public class Xcls_TreeView24 : Object
947 public Gtk.TreeView el;
948 private Clones _this;
954 public Xcls_TreeView24(Clones _owner )
957 this.el = new Gtk.TreeView();
961 // set gobject values
962 var child_0 = new Xcls_ListStore25( _this );
966 // user defined functions
968 public class Xcls_ListStore25 : Object
970 public Gtk.ListStore el;
971 private Clones _this;
977 public Xcls_ListStore25(Clones _owner )
980 this.el = new Gtk.ListStore( 0, null );
984 // set gobject values
987 // user defined functions
993 public class Xcls_ok_button : Object
995 public Gtk.Button el;
996 private Clones _this;
1002 public Xcls_ok_button(Clones _owner )
1005 _this.ok_button = this;
1006 this.el = new Gtk.Button();
1010 // set gobject values
1011 this.el.label = "Close";
1014 // user defined functions