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.add ( child_0.el );
49 // user defined functions
50 public void show (Gtk.Widget menuitem) {
53 this.el.set_relative_to( null );
57 //console.log('show all');
58 this.el.set_modal(true);
61 this.el.set_position(Gtk.PositionType.BOTTOM);
65 this.el.set_size_request(800,500);
67 //this.view.el.grab_focus();
69 public class Xcls_Box2 : Object
78 public Xcls_Box2(Clones _owner )
81 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
86 var child_0 = new Xcls_Box3( _this );
88 this.el.pack_start ( child_0.el , false,false,0 );
89 var child_1 = new Xcls_ScrolledWindow9( _this );
91 this.el.add ( child_1.el );
92 var child_2 = new Xcls_ok_button( _this );
94 this.el.add ( child_2.el );
97 // user defined functions
99 public class Xcls_Box3 : Object
102 private Clones _this;
108 public Xcls_Box3(Clones _owner )
111 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
115 // set gobject values
116 var child_0 = new Xcls_Button4( _this );
118 this.el.add ( child_0.el );
119 var child_1 = new Xcls_Button5( _this );
121 this.el.add ( child_1.el );
122 var child_2 = new Xcls_Button6( _this );
124 this.el.add ( child_2.el );
125 var child_3 = new Xcls_Button7( _this );
127 this.el.add ( child_3.el );
128 var child_4 = new Xcls_Button8( _this );
130 this.el.add ( child_4.el );
133 // user defined functions
135 public class Xcls_Button4 : Object
137 public Gtk.Button el;
138 private Clones _this;
144 public Xcls_Button4(Clones _owner )
147 this.el = new Gtk.Button();
151 // set gobject values
152 this.el.label = "Remotes / Clones";
155 this.el.clicked.connect( () => {
157 /* var rv = this.get('/reposView');
158 var rs = this.get('/reposStore');
159 if (rv.el.get_selection().count_selected_rows() != 1) {
164 var Remotes = imports.Remotes.Remotes;
168 var s = rv.el.get_selection();
170 s.selected_foreach(function(model,p,iter) {
172 path = model.get_value(iter, 6).value.get_string();
177 rs.repos.forEach(function(r) {
178 if (r.repopath == path) {
185 Remotes.el.set_transient_for(Clones.el);
186 Clones.el.set_title("Manage Clones - " + repo.repopath);
188 Clones.el.set_title("Manage Clones");
200 // user defined functions
203 public class Xcls_Button5 : Object
205 public Gtk.Button el;
206 private Clones _this;
212 public Xcls_Button5(Clones _owner )
215 this.el = new Gtk.Button();
219 // set gobject values
220 this.el.label = "Branches";
223 this.el.clicked.connect( () => {
225 var rv = this.get('/reposView');
226 var rs = this.get('/reposStore');
227 if (rv.el.get_selection().count_selected_rows() != 1) {
232 var Branches = imports.Branches.Branches;
236 var s = rv.el.get_selection();
238 s.selected_foreach(function(model,p,iter) {
240 path = model.get_value(iter, 6).value.get_string();
245 rs.repos.forEach(function(r) {
246 if (r.repopath == path) {
252 Branches.repo = repo;
253 Branches.el.set_transient_for(Clones.el);
254 Clones.el.set_title("Manage Clones - " + repo.repopath);
256 Clones.el.set_title("Manage Clones");
269 // user defined functions
272 public class Xcls_Button6 : Object
274 public Gtk.Button el;
275 private Clones _this;
281 public Xcls_Button6(Clones _owner )
284 this.el = new Gtk.Button();
288 // set gobject values
289 this.el.label = "Merge";
292 this.el.clicked.connect( () => {
294 var rv = this.get('/reposView');
295 var rs = this.get('/reposStore');
296 if (rv.el.get_selection().count_selected_rows() != 1) {
301 var Merger = imports.Merger.Merger;
305 var s = rv.el.get_selection();
307 s.selected_foreach(function(model,p,iter) {
309 path = model.get_value(iter, 6).value.get_string();
314 rs.repos.forEach(function(r) {
315 if (r.repopath == path) {
322 Merger.el.set_transient_for(Clones.el);
323 Clones.el.set_title("Manage Clones - " + repo.repopath);
325 Clones.el.set_title("Manage Clones");
339 // user defined functions
342 public class Xcls_Button7 : Object
344 public Gtk.Button el;
345 private Clones _this;
351 public Xcls_Button7(Clones _owner )
354 this.el = new Gtk.Button();
358 // set gobject values
359 this.el.label = "Switch Branch";
362 this.el.clicked.connect( () => {
372 // user defined functions
375 public class Xcls_Button8 : Object
377 public Gtk.Button el;
378 private Clones _this;
384 public Xcls_Button8(Clones _owner )
387 this.el = new Gtk.Button();
391 // set gobject values
392 this.el.label = "Pull";
395 this.el.clicked.connect( () => {
405 // user defined functions
409 public class Xcls_ScrolledWindow9 : Object
411 public Gtk.ScrolledWindow el;
412 private Clones _this;
418 public Xcls_ScrolledWindow9(Clones _owner )
421 this.el = new Gtk.ScrolledWindow( null, null );
425 // set gobject values
426 this.el.expand = true;
427 this.el.shadow_type = Gtk.ShadowType.IN;
428 var child_0 = new Xcls_reposView( _this );
430 this.el.add ( child_0.el );
436 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
440 // user defined functions
442 public class Xcls_reposView : Object
444 public Gtk.TreeView el;
445 private Clones _this;
451 public Xcls_reposView(Clones _owner )
454 _this.reposView = this;
455 this.el = new Gtk.TreeView();
459 // set gobject values
460 var child_0 = new Xcls_reposStore( _this );
462 this.el.set_model ( child_0.el );
463 var child_1 = new Xcls_tv_autocommit( _this );
465 this.el.append_column ( child_1.el );
466 var child_2 = new Xcls_tv_autopush( _this );
468 this.el.append_column ( child_2.el );
469 var child_3 = new Xcls_tv_repo( _this );
471 this.el.append_column ( child_3.el );
472 var child_4 = new Xcls_tv_current_branch( _this );
474 this.el.append_column ( child_4.el );
475 var child_5 = new Xcls_tv_last_updated( _this );
477 this.el.append_column ( child_5.el );
478 var child_6 = new Xcls_tv_all_branches( _this );
480 this.el.append_column ( child_6.el );
485 var selection = this.el.get_selection();
486 selection.set_mode( Gtk.SelectionMode.SINGLE);
489 var description = new Pango.FontDescription();
490 description.set_size(10000);
491 this.el.override_font(description);
495 this.el.cursor_changed.connect( () => {
496 // SEE SELECTION.CHANGED
501 if (this.el.get_selection().count_selected_rows() < 1) {
502 //nothing? - clea it?
506 var model = this.get('/changedFilesStore');
508 var s = this.el.get_selection();
510 s.selected_foreach(function(model,p,iter) {
512 files.push( model.get_value(iter, 0).value.get_string());
515 this.get('/patchview').showDiff(files);
516 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
517 //print("OUT?" + value);// id..
518 // load the list in the right grid..
525 // user defined functions
527 public class Xcls_reposStore : Object
529 public Gtk.ListStore el;
530 private Clones _this;
536 public Xcls_reposStore(Clones _owner )
539 _this.reposStore = this;
540 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
541 typeof(string), // 1 current branch
542 typeof(string), // 2 all branch
543 typeof(string), // 3 updated
544 typeof(bool), // 4 auto commit
545 typeof(bool), // 5 auto push
546 typeof(string), // 7 repopath
547 typeof(string) // 8 color highlighting?
552 // set gobject values
555 // user defined functions
558 public class Xcls_tv_autocommit : Object
560 public Gtk.TreeViewColumn el;
561 private Clones _this;
567 public Xcls_tv_autocommit(Clones _owner )
570 _this.tv_autocommit = this;
571 this.el = new Gtk.TreeViewColumn();
575 // set gobject values
576 this.el.title = "Auto Commit";
577 this.el.min_width = 50;
578 var child_0 = new Xcls_cr_autocommit( _this );
580 this.el.pack_start ( child_0.el , false );
584 // this.items[0].el.set_activatable(true);
585 this.el.add_attribute(_this.cr_autocommit.el , "active", 4 );
588 // user defined functions
590 public class Xcls_cr_autocommit : Object
592 public Gtk.CellRendererToggle el;
593 private Clones _this;
599 public Xcls_cr_autocommit(Clones _owner )
602 _this.cr_autocommit = this;
603 this.el = new Gtk.CellRendererToggle();
607 // set gobject values
608 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
611 this.el.toggled.connect( (self, path) => {
613 var store = this.get('/reposStore');
614 store.el.get_iter_from_string(ret, path);
616 var value = store.el.get_value(ret.iter,4).value.get_boolean();
618 //print(JSON.stringify(value));
619 store.el.set_value(ret.iter,4, !value);
621 var path = store.el.get_value(ret.iter, 6).value.get_string();
622 var repo = imports.Scm.Repo.Repo.get(path);
623 repo.autocommit(!value);
630 // user defined functions
634 public class Xcls_tv_autopush : Object
636 public Gtk.TreeViewColumn el;
637 private Clones _this;
643 public Xcls_tv_autopush(Clones _owner )
646 _this.tv_autopush = this;
647 this.el = new Gtk.TreeViewColumn();
651 // set gobject values
652 this.el.title = "Auto Push";
653 this.el.min_width = 50;
654 var child_0 = new Xcls_cr_autopush( _this );
656 this.el.pack_start ( child_0.el , false );
660 this.el.add_attribute(_this.cr_autopush.el , "active", 5 );
661 // this.items[0].el.set_activatable(true);
664 // user defined functions
666 public class Xcls_cr_autopush : Object
668 public Gtk.CellRendererToggle el;
669 private Clones _this;
675 public Xcls_cr_autopush(Clones _owner )
678 _this.cr_autopush = this;
679 this.el = new Gtk.CellRendererToggle();
683 // set gobject values
684 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
687 this.el.toggled.connect( (self, path) => {
689 var store = this.get('/reposStore');
690 store.el.get_iter_from_string(ret, path);
692 var value = store.el.get_value(ret.iter,5).value.get_boolean();
694 //print(JSON.stringify(value));
695 store.el.set_value(ret.iter,5, !value);
696 var path = store.el.get_value(ret.iter, 6).value.get_string();
697 var repo = imports.Scm.Repo.Repo.get(path);
698 repo.autopush(!value);
703 // user defined functions
707 public class Xcls_tv_repo : Object
709 public Gtk.TreeViewColumn el;
710 private Clones _this;
716 public Xcls_tv_repo(Clones _owner )
719 _this.tv_repo = this;
720 this.el = new Gtk.TreeViewColumn();
724 // set gobject values
725 this.el.title = "Repo";
726 this.el.min_width = 200;
727 this.el.resizable = true;
728 var child_0 = new Xcls_cr_repo( _this );
730 this.el.pack_start ( child_0.el , false );
734 this.el.add_attribute(_this.cr_repo.el , "markup", 0 );
737 // user defined functions
739 public class Xcls_cr_repo : Object
741 public Gtk.CellRendererText el;
742 private Clones _this;
748 public Xcls_cr_repo(Clones _owner )
751 _this.cr_repo = this;
752 this.el = new Gtk.CellRendererText();
756 // set gobject values
759 // user defined functions
763 public class Xcls_tv_current_branch : Object
765 public Gtk.TreeViewColumn el;
766 private Clones _this;
772 public Xcls_tv_current_branch(Clones _owner )
775 _this.tv_current_branch = this;
776 this.el = new Gtk.TreeViewColumn();
780 // set gobject values
781 this.el.title = "Current Branch";
782 this.el.min_width = 50;
783 var child_0 = new Xcls_cr_current_branch( _this );
785 this.el.pack_start ( child_0.el , false );
789 this.el.add_attribute(_this.cr_current_branch.el , "markup", 1 );
790 this.el.add_attribute(_this.cr_current_branch.el, "cell-background", 7 );
793 // user defined functions
795 public class Xcls_cr_current_branch : Object
797 public Gtk.CellRendererText el;
798 private Clones _this;
804 public Xcls_cr_current_branch(Clones _owner )
807 _this.cr_current_branch = this;
808 this.el = new Gtk.CellRendererText();
812 // set gobject values
815 // user defined functions
819 public class Xcls_tv_last_updated : Object
821 public Gtk.TreeViewColumn el;
822 private Clones _this;
828 public Xcls_tv_last_updated(Clones _owner )
831 _this.tv_last_updated = this;
832 this.el = new Gtk.TreeViewColumn();
836 // set gobject values
837 this.el.title = "Last updated";
838 this.el.min_width = 50;
839 var child_0 = new Xcls_cr_last_updated( _this );
841 this.el.pack_start ( child_0.el , false );
845 this.el.add_attribute(_this.cr_last_updated.el , "markup", 3 );
848 // user defined functions
850 public class Xcls_cr_last_updated : Object
852 public Gtk.CellRendererText el;
853 private Clones _this;
859 public Xcls_cr_last_updated(Clones _owner )
862 _this.cr_last_updated = this;
863 this.el = new Gtk.CellRendererText();
867 // set gobject values
870 // user defined functions
874 public class Xcls_tv_all_branches : Object
876 public Gtk.TreeViewColumn el;
877 private Clones _this;
883 public Xcls_tv_all_branches(Clones _owner )
886 _this.tv_all_branches = this;
887 this.el = new Gtk.TreeViewColumn();
891 // set gobject values
892 this.el.title = "All Branches";
893 this.el.min_width = 50;
894 this.el.resizable = false;
895 var child_0 = new Xcls_cr_all_branches( _this );
897 this.el.pack_start ( child_0.el , false );
901 this.el.add_attribute(_this.cr_all_branches.el , "markup", 2 );
904 // user defined functions
906 public class Xcls_cr_all_branches : Object
908 public Gtk.CellRendererText el;
909 private Clones _this;
915 public Xcls_cr_all_branches(Clones _owner )
918 _this.cr_all_branches = this;
919 this.el = new Gtk.CellRendererText();
923 // set gobject values
926 // user defined functions
932 public class Xcls_ok_button : Object
934 public Gtk.Button el;
935 private Clones _this;
941 public Xcls_ok_button(Clones _owner )
944 _this.ok_button = this;
945 this.el = new Gtk.Button();
949 // set gobject values
950 this.el.label = "Close";
953 // user defined functions