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_tv_autopush tv_autopush;
20 public Xcls_ok_button ok_button;
28 this.el = new Gtk.Dialog();
33 this.el.title = "Manage Clones";
34 this.el.border_width = 3;
35 this.el.default_height = 500;
36 this.el.default_width = 600;
37 this.el.deletable = true;
39 var child_0 = new Xcls_Clones( _this );
41 this.el.get_content_area().add ( child_0.el );
42 var child_1 = new Xcls_ok_button( _this );
44 this.el.add_action_widget ( child_1.el , 1 );
47 this.el.delete_event.connect( (self, event) => {
52 this.el.response.connect( (self, response_id) => {
59 // user defined functions
63 this.el.set_deletable(false);
66 // this.get('/reposStore').load();
68 //this.get('/ok_button').el.set_sensitive(false);
70 // block until we return.
71 // var run_ret = this.el.run();
72 // if (run_ret < 1 ) {
75 // print("RUN RETURN : " + run_ret);
77 //print(JSON.stringify(this.get('bug').getValue()));
78 // return this.get('bug').getValue();
79 //this.success = c.success;
81 public class Xcls_Clones : Object
90 public Xcls_Clones(Clones _owner )
94 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
99 var child_0 = new Xcls_Box3( _this );
101 this.el.pack_start ( child_0.el , false,false,0 );
102 var child_1 = new Xcls_ScrolledWindow9( _this );
104 this.el.pack_end ( child_1.el , true,true,0 );
107 // user defined functions
109 public class Xcls_Box3 : Object
112 private Clones _this;
118 public Xcls_Box3(Clones _owner )
121 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
125 // set gobject values
126 var child_0 = new Xcls_Button4( _this );
128 this.el.add ( child_0.el );
129 var child_1 = new Xcls_Button5( _this );
131 this.el.add ( child_1.el );
132 var child_2 = new Xcls_Button6( _this );
134 this.el.add ( child_2.el );
135 var child_3 = new Xcls_Button7( _this );
137 this.el.add ( child_3.el );
138 var child_4 = new Xcls_Button8( _this );
140 this.el.add ( child_4.el );
143 // user defined functions
145 public class Xcls_Button4 : Object
147 public Gtk.Button el;
148 private Clones _this;
154 public Xcls_Button4(Clones _owner )
157 this.el = new Gtk.Button();
161 // set gobject values
162 this.el.label = "Remotes / Clones";
165 this.el.clicked.connect( () => {
167 /* var rv = this.get('/reposView');
168 var rs = this.get('/reposStore');
169 if (rv.el.get_selection().count_selected_rows() != 1) {
174 var Remotes = imports.Remotes.Remotes;
178 var s = rv.el.get_selection();
180 s.selected_foreach(function(model,p,iter) {
182 path = model.get_value(iter, 6).value.get_string();
187 rs.repos.forEach(function(r) {
188 if (r.repopath == path) {
195 Remotes.el.set_transient_for(Clones.el);
196 Clones.el.set_title("Manage Clones - " + repo.repopath);
198 Clones.el.set_title("Manage Clones");
210 // user defined functions
213 public class Xcls_Button5 : Object
215 public Gtk.Button el;
216 private Clones _this;
222 public Xcls_Button5(Clones _owner )
225 this.el = new Gtk.Button();
229 // set gobject values
230 this.el.label = "Branches";
233 this.el.clicked.connect( () => {
235 var rv = this.get('/reposView');
236 var rs = this.get('/reposStore');
237 if (rv.el.get_selection().count_selected_rows() != 1) {
242 var Branches = imports.Branches.Branches;
246 var s = rv.el.get_selection();
248 s.selected_foreach(function(model,p,iter) {
250 path = model.get_value(iter, 6).value.get_string();
255 rs.repos.forEach(function(r) {
256 if (r.repopath == path) {
262 Branches.repo = repo;
263 Branches.el.set_transient_for(Clones.el);
264 Clones.el.set_title("Manage Clones - " + repo.repopath);
266 Clones.el.set_title("Manage Clones");
279 // user defined functions
282 public class Xcls_Button6 : Object
284 public Gtk.Button el;
285 private Clones _this;
291 public Xcls_Button6(Clones _owner )
294 this.el = new Gtk.Button();
298 // set gobject values
299 this.el.label = "Merge";
302 this.el.clicked.connect( () => {
304 var rv = this.get('/reposView');
305 var rs = this.get('/reposStore');
306 if (rv.el.get_selection().count_selected_rows() != 1) {
311 var Merger = imports.Merger.Merger;
315 var s = rv.el.get_selection();
317 s.selected_foreach(function(model,p,iter) {
319 path = model.get_value(iter, 6).value.get_string();
324 rs.repos.forEach(function(r) {
325 if (r.repopath == path) {
332 Merger.el.set_transient_for(Clones.el);
333 Clones.el.set_title("Manage Clones - " + repo.repopath);
335 Clones.el.set_title("Manage Clones");
349 // user defined functions
352 public class Xcls_Button7 : Object
354 public Gtk.Button el;
355 private Clones _this;
361 public Xcls_Button7(Clones _owner )
364 this.el = new Gtk.Button();
368 // set gobject values
369 this.el.label = "Switch Branch";
372 this.el.clicked.connect( () => {
382 // user defined functions
385 public class Xcls_Button8 : Object
387 public Gtk.Button el;
388 private Clones _this;
394 public Xcls_Button8(Clones _owner )
397 this.el = new Gtk.Button();
401 // set gobject values
402 this.el.label = "Pull";
405 this.el.clicked.connect( () => {
415 // user defined functions
419 public class Xcls_ScrolledWindow9 : Object
421 public Gtk.ScrolledWindow el;
422 private Clones _this;
428 public Xcls_ScrolledWindow9(Clones _owner )
431 this.el = new Gtk.ScrolledWindow( null, null );
435 // set gobject values
436 this.el.shadow_type = Gtk.ShadowType.IN;
437 var child_0 = new Xcls_reposView( _this );
439 this.el.add ( child_0.el );
440 var child_1 = new Xcls_TreeView24( _this );
447 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
451 // user defined functions
453 public class Xcls_reposView : Object
455 public Gtk.TreeView el;
456 private Clones _this;
462 public Xcls_reposView(Clones _owner )
465 _this.reposView = this;
466 this.el = new Gtk.TreeView();
470 // set gobject values
471 var child_0 = new Xcls_reposStore( _this );
473 this.el.set_model ( child_0.el );
474 var child_1 = new Xcls_tv_autocommit( _this );
476 this.el.append_column ( child_1.el );
477 var child_2 = new Xcls_tv_autopush( _this );
479 this.el.append_column ( child_2.el );
480 var child_3 = new Xcls_TreeViewColumn16( _this );
482 this.el.append_column ( child_3.el );
483 var child_4 = new Xcls_TreeViewColumn18( _this );
485 this.el.append_column ( child_4.el );
486 var child_5 = new Xcls_TreeViewColumn20( _this );
488 this.el.append_column ( child_5.el );
489 var child_6 = new Xcls_TreeViewColumn22( _this );
491 this.el.append_column ( child_6.el );
496 var selection = this.el.get_selection();
497 selection.set_mode( Gtk.SelectionMode.SINGLE);
500 var description = new Pango.FontDescription();
501 description.set_size(10000);
502 this.el.override_font(description);
506 this.el.cursor_changed.connect( () => {
507 // SEE SELECTION.CHANGED
512 if (this.el.get_selection().count_selected_rows() < 1) {
513 //nothing? - clea it?
517 var model = this.get('/changedFilesStore');
519 var s = this.el.get_selection();
521 s.selected_foreach(function(model,p,iter) {
523 files.push( model.get_value(iter, 0).value.get_string());
526 this.get('/patchview').showDiff(files);
527 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
528 //print("OUT?" + value);// id..
529 // load the list in the right grid..
536 // user defined functions
538 public class Xcls_reposStore : Object
540 public Gtk.ListStore el;
541 private Clones _this;
547 public Xcls_reposStore(Clones _owner )
550 _this.reposStore = this;
551 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
552 typeof(string), // 1 current branch
553 typeof(string), // 2 all branch
554 typeof(string), // 3 updated
555 typeof(bool), // 4 auto commit
556 typeof(bool), // 5 auto push
557 typeof(string) // 7 repopath
558 typeof(string) // 8 color highlighting? );
562 // set gobject values
565 // user defined functions
568 public class Xcls_tv_autocommit : Object
570 public Gtk.TreeViewColumn el;
571 private Clones _this;
577 public Xcls_tv_autocommit(Clones _owner )
580 _this.tv_autocommit = this;
581 this.el = new Gtk.TreeViewColumn();
585 // set gobject values
586 this.el.title = "Auto Commit";
587 this.el.min_width = 50;
588 var child_0 = new Xcls_CellRendererToggle13( _this );
590 this.el.pack_start ( child_0.el , false );
594 // this.items[0].el.set_activatable(true);
595 this.el.add_attribute(_this.keyrender.el , "active", 4 );
598 // user defined functions
600 public class Xcls_CellRendererToggle13 : Object
602 public Gtk.CellRendererToggle el;
603 private Clones _this;
609 public Xcls_CellRendererToggle13(Clones _owner )
612 this.el = new Gtk.CellRendererToggle();
616 // set gobject values
617 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
620 this.el.toggled.connect( (self, path) => {
622 var store = this.get('/reposStore');
623 store.el.get_iter_from_string(ret, path);
625 var value = store.el.get_value(ret.iter,4).value.get_boolean();
627 //print(JSON.stringify(value));
628 store.el.set_value(ret.iter,4, !value);
630 var path = store.el.get_value(ret.iter, 6).value.get_string();
631 var repo = imports.Scm.Repo.Repo.get(path);
632 repo.autocommit(!value);
639 // user defined functions
643 public class Xcls_tv_autopush : Object
645 public Gtk.TreeViewColumn el;
646 private Clones _this;
652 public Xcls_tv_autopush(Clones _owner )
655 _this.tv_autopush = this;
656 this.el = new Gtk.TreeViewColumn();
660 // set gobject values
661 this.el.title = "Auto Push";
662 this.el.min_width = 50;
663 var child_0 = new Xcls_CellRendererToggle15( _this );
665 this.el.pack_start ( child_0.el );
669 this.el.add_attribute(this.items[0].el , 'active', 5 );
670 // this.items[0].el.set_activatable(true);
673 // user defined functions
675 public class Xcls_CellRendererToggle15 : Object
677 public Gtk.CellRendererToggle el;
678 private Clones _this;
684 public Xcls_CellRendererToggle15(Clones _owner )
687 this.el = new Gtk.CellRendererToggle();
691 // set gobject values
692 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
695 this.el.toggled.connect( function (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_TreeViewColumn16 : Object
717 public Gtk.TreeViewColumn el;
718 private Clones _this;
724 public Xcls_TreeViewColumn16(Clones _owner )
727 this.el = new Gtk.TreeViewColumn();
731 // set gobject values
732 this.el.title = "Repo";
733 this.el.min_width = 200;
734 this.el.resizable = true;
735 var child_0 = new Xcls_CellRendererText17( _this );
737 this.el.pack_start ( child_0.el );
742 XObject.prototype.init.call(this);
743 this.el.add_attribute(this.items[0].el , 'markup', 0 );
748 // user defined functions
750 public class Xcls_CellRendererText17 : Object
752 public Gtk.CellRendererText el;
753 private Clones _this;
759 public Xcls_CellRendererText17(Clones _owner )
762 this.el = new Gtk.CellRendererText();
766 // set gobject values
769 // user defined functions
773 public class Xcls_TreeViewColumn18 : Object
775 public Gtk.TreeViewColumn el;
776 private Clones _this;
782 public Xcls_TreeViewColumn18(Clones _owner )
785 this.el = new Gtk.TreeViewColumn();
789 // set gobject values
790 this.el.title = "Current Branch";
791 this.el.min_width = 50;
792 var child_0 = new Xcls_CellRendererText19( _this );
794 this.el.pack_start ( child_0.el );
799 XObject.prototype.init.call(this);
800 this.el.add_attribute(this.items[0].el , 'markup', 1 );
801 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
806 // user defined functions
808 public class Xcls_CellRendererText19 : Object
810 public Gtk.CellRendererText el;
811 private Clones _this;
817 public Xcls_CellRendererText19(Clones _owner )
820 this.el = new Gtk.CellRendererText();
824 // set gobject values
827 // user defined functions
831 public class Xcls_TreeViewColumn20 : Object
833 public Gtk.TreeViewColumn el;
834 private Clones _this;
840 public Xcls_TreeViewColumn20(Clones _owner )
843 this.el = new Gtk.TreeViewColumn();
847 // set gobject values
848 this.el.title = "Last updated";
849 this.el.min_width = 50;
850 var child_0 = new Xcls_CellRendererText21( _this );
852 this.el.pack_start ( child_0.el );
857 XObject.prototype.init.call(this);
858 this.el.add_attribute(this.items[0].el , 'markup', 3 );
863 // user defined functions
865 public class Xcls_CellRendererText21 : Object
867 public Gtk.CellRendererText el;
868 private Clones _this;
874 public Xcls_CellRendererText21(Clones _owner )
877 this.el = new Gtk.CellRendererText();
881 // set gobject values
884 // user defined functions
888 public class Xcls_TreeViewColumn22 : Object
890 public Gtk.TreeViewColumn el;
891 private Clones _this;
897 public Xcls_TreeViewColumn22(Clones _owner )
900 this.el = new Gtk.TreeViewColumn();
904 // set gobject values
905 this.el.title = "All Branches";
906 this.el.min_width = 50;
907 this.el.resizable = false;
908 var child_0 = new Xcls_CellRendererText23( _this );
910 this.el.pack_start ( child_0.el );
915 XObject.prototype.init.call(this);
916 this.el.add_attribute(this.items[0].el , 'markup', 2 );
921 // user defined functions
923 public class Xcls_CellRendererText23 : Object
925 public Gtk.CellRendererText el;
926 private Clones _this;
932 public Xcls_CellRendererText23(Clones _owner )
935 this.el = new Gtk.CellRendererText();
939 // set gobject values
942 // user defined functions
947 public class Xcls_TreeView24 : Object
949 public Gtk.TreeView el;
950 private Clones _this;
956 public Xcls_TreeView24(Clones _owner )
959 this.el = new Gtk.TreeView();
963 // set gobject values
964 var child_0 = new Xcls_ListStore25( _this );
968 // user defined functions
970 public class Xcls_ListStore25 : Object
972 public Gtk.ListStore el;
973 private Clones _this;
979 public Xcls_ListStore25(Clones _owner )
982 this.el = new Gtk.ListStore( 0, null );
986 // set gobject values
989 // user defined functions
995 public class Xcls_ok_button : Object
997 public Gtk.Button el;
998 private Clones _this;
1004 public Xcls_ok_button(Clones _owner )
1007 _this.ok_button = this;
1008 this.el = new Gtk.Button();
1012 // set gobject values
1013 this.el.label = "Close";
1016 // user defined functions