3 public class Clones : Object
8 public static Clones singleton()
10 if (_Clones == null) {
11 _Clones= new Clones();
15 public Xcls_Clones Clones;
16 public Xcls_reposView reposView;
17 public Xcls_reposStore reposStore;
18 public Xcls_tv_autocommit tv_autocommit;
19 public Xcls_cr_autocommit cr_autocommit;
20 public Xcls_tv_autopush tv_autopush;
21 public Xcls_cr_autopush cr_autopush;
22 public Xcls_tv_repo tv_repo;
23 public Xcls_cr_repo cr_repo;
24 public Xcls_tv_current_branch tv_current_branch;
25 public Xcls_tv_last_updated tv_last_updated;
26 public Xcls_tv_all_branches tv_all_branches;
27 public Xcls_ok_button ok_button;
35 this.el = new Gtk.Dialog();
40 this.el.title = "Manage Clones";
41 this.el.border_width = 3;
42 this.el.default_height = 500;
43 this.el.default_width = 600;
44 this.el.deletable = true;
46 var child_0 = new Xcls_Clones( _this );
48 this.el.get_content_area().add ( child_0.el );
49 var child_1 = new Xcls_ok_button( _this );
51 this.el.add_action_widget ( child_1.el , 1 );
54 this.el.delete_event.connect( (self, event) => {
59 this.el.response.connect( (self, response_id) => {
66 // user defined functions
70 this.el.set_deletable(false);
73 // this.get('/reposStore').load();
75 //this.get('/ok_button').el.set_sensitive(false);
77 // block until we return.
78 // var run_ret = this.el.run();
79 // if (run_ret < 1 ) {
82 // print("RUN RETURN : " + run_ret);
84 //print(JSON.stringify(this.get('bug').getValue()));
85 // return this.get('bug').getValue();
86 //this.success = c.success;
88 public class Xcls_Clones : Object
97 public Xcls_Clones(Clones _owner )
101 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
105 // set gobject values
106 var child_0 = new Xcls_Box3( _this );
108 this.el.pack_start ( child_0.el , false,false,0 );
109 var child_1 = new Xcls_ScrolledWindow9( _this );
111 this.el.pack_end ( child_1.el , true,true,0 );
114 // user defined functions
116 public class Xcls_Box3 : Object
119 private Clones _this;
125 public Xcls_Box3(Clones _owner )
128 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
132 // set gobject values
133 var child_0 = new Xcls_Button4( _this );
135 this.el.add ( child_0.el );
136 var child_1 = new Xcls_Button5( _this );
138 this.el.add ( child_1.el );
139 var child_2 = new Xcls_Button6( _this );
141 this.el.add ( child_2.el );
142 var child_3 = new Xcls_Button7( _this );
144 this.el.add ( child_3.el );
145 var child_4 = new Xcls_Button8( _this );
147 this.el.add ( child_4.el );
150 // user defined functions
152 public class Xcls_Button4 : Object
154 public Gtk.Button el;
155 private Clones _this;
161 public Xcls_Button4(Clones _owner )
164 this.el = new Gtk.Button();
168 // set gobject values
169 this.el.label = "Remotes / Clones";
172 this.el.clicked.connect( () => {
174 /* var rv = this.get('/reposView');
175 var rs = this.get('/reposStore');
176 if (rv.el.get_selection().count_selected_rows() != 1) {
181 var Remotes = imports.Remotes.Remotes;
185 var s = rv.el.get_selection();
187 s.selected_foreach(function(model,p,iter) {
189 path = model.get_value(iter, 6).value.get_string();
194 rs.repos.forEach(function(r) {
195 if (r.repopath == path) {
202 Remotes.el.set_transient_for(Clones.el);
203 Clones.el.set_title("Manage Clones - " + repo.repopath);
205 Clones.el.set_title("Manage Clones");
217 // user defined functions
220 public class Xcls_Button5 : Object
222 public Gtk.Button el;
223 private Clones _this;
229 public Xcls_Button5(Clones _owner )
232 this.el = new Gtk.Button();
236 // set gobject values
237 this.el.label = "Branches";
240 this.el.clicked.connect( () => {
242 var rv = this.get('/reposView');
243 var rs = this.get('/reposStore');
244 if (rv.el.get_selection().count_selected_rows() != 1) {
249 var Branches = imports.Branches.Branches;
253 var s = rv.el.get_selection();
255 s.selected_foreach(function(model,p,iter) {
257 path = model.get_value(iter, 6).value.get_string();
262 rs.repos.forEach(function(r) {
263 if (r.repopath == path) {
269 Branches.repo = repo;
270 Branches.el.set_transient_for(Clones.el);
271 Clones.el.set_title("Manage Clones - " + repo.repopath);
273 Clones.el.set_title("Manage Clones");
286 // user defined functions
289 public class Xcls_Button6 : Object
291 public Gtk.Button el;
292 private Clones _this;
298 public Xcls_Button6(Clones _owner )
301 this.el = new Gtk.Button();
305 // set gobject values
306 this.el.label = "Merge";
309 this.el.clicked.connect( () => {
311 var rv = this.get('/reposView');
312 var rs = this.get('/reposStore');
313 if (rv.el.get_selection().count_selected_rows() != 1) {
318 var Merger = imports.Merger.Merger;
322 var s = rv.el.get_selection();
324 s.selected_foreach(function(model,p,iter) {
326 path = model.get_value(iter, 6).value.get_string();
331 rs.repos.forEach(function(r) {
332 if (r.repopath == path) {
339 Merger.el.set_transient_for(Clones.el);
340 Clones.el.set_title("Manage Clones - " + repo.repopath);
342 Clones.el.set_title("Manage Clones");
356 // user defined functions
359 public class Xcls_Button7 : Object
361 public Gtk.Button el;
362 private Clones _this;
368 public Xcls_Button7(Clones _owner )
371 this.el = new Gtk.Button();
375 // set gobject values
376 this.el.label = "Switch Branch";
379 this.el.clicked.connect( () => {
389 // user defined functions
392 public class Xcls_Button8 : Object
394 public Gtk.Button el;
395 private Clones _this;
401 public Xcls_Button8(Clones _owner )
404 this.el = new Gtk.Button();
408 // set gobject values
409 this.el.label = "Pull";
412 this.el.clicked.connect( () => {
422 // user defined functions
426 public class Xcls_ScrolledWindow9 : Object
428 public Gtk.ScrolledWindow el;
429 private Clones _this;
435 public Xcls_ScrolledWindow9(Clones _owner )
438 this.el = new Gtk.ScrolledWindow( null, null );
442 // set gobject values
443 this.el.shadow_type = Gtk.ShadowType.IN;
444 var child_0 = new Xcls_reposView( _this );
446 this.el.add ( child_0.el );
447 var child_1 = new Xcls_TreeView24( _this );
454 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
458 // user defined functions
460 public class Xcls_reposView : Object
462 public Gtk.TreeView el;
463 private Clones _this;
469 public Xcls_reposView(Clones _owner )
472 _this.reposView = this;
473 this.el = new Gtk.TreeView();
477 // set gobject values
478 var child_0 = new Xcls_reposStore( _this );
480 this.el.set_model ( child_0.el );
481 var child_1 = new Xcls_tv_autocommit( _this );
483 this.el.append_column ( child_1.el );
484 var child_2 = new Xcls_tv_autopush( _this );
486 this.el.append_column ( child_2.el );
487 var child_3 = new Xcls_tv_repo( _this );
489 this.el.append_column ( child_3.el );
490 var child_4 = new Xcls_tv_current_branch( _this );
492 this.el.append_column ( child_4.el );
493 var child_5 = new Xcls_tv_last_updated( _this );
495 this.el.append_column ( child_5.el );
496 var child_6 = new Xcls_tv_all_branches( _this );
498 this.el.append_column ( child_6.el );
503 var selection = this.el.get_selection();
504 selection.set_mode( Gtk.SelectionMode.SINGLE);
507 var description = new Pango.FontDescription();
508 description.set_size(10000);
509 this.el.override_font(description);
513 this.el.cursor_changed.connect( () => {
514 // SEE SELECTION.CHANGED
519 if (this.el.get_selection().count_selected_rows() < 1) {
520 //nothing? - clea it?
524 var model = this.get('/changedFilesStore');
526 var s = this.el.get_selection();
528 s.selected_foreach(function(model,p,iter) {
530 files.push( model.get_value(iter, 0).value.get_string());
533 this.get('/patchview').showDiff(files);
534 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
535 //print("OUT?" + value);// id..
536 // load the list in the right grid..
543 // user defined functions
545 public class Xcls_reposStore : Object
547 public Gtk.ListStore el;
548 private Clones _this;
554 public Xcls_reposStore(Clones _owner )
557 _this.reposStore = this;
558 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
559 typeof(string), // 1 current branch
560 typeof(string), // 2 all branch
561 typeof(string), // 3 updated
562 typeof(bool), // 4 auto commit
563 typeof(bool), // 5 auto push
564 typeof(string) // 7 repopath
565 typeof(string) // 8 color highlighting? );
569 // set gobject values
572 // user defined functions
575 public class Xcls_tv_autocommit : Object
577 public Gtk.TreeViewColumn el;
578 private Clones _this;
584 public Xcls_tv_autocommit(Clones _owner )
587 _this.tv_autocommit = this;
588 this.el = new Gtk.TreeViewColumn();
592 // set gobject values
593 this.el.title = "Auto Commit";
594 this.el.min_width = 50;
595 var child_0 = new Xcls_cr_autocommit( _this );
597 this.el.pack_start ( child_0.el , false );
601 // this.items[0].el.set_activatable(true);
602 this.el.add_attribute(_this.keyrender.el , "active", 4 );
605 // user defined functions
607 public class Xcls_cr_autocommit : Object
609 public Gtk.CellRendererToggle el;
610 private Clones _this;
616 public Xcls_cr_autocommit(Clones _owner )
619 _this.cr_autocommit = this;
620 this.el = new Gtk.CellRendererToggle();
624 // set gobject values
625 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
628 this.el.toggled.connect( (self, path) => {
630 var store = this.get('/reposStore');
631 store.el.get_iter_from_string(ret, path);
633 var value = store.el.get_value(ret.iter,4).value.get_boolean();
635 //print(JSON.stringify(value));
636 store.el.set_value(ret.iter,4, !value);
638 var path = store.el.get_value(ret.iter, 6).value.get_string();
639 var repo = imports.Scm.Repo.Repo.get(path);
640 repo.autocommit(!value);
647 // user defined functions
651 public class Xcls_tv_autopush : Object
653 public Gtk.TreeViewColumn el;
654 private Clones _this;
660 public Xcls_tv_autopush(Clones _owner )
663 _this.tv_autopush = this;
664 this.el = new Gtk.TreeViewColumn();
668 // set gobject values
669 this.el.title = "Auto Push";
670 this.el.min_width = 50;
671 var child_0 = new Xcls_cr_autopush( _this );
673 this.el.pack_start ( child_0.el );
677 this.el.add_attribute(this.items[0].el , 'active', 5 );
678 // this.items[0].el.set_activatable(true);
681 // user defined functions
683 public class Xcls_cr_autopush : Object
685 public Gtk.CellRendererToggle el;
686 private Clones _this;
692 public Xcls_cr_autopush(Clones _owner )
695 _this.cr_autopush = this;
696 this.el = new Gtk.CellRendererToggle();
700 // set gobject values
701 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
704 this.el.toggled.connect( function (self, path) {
706 var store = this.get('/reposStore');
707 store.el.get_iter_from_string(ret, path);
709 var value = store.el.get_value(ret.iter,5).value.get_boolean();
711 //print(JSON.stringify(value));
712 store.el.set_value(ret.iter,5, !value);
713 var path = store.el.get_value(ret.iter, 6).value.get_string();
714 var repo = imports.Scm.Repo.Repo.get(path);
715 repo.autopush(!value);
720 // user defined functions
724 public class Xcls_tv_repo : Object
726 public Gtk.TreeViewColumn el;
727 private Clones _this;
733 public Xcls_tv_repo(Clones _owner )
736 _this.tv_repo = this;
737 this.el = new Gtk.TreeViewColumn();
741 // set gobject values
742 this.el.title = "Repo";
743 this.el.min_width = 200;
744 this.el.resizable = true;
745 var child_0 = new Xcls_cr_repo( _this );
747 this.el.pack_start ( child_0.el );
752 XObject.prototype.init.call(this);
753 this.el.add_attribute(this.items[0].el , 'markup', 0 );
758 // user defined functions
760 public class Xcls_cr_repo : Object
762 public Gtk.CellRendererText el;
763 private Clones _this;
769 public Xcls_cr_repo(Clones _owner )
772 _this.cr_repo = this;
773 this.el = new Gtk.CellRendererText();
777 // set gobject values
780 // user defined functions
784 public class Xcls_tv_current_branch : Object
786 public Gtk.TreeViewColumn el;
787 private Clones _this;
793 public Xcls_tv_current_branch(Clones _owner )
796 _this.tv_current_branch = this;
797 this.el = new Gtk.TreeViewColumn();
801 // set gobject values
802 this.el.title = "Current Branch";
803 this.el.min_width = 50;
804 var child_0 = new Xcls_CellRendererText19( _this );
806 this.el.pack_start ( child_0.el );
811 XObject.prototype.init.call(this);
812 this.el.add_attribute(this.items[0].el , 'markup', 1 );
813 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
818 // user defined functions
820 public class Xcls_CellRendererText19 : Object
822 public Gtk.CellRendererText el;
823 private Clones _this;
829 public Xcls_CellRendererText19(Clones _owner )
832 this.el = new Gtk.CellRendererText();
836 // set gobject values
839 // user defined functions
843 public class Xcls_tv_last_updated : Object
845 public Gtk.TreeViewColumn el;
846 private Clones _this;
852 public Xcls_tv_last_updated(Clones _owner )
855 _this.tv_last_updated = this;
856 this.el = new Gtk.TreeViewColumn();
860 // set gobject values
861 this.el.title = "Last updated";
862 this.el.min_width = 50;
863 var child_0 = new Xcls_CellRendererText21( _this );
865 this.el.pack_start ( child_0.el );
870 XObject.prototype.init.call(this);
871 this.el.add_attribute(this.items[0].el , 'markup', 3 );
876 // user defined functions
878 public class Xcls_CellRendererText21 : Object
880 public Gtk.CellRendererText el;
881 private Clones _this;
887 public Xcls_CellRendererText21(Clones _owner )
890 this.el = new Gtk.CellRendererText();
894 // set gobject values
897 // user defined functions
901 public class Xcls_tv_all_branches : Object
903 public Gtk.TreeViewColumn el;
904 private Clones _this;
910 public Xcls_tv_all_branches(Clones _owner )
913 _this.tv_all_branches = this;
914 this.el = new Gtk.TreeViewColumn();
918 // set gobject values
919 this.el.title = "All Branches";
920 this.el.min_width = 50;
921 this.el.resizable = false;
922 var child_0 = new Xcls_CellRendererText23( _this );
924 this.el.pack_start ( child_0.el );
929 XObject.prototype.init.call(this);
930 this.el.add_attribute(this.items[0].el , 'markup', 2 );
935 // user defined functions
937 public class Xcls_CellRendererText23 : Object
939 public Gtk.CellRendererText el;
940 private Clones _this;
946 public Xcls_CellRendererText23(Clones _owner )
949 this.el = new Gtk.CellRendererText();
953 // set gobject values
956 // user defined functions
961 public class Xcls_TreeView24 : Object
963 public Gtk.TreeView el;
964 private Clones _this;
970 public Xcls_TreeView24(Clones _owner )
973 this.el = new Gtk.TreeView();
977 // set gobject values
978 var child_0 = new Xcls_ListStore25( _this );
982 // user defined functions
984 public class Xcls_ListStore25 : Object
986 public Gtk.ListStore el;
987 private Clones _this;
993 public Xcls_ListStore25(Clones _owner )
996 this.el = new Gtk.ListStore( 0, null );
1000 // set gobject values
1003 // user defined functions
1009 public class Xcls_ok_button : Object
1011 public Gtk.Button el;
1012 private Clones _this;
1018 public Xcls_ok_button(Clones _owner )
1021 _this.ok_button = this;
1022 this.el = new Gtk.Button();
1026 // set gobject values
1027 this.el.label = "Close";
1030 // user defined functions