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_tv_repo tv_repo;
21 public Xcls_ok_button ok_button;
29 this.el = new Gtk.Dialog();
34 this.el.title = "Manage Clones";
35 this.el.border_width = 3;
36 this.el.default_height = 500;
37 this.el.default_width = 600;
38 this.el.deletable = true;
40 var child_0 = new Xcls_Clones( _this );
42 this.el.get_content_area().add ( child_0.el );
43 var child_1 = new Xcls_ok_button( _this );
45 this.el.add_action_widget ( child_1.el , 1 );
48 this.el.delete_event.connect( (self, event) => {
53 this.el.response.connect( (self, response_id) => {
60 // user defined functions
64 this.el.set_deletable(false);
67 // this.get('/reposStore').load();
69 //this.get('/ok_button').el.set_sensitive(false);
71 // block until we return.
72 // var run_ret = this.el.run();
73 // if (run_ret < 1 ) {
76 // print("RUN RETURN : " + run_ret);
78 //print(JSON.stringify(this.get('bug').getValue()));
79 // return this.get('bug').getValue();
80 //this.success = c.success;
82 public class Xcls_Clones : Object
91 public Xcls_Clones(Clones _owner )
95 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
100 var child_0 = new Xcls_Box3( _this );
102 this.el.pack_start ( child_0.el , false,false,0 );
103 var child_1 = new Xcls_ScrolledWindow9( _this );
105 this.el.pack_end ( child_1.el , true,true,0 );
108 // user defined functions
110 public class Xcls_Box3 : Object
113 private Clones _this;
119 public Xcls_Box3(Clones _owner )
122 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
126 // set gobject values
127 var child_0 = new Xcls_Button4( _this );
129 this.el.add ( child_0.el );
130 var child_1 = new Xcls_Button5( _this );
132 this.el.add ( child_1.el );
133 var child_2 = new Xcls_Button6( _this );
135 this.el.add ( child_2.el );
136 var child_3 = new Xcls_Button7( _this );
138 this.el.add ( child_3.el );
139 var child_4 = new Xcls_Button8( _this );
141 this.el.add ( child_4.el );
144 // user defined functions
146 public class Xcls_Button4 : Object
148 public Gtk.Button el;
149 private Clones _this;
155 public Xcls_Button4(Clones _owner )
158 this.el = new Gtk.Button();
162 // set gobject values
163 this.el.label = "Remotes / Clones";
166 this.el.clicked.connect( () => {
168 /* var rv = this.get('/reposView');
169 var rs = this.get('/reposStore');
170 if (rv.el.get_selection().count_selected_rows() != 1) {
175 var Remotes = imports.Remotes.Remotes;
179 var s = rv.el.get_selection();
181 s.selected_foreach(function(model,p,iter) {
183 path = model.get_value(iter, 6).value.get_string();
188 rs.repos.forEach(function(r) {
189 if (r.repopath == path) {
196 Remotes.el.set_transient_for(Clones.el);
197 Clones.el.set_title("Manage Clones - " + repo.repopath);
199 Clones.el.set_title("Manage Clones");
211 // user defined functions
214 public class Xcls_Button5 : Object
216 public Gtk.Button el;
217 private Clones _this;
223 public Xcls_Button5(Clones _owner )
226 this.el = new Gtk.Button();
230 // set gobject values
231 this.el.label = "Branches";
234 this.el.clicked.connect( () => {
236 var rv = this.get('/reposView');
237 var rs = this.get('/reposStore');
238 if (rv.el.get_selection().count_selected_rows() != 1) {
243 var Branches = imports.Branches.Branches;
247 var s = rv.el.get_selection();
249 s.selected_foreach(function(model,p,iter) {
251 path = model.get_value(iter, 6).value.get_string();
256 rs.repos.forEach(function(r) {
257 if (r.repopath == path) {
263 Branches.repo = repo;
264 Branches.el.set_transient_for(Clones.el);
265 Clones.el.set_title("Manage Clones - " + repo.repopath);
267 Clones.el.set_title("Manage Clones");
280 // user defined functions
283 public class Xcls_Button6 : Object
285 public Gtk.Button el;
286 private Clones _this;
292 public Xcls_Button6(Clones _owner )
295 this.el = new Gtk.Button();
299 // set gobject values
300 this.el.label = "Merge";
303 this.el.clicked.connect( () => {
305 var rv = this.get('/reposView');
306 var rs = this.get('/reposStore');
307 if (rv.el.get_selection().count_selected_rows() != 1) {
312 var Merger = imports.Merger.Merger;
316 var s = rv.el.get_selection();
318 s.selected_foreach(function(model,p,iter) {
320 path = model.get_value(iter, 6).value.get_string();
325 rs.repos.forEach(function(r) {
326 if (r.repopath == path) {
333 Merger.el.set_transient_for(Clones.el);
334 Clones.el.set_title("Manage Clones - " + repo.repopath);
336 Clones.el.set_title("Manage Clones");
350 // user defined functions
353 public class Xcls_Button7 : Object
355 public Gtk.Button el;
356 private Clones _this;
362 public Xcls_Button7(Clones _owner )
365 this.el = new Gtk.Button();
369 // set gobject values
370 this.el.label = "Switch Branch";
373 this.el.clicked.connect( () => {
383 // user defined functions
386 public class Xcls_Button8 : Object
388 public Gtk.Button el;
389 private Clones _this;
395 public Xcls_Button8(Clones _owner )
398 this.el = new Gtk.Button();
402 // set gobject values
403 this.el.label = "Pull";
406 this.el.clicked.connect( () => {
416 // user defined functions
420 public class Xcls_ScrolledWindow9 : Object
422 public Gtk.ScrolledWindow el;
423 private Clones _this;
429 public Xcls_ScrolledWindow9(Clones _owner )
432 this.el = new Gtk.ScrolledWindow( null, null );
436 // set gobject values
437 this.el.shadow_type = Gtk.ShadowType.IN;
438 var child_0 = new Xcls_reposView( _this );
440 this.el.add ( child_0.el );
441 var child_1 = new Xcls_TreeView24( _this );
448 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
452 // user defined functions
454 public class Xcls_reposView : Object
456 public Gtk.TreeView el;
457 private Clones _this;
463 public Xcls_reposView(Clones _owner )
466 _this.reposView = this;
467 this.el = new Gtk.TreeView();
471 // set gobject values
472 var child_0 = new Xcls_reposStore( _this );
474 this.el.set_model ( child_0.el );
475 var child_1 = new Xcls_tv_autocommit( _this );
477 this.el.append_column ( child_1.el );
478 var child_2 = new Xcls_tv_autopush( _this );
480 this.el.append_column ( child_2.el );
481 var child_3 = new Xcls_tv_repo( _this );
483 this.el.append_column ( child_3.el );
484 var child_4 = new Xcls_TreeViewColumn18( _this );
486 this.el.append_column ( child_4.el );
487 var child_5 = new Xcls_TreeViewColumn20( _this );
489 this.el.append_column ( child_5.el );
490 var child_6 = new Xcls_TreeViewColumn22( _this );
492 this.el.append_column ( child_6.el );
497 var selection = this.el.get_selection();
498 selection.set_mode( Gtk.SelectionMode.SINGLE);
501 var description = new Pango.FontDescription();
502 description.set_size(10000);
503 this.el.override_font(description);
507 this.el.cursor_changed.connect( () => {
508 // SEE SELECTION.CHANGED
513 if (this.el.get_selection().count_selected_rows() < 1) {
514 //nothing? - clea it?
518 var model = this.get('/changedFilesStore');
520 var s = this.el.get_selection();
522 s.selected_foreach(function(model,p,iter) {
524 files.push( model.get_value(iter, 0).value.get_string());
527 this.get('/patchview').showDiff(files);
528 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
529 //print("OUT?" + value);// id..
530 // load the list in the right grid..
537 // user defined functions
539 public class Xcls_reposStore : Object
541 public Gtk.ListStore el;
542 private Clones _this;
548 public Xcls_reposStore(Clones _owner )
551 _this.reposStore = this;
552 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
553 typeof(string), // 1 current branch
554 typeof(string), // 2 all branch
555 typeof(string), // 3 updated
556 typeof(bool), // 4 auto commit
557 typeof(bool), // 5 auto push
558 typeof(string) // 7 repopath
559 typeof(string) // 8 color highlighting? );
563 // set gobject values
566 // user defined functions
569 public class Xcls_tv_autocommit : Object
571 public Gtk.TreeViewColumn el;
572 private Clones _this;
578 public Xcls_tv_autocommit(Clones _owner )
581 _this.tv_autocommit = this;
582 this.el = new Gtk.TreeViewColumn();
586 // set gobject values
587 this.el.title = "Auto Commit";
588 this.el.min_width = 50;
589 var child_0 = new Xcls_CellRendererToggle13( _this );
591 this.el.pack_start ( child_0.el , false );
595 // this.items[0].el.set_activatable(true);
596 this.el.add_attribute(_this.keyrender.el , "active", 4 );
599 // user defined functions
601 public class Xcls_CellRendererToggle13 : Object
603 public Gtk.CellRendererToggle el;
604 private Clones _this;
610 public Xcls_CellRendererToggle13(Clones _owner )
613 this.el = new Gtk.CellRendererToggle();
617 // set gobject values
618 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
621 this.el.toggled.connect( (self, path) => {
623 var store = this.get('/reposStore');
624 store.el.get_iter_from_string(ret, path);
626 var value = store.el.get_value(ret.iter,4).value.get_boolean();
628 //print(JSON.stringify(value));
629 store.el.set_value(ret.iter,4, !value);
631 var path = store.el.get_value(ret.iter, 6).value.get_string();
632 var repo = imports.Scm.Repo.Repo.get(path);
633 repo.autocommit(!value);
640 // user defined functions
644 public class Xcls_tv_autopush : Object
646 public Gtk.TreeViewColumn el;
647 private Clones _this;
653 public Xcls_tv_autopush(Clones _owner )
656 _this.tv_autopush = this;
657 this.el = new Gtk.TreeViewColumn();
661 // set gobject values
662 this.el.title = "Auto Push";
663 this.el.min_width = 50;
664 var child_0 = new Xcls_CellRendererToggle15( _this );
666 this.el.pack_start ( child_0.el );
670 this.el.add_attribute(this.items[0].el , 'active', 5 );
671 // this.items[0].el.set_activatable(true);
674 // user defined functions
676 public class Xcls_CellRendererToggle15 : Object
678 public Gtk.CellRendererToggle el;
679 private Clones _this;
685 public Xcls_CellRendererToggle15(Clones _owner )
688 this.el = new Gtk.CellRendererToggle();
692 // set gobject values
693 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
696 this.el.toggled.connect( function (self, path) {
698 var store = this.get('/reposStore');
699 store.el.get_iter_from_string(ret, path);
701 var value = store.el.get_value(ret.iter,5).value.get_boolean();
703 //print(JSON.stringify(value));
704 store.el.set_value(ret.iter,5, !value);
705 var path = store.el.get_value(ret.iter, 6).value.get_string();
706 var repo = imports.Scm.Repo.Repo.get(path);
707 repo.autopush(!value);
712 // user defined functions
716 public class Xcls_tv_repo : Object
718 public Gtk.TreeViewColumn el;
719 private Clones _this;
725 public Xcls_tv_repo(Clones _owner )
728 _this.tv_repo = this;
729 this.el = new Gtk.TreeViewColumn();
733 // set gobject values
734 this.el.title = "Repo";
735 this.el.min_width = 200;
736 this.el.resizable = true;
737 var child_0 = new Xcls_CellRendererText17( _this );
739 this.el.pack_start ( child_0.el );
744 XObject.prototype.init.call(this);
745 this.el.add_attribute(this.items[0].el , 'markup', 0 );
750 // user defined functions
752 public class Xcls_CellRendererText17 : Object
754 public Gtk.CellRendererText el;
755 private Clones _this;
761 public Xcls_CellRendererText17(Clones _owner )
764 this.el = new Gtk.CellRendererText();
768 // set gobject values
771 // user defined functions
775 public class Xcls_TreeViewColumn18 : Object
777 public Gtk.TreeViewColumn el;
778 private Clones _this;
784 public Xcls_TreeViewColumn18(Clones _owner )
787 this.el = new Gtk.TreeViewColumn();
791 // set gobject values
792 this.el.title = "Current Branch";
793 this.el.min_width = 50;
794 var child_0 = new Xcls_CellRendererText19( _this );
796 this.el.pack_start ( child_0.el );
801 XObject.prototype.init.call(this);
802 this.el.add_attribute(this.items[0].el , 'markup', 1 );
803 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
808 // user defined functions
810 public class Xcls_CellRendererText19 : Object
812 public Gtk.CellRendererText el;
813 private Clones _this;
819 public Xcls_CellRendererText19(Clones _owner )
822 this.el = new Gtk.CellRendererText();
826 // set gobject values
829 // user defined functions
833 public class Xcls_TreeViewColumn20 : Object
835 public Gtk.TreeViewColumn el;
836 private Clones _this;
842 public Xcls_TreeViewColumn20(Clones _owner )
845 this.el = new Gtk.TreeViewColumn();
849 // set gobject values
850 this.el.title = "Last updated";
851 this.el.min_width = 50;
852 var child_0 = new Xcls_CellRendererText21( _this );
854 this.el.pack_start ( child_0.el );
859 XObject.prototype.init.call(this);
860 this.el.add_attribute(this.items[0].el , 'markup', 3 );
865 // user defined functions
867 public class Xcls_CellRendererText21 : Object
869 public Gtk.CellRendererText el;
870 private Clones _this;
876 public Xcls_CellRendererText21(Clones _owner )
879 this.el = new Gtk.CellRendererText();
883 // set gobject values
886 // user defined functions
890 public class Xcls_TreeViewColumn22 : Object
892 public Gtk.TreeViewColumn el;
893 private Clones _this;
899 public Xcls_TreeViewColumn22(Clones _owner )
902 this.el = new Gtk.TreeViewColumn();
906 // set gobject values
907 this.el.title = "All Branches";
908 this.el.min_width = 50;
909 this.el.resizable = false;
910 var child_0 = new Xcls_CellRendererText23( _this );
912 this.el.pack_start ( child_0.el );
917 XObject.prototype.init.call(this);
918 this.el.add_attribute(this.items[0].el , 'markup', 2 );
923 // user defined functions
925 public class Xcls_CellRendererText23 : Object
927 public Gtk.CellRendererText el;
928 private Clones _this;
934 public Xcls_CellRendererText23(Clones _owner )
937 this.el = new Gtk.CellRendererText();
941 // set gobject values
944 // user defined functions
949 public class Xcls_TreeView24 : Object
951 public Gtk.TreeView el;
952 private Clones _this;
958 public Xcls_TreeView24(Clones _owner )
961 this.el = new Gtk.TreeView();
965 // set gobject values
966 var child_0 = new Xcls_ListStore25( _this );
970 // user defined functions
972 public class Xcls_ListStore25 : Object
974 public Gtk.ListStore el;
975 private Clones _this;
981 public Xcls_ListStore25(Clones _owner )
984 this.el = new Gtk.ListStore( 0, null );
988 // set gobject values
991 // user defined functions
997 public class Xcls_ok_button : Object
999 public Gtk.Button el;
1000 private Clones _this;
1006 public Xcls_ok_button(Clones _owner )
1009 _this.ok_button = this;
1010 this.el = new Gtk.Button();
1014 // set gobject values
1015 this.el.label = "Close";
1018 // user defined functions