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_tv_last_updated tv_last_updated;
23 public Xcls_tv_all_branches tv_all_branches;
24 public Xcls_ok_button ok_button;
32 this.el = new Gtk.Dialog();
37 this.el.title = "Manage Clones";
38 this.el.border_width = 3;
39 this.el.default_height = 500;
40 this.el.default_width = 600;
41 this.el.deletable = true;
43 var child_0 = new Xcls_Clones( _this );
45 this.el.get_content_area().add ( child_0.el );
46 var child_1 = new Xcls_ok_button( _this );
48 this.el.add_action_widget ( child_1.el , 1 );
51 this.el.delete_event.connect( (self, event) => {
56 this.el.response.connect( (self, response_id) => {
63 // user defined functions
67 this.el.set_deletable(false);
70 // this.get('/reposStore').load();
72 //this.get('/ok_button').el.set_sensitive(false);
74 // block until we return.
75 // var run_ret = this.el.run();
76 // if (run_ret < 1 ) {
79 // print("RUN RETURN : " + run_ret);
81 //print(JSON.stringify(this.get('bug').getValue()));
82 // return this.get('bug').getValue();
83 //this.success = c.success;
85 public class Xcls_Clones : Object
94 public Xcls_Clones(Clones _owner )
98 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
102 // set gobject values
103 var child_0 = new Xcls_Box3( _this );
105 this.el.pack_start ( child_0.el , false,false,0 );
106 var child_1 = new Xcls_ScrolledWindow9( _this );
108 this.el.pack_end ( child_1.el , true,true,0 );
111 // user defined functions
113 public class Xcls_Box3 : Object
116 private Clones _this;
122 public Xcls_Box3(Clones _owner )
125 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
129 // set gobject values
130 var child_0 = new Xcls_Button4( _this );
132 this.el.add ( child_0.el );
133 var child_1 = new Xcls_Button5( _this );
135 this.el.add ( child_1.el );
136 var child_2 = new Xcls_Button6( _this );
138 this.el.add ( child_2.el );
139 var child_3 = new Xcls_Button7( _this );
141 this.el.add ( child_3.el );
142 var child_4 = new Xcls_Button8( _this );
144 this.el.add ( child_4.el );
147 // user defined functions
149 public class Xcls_Button4 : Object
151 public Gtk.Button el;
152 private Clones _this;
158 public Xcls_Button4(Clones _owner )
161 this.el = new Gtk.Button();
165 // set gobject values
166 this.el.label = "Remotes / Clones";
169 this.el.clicked.connect( () => {
171 /* var rv = this.get('/reposView');
172 var rs = this.get('/reposStore');
173 if (rv.el.get_selection().count_selected_rows() != 1) {
178 var Remotes = imports.Remotes.Remotes;
182 var s = rv.el.get_selection();
184 s.selected_foreach(function(model,p,iter) {
186 path = model.get_value(iter, 6).value.get_string();
191 rs.repos.forEach(function(r) {
192 if (r.repopath == path) {
199 Remotes.el.set_transient_for(Clones.el);
200 Clones.el.set_title("Manage Clones - " + repo.repopath);
202 Clones.el.set_title("Manage Clones");
214 // user defined functions
217 public class Xcls_Button5 : Object
219 public Gtk.Button el;
220 private Clones _this;
226 public Xcls_Button5(Clones _owner )
229 this.el = new Gtk.Button();
233 // set gobject values
234 this.el.label = "Branches";
237 this.el.clicked.connect( () => {
239 var rv = this.get('/reposView');
240 var rs = this.get('/reposStore');
241 if (rv.el.get_selection().count_selected_rows() != 1) {
246 var Branches = imports.Branches.Branches;
250 var s = rv.el.get_selection();
252 s.selected_foreach(function(model,p,iter) {
254 path = model.get_value(iter, 6).value.get_string();
259 rs.repos.forEach(function(r) {
260 if (r.repopath == path) {
266 Branches.repo = repo;
267 Branches.el.set_transient_for(Clones.el);
268 Clones.el.set_title("Manage Clones - " + repo.repopath);
270 Clones.el.set_title("Manage Clones");
283 // user defined functions
286 public class Xcls_Button6 : Object
288 public Gtk.Button el;
289 private Clones _this;
295 public Xcls_Button6(Clones _owner )
298 this.el = new Gtk.Button();
302 // set gobject values
303 this.el.label = "Merge";
306 this.el.clicked.connect( () => {
308 var rv = this.get('/reposView');
309 var rs = this.get('/reposStore');
310 if (rv.el.get_selection().count_selected_rows() != 1) {
315 var Merger = imports.Merger.Merger;
319 var s = rv.el.get_selection();
321 s.selected_foreach(function(model,p,iter) {
323 path = model.get_value(iter, 6).value.get_string();
328 rs.repos.forEach(function(r) {
329 if (r.repopath == path) {
336 Merger.el.set_transient_for(Clones.el);
337 Clones.el.set_title("Manage Clones - " + repo.repopath);
339 Clones.el.set_title("Manage Clones");
353 // user defined functions
356 public class Xcls_Button7 : Object
358 public Gtk.Button el;
359 private Clones _this;
365 public Xcls_Button7(Clones _owner )
368 this.el = new Gtk.Button();
372 // set gobject values
373 this.el.label = "Switch Branch";
376 this.el.clicked.connect( () => {
386 // user defined functions
389 public class Xcls_Button8 : Object
391 public Gtk.Button el;
392 private Clones _this;
398 public Xcls_Button8(Clones _owner )
401 this.el = new Gtk.Button();
405 // set gobject values
406 this.el.label = "Pull";
409 this.el.clicked.connect( () => {
419 // user defined functions
423 public class Xcls_ScrolledWindow9 : Object
425 public Gtk.ScrolledWindow el;
426 private Clones _this;
432 public Xcls_ScrolledWindow9(Clones _owner )
435 this.el = new Gtk.ScrolledWindow( null, null );
439 // set gobject values
440 this.el.shadow_type = Gtk.ShadowType.IN;
441 var child_0 = new Xcls_reposView( _this );
443 this.el.add ( child_0.el );
444 var child_1 = new Xcls_TreeView24( _this );
451 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
455 // user defined functions
457 public class Xcls_reposView : Object
459 public Gtk.TreeView el;
460 private Clones _this;
466 public Xcls_reposView(Clones _owner )
469 _this.reposView = this;
470 this.el = new Gtk.TreeView();
474 // set gobject values
475 var child_0 = new Xcls_reposStore( _this );
477 this.el.set_model ( child_0.el );
478 var child_1 = new Xcls_tv_autocommit( _this );
480 this.el.append_column ( child_1.el );
481 var child_2 = new Xcls_tv_autopush( _this );
483 this.el.append_column ( child_2.el );
484 var child_3 = new Xcls_tv_repo( _this );
486 this.el.append_column ( child_3.el );
487 var child_4 = new Xcls_tv_current_branch( _this );
489 this.el.append_column ( child_4.el );
490 var child_5 = new Xcls_tv_last_updated( _this );
492 this.el.append_column ( child_5.el );
493 var child_6 = new Xcls_tv_all_branches( _this );
495 this.el.append_column ( child_6.el );
500 var selection = this.el.get_selection();
501 selection.set_mode( Gtk.SelectionMode.SINGLE);
504 var description = new Pango.FontDescription();
505 description.set_size(10000);
506 this.el.override_font(description);
510 this.el.cursor_changed.connect( () => {
511 // SEE SELECTION.CHANGED
516 if (this.el.get_selection().count_selected_rows() < 1) {
517 //nothing? - clea it?
521 var model = this.get('/changedFilesStore');
523 var s = this.el.get_selection();
525 s.selected_foreach(function(model,p,iter) {
527 files.push( model.get_value(iter, 0).value.get_string());
530 this.get('/patchview').showDiff(files);
531 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
532 //print("OUT?" + value);// id..
533 // load the list in the right grid..
540 // user defined functions
542 public class Xcls_reposStore : Object
544 public Gtk.ListStore el;
545 private Clones _this;
551 public Xcls_reposStore(Clones _owner )
554 _this.reposStore = this;
555 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
556 typeof(string), // 1 current branch
557 typeof(string), // 2 all branch
558 typeof(string), // 3 updated
559 typeof(bool), // 4 auto commit
560 typeof(bool), // 5 auto push
561 typeof(string) // 7 repopath
562 typeof(string) // 8 color highlighting? );
566 // set gobject values
569 // user defined functions
572 public class Xcls_tv_autocommit : Object
574 public Gtk.TreeViewColumn el;
575 private Clones _this;
581 public Xcls_tv_autocommit(Clones _owner )
584 _this.tv_autocommit = this;
585 this.el = new Gtk.TreeViewColumn();
589 // set gobject values
590 this.el.title = "Auto Commit";
591 this.el.min_width = 50;
592 var child_0 = new Xcls_CellRendererToggle13( _this );
594 this.el.pack_start ( child_0.el , false );
598 // this.items[0].el.set_activatable(true);
599 this.el.add_attribute(_this.keyrender.el , "active", 4 );
602 // user defined functions
604 public class Xcls_CellRendererToggle13 : Object
606 public Gtk.CellRendererToggle el;
607 private Clones _this;
613 public Xcls_CellRendererToggle13(Clones _owner )
616 this.el = new Gtk.CellRendererToggle();
620 // set gobject values
621 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
624 this.el.toggled.connect( (self, path) => {
626 var store = this.get('/reposStore');
627 store.el.get_iter_from_string(ret, path);
629 var value = store.el.get_value(ret.iter,4).value.get_boolean();
631 //print(JSON.stringify(value));
632 store.el.set_value(ret.iter,4, !value);
634 var path = store.el.get_value(ret.iter, 6).value.get_string();
635 var repo = imports.Scm.Repo.Repo.get(path);
636 repo.autocommit(!value);
643 // user defined functions
647 public class Xcls_tv_autopush : Object
649 public Gtk.TreeViewColumn el;
650 private Clones _this;
656 public Xcls_tv_autopush(Clones _owner )
659 _this.tv_autopush = this;
660 this.el = new Gtk.TreeViewColumn();
664 // set gobject values
665 this.el.title = "Auto Push";
666 this.el.min_width = 50;
667 var child_0 = new Xcls_CellRendererToggle15( _this );
669 this.el.pack_start ( child_0.el );
673 this.el.add_attribute(this.items[0].el , 'active', 5 );
674 // this.items[0].el.set_activatable(true);
677 // user defined functions
679 public class Xcls_CellRendererToggle15 : Object
681 public Gtk.CellRendererToggle el;
682 private Clones _this;
688 public Xcls_CellRendererToggle15(Clones _owner )
691 this.el = new Gtk.CellRendererToggle();
695 // set gobject values
696 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
699 this.el.toggled.connect( function (self, path) {
701 var store = this.get('/reposStore');
702 store.el.get_iter_from_string(ret, path);
704 var value = store.el.get_value(ret.iter,5).value.get_boolean();
706 //print(JSON.stringify(value));
707 store.el.set_value(ret.iter,5, !value);
708 var path = store.el.get_value(ret.iter, 6).value.get_string();
709 var repo = imports.Scm.Repo.Repo.get(path);
710 repo.autopush(!value);
715 // user defined functions
719 public class Xcls_tv_repo : Object
721 public Gtk.TreeViewColumn el;
722 private Clones _this;
728 public Xcls_tv_repo(Clones _owner )
731 _this.tv_repo = this;
732 this.el = new Gtk.TreeViewColumn();
736 // set gobject values
737 this.el.title = "Repo";
738 this.el.min_width = 200;
739 this.el.resizable = true;
740 var child_0 = new Xcls_CellRendererText17( _this );
742 this.el.pack_start ( child_0.el );
747 XObject.prototype.init.call(this);
748 this.el.add_attribute(this.items[0].el , 'markup', 0 );
753 // user defined functions
755 public class Xcls_CellRendererText17 : Object
757 public Gtk.CellRendererText el;
758 private Clones _this;
764 public Xcls_CellRendererText17(Clones _owner )
767 this.el = new Gtk.CellRendererText();
771 // set gobject values
774 // user defined functions
778 public class Xcls_tv_current_branch : Object
780 public Gtk.TreeViewColumn el;
781 private Clones _this;
787 public Xcls_tv_current_branch(Clones _owner )
790 _this.tv_current_branch = this;
791 this.el = new Gtk.TreeViewColumn();
795 // set gobject values
796 this.el.title = "Current Branch";
797 this.el.min_width = 50;
798 var child_0 = new Xcls_CellRendererText19( _this );
800 this.el.pack_start ( child_0.el );
805 XObject.prototype.init.call(this);
806 this.el.add_attribute(this.items[0].el , 'markup', 1 );
807 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
812 // user defined functions
814 public class Xcls_CellRendererText19 : Object
816 public Gtk.CellRendererText el;
817 private Clones _this;
823 public Xcls_CellRendererText19(Clones _owner )
826 this.el = new Gtk.CellRendererText();
830 // set gobject values
833 // user defined functions
837 public class Xcls_tv_last_updated : Object
839 public Gtk.TreeViewColumn el;
840 private Clones _this;
846 public Xcls_tv_last_updated(Clones _owner )
849 _this.tv_last_updated = this;
850 this.el = new Gtk.TreeViewColumn();
854 // set gobject values
855 this.el.title = "Last updated";
856 this.el.min_width = 50;
857 var child_0 = new Xcls_CellRendererText21( _this );
859 this.el.pack_start ( child_0.el );
864 XObject.prototype.init.call(this);
865 this.el.add_attribute(this.items[0].el , 'markup', 3 );
870 // user defined functions
872 public class Xcls_CellRendererText21 : Object
874 public Gtk.CellRendererText el;
875 private Clones _this;
881 public Xcls_CellRendererText21(Clones _owner )
884 this.el = new Gtk.CellRendererText();
888 // set gobject values
891 // user defined functions
895 public class Xcls_tv_all_branches : Object
897 public Gtk.TreeViewColumn el;
898 private Clones _this;
904 public Xcls_tv_all_branches(Clones _owner )
907 _this.tv_all_branches = this;
908 this.el = new Gtk.TreeViewColumn();
912 // set gobject values
913 this.el.title = "All Branches";
914 this.el.min_width = 50;
915 this.el.resizable = false;
916 var child_0 = new Xcls_CellRendererText23( _this );
918 this.el.pack_start ( child_0.el );
923 XObject.prototype.init.call(this);
924 this.el.add_attribute(this.items[0].el , 'markup', 2 );
929 // user defined functions
931 public class Xcls_CellRendererText23 : Object
933 public Gtk.CellRendererText el;
934 private Clones _this;
940 public Xcls_CellRendererText23(Clones _owner )
943 this.el = new Gtk.CellRendererText();
947 // set gobject values
950 // user defined functions
955 public class Xcls_TreeView24 : Object
957 public Gtk.TreeView el;
958 private Clones _this;
964 public Xcls_TreeView24(Clones _owner )
967 this.el = new Gtk.TreeView();
971 // set gobject values
972 var child_0 = new Xcls_ListStore25( _this );
976 // user defined functions
978 public class Xcls_ListStore25 : Object
980 public Gtk.ListStore el;
981 private Clones _this;
987 public Xcls_ListStore25(Clones _owner )
990 this.el = new Gtk.ListStore( 0, null );
994 // set gobject values
997 // user defined functions
1003 public class Xcls_ok_button : Object
1005 public Gtk.Button el;
1006 private Clones _this;
1012 public Xcls_ok_button(Clones _owner )
1015 _this.ok_button = this;
1016 this.el = new Gtk.Button();
1020 // set gobject values
1021 this.el.label = "Close";
1024 // user defined functions