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) {
57 statusicon.get_geometry( out s, out r, out o);
60 this.el.set_relative_to( null );
61 this.el.set_pointing_to( r);
62 this.el.set_position(Gtk.PositionType.BOTTOM);
65 //console.log('show all');
66 this.el.set_modal(true);
73 this.el.set_size_request(800,500);
75 //this.view.el.grab_focus();
77 public class Xcls_Box2 : Object
86 public Xcls_Box2(Clones _owner )
89 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
94 var child_0 = new Xcls_Box3( _this );
96 this.el.pack_start ( child_0.el , false,false,0 );
97 var child_1 = new Xcls_ScrolledWindow9( _this );
99 this.el.add ( child_1.el );
100 var child_2 = new Xcls_ok_button( _this );
102 this.el.add ( child_2.el );
105 // user defined functions
107 public class Xcls_Box3 : Object
110 private Clones _this;
116 public Xcls_Box3(Clones _owner )
119 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
123 // set gobject values
124 var child_0 = new Xcls_Button4( _this );
126 this.el.add ( child_0.el );
127 var child_1 = new Xcls_Button5( _this );
129 this.el.add ( child_1.el );
130 var child_2 = new Xcls_Button6( _this );
132 this.el.add ( child_2.el );
133 var child_3 = new Xcls_Button7( _this );
135 this.el.add ( child_3.el );
136 var child_4 = new Xcls_Button8( _this );
138 this.el.add ( child_4.el );
141 // user defined functions
143 public class Xcls_Button4 : Object
145 public Gtk.Button el;
146 private Clones _this;
152 public Xcls_Button4(Clones _owner )
155 this.el = new Gtk.Button();
159 // set gobject values
160 this.el.label = "Remotes / Clones";
163 this.el.clicked.connect( () => {
165 /* var rv = this.get('/reposView');
166 var rs = this.get('/reposStore');
167 if (rv.el.get_selection().count_selected_rows() != 1) {
172 var Remotes = imports.Remotes.Remotes;
176 var s = rv.el.get_selection();
178 s.selected_foreach(function(model,p,iter) {
180 path = model.get_value(iter, 6).value.get_string();
185 rs.repos.forEach(function(r) {
186 if (r.repopath == path) {
193 Remotes.el.set_transient_for(Clones.el);
194 Clones.el.set_title("Manage Clones - " + repo.repopath);
196 Clones.el.set_title("Manage Clones");
208 // user defined functions
211 public class Xcls_Button5 : Object
213 public Gtk.Button el;
214 private Clones _this;
220 public Xcls_Button5(Clones _owner )
223 this.el = new Gtk.Button();
227 // set gobject values
228 this.el.label = "Branches";
231 this.el.clicked.connect( () => {
233 var rv = this.get('/reposView');
234 var rs = this.get('/reposStore');
235 if (rv.el.get_selection().count_selected_rows() != 1) {
240 var Branches = imports.Branches.Branches;
244 var s = rv.el.get_selection();
246 s.selected_foreach(function(model,p,iter) {
248 path = model.get_value(iter, 6).value.get_string();
253 rs.repos.forEach(function(r) {
254 if (r.repopath == path) {
260 Branches.repo = repo;
261 Branches.el.set_transient_for(Clones.el);
262 Clones.el.set_title("Manage Clones - " + repo.repopath);
264 Clones.el.set_title("Manage Clones");
277 // user defined functions
280 public class Xcls_Button6 : Object
282 public Gtk.Button el;
283 private Clones _this;
289 public Xcls_Button6(Clones _owner )
292 this.el = new Gtk.Button();
296 // set gobject values
297 this.el.label = "Merge";
300 this.el.clicked.connect( () => {
302 var rv = this.get('/reposView');
303 var rs = this.get('/reposStore');
304 if (rv.el.get_selection().count_selected_rows() != 1) {
309 var Merger = imports.Merger.Merger;
313 var s = rv.el.get_selection();
315 s.selected_foreach(function(model,p,iter) {
317 path = model.get_value(iter, 6).value.get_string();
322 rs.repos.forEach(function(r) {
323 if (r.repopath == path) {
330 Merger.el.set_transient_for(Clones.el);
331 Clones.el.set_title("Manage Clones - " + repo.repopath);
333 Clones.el.set_title("Manage Clones");
347 // user defined functions
350 public class Xcls_Button7 : Object
352 public Gtk.Button el;
353 private Clones _this;
359 public Xcls_Button7(Clones _owner )
362 this.el = new Gtk.Button();
366 // set gobject values
367 this.el.label = "Switch Branch";
370 this.el.clicked.connect( () => {
380 // user defined functions
383 public class Xcls_Button8 : Object
385 public Gtk.Button el;
386 private Clones _this;
392 public Xcls_Button8(Clones _owner )
395 this.el = new Gtk.Button();
399 // set gobject values
400 this.el.label = "Pull";
403 this.el.clicked.connect( () => {
413 // user defined functions
417 public class Xcls_ScrolledWindow9 : Object
419 public Gtk.ScrolledWindow el;
420 private Clones _this;
426 public Xcls_ScrolledWindow9(Clones _owner )
429 this.el = new Gtk.ScrolledWindow( null, null );
433 // set gobject values
434 this.el.expand = true;
435 this.el.shadow_type = Gtk.ShadowType.IN;
436 var child_0 = new Xcls_reposView( _this );
438 this.el.add ( child_0.el );
444 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
448 // user defined functions
450 public class Xcls_reposView : Object
452 public Gtk.TreeView el;
453 private Clones _this;
459 public Xcls_reposView(Clones _owner )
462 _this.reposView = this;
463 this.el = new Gtk.TreeView();
467 // set gobject values
468 var child_0 = new Xcls_reposStore( _this );
470 this.el.set_model ( child_0.el );
471 var child_1 = new Xcls_tv_autocommit( _this );
473 this.el.append_column ( child_1.el );
474 var child_2 = new Xcls_tv_autopush( _this );
476 this.el.append_column ( child_2.el );
477 var child_3 = new Xcls_tv_repo( _this );
479 this.el.append_column ( child_3.el );
480 var child_4 = new Xcls_tv_current_branch( _this );
482 this.el.append_column ( child_4.el );
483 var child_5 = new Xcls_tv_last_updated( _this );
485 this.el.append_column ( child_5.el );
486 var child_6 = new Xcls_tv_all_branches( _this );
488 this.el.append_column ( child_6.el );
493 var selection = this.el.get_selection();
494 selection.set_mode( Gtk.SelectionMode.SINGLE);
497 var description = new Pango.FontDescription();
498 description.set_size(10000);
499 this.el.override_font(description);
503 this.el.cursor_changed.connect( () => {
504 // SEE SELECTION.CHANGED
509 if (this.el.get_selection().count_selected_rows() < 1) {
510 //nothing? - clea it?
514 var model = this.get('/changedFilesStore');
516 var s = this.el.get_selection();
518 s.selected_foreach(function(model,p,iter) {
520 files.push( model.get_value(iter, 0).value.get_string());
523 this.get('/patchview').showDiff(files);
524 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
525 //print("OUT?" + value);// id..
526 // load the list in the right grid..
533 // user defined functions
535 public class Xcls_reposStore : Object
537 public Gtk.ListStore el;
538 private Clones _this;
544 public Xcls_reposStore(Clones _owner )
547 _this.reposStore = this;
548 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
549 typeof(string), // 1 current branch
550 typeof(string), // 2 all branch
551 typeof(string), // 3 updated
552 typeof(bool), // 4 auto commit
553 typeof(bool), // 5 auto push
554 typeof(string), // 7 repopath
555 typeof(string) // 8 color highlighting?
560 // set gobject values
563 // user defined functions
566 public class Xcls_tv_autocommit : Object
568 public Gtk.TreeViewColumn el;
569 private Clones _this;
575 public Xcls_tv_autocommit(Clones _owner )
578 _this.tv_autocommit = this;
579 this.el = new Gtk.TreeViewColumn();
583 // set gobject values
584 this.el.title = "Auto Commit";
585 this.el.min_width = 50;
586 var child_0 = new Xcls_cr_autocommit( _this );
588 this.el.pack_start ( child_0.el , false );
592 // this.items[0].el.set_activatable(true);
593 this.el.add_attribute(_this.cr_autocommit.el , "active", 4 );
596 // user defined functions
598 public class Xcls_cr_autocommit : Object
600 public Gtk.CellRendererToggle el;
601 private Clones _this;
607 public Xcls_cr_autocommit(Clones _owner )
610 _this.cr_autocommit = this;
611 this.el = new Gtk.CellRendererToggle();
615 // set gobject values
616 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
619 this.el.toggled.connect( (self, path) => {
621 var store = this.get('/reposStore');
622 store.el.get_iter_from_string(ret, path);
624 var value = store.el.get_value(ret.iter,4).value.get_boolean();
626 //print(JSON.stringify(value));
627 store.el.set_value(ret.iter,4, !value);
629 var path = store.el.get_value(ret.iter, 6).value.get_string();
630 var repo = imports.Scm.Repo.Repo.get(path);
631 repo.autocommit(!value);
638 // user defined functions
642 public class Xcls_tv_autopush : Object
644 public Gtk.TreeViewColumn el;
645 private Clones _this;
651 public Xcls_tv_autopush(Clones _owner )
654 _this.tv_autopush = this;
655 this.el = new Gtk.TreeViewColumn();
659 // set gobject values
660 this.el.title = "Auto Push";
661 this.el.min_width = 50;
662 var child_0 = new Xcls_cr_autopush( _this );
664 this.el.pack_start ( child_0.el , false );
668 this.el.add_attribute(_this.cr_autopush.el , "active", 5 );
669 // this.items[0].el.set_activatable(true);
672 // user defined functions
674 public class Xcls_cr_autopush : Object
676 public Gtk.CellRendererToggle el;
677 private Clones _this;
683 public Xcls_cr_autopush(Clones _owner )
686 _this.cr_autopush = this;
687 this.el = new Gtk.CellRendererToggle();
691 // set gobject values
692 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
695 this.el.toggled.connect( (self, path) => {
697 var store = this.get('/reposStore');
698 store.el.get_iter_from_string(ret, path);
700 var value = store.el.get_value(ret.iter,5).value.get_boolean();
702 //print(JSON.stringify(value));
703 store.el.set_value(ret.iter,5, !value);
704 var path = store.el.get_value(ret.iter, 6).value.get_string();
705 var repo = imports.Scm.Repo.Repo.get(path);
706 repo.autopush(!value);
711 // user defined functions
715 public class Xcls_tv_repo : Object
717 public Gtk.TreeViewColumn el;
718 private Clones _this;
724 public Xcls_tv_repo(Clones _owner )
727 _this.tv_repo = this;
728 this.el = new Gtk.TreeViewColumn();
732 // set gobject values
733 this.el.title = "Repo";
734 this.el.min_width = 200;
735 this.el.resizable = true;
736 var child_0 = new Xcls_cr_repo( _this );
738 this.el.pack_start ( child_0.el , false );
742 this.el.add_attribute(_this.cr_repo.el , "markup", 0 );
745 // user defined functions
747 public class Xcls_cr_repo : Object
749 public Gtk.CellRendererText el;
750 private Clones _this;
756 public Xcls_cr_repo(Clones _owner )
759 _this.cr_repo = this;
760 this.el = new Gtk.CellRendererText();
764 // set gobject values
767 // user defined functions
771 public class Xcls_tv_current_branch : Object
773 public Gtk.TreeViewColumn el;
774 private Clones _this;
780 public Xcls_tv_current_branch(Clones _owner )
783 _this.tv_current_branch = this;
784 this.el = new Gtk.TreeViewColumn();
788 // set gobject values
789 this.el.title = "Current Branch";
790 this.el.min_width = 50;
791 var child_0 = new Xcls_cr_current_branch( _this );
793 this.el.pack_start ( child_0.el , false );
797 this.el.add_attribute(_this.cr_current_branch.el , "markup", 1 );
798 this.el.add_attribute(_this.cr_current_branch.el, "cell-background", 7 );
801 // user defined functions
803 public class Xcls_cr_current_branch : Object
805 public Gtk.CellRendererText el;
806 private Clones _this;
812 public Xcls_cr_current_branch(Clones _owner )
815 _this.cr_current_branch = this;
816 this.el = new Gtk.CellRendererText();
820 // set gobject values
823 // user defined functions
827 public class Xcls_tv_last_updated : Object
829 public Gtk.TreeViewColumn el;
830 private Clones _this;
836 public Xcls_tv_last_updated(Clones _owner )
839 _this.tv_last_updated = this;
840 this.el = new Gtk.TreeViewColumn();
844 // set gobject values
845 this.el.title = "Last updated";
846 this.el.min_width = 50;
847 var child_0 = new Xcls_cr_last_updated( _this );
849 this.el.pack_start ( child_0.el , false );
853 this.el.add_attribute(_this.cr_last_updated.el , "markup", 3 );
856 // user defined functions
858 public class Xcls_cr_last_updated : Object
860 public Gtk.CellRendererText el;
861 private Clones _this;
867 public Xcls_cr_last_updated(Clones _owner )
870 _this.cr_last_updated = this;
871 this.el = new Gtk.CellRendererText();
875 // set gobject values
878 // user defined functions
882 public class Xcls_tv_all_branches : Object
884 public Gtk.TreeViewColumn el;
885 private Clones _this;
891 public Xcls_tv_all_branches(Clones _owner )
894 _this.tv_all_branches = this;
895 this.el = new Gtk.TreeViewColumn();
899 // set gobject values
900 this.el.title = "All Branches";
901 this.el.min_width = 50;
902 this.el.resizable = false;
903 var child_0 = new Xcls_cr_all_branches( _this );
905 this.el.pack_start ( child_0.el , false );
909 this.el.add_attribute(_this.cr_all_branches.el , "markup", 2 );
912 // user defined functions
914 public class Xcls_cr_all_branches : Object
916 public Gtk.CellRendererText el;
917 private Clones _this;
923 public Xcls_cr_all_branches(Clones _owner )
926 _this.cr_all_branches = this;
927 this.el = new Gtk.CellRendererText();
931 // set gobject values
934 // user defined functions
940 public class Xcls_ok_button : Object
942 public Gtk.Button el;
943 private Clones _this;
949 public Xcls_ok_button(Clones _owner )
952 _this.ok_button = this;
953 this.el = new Gtk.Button();
957 // set gobject values
958 this.el.label = "Close";
961 // user defined functions