3 public class Clones : Object
8 public static Clones singleton()
10 if (_Clones == null) {
11 _Clones= new Clones();
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_repo tv_repo;
22 public Xcls_cr_repo cr_repo;
23 public Xcls_tv_current_branch tv_current_branch;
24 public Xcls_cr_current_branch cr_current_branch;
25 public Xcls_tv_last_updated tv_last_updated;
26 public Xcls_cr_last_updated cr_last_updated;
27 public Xcls_tv_all_branches tv_all_branches;
28 public Xcls_cr_all_branches cr_all_branches;
29 public Xcls_ok_button ok_button;
37 this.el = new Gtk.Popover( null );
42 this.el.border_width = 3;
44 var child_0 = new Xcls_Box2( _this );
46 this.el.get_content_area().add ( child_0.el );
47 var child_1 = new Xcls_ok_button( _this );
49 this.el.add_action_widget ( child_1.el , 1 );
52 this.el.delete_event.connect( (self, event) => {
57 this.el.response.connect( (self, response_id) => {
64 // user defined functions
68 this.el.set_deletable(false);
71 // this.get('/reposStore').load();
73 //this.get('/ok_button').el.set_sensitive(false);
75 // block until we return.
76 // var run_ret = this.el.run();
77 // if (run_ret < 1 ) {
80 // print("RUN RETURN : " + run_ret);
82 //print(JSON.stringify(this.get('bug').getValue()));
83 // return this.get('bug').getValue();
84 //this.success = c.success;
86 public class Xcls_Box2 : Object
95 public Xcls_Box2(Clones _owner )
98 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 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.add ( child_1.el );
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.expand = true;
441 this.el.shadow_type = Gtk.ShadowType.IN;
442 var child_0 = new Xcls_reposView( _this );
444 this.el.add ( child_0.el );
450 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
454 // user defined functions
456 public class Xcls_reposView : Object
458 public Gtk.TreeView el;
459 private Clones _this;
465 public Xcls_reposView(Clones _owner )
468 _this.reposView = this;
469 this.el = new Gtk.TreeView();
473 // set gobject values
474 var child_0 = new Xcls_reposStore( _this );
476 this.el.set_model ( child_0.el );
477 var child_1 = new Xcls_tv_autocommit( _this );
479 this.el.append_column ( child_1.el );
480 var child_2 = new Xcls_tv_autopush( _this );
482 this.el.append_column ( child_2.el );
483 var child_3 = new Xcls_tv_repo( _this );
485 this.el.append_column ( child_3.el );
486 var child_4 = new Xcls_tv_current_branch( _this );
488 this.el.append_column ( child_4.el );
489 var child_5 = new Xcls_tv_last_updated( _this );
491 this.el.append_column ( child_5.el );
492 var child_6 = new Xcls_tv_all_branches( _this );
494 this.el.append_column ( child_6.el );
499 var selection = this.el.get_selection();
500 selection.set_mode( Gtk.SelectionMode.SINGLE);
503 var description = new Pango.FontDescription();
504 description.set_size(10000);
505 this.el.override_font(description);
509 this.el.cursor_changed.connect( () => {
510 // SEE SELECTION.CHANGED
515 if (this.el.get_selection().count_selected_rows() < 1) {
516 //nothing? - clea it?
520 var model = this.get('/changedFilesStore');
522 var s = this.el.get_selection();
524 s.selected_foreach(function(model,p,iter) {
526 files.push( model.get_value(iter, 0).value.get_string());
529 this.get('/patchview').showDiff(files);
530 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
531 //print("OUT?" + value);// id..
532 // load the list in the right grid..
539 // user defined functions
541 public class Xcls_reposStore : Object
543 public Gtk.ListStore el;
544 private Clones _this;
550 public Xcls_reposStore(Clones _owner )
553 _this.reposStore = this;
554 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
555 typeof(string), // 1 current branch
556 typeof(string), // 2 all branch
557 typeof(string), // 3 updated
558 typeof(bool), // 4 auto commit
559 typeof(bool), // 5 auto push
560 typeof(string), // 7 repopath
561 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_cr_autocommit( _this );
594 this.el.pack_start ( child_0.el , false );
598 // this.items[0].el.set_activatable(true);
599 this.el.add_attribute(_this.cr_autocommit.el , "active", 4 );
602 // user defined functions
604 public class Xcls_cr_autocommit : Object
606 public Gtk.CellRendererToggle el;
607 private Clones _this;
613 public Xcls_cr_autocommit(Clones _owner )
616 _this.cr_autocommit = this;
617 this.el = new Gtk.CellRendererToggle();
621 // set gobject values
622 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
625 this.el.toggled.connect( (self, path) => {
627 var store = this.get('/reposStore');
628 store.el.get_iter_from_string(ret, path);
630 var value = store.el.get_value(ret.iter,4).value.get_boolean();
632 //print(JSON.stringify(value));
633 store.el.set_value(ret.iter,4, !value);
635 var path = store.el.get_value(ret.iter, 6).value.get_string();
636 var repo = imports.Scm.Repo.Repo.get(path);
637 repo.autocommit(!value);
644 // user defined functions
648 public class Xcls_tv_autopush : Object
650 public Gtk.TreeViewColumn el;
651 private Clones _this;
657 public Xcls_tv_autopush(Clones _owner )
660 _this.tv_autopush = this;
661 this.el = new Gtk.TreeViewColumn();
665 // set gobject values
666 this.el.title = "Auto Push";
667 this.el.min_width = 50;
668 var child_0 = new Xcls_cr_autopush( _this );
670 this.el.pack_start ( child_0.el , false );
674 this.el.add_attribute(_this.cr_autopush.el , "active", 5 );
675 // this.items[0].el.set_activatable(true);
678 // user defined functions
680 public class Xcls_cr_autopush : Object
682 public Gtk.CellRendererToggle el;
683 private Clones _this;
689 public Xcls_cr_autopush(Clones _owner )
692 _this.cr_autopush = this;
693 this.el = new Gtk.CellRendererToggle();
697 // set gobject values
698 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
701 this.el.toggled.connect( (self, path) => {
703 var store = this.get('/reposStore');
704 store.el.get_iter_from_string(ret, path);
706 var value = store.el.get_value(ret.iter,5).value.get_boolean();
708 //print(JSON.stringify(value));
709 store.el.set_value(ret.iter,5, !value);
710 var path = store.el.get_value(ret.iter, 6).value.get_string();
711 var repo = imports.Scm.Repo.Repo.get(path);
712 repo.autopush(!value);
717 // user defined functions
721 public class Xcls_tv_repo : Object
723 public Gtk.TreeViewColumn el;
724 private Clones _this;
730 public Xcls_tv_repo(Clones _owner )
733 _this.tv_repo = this;
734 this.el = new Gtk.TreeViewColumn();
738 // set gobject values
739 this.el.title = "Repo";
740 this.el.min_width = 200;
741 this.el.resizable = true;
742 var child_0 = new Xcls_cr_repo( _this );
744 this.el.pack_start ( child_0.el , false );
748 this.el.add_attribute(_this.cr_repo.el , "markup", 0 );
751 // user defined functions
753 public class Xcls_cr_repo : Object
755 public Gtk.CellRendererText el;
756 private Clones _this;
762 public Xcls_cr_repo(Clones _owner )
765 _this.cr_repo = this;
766 this.el = new Gtk.CellRendererText();
770 // set gobject values
773 // user defined functions
777 public class Xcls_tv_current_branch : Object
779 public Gtk.TreeViewColumn el;
780 private Clones _this;
786 public Xcls_tv_current_branch(Clones _owner )
789 _this.tv_current_branch = this;
790 this.el = new Gtk.TreeViewColumn();
794 // set gobject values
795 this.el.title = "Current Branch";
796 this.el.min_width = 50;
797 var child_0 = new Xcls_cr_current_branch( _this );
799 this.el.pack_start ( child_0.el , false );
803 this.el.add_attribute(_this.cr_current_branch.el , "markup", 1 );
804 this.el.add_attribute(_this.cr_current_branch.el, "cell-background", 7 );
807 // user defined functions
809 public class Xcls_cr_current_branch : Object
811 public Gtk.CellRendererText el;
812 private Clones _this;
818 public Xcls_cr_current_branch(Clones _owner )
821 _this.cr_current_branch = this;
822 this.el = new Gtk.CellRendererText();
826 // set gobject values
829 // user defined functions
833 public class Xcls_tv_last_updated : Object
835 public Gtk.TreeViewColumn el;
836 private Clones _this;
842 public Xcls_tv_last_updated(Clones _owner )
845 _this.tv_last_updated = this;
846 this.el = new Gtk.TreeViewColumn();
850 // set gobject values
851 this.el.title = "Last updated";
852 this.el.min_width = 50;
853 var child_0 = new Xcls_cr_last_updated( _this );
855 this.el.pack_start ( child_0.el , false );
859 this.el.add_attribute(_this.cr_last_updated.el , "markup", 3 );
862 // user defined functions
864 public class Xcls_cr_last_updated : Object
866 public Gtk.CellRendererText el;
867 private Clones _this;
873 public Xcls_cr_last_updated(Clones _owner )
876 _this.cr_last_updated = this;
877 this.el = new Gtk.CellRendererText();
881 // set gobject values
884 // user defined functions
888 public class Xcls_tv_all_branches : Object
890 public Gtk.TreeViewColumn el;
891 private Clones _this;
897 public Xcls_tv_all_branches(Clones _owner )
900 _this.tv_all_branches = this;
901 this.el = new Gtk.TreeViewColumn();
905 // set gobject values
906 this.el.title = "All Branches";
907 this.el.min_width = 50;
908 this.el.resizable = false;
909 var child_0 = new Xcls_cr_all_branches( _this );
911 this.el.pack_start ( child_0.el , false );
915 this.el.add_attribute(_this.cr_all_branches.el , "markup", 2 );
918 // user defined functions
920 public class Xcls_cr_all_branches : Object
922 public Gtk.CellRendererText el;
923 private Clones _this;
929 public Xcls_cr_all_branches(Clones _owner )
932 _this.cr_all_branches = this;
933 this.el = new Gtk.CellRendererText();
937 // set gobject values
940 // user defined functions
947 public class Xcls_ok_button : Object
949 public Gtk.Button el;
950 private Clones _this;
956 public Xcls_ok_button(Clones _owner )
959 _this.ok_button = this;
960 this.el = new Gtk.Button();
964 // set gobject values
965 this.el.label = "Close";
968 // user defined functions