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) {
55 //console.log('show all');
56 this.el.set_modal(false);
59 this.el.set_position(Gtk.PositionType.TOP);
63 this.el.set_size_request(800,500);
64 this.el.set_relative_to(menuitem);
65 //this.view.el.grab_focus();
67 public class Xcls_Box2 : Object
76 public Xcls_Box2(Clones _owner )
79 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
84 var child_0 = new Xcls_Box3( _this );
86 this.el.pack_start ( child_0.el , false,false,0 );
87 var child_1 = new Xcls_ScrolledWindow9( _this );
89 this.el.add ( child_1.el );
90 var child_2 = new Xcls_ok_button( _this );
92 this.el.add ( child_2.el );
95 // user defined functions
97 public class Xcls_Box3 : Object
100 private Clones _this;
106 public Xcls_Box3(Clones _owner )
109 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
113 // set gobject values
114 var child_0 = new Xcls_Button4( _this );
116 this.el.add ( child_0.el );
117 var child_1 = new Xcls_Button5( _this );
119 this.el.add ( child_1.el );
120 var child_2 = new Xcls_Button6( _this );
122 this.el.add ( child_2.el );
123 var child_3 = new Xcls_Button7( _this );
125 this.el.add ( child_3.el );
126 var child_4 = new Xcls_Button8( _this );
128 this.el.add ( child_4.el );
131 // user defined functions
133 public class Xcls_Button4 : Object
135 public Gtk.Button el;
136 private Clones _this;
142 public Xcls_Button4(Clones _owner )
145 this.el = new Gtk.Button();
149 // set gobject values
150 this.el.label = "Remotes / Clones";
153 this.el.clicked.connect( () => {
155 /* var rv = this.get('/reposView');
156 var rs = this.get('/reposStore');
157 if (rv.el.get_selection().count_selected_rows() != 1) {
162 var Remotes = imports.Remotes.Remotes;
166 var s = rv.el.get_selection();
168 s.selected_foreach(function(model,p,iter) {
170 path = model.get_value(iter, 6).value.get_string();
175 rs.repos.forEach(function(r) {
176 if (r.repopath == path) {
183 Remotes.el.set_transient_for(Clones.el);
184 Clones.el.set_title("Manage Clones - " + repo.repopath);
186 Clones.el.set_title("Manage Clones");
198 // user defined functions
201 public class Xcls_Button5 : Object
203 public Gtk.Button el;
204 private Clones _this;
210 public Xcls_Button5(Clones _owner )
213 this.el = new Gtk.Button();
217 // set gobject values
218 this.el.label = "Branches";
221 this.el.clicked.connect( () => {
223 var rv = this.get('/reposView');
224 var rs = this.get('/reposStore');
225 if (rv.el.get_selection().count_selected_rows() != 1) {
230 var Branches = imports.Branches.Branches;
234 var s = rv.el.get_selection();
236 s.selected_foreach(function(model,p,iter) {
238 path = model.get_value(iter, 6).value.get_string();
243 rs.repos.forEach(function(r) {
244 if (r.repopath == path) {
250 Branches.repo = repo;
251 Branches.el.set_transient_for(Clones.el);
252 Clones.el.set_title("Manage Clones - " + repo.repopath);
254 Clones.el.set_title("Manage Clones");
267 // user defined functions
270 public class Xcls_Button6 : Object
272 public Gtk.Button el;
273 private Clones _this;
279 public Xcls_Button6(Clones _owner )
282 this.el = new Gtk.Button();
286 // set gobject values
287 this.el.label = "Merge";
290 this.el.clicked.connect( () => {
292 var rv = this.get('/reposView');
293 var rs = this.get('/reposStore');
294 if (rv.el.get_selection().count_selected_rows() != 1) {
299 var Merger = imports.Merger.Merger;
303 var s = rv.el.get_selection();
305 s.selected_foreach(function(model,p,iter) {
307 path = model.get_value(iter, 6).value.get_string();
312 rs.repos.forEach(function(r) {
313 if (r.repopath == path) {
320 Merger.el.set_transient_for(Clones.el);
321 Clones.el.set_title("Manage Clones - " + repo.repopath);
323 Clones.el.set_title("Manage Clones");
337 // user defined functions
340 public class Xcls_Button7 : Object
342 public Gtk.Button el;
343 private Clones _this;
349 public Xcls_Button7(Clones _owner )
352 this.el = new Gtk.Button();
356 // set gobject values
357 this.el.label = "Switch Branch";
360 this.el.clicked.connect( () => {
370 // user defined functions
373 public class Xcls_Button8 : Object
375 public Gtk.Button el;
376 private Clones _this;
382 public Xcls_Button8(Clones _owner )
385 this.el = new Gtk.Button();
389 // set gobject values
390 this.el.label = "Pull";
393 this.el.clicked.connect( () => {
403 // user defined functions
407 public class Xcls_ScrolledWindow9 : Object
409 public Gtk.ScrolledWindow el;
410 private Clones _this;
416 public Xcls_ScrolledWindow9(Clones _owner )
419 this.el = new Gtk.ScrolledWindow( null, null );
423 // set gobject values
424 this.el.expand = true;
425 this.el.shadow_type = Gtk.ShadowType.IN;
426 var child_0 = new Xcls_reposView( _this );
428 this.el.add ( child_0.el );
434 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
438 // user defined functions
440 public class Xcls_reposView : Object
442 public Gtk.TreeView el;
443 private Clones _this;
449 public Xcls_reposView(Clones _owner )
452 _this.reposView = this;
453 this.el = new Gtk.TreeView();
457 // set gobject values
458 var child_0 = new Xcls_reposStore( _this );
460 this.el.set_model ( child_0.el );
461 var child_1 = new Xcls_tv_autocommit( _this );
463 this.el.append_column ( child_1.el );
464 var child_2 = new Xcls_tv_autopush( _this );
466 this.el.append_column ( child_2.el );
467 var child_3 = new Xcls_tv_repo( _this );
469 this.el.append_column ( child_3.el );
470 var child_4 = new Xcls_tv_current_branch( _this );
472 this.el.append_column ( child_4.el );
473 var child_5 = new Xcls_tv_last_updated( _this );
475 this.el.append_column ( child_5.el );
476 var child_6 = new Xcls_tv_all_branches( _this );
478 this.el.append_column ( child_6.el );
483 var selection = this.el.get_selection();
484 selection.set_mode( Gtk.SelectionMode.SINGLE);
487 var description = new Pango.FontDescription();
488 description.set_size(10000);
489 this.el.override_font(description);
493 this.el.cursor_changed.connect( () => {
494 // SEE SELECTION.CHANGED
499 if (this.el.get_selection().count_selected_rows() < 1) {
500 //nothing? - clea it?
504 var model = this.get('/changedFilesStore');
506 var s = this.el.get_selection();
508 s.selected_foreach(function(model,p,iter) {
510 files.push( model.get_value(iter, 0).value.get_string());
513 this.get('/patchview').showDiff(files);
514 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
515 //print("OUT?" + value);// id..
516 // load the list in the right grid..
523 // user defined functions
525 public class Xcls_reposStore : Object
527 public Gtk.ListStore el;
528 private Clones _this;
534 public Xcls_reposStore(Clones _owner )
537 _this.reposStore = this;
538 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
539 typeof(string), // 1 current branch
540 typeof(string), // 2 all branch
541 typeof(string), // 3 updated
542 typeof(bool), // 4 auto commit
543 typeof(bool), // 5 auto push
544 typeof(string), // 7 repopath
545 typeof(string) // 8 color highlighting?
550 // set gobject values
553 // user defined functions
556 public class Xcls_tv_autocommit : Object
558 public Gtk.TreeViewColumn el;
559 private Clones _this;
565 public Xcls_tv_autocommit(Clones _owner )
568 _this.tv_autocommit = this;
569 this.el = new Gtk.TreeViewColumn();
573 // set gobject values
574 this.el.title = "Auto Commit";
575 this.el.min_width = 50;
576 var child_0 = new Xcls_cr_autocommit( _this );
578 this.el.pack_start ( child_0.el , false );
582 // this.items[0].el.set_activatable(true);
583 this.el.add_attribute(_this.cr_autocommit.el , "active", 4 );
586 // user defined functions
588 public class Xcls_cr_autocommit : Object
590 public Gtk.CellRendererToggle el;
591 private Clones _this;
597 public Xcls_cr_autocommit(Clones _owner )
600 _this.cr_autocommit = this;
601 this.el = new Gtk.CellRendererToggle();
605 // set gobject values
606 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
609 this.el.toggled.connect( (self, path) => {
611 var store = this.get('/reposStore');
612 store.el.get_iter_from_string(ret, path);
614 var value = store.el.get_value(ret.iter,4).value.get_boolean();
616 //print(JSON.stringify(value));
617 store.el.set_value(ret.iter,4, !value);
619 var path = store.el.get_value(ret.iter, 6).value.get_string();
620 var repo = imports.Scm.Repo.Repo.get(path);
621 repo.autocommit(!value);
628 // user defined functions
632 public class Xcls_tv_autopush : Object
634 public Gtk.TreeViewColumn el;
635 private Clones _this;
641 public Xcls_tv_autopush(Clones _owner )
644 _this.tv_autopush = this;
645 this.el = new Gtk.TreeViewColumn();
649 // set gobject values
650 this.el.title = "Auto Push";
651 this.el.min_width = 50;
652 var child_0 = new Xcls_cr_autopush( _this );
654 this.el.pack_start ( child_0.el , false );
658 this.el.add_attribute(_this.cr_autopush.el , "active", 5 );
659 // this.items[0].el.set_activatable(true);
662 // user defined functions
664 public class Xcls_cr_autopush : Object
666 public Gtk.CellRendererToggle el;
667 private Clones _this;
673 public Xcls_cr_autopush(Clones _owner )
676 _this.cr_autopush = this;
677 this.el = new Gtk.CellRendererToggle();
681 // set gobject values
682 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
685 this.el.toggled.connect( (self, path) => {
687 var store = this.get('/reposStore');
688 store.el.get_iter_from_string(ret, path);
690 var value = store.el.get_value(ret.iter,5).value.get_boolean();
692 //print(JSON.stringify(value));
693 store.el.set_value(ret.iter,5, !value);
694 var path = store.el.get_value(ret.iter, 6).value.get_string();
695 var repo = imports.Scm.Repo.Repo.get(path);
696 repo.autopush(!value);
701 // user defined functions
705 public class Xcls_tv_repo : Object
707 public Gtk.TreeViewColumn el;
708 private Clones _this;
714 public Xcls_tv_repo(Clones _owner )
717 _this.tv_repo = this;
718 this.el = new Gtk.TreeViewColumn();
722 // set gobject values
723 this.el.title = "Repo";
724 this.el.min_width = 200;
725 this.el.resizable = true;
726 var child_0 = new Xcls_cr_repo( _this );
728 this.el.pack_start ( child_0.el , false );
732 this.el.add_attribute(_this.cr_repo.el , "markup", 0 );
735 // user defined functions
737 public class Xcls_cr_repo : Object
739 public Gtk.CellRendererText el;
740 private Clones _this;
746 public Xcls_cr_repo(Clones _owner )
749 _this.cr_repo = this;
750 this.el = new Gtk.CellRendererText();
754 // set gobject values
757 // user defined functions
761 public class Xcls_tv_current_branch : Object
763 public Gtk.TreeViewColumn el;
764 private Clones _this;
770 public Xcls_tv_current_branch(Clones _owner )
773 _this.tv_current_branch = this;
774 this.el = new Gtk.TreeViewColumn();
778 // set gobject values
779 this.el.title = "Current Branch";
780 this.el.min_width = 50;
781 var child_0 = new Xcls_cr_current_branch( _this );
783 this.el.pack_start ( child_0.el , false );
787 this.el.add_attribute(_this.cr_current_branch.el , "markup", 1 );
788 this.el.add_attribute(_this.cr_current_branch.el, "cell-background", 7 );
791 // user defined functions
793 public class Xcls_cr_current_branch : Object
795 public Gtk.CellRendererText el;
796 private Clones _this;
802 public Xcls_cr_current_branch(Clones _owner )
805 _this.cr_current_branch = this;
806 this.el = new Gtk.CellRendererText();
810 // set gobject values
813 // user defined functions
817 public class Xcls_tv_last_updated : Object
819 public Gtk.TreeViewColumn el;
820 private Clones _this;
826 public Xcls_tv_last_updated(Clones _owner )
829 _this.tv_last_updated = this;
830 this.el = new Gtk.TreeViewColumn();
834 // set gobject values
835 this.el.title = "Last updated";
836 this.el.min_width = 50;
837 var child_0 = new Xcls_cr_last_updated( _this );
839 this.el.pack_start ( child_0.el , false );
843 this.el.add_attribute(_this.cr_last_updated.el , "markup", 3 );
846 // user defined functions
848 public class Xcls_cr_last_updated : Object
850 public Gtk.CellRendererText el;
851 private Clones _this;
857 public Xcls_cr_last_updated(Clones _owner )
860 _this.cr_last_updated = this;
861 this.el = new Gtk.CellRendererText();
865 // set gobject values
868 // user defined functions
872 public class Xcls_tv_all_branches : Object
874 public Gtk.TreeViewColumn el;
875 private Clones _this;
881 public Xcls_tv_all_branches(Clones _owner )
884 _this.tv_all_branches = this;
885 this.el = new Gtk.TreeViewColumn();
889 // set gobject values
890 this.el.title = "All Branches";
891 this.el.min_width = 50;
892 this.el.resizable = false;
893 var child_0 = new Xcls_cr_all_branches( _this );
895 this.el.pack_start ( child_0.el , false );
899 this.el.add_attribute(_this.cr_all_branches.el , "markup", 2 );
902 // user defined functions
904 public class Xcls_cr_all_branches : Object
906 public Gtk.CellRendererText el;
907 private Clones _this;
913 public Xcls_cr_all_branches(Clones _owner )
916 _this.cr_all_branches = this;
917 this.el = new Gtk.CellRendererText();
921 // set gobject values
924 // user defined functions
930 public class Xcls_ok_button : Object
932 public Gtk.Button el;
933 private Clones _this;
939 public Xcls_ok_button(Clones _owner )
942 _this.ok_button = this;
943 this.el = new Gtk.Button();
947 // set gobject values
948 this.el.label = "Close";
951 // user defined functions