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_tv_autopush tv_autopush;
20 public Xcls_tv_repo tv_repo;
21 public Xcls_tv_current_branch tv_current_branch;
22 public Xcls_ok_button ok_button;
30 this.el = new Gtk.Dialog();
35 this.el.title = "Manage Clones";
36 this.el.border_width = 3;
37 this.el.default_height = 500;
38 this.el.default_width = 600;
39 this.el.deletable = true;
41 var child_0 = new Xcls_Clones( _this );
43 this.el.get_content_area().add ( child_0.el );
44 var child_1 = new Xcls_ok_button( _this );
46 this.el.add_action_widget ( child_1.el , 1 );
49 this.el.delete_event.connect( (self, event) => {
54 this.el.response.connect( (self, response_id) => {
61 // user defined functions
65 this.el.set_deletable(false);
68 // this.get('/reposStore').load();
70 //this.get('/ok_button').el.set_sensitive(false);
72 // block until we return.
73 // var run_ret = this.el.run();
74 // if (run_ret < 1 ) {
77 // print("RUN RETURN : " + run_ret);
79 //print(JSON.stringify(this.get('bug').getValue()));
80 // return this.get('bug').getValue();
81 //this.success = c.success;
83 public class Xcls_Clones : Object
92 public Xcls_Clones(Clones _owner )
96 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
100 // set gobject values
101 var child_0 = new Xcls_Box3( _this );
103 this.el.pack_start ( child_0.el , false,false,0 );
104 var child_1 = new Xcls_ScrolledWindow9( _this );
106 this.el.pack_end ( child_1.el , true,true,0 );
109 // user defined functions
111 public class Xcls_Box3 : Object
114 private Clones _this;
120 public Xcls_Box3(Clones _owner )
123 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
127 // set gobject values
128 var child_0 = new Xcls_Button4( _this );
130 this.el.add ( child_0.el );
131 var child_1 = new Xcls_Button5( _this );
133 this.el.add ( child_1.el );
134 var child_2 = new Xcls_Button6( _this );
136 this.el.add ( child_2.el );
137 var child_3 = new Xcls_Button7( _this );
139 this.el.add ( child_3.el );
140 var child_4 = new Xcls_Button8( _this );
142 this.el.add ( child_4.el );
145 // user defined functions
147 public class Xcls_Button4 : Object
149 public Gtk.Button el;
150 private Clones _this;
156 public Xcls_Button4(Clones _owner )
159 this.el = new Gtk.Button();
163 // set gobject values
164 this.el.label = "Remotes / Clones";
167 this.el.clicked.connect( () => {
169 /* var rv = this.get('/reposView');
170 var rs = this.get('/reposStore');
171 if (rv.el.get_selection().count_selected_rows() != 1) {
176 var Remotes = imports.Remotes.Remotes;
180 var s = rv.el.get_selection();
182 s.selected_foreach(function(model,p,iter) {
184 path = model.get_value(iter, 6).value.get_string();
189 rs.repos.forEach(function(r) {
190 if (r.repopath == path) {
197 Remotes.el.set_transient_for(Clones.el);
198 Clones.el.set_title("Manage Clones - " + repo.repopath);
200 Clones.el.set_title("Manage Clones");
212 // user defined functions
215 public class Xcls_Button5 : Object
217 public Gtk.Button el;
218 private Clones _this;
224 public Xcls_Button5(Clones _owner )
227 this.el = new Gtk.Button();
231 // set gobject values
232 this.el.label = "Branches";
235 this.el.clicked.connect( () => {
237 var rv = this.get('/reposView');
238 var rs = this.get('/reposStore');
239 if (rv.el.get_selection().count_selected_rows() != 1) {
244 var Branches = imports.Branches.Branches;
248 var s = rv.el.get_selection();
250 s.selected_foreach(function(model,p,iter) {
252 path = model.get_value(iter, 6).value.get_string();
257 rs.repos.forEach(function(r) {
258 if (r.repopath == path) {
264 Branches.repo = repo;
265 Branches.el.set_transient_for(Clones.el);
266 Clones.el.set_title("Manage Clones - " + repo.repopath);
268 Clones.el.set_title("Manage Clones");
281 // user defined functions
284 public class Xcls_Button6 : Object
286 public Gtk.Button el;
287 private Clones _this;
293 public Xcls_Button6(Clones _owner )
296 this.el = new Gtk.Button();
300 // set gobject values
301 this.el.label = "Merge";
304 this.el.clicked.connect( () => {
306 var rv = this.get('/reposView');
307 var rs = this.get('/reposStore');
308 if (rv.el.get_selection().count_selected_rows() != 1) {
313 var Merger = imports.Merger.Merger;
317 var s = rv.el.get_selection();
319 s.selected_foreach(function(model,p,iter) {
321 path = model.get_value(iter, 6).value.get_string();
326 rs.repos.forEach(function(r) {
327 if (r.repopath == path) {
334 Merger.el.set_transient_for(Clones.el);
335 Clones.el.set_title("Manage Clones - " + repo.repopath);
337 Clones.el.set_title("Manage Clones");
351 // user defined functions
354 public class Xcls_Button7 : Object
356 public Gtk.Button el;
357 private Clones _this;
363 public Xcls_Button7(Clones _owner )
366 this.el = new Gtk.Button();
370 // set gobject values
371 this.el.label = "Switch Branch";
374 this.el.clicked.connect( () => {
384 // user defined functions
387 public class Xcls_Button8 : Object
389 public Gtk.Button el;
390 private Clones _this;
396 public Xcls_Button8(Clones _owner )
399 this.el = new Gtk.Button();
403 // set gobject values
404 this.el.label = "Pull";
407 this.el.clicked.connect( () => {
417 // user defined functions
421 public class Xcls_ScrolledWindow9 : Object
423 public Gtk.ScrolledWindow el;
424 private Clones _this;
430 public Xcls_ScrolledWindow9(Clones _owner )
433 this.el = new Gtk.ScrolledWindow( null, null );
437 // set gobject values
438 this.el.shadow_type = Gtk.ShadowType.IN;
439 var child_0 = new Xcls_reposView( _this );
441 this.el.add ( child_0.el );
442 var child_1 = new Xcls_TreeView24( _this );
449 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
453 // user defined functions
455 public class Xcls_reposView : Object
457 public Gtk.TreeView el;
458 private Clones _this;
464 public Xcls_reposView(Clones _owner )
467 _this.reposView = this;
468 this.el = new Gtk.TreeView();
472 // set gobject values
473 var child_0 = new Xcls_reposStore( _this );
475 this.el.set_model ( child_0.el );
476 var child_1 = new Xcls_tv_autocommit( _this );
478 this.el.append_column ( child_1.el );
479 var child_2 = new Xcls_tv_autopush( _this );
481 this.el.append_column ( child_2.el );
482 var child_3 = new Xcls_tv_repo( _this );
484 this.el.append_column ( child_3.el );
485 var child_4 = new Xcls_tv_current_branch( _this );
487 this.el.append_column ( child_4.el );
488 var child_5 = new Xcls_TreeViewColumn20( _this );
490 this.el.append_column ( child_5.el );
491 var child_6 = new Xcls_TreeViewColumn22( _this );
493 this.el.append_column ( child_6.el );
498 var selection = this.el.get_selection();
499 selection.set_mode( Gtk.SelectionMode.SINGLE);
502 var description = new Pango.FontDescription();
503 description.set_size(10000);
504 this.el.override_font(description);
508 this.el.cursor_changed.connect( () => {
509 // SEE SELECTION.CHANGED
514 if (this.el.get_selection().count_selected_rows() < 1) {
515 //nothing? - clea it?
519 var model = this.get('/changedFilesStore');
521 var s = this.el.get_selection();
523 s.selected_foreach(function(model,p,iter) {
525 files.push( model.get_value(iter, 0).value.get_string());
528 this.get('/patchview').showDiff(files);
529 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
530 //print("OUT?" + value);// id..
531 // load the list in the right grid..
538 // user defined functions
540 public class Xcls_reposStore : Object
542 public Gtk.ListStore el;
543 private Clones _this;
549 public Xcls_reposStore(Clones _owner )
552 _this.reposStore = this;
553 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
554 typeof(string), // 1 current branch
555 typeof(string), // 2 all branch
556 typeof(string), // 3 updated
557 typeof(bool), // 4 auto commit
558 typeof(bool), // 5 auto push
559 typeof(string) // 7 repopath
560 typeof(string) // 8 color highlighting? );
564 // set gobject values
567 // user defined functions
570 public class Xcls_tv_autocommit : Object
572 public Gtk.TreeViewColumn el;
573 private Clones _this;
579 public Xcls_tv_autocommit(Clones _owner )
582 _this.tv_autocommit = this;
583 this.el = new Gtk.TreeViewColumn();
587 // set gobject values
588 this.el.title = "Auto Commit";
589 this.el.min_width = 50;
590 var child_0 = new Xcls_CellRendererToggle13( _this );
592 this.el.pack_start ( child_0.el , false );
596 // this.items[0].el.set_activatable(true);
597 this.el.add_attribute(_this.keyrender.el , "active", 4 );
600 // user defined functions
602 public class Xcls_CellRendererToggle13 : Object
604 public Gtk.CellRendererToggle el;
605 private Clones _this;
611 public Xcls_CellRendererToggle13(Clones _owner )
614 this.el = new Gtk.CellRendererToggle();
618 // set gobject values
619 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
622 this.el.toggled.connect( (self, path) => {
624 var store = this.get('/reposStore');
625 store.el.get_iter_from_string(ret, path);
627 var value = store.el.get_value(ret.iter,4).value.get_boolean();
629 //print(JSON.stringify(value));
630 store.el.set_value(ret.iter,4, !value);
632 var path = store.el.get_value(ret.iter, 6).value.get_string();
633 var repo = imports.Scm.Repo.Repo.get(path);
634 repo.autocommit(!value);
641 // user defined functions
645 public class Xcls_tv_autopush : Object
647 public Gtk.TreeViewColumn el;
648 private Clones _this;
654 public Xcls_tv_autopush(Clones _owner )
657 _this.tv_autopush = this;
658 this.el = new Gtk.TreeViewColumn();
662 // set gobject values
663 this.el.title = "Auto Push";
664 this.el.min_width = 50;
665 var child_0 = new Xcls_CellRendererToggle15( _this );
667 this.el.pack_start ( child_0.el );
671 this.el.add_attribute(this.items[0].el , 'active', 5 );
672 // this.items[0].el.set_activatable(true);
675 // user defined functions
677 public class Xcls_CellRendererToggle15 : Object
679 public Gtk.CellRendererToggle el;
680 private Clones _this;
686 public Xcls_CellRendererToggle15(Clones _owner )
689 this.el = new Gtk.CellRendererToggle();
693 // set gobject values
694 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
697 this.el.toggled.connect( function (self, path) {
699 var store = this.get('/reposStore');
700 store.el.get_iter_from_string(ret, path);
702 var value = store.el.get_value(ret.iter,5).value.get_boolean();
704 //print(JSON.stringify(value));
705 store.el.set_value(ret.iter,5, !value);
706 var path = store.el.get_value(ret.iter, 6).value.get_string();
707 var repo = imports.Scm.Repo.Repo.get(path);
708 repo.autopush(!value);
713 // user defined functions
717 public class Xcls_tv_repo : Object
719 public Gtk.TreeViewColumn el;
720 private Clones _this;
726 public Xcls_tv_repo(Clones _owner )
729 _this.tv_repo = this;
730 this.el = new Gtk.TreeViewColumn();
734 // set gobject values
735 this.el.title = "Repo";
736 this.el.min_width = 200;
737 this.el.resizable = true;
738 var child_0 = new Xcls_CellRendererText17( _this );
740 this.el.pack_start ( child_0.el );
745 XObject.prototype.init.call(this);
746 this.el.add_attribute(this.items[0].el , 'markup', 0 );
751 // user defined functions
753 public class Xcls_CellRendererText17 : Object
755 public Gtk.CellRendererText el;
756 private Clones _this;
762 public Xcls_CellRendererText17(Clones _owner )
765 this.el = new Gtk.CellRendererText();
769 // set gobject values
772 // user defined functions
776 public class Xcls_tv_current_branch : Object
778 public Gtk.TreeViewColumn el;
779 private Clones _this;
785 public Xcls_tv_current_branch(Clones _owner )
788 _this.tv_current_branch = this;
789 this.el = new Gtk.TreeViewColumn();
793 // set gobject values
794 this.el.title = "Current Branch";
795 this.el.min_width = 50;
796 var child_0 = new Xcls_CellRendererText19( _this );
798 this.el.pack_start ( child_0.el );
803 XObject.prototype.init.call(this);
804 this.el.add_attribute(this.items[0].el , 'markup', 1 );
805 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
810 // user defined functions
812 public class Xcls_CellRendererText19 : Object
814 public Gtk.CellRendererText el;
815 private Clones _this;
821 public Xcls_CellRendererText19(Clones _owner )
824 this.el = new Gtk.CellRendererText();
828 // set gobject values
831 // user defined functions
835 public class Xcls_TreeViewColumn20 : Object
837 public Gtk.TreeViewColumn el;
838 private Clones _this;
844 public Xcls_TreeViewColumn20(Clones _owner )
847 this.el = new Gtk.TreeViewColumn();
851 // set gobject values
852 this.el.title = "Last updated";
853 this.el.min_width = 50;
854 var child_0 = new Xcls_CellRendererText21( _this );
856 this.el.pack_start ( child_0.el );
861 XObject.prototype.init.call(this);
862 this.el.add_attribute(this.items[0].el , 'markup', 3 );
867 // user defined functions
869 public class Xcls_CellRendererText21 : Object
871 public Gtk.CellRendererText el;
872 private Clones _this;
878 public Xcls_CellRendererText21(Clones _owner )
881 this.el = new Gtk.CellRendererText();
885 // set gobject values
888 // user defined functions
892 public class Xcls_TreeViewColumn22 : Object
894 public Gtk.TreeViewColumn el;
895 private Clones _this;
901 public Xcls_TreeViewColumn22(Clones _owner )
904 this.el = new Gtk.TreeViewColumn();
908 // set gobject values
909 this.el.title = "All Branches";
910 this.el.min_width = 50;
911 this.el.resizable = false;
912 var child_0 = new Xcls_CellRendererText23( _this );
914 this.el.pack_start ( child_0.el );
919 XObject.prototype.init.call(this);
920 this.el.add_attribute(this.items[0].el , 'markup', 2 );
925 // user defined functions
927 public class Xcls_CellRendererText23 : Object
929 public Gtk.CellRendererText el;
930 private Clones _this;
936 public Xcls_CellRendererText23(Clones _owner )
939 this.el = new Gtk.CellRendererText();
943 // set gobject values
946 // user defined functions
951 public class Xcls_TreeView24 : Object
953 public Gtk.TreeView el;
954 private Clones _this;
960 public Xcls_TreeView24(Clones _owner )
963 this.el = new Gtk.TreeView();
967 // set gobject values
968 var child_0 = new Xcls_ListStore25( _this );
972 // user defined functions
974 public class Xcls_ListStore25 : Object
976 public Gtk.ListStore el;
977 private Clones _this;
983 public Xcls_ListStore25(Clones _owner )
986 this.el = new Gtk.ListStore( 0, null );
990 // set gobject values
993 // user defined functions
999 public class Xcls_ok_button : Object
1001 public Gtk.Button el;
1002 private Clones _this;
1008 public Xcls_ok_button(Clones _owner )
1011 _this.ok_button = this;
1012 this.el = new Gtk.Button();
1016 // set gobject values
1017 this.el.label = "Close";
1020 // user defined functions