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.StatusIcon icon) {
56 icon.get_geometry(out screen, out area, out ori);
58 this.el.set_pointing_to(area);
60 //console.log('show all');
61 this.el.set_modal(true);
64 this.el.set_position(Gtk.PositionType.TOP);
68 this.el.set_size_request(800,500);
70 //this.view.el.grab_focus();
72 public class Xcls_Box2 : Object
81 public Xcls_Box2(Clones _owner )
84 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
89 var child_0 = new Xcls_Box3( _this );
91 this.el.pack_start ( child_0.el , false,false,0 );
92 var child_1 = new Xcls_ScrolledWindow9( _this );
94 this.el.add ( child_1.el );
95 var child_2 = new Xcls_ok_button( _this );
97 this.el.add ( child_2.el );
100 // user defined functions
102 public class Xcls_Box3 : Object
105 private Clones _this;
111 public Xcls_Box3(Clones _owner )
114 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
118 // set gobject values
119 var child_0 = new Xcls_Button4( _this );
121 this.el.add ( child_0.el );
122 var child_1 = new Xcls_Button5( _this );
124 this.el.add ( child_1.el );
125 var child_2 = new Xcls_Button6( _this );
127 this.el.add ( child_2.el );
128 var child_3 = new Xcls_Button7( _this );
130 this.el.add ( child_3.el );
131 var child_4 = new Xcls_Button8( _this );
133 this.el.add ( child_4.el );
136 // user defined functions
138 public class Xcls_Button4 : Object
140 public Gtk.Button el;
141 private Clones _this;
147 public Xcls_Button4(Clones _owner )
150 this.el = new Gtk.Button();
154 // set gobject values
155 this.el.label = "Remotes / Clones";
158 this.el.clicked.connect( () => {
160 /* var rv = this.get('/reposView');
161 var rs = this.get('/reposStore');
162 if (rv.el.get_selection().count_selected_rows() != 1) {
167 var Remotes = imports.Remotes.Remotes;
171 var s = rv.el.get_selection();
173 s.selected_foreach(function(model,p,iter) {
175 path = model.get_value(iter, 6).value.get_string();
180 rs.repos.forEach(function(r) {
181 if (r.repopath == path) {
188 Remotes.el.set_transient_for(Clones.el);
189 Clones.el.set_title("Manage Clones - " + repo.repopath);
191 Clones.el.set_title("Manage Clones");
203 // user defined functions
206 public class Xcls_Button5 : Object
208 public Gtk.Button el;
209 private Clones _this;
215 public Xcls_Button5(Clones _owner )
218 this.el = new Gtk.Button();
222 // set gobject values
223 this.el.label = "Branches";
226 this.el.clicked.connect( () => {
228 var rv = this.get('/reposView');
229 var rs = this.get('/reposStore');
230 if (rv.el.get_selection().count_selected_rows() != 1) {
235 var Branches = imports.Branches.Branches;
239 var s = rv.el.get_selection();
241 s.selected_foreach(function(model,p,iter) {
243 path = model.get_value(iter, 6).value.get_string();
248 rs.repos.forEach(function(r) {
249 if (r.repopath == path) {
255 Branches.repo = repo;
256 Branches.el.set_transient_for(Clones.el);
257 Clones.el.set_title("Manage Clones - " + repo.repopath);
259 Clones.el.set_title("Manage Clones");
272 // user defined functions
275 public class Xcls_Button6 : Object
277 public Gtk.Button el;
278 private Clones _this;
284 public Xcls_Button6(Clones _owner )
287 this.el = new Gtk.Button();
291 // set gobject values
292 this.el.label = "Merge";
295 this.el.clicked.connect( () => {
297 var rv = this.get('/reposView');
298 var rs = this.get('/reposStore');
299 if (rv.el.get_selection().count_selected_rows() != 1) {
304 var Merger = imports.Merger.Merger;
308 var s = rv.el.get_selection();
310 s.selected_foreach(function(model,p,iter) {
312 path = model.get_value(iter, 6).value.get_string();
317 rs.repos.forEach(function(r) {
318 if (r.repopath == path) {
325 Merger.el.set_transient_for(Clones.el);
326 Clones.el.set_title("Manage Clones - " + repo.repopath);
328 Clones.el.set_title("Manage Clones");
342 // user defined functions
345 public class Xcls_Button7 : Object
347 public Gtk.Button el;
348 private Clones _this;
354 public Xcls_Button7(Clones _owner )
357 this.el = new Gtk.Button();
361 // set gobject values
362 this.el.label = "Switch Branch";
365 this.el.clicked.connect( () => {
375 // user defined functions
378 public class Xcls_Button8 : Object
380 public Gtk.Button el;
381 private Clones _this;
387 public Xcls_Button8(Clones _owner )
390 this.el = new Gtk.Button();
394 // set gobject values
395 this.el.label = "Pull";
398 this.el.clicked.connect( () => {
408 // user defined functions
412 public class Xcls_ScrolledWindow9 : Object
414 public Gtk.ScrolledWindow el;
415 private Clones _this;
421 public Xcls_ScrolledWindow9(Clones _owner )
424 this.el = new Gtk.ScrolledWindow( null, null );
428 // set gobject values
429 this.el.expand = true;
430 this.el.shadow_type = Gtk.ShadowType.IN;
431 var child_0 = new Xcls_reposView( _this );
433 this.el.add ( child_0.el );
439 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
443 // user defined functions
445 public class Xcls_reposView : Object
447 public Gtk.TreeView el;
448 private Clones _this;
454 public Xcls_reposView(Clones _owner )
457 _this.reposView = this;
458 this.el = new Gtk.TreeView();
462 // set gobject values
463 var child_0 = new Xcls_reposStore( _this );
465 this.el.set_model ( child_0.el );
466 var child_1 = new Xcls_tv_autocommit( _this );
468 this.el.append_column ( child_1.el );
469 var child_2 = new Xcls_tv_autopush( _this );
471 this.el.append_column ( child_2.el );
472 var child_3 = new Xcls_tv_repo( _this );
474 this.el.append_column ( child_3.el );
475 var child_4 = new Xcls_tv_current_branch( _this );
477 this.el.append_column ( child_4.el );
478 var child_5 = new Xcls_tv_last_updated( _this );
480 this.el.append_column ( child_5.el );
481 var child_6 = new Xcls_tv_all_branches( _this );
483 this.el.append_column ( child_6.el );
488 var selection = this.el.get_selection();
489 selection.set_mode( Gtk.SelectionMode.SINGLE);
492 var description = new Pango.FontDescription();
493 description.set_size(10000);
494 this.el.override_font(description);
498 this.el.cursor_changed.connect( () => {
499 // SEE SELECTION.CHANGED
504 if (this.el.get_selection().count_selected_rows() < 1) {
505 //nothing? - clea it?
509 var model = this.get('/changedFilesStore');
511 var s = this.el.get_selection();
513 s.selected_foreach(function(model,p,iter) {
515 files.push( model.get_value(iter, 0).value.get_string());
518 this.get('/patchview').showDiff(files);
519 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
520 //print("OUT?" + value);// id..
521 // load the list in the right grid..
528 // user defined functions
530 public class Xcls_reposStore : Object
532 public Gtk.ListStore el;
533 private Clones _this;
539 public Xcls_reposStore(Clones _owner )
542 _this.reposStore = this;
543 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
544 typeof(string), // 1 current branch
545 typeof(string), // 2 all branch
546 typeof(string), // 3 updated
547 typeof(bool), // 4 auto commit
548 typeof(bool), // 5 auto push
549 typeof(string), // 7 repopath
550 typeof(string) // 8 color highlighting?
555 // set gobject values
558 // user defined functions
561 public class Xcls_tv_autocommit : Object
563 public Gtk.TreeViewColumn el;
564 private Clones _this;
570 public Xcls_tv_autocommit(Clones _owner )
573 _this.tv_autocommit = this;
574 this.el = new Gtk.TreeViewColumn();
578 // set gobject values
579 this.el.title = "Auto Commit";
580 this.el.min_width = 50;
581 var child_0 = new Xcls_cr_autocommit( _this );
583 this.el.pack_start ( child_0.el , false );
587 // this.items[0].el.set_activatable(true);
588 this.el.add_attribute(_this.cr_autocommit.el , "active", 4 );
591 // user defined functions
593 public class Xcls_cr_autocommit : Object
595 public Gtk.CellRendererToggle el;
596 private Clones _this;
602 public Xcls_cr_autocommit(Clones _owner )
605 _this.cr_autocommit = this;
606 this.el = new Gtk.CellRendererToggle();
610 // set gobject values
611 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
614 this.el.toggled.connect( (self, path) => {
616 var store = this.get('/reposStore');
617 store.el.get_iter_from_string(ret, path);
619 var value = store.el.get_value(ret.iter,4).value.get_boolean();
621 //print(JSON.stringify(value));
622 store.el.set_value(ret.iter,4, !value);
624 var path = store.el.get_value(ret.iter, 6).value.get_string();
625 var repo = imports.Scm.Repo.Repo.get(path);
626 repo.autocommit(!value);
633 // user defined functions
637 public class Xcls_tv_autopush : Object
639 public Gtk.TreeViewColumn el;
640 private Clones _this;
646 public Xcls_tv_autopush(Clones _owner )
649 _this.tv_autopush = this;
650 this.el = new Gtk.TreeViewColumn();
654 // set gobject values
655 this.el.title = "Auto Push";
656 this.el.min_width = 50;
657 var child_0 = new Xcls_cr_autopush( _this );
659 this.el.pack_start ( child_0.el , false );
663 this.el.add_attribute(_this.cr_autopush.el , "active", 5 );
664 // this.items[0].el.set_activatable(true);
667 // user defined functions
669 public class Xcls_cr_autopush : Object
671 public Gtk.CellRendererToggle el;
672 private Clones _this;
678 public Xcls_cr_autopush(Clones _owner )
681 _this.cr_autopush = this;
682 this.el = new Gtk.CellRendererToggle();
686 // set gobject values
687 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
690 this.el.toggled.connect( (self, path) => {
692 var store = this.get('/reposStore');
693 store.el.get_iter_from_string(ret, path);
695 var value = store.el.get_value(ret.iter,5).value.get_boolean();
697 //print(JSON.stringify(value));
698 store.el.set_value(ret.iter,5, !value);
699 var path = store.el.get_value(ret.iter, 6).value.get_string();
700 var repo = imports.Scm.Repo.Repo.get(path);
701 repo.autopush(!value);
706 // user defined functions
710 public class Xcls_tv_repo : Object
712 public Gtk.TreeViewColumn el;
713 private Clones _this;
719 public Xcls_tv_repo(Clones _owner )
722 _this.tv_repo = this;
723 this.el = new Gtk.TreeViewColumn();
727 // set gobject values
728 this.el.title = "Repo";
729 this.el.min_width = 200;
730 this.el.resizable = true;
731 var child_0 = new Xcls_cr_repo( _this );
733 this.el.pack_start ( child_0.el , false );
737 this.el.add_attribute(_this.cr_repo.el , "markup", 0 );
740 // user defined functions
742 public class Xcls_cr_repo : Object
744 public Gtk.CellRendererText el;
745 private Clones _this;
751 public Xcls_cr_repo(Clones _owner )
754 _this.cr_repo = this;
755 this.el = new Gtk.CellRendererText();
759 // set gobject values
762 // user defined functions
766 public class Xcls_tv_current_branch : Object
768 public Gtk.TreeViewColumn el;
769 private Clones _this;
775 public Xcls_tv_current_branch(Clones _owner )
778 _this.tv_current_branch = this;
779 this.el = new Gtk.TreeViewColumn();
783 // set gobject values
784 this.el.title = "Current Branch";
785 this.el.min_width = 50;
786 var child_0 = new Xcls_cr_current_branch( _this );
788 this.el.pack_start ( child_0.el , false );
792 this.el.add_attribute(_this.cr_current_branch.el , "markup", 1 );
793 this.el.add_attribute(_this.cr_current_branch.el, "cell-background", 7 );
796 // user defined functions
798 public class Xcls_cr_current_branch : Object
800 public Gtk.CellRendererText el;
801 private Clones _this;
807 public Xcls_cr_current_branch(Clones _owner )
810 _this.cr_current_branch = this;
811 this.el = new Gtk.CellRendererText();
815 // set gobject values
818 // user defined functions
822 public class Xcls_tv_last_updated : Object
824 public Gtk.TreeViewColumn el;
825 private Clones _this;
831 public Xcls_tv_last_updated(Clones _owner )
834 _this.tv_last_updated = this;
835 this.el = new Gtk.TreeViewColumn();
839 // set gobject values
840 this.el.title = "Last updated";
841 this.el.min_width = 50;
842 var child_0 = new Xcls_cr_last_updated( _this );
844 this.el.pack_start ( child_0.el , false );
848 this.el.add_attribute(_this.cr_last_updated.el , "markup", 3 );
851 // user defined functions
853 public class Xcls_cr_last_updated : Object
855 public Gtk.CellRendererText el;
856 private Clones _this;
862 public Xcls_cr_last_updated(Clones _owner )
865 _this.cr_last_updated = this;
866 this.el = new Gtk.CellRendererText();
870 // set gobject values
873 // user defined functions
877 public class Xcls_tv_all_branches : Object
879 public Gtk.TreeViewColumn el;
880 private Clones _this;
886 public Xcls_tv_all_branches(Clones _owner )
889 _this.tv_all_branches = this;
890 this.el = new Gtk.TreeViewColumn();
894 // set gobject values
895 this.el.title = "All Branches";
896 this.el.min_width = 50;
897 this.el.resizable = false;
898 var child_0 = new Xcls_cr_all_branches( _this );
900 this.el.pack_start ( child_0.el , false );
904 this.el.add_attribute(_this.cr_all_branches.el , "markup", 2 );
907 // user defined functions
909 public class Xcls_cr_all_branches : Object
911 public Gtk.CellRendererText el;
912 private Clones _this;
918 public Xcls_cr_all_branches(Clones _owner )
921 _this.cr_all_branches = this;
922 this.el = new Gtk.CellRendererText();
926 // set gobject values
929 // user defined functions
935 public class Xcls_ok_button : Object
937 public Gtk.Button el;
938 private Clones _this;
944 public Xcls_ok_button(Clones _owner )
947 _this.ok_button = this;
948 this.el = new Gtk.Button();
952 // set gobject values
953 this.el.label = "Close";
956 // user defined functions