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_tv_current_branch tv_current_branch;
22 public Xcls_tv_last_updated tv_last_updated;
23 public Xcls_ok_button ok_button;
31 this.el = new Gtk.Dialog();
36 this.el.title = "Manage Clones";
37 this.el.border_width = 3;
38 this.el.default_height = 500;
39 this.el.default_width = 600;
40 this.el.deletable = true;
42 var child_0 = new Xcls_Clones( _this );
44 this.el.get_content_area().add ( child_0.el );
45 var child_1 = new Xcls_ok_button( _this );
47 this.el.add_action_widget ( child_1.el , 1 );
50 this.el.delete_event.connect( (self, event) => {
55 this.el.response.connect( (self, response_id) => {
62 // user defined functions
66 this.el.set_deletable(false);
69 // this.get('/reposStore').load();
71 //this.get('/ok_button').el.set_sensitive(false);
73 // block until we return.
74 // var run_ret = this.el.run();
75 // if (run_ret < 1 ) {
78 // print("RUN RETURN : " + run_ret);
80 //print(JSON.stringify(this.get('bug').getValue()));
81 // return this.get('bug').getValue();
82 //this.success = c.success;
84 public class Xcls_Clones : Object
93 public Xcls_Clones(Clones _owner )
97 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
101 // set gobject values
102 var child_0 = new Xcls_Box3( _this );
104 this.el.pack_start ( child_0.el , false,false,0 );
105 var child_1 = new Xcls_ScrolledWindow9( _this );
107 this.el.pack_end ( child_1.el , true,true,0 );
110 // user defined functions
112 public class Xcls_Box3 : Object
115 private Clones _this;
121 public Xcls_Box3(Clones _owner )
124 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
128 // set gobject values
129 var child_0 = new Xcls_Button4( _this );
131 this.el.add ( child_0.el );
132 var child_1 = new Xcls_Button5( _this );
134 this.el.add ( child_1.el );
135 var child_2 = new Xcls_Button6( _this );
137 this.el.add ( child_2.el );
138 var child_3 = new Xcls_Button7( _this );
140 this.el.add ( child_3.el );
141 var child_4 = new Xcls_Button8( _this );
143 this.el.add ( child_4.el );
146 // user defined functions
148 public class Xcls_Button4 : Object
150 public Gtk.Button el;
151 private Clones _this;
157 public Xcls_Button4(Clones _owner )
160 this.el = new Gtk.Button();
164 // set gobject values
165 this.el.label = "Remotes / Clones";
168 this.el.clicked.connect( () => {
170 /* var rv = this.get('/reposView');
171 var rs = this.get('/reposStore');
172 if (rv.el.get_selection().count_selected_rows() != 1) {
177 var Remotes = imports.Remotes.Remotes;
181 var s = rv.el.get_selection();
183 s.selected_foreach(function(model,p,iter) {
185 path = model.get_value(iter, 6).value.get_string();
190 rs.repos.forEach(function(r) {
191 if (r.repopath == path) {
198 Remotes.el.set_transient_for(Clones.el);
199 Clones.el.set_title("Manage Clones - " + repo.repopath);
201 Clones.el.set_title("Manage Clones");
213 // user defined functions
216 public class Xcls_Button5 : Object
218 public Gtk.Button el;
219 private Clones _this;
225 public Xcls_Button5(Clones _owner )
228 this.el = new Gtk.Button();
232 // set gobject values
233 this.el.label = "Branches";
236 this.el.clicked.connect( () => {
238 var rv = this.get('/reposView');
239 var rs = this.get('/reposStore');
240 if (rv.el.get_selection().count_selected_rows() != 1) {
245 var Branches = imports.Branches.Branches;
249 var s = rv.el.get_selection();
251 s.selected_foreach(function(model,p,iter) {
253 path = model.get_value(iter, 6).value.get_string();
258 rs.repos.forEach(function(r) {
259 if (r.repopath == path) {
265 Branches.repo = repo;
266 Branches.el.set_transient_for(Clones.el);
267 Clones.el.set_title("Manage Clones - " + repo.repopath);
269 Clones.el.set_title("Manage Clones");
282 // user defined functions
285 public class Xcls_Button6 : Object
287 public Gtk.Button el;
288 private Clones _this;
294 public Xcls_Button6(Clones _owner )
297 this.el = new Gtk.Button();
301 // set gobject values
302 this.el.label = "Merge";
305 this.el.clicked.connect( () => {
307 var rv = this.get('/reposView');
308 var rs = this.get('/reposStore');
309 if (rv.el.get_selection().count_selected_rows() != 1) {
314 var Merger = imports.Merger.Merger;
318 var s = rv.el.get_selection();
320 s.selected_foreach(function(model,p,iter) {
322 path = model.get_value(iter, 6).value.get_string();
327 rs.repos.forEach(function(r) {
328 if (r.repopath == path) {
335 Merger.el.set_transient_for(Clones.el);
336 Clones.el.set_title("Manage Clones - " + repo.repopath);
338 Clones.el.set_title("Manage Clones");
352 // user defined functions
355 public class Xcls_Button7 : Object
357 public Gtk.Button el;
358 private Clones _this;
364 public Xcls_Button7(Clones _owner )
367 this.el = new Gtk.Button();
371 // set gobject values
372 this.el.label = "Switch Branch";
375 this.el.clicked.connect( () => {
385 // user defined functions
388 public class Xcls_Button8 : Object
390 public Gtk.Button el;
391 private Clones _this;
397 public Xcls_Button8(Clones _owner )
400 this.el = new Gtk.Button();
404 // set gobject values
405 this.el.label = "Pull";
408 this.el.clicked.connect( () => {
418 // user defined functions
422 public class Xcls_ScrolledWindow9 : Object
424 public Gtk.ScrolledWindow el;
425 private Clones _this;
431 public Xcls_ScrolledWindow9(Clones _owner )
434 this.el = new Gtk.ScrolledWindow( null, null );
438 // set gobject values
439 this.el.shadow_type = Gtk.ShadowType.IN;
440 var child_0 = new Xcls_reposView( _this );
442 this.el.add ( child_0.el );
443 var child_1 = new Xcls_TreeView24( _this );
450 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
454 // user defined functions
456 public class Xcls_reposView : Object
458 public Gtk.TreeView el;
459 private Clones _this;
465 public Xcls_reposView(Clones _owner )
468 _this.reposView = this;
469 this.el = new Gtk.TreeView();
473 // set gobject values
474 var child_0 = new Xcls_reposStore( _this );
476 this.el.set_model ( child_0.el );
477 var child_1 = new Xcls_tv_autocommit( _this );
479 this.el.append_column ( child_1.el );
480 var child_2 = new Xcls_tv_autopush( _this );
482 this.el.append_column ( child_2.el );
483 var child_3 = new Xcls_tv_repo( _this );
485 this.el.append_column ( child_3.el );
486 var child_4 = new Xcls_tv_current_branch( _this );
488 this.el.append_column ( child_4.el );
489 var child_5 = new Xcls_tv_last_updated( _this );
491 this.el.append_column ( child_5.el );
492 var child_6 = new Xcls_TreeViewColumn22( _this );
494 this.el.append_column ( child_6.el );
499 var selection = this.el.get_selection();
500 selection.set_mode( Gtk.SelectionMode.SINGLE);
503 var description = new Pango.FontDescription();
504 description.set_size(10000);
505 this.el.override_font(description);
509 this.el.cursor_changed.connect( () => {
510 // SEE SELECTION.CHANGED
515 if (this.el.get_selection().count_selected_rows() < 1) {
516 //nothing? - clea it?
520 var model = this.get('/changedFilesStore');
522 var s = this.el.get_selection();
524 s.selected_foreach(function(model,p,iter) {
526 files.push( model.get_value(iter, 0).value.get_string());
529 this.get('/patchview').showDiff(files);
530 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
531 //print("OUT?" + value);// id..
532 // load the list in the right grid..
539 // user defined functions
541 public class Xcls_reposStore : Object
543 public Gtk.ListStore el;
544 private Clones _this;
550 public Xcls_reposStore(Clones _owner )
553 _this.reposStore = this;
554 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
555 typeof(string), // 1 current branch
556 typeof(string), // 2 all branch
557 typeof(string), // 3 updated
558 typeof(bool), // 4 auto commit
559 typeof(bool), // 5 auto push
560 typeof(string) // 7 repopath
561 typeof(string) // 8 color highlighting? );
565 // set gobject values
568 // user defined functions
571 public class Xcls_tv_autocommit : Object
573 public Gtk.TreeViewColumn el;
574 private Clones _this;
580 public Xcls_tv_autocommit(Clones _owner )
583 _this.tv_autocommit = this;
584 this.el = new Gtk.TreeViewColumn();
588 // set gobject values
589 this.el.title = "Auto Commit";
590 this.el.min_width = 50;
591 var child_0 = new Xcls_CellRendererToggle13( _this );
593 this.el.pack_start ( child_0.el , false );
597 // this.items[0].el.set_activatable(true);
598 this.el.add_attribute(_this.keyrender.el , "active", 4 );
601 // user defined functions
603 public class Xcls_CellRendererToggle13 : Object
605 public Gtk.CellRendererToggle el;
606 private Clones _this;
612 public Xcls_CellRendererToggle13(Clones _owner )
615 this.el = new Gtk.CellRendererToggle();
619 // set gobject values
620 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
623 this.el.toggled.connect( (self, path) => {
625 var store = this.get('/reposStore');
626 store.el.get_iter_from_string(ret, path);
628 var value = store.el.get_value(ret.iter,4).value.get_boolean();
630 //print(JSON.stringify(value));
631 store.el.set_value(ret.iter,4, !value);
633 var path = store.el.get_value(ret.iter, 6).value.get_string();
634 var repo = imports.Scm.Repo.Repo.get(path);
635 repo.autocommit(!value);
642 // user defined functions
646 public class Xcls_tv_autopush : Object
648 public Gtk.TreeViewColumn el;
649 private Clones _this;
655 public Xcls_tv_autopush(Clones _owner )
658 _this.tv_autopush = this;
659 this.el = new Gtk.TreeViewColumn();
663 // set gobject values
664 this.el.title = "Auto Push";
665 this.el.min_width = 50;
666 var child_0 = new Xcls_CellRendererToggle15( _this );
668 this.el.pack_start ( child_0.el );
672 this.el.add_attribute(this.items[0].el , 'active', 5 );
673 // this.items[0].el.set_activatable(true);
676 // user defined functions
678 public class Xcls_CellRendererToggle15 : Object
680 public Gtk.CellRendererToggle el;
681 private Clones _this;
687 public Xcls_CellRendererToggle15(Clones _owner )
690 this.el = new Gtk.CellRendererToggle();
694 // set gobject values
695 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
698 this.el.toggled.connect( function (self, path) {
700 var store = this.get('/reposStore');
701 store.el.get_iter_from_string(ret, path);
703 var value = store.el.get_value(ret.iter,5).value.get_boolean();
705 //print(JSON.stringify(value));
706 store.el.set_value(ret.iter,5, !value);
707 var path = store.el.get_value(ret.iter, 6).value.get_string();
708 var repo = imports.Scm.Repo.Repo.get(path);
709 repo.autopush(!value);
714 // user defined functions
718 public class Xcls_tv_repo : Object
720 public Gtk.TreeViewColumn el;
721 private Clones _this;
727 public Xcls_tv_repo(Clones _owner )
730 _this.tv_repo = this;
731 this.el = new Gtk.TreeViewColumn();
735 // set gobject values
736 this.el.title = "Repo";
737 this.el.min_width = 200;
738 this.el.resizable = true;
739 var child_0 = new Xcls_CellRendererText17( _this );
741 this.el.pack_start ( child_0.el );
746 XObject.prototype.init.call(this);
747 this.el.add_attribute(this.items[0].el , 'markup', 0 );
752 // user defined functions
754 public class Xcls_CellRendererText17 : Object
756 public Gtk.CellRendererText el;
757 private Clones _this;
763 public Xcls_CellRendererText17(Clones _owner )
766 this.el = new Gtk.CellRendererText();
770 // set gobject values
773 // user defined functions
777 public class Xcls_tv_current_branch : Object
779 public Gtk.TreeViewColumn el;
780 private Clones _this;
786 public Xcls_tv_current_branch(Clones _owner )
789 _this.tv_current_branch = this;
790 this.el = new Gtk.TreeViewColumn();
794 // set gobject values
795 this.el.title = "Current Branch";
796 this.el.min_width = 50;
797 var child_0 = new Xcls_CellRendererText19( _this );
799 this.el.pack_start ( child_0.el );
804 XObject.prototype.init.call(this);
805 this.el.add_attribute(this.items[0].el , 'markup', 1 );
806 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
811 // user defined functions
813 public class Xcls_CellRendererText19 : Object
815 public Gtk.CellRendererText el;
816 private Clones _this;
822 public Xcls_CellRendererText19(Clones _owner )
825 this.el = new Gtk.CellRendererText();
829 // set gobject values
832 // user defined functions
836 public class Xcls_tv_last_updated : Object
838 public Gtk.TreeViewColumn el;
839 private Clones _this;
845 public Xcls_tv_last_updated(Clones _owner )
848 _this.tv_last_updated = this;
849 this.el = new Gtk.TreeViewColumn();
853 // set gobject values
854 this.el.title = "Last updated";
855 this.el.min_width = 50;
856 var child_0 = new Xcls_CellRendererText21( _this );
858 this.el.pack_start ( child_0.el );
863 XObject.prototype.init.call(this);
864 this.el.add_attribute(this.items[0].el , 'markup', 3 );
869 // user defined functions
871 public class Xcls_CellRendererText21 : Object
873 public Gtk.CellRendererText el;
874 private Clones _this;
880 public Xcls_CellRendererText21(Clones _owner )
883 this.el = new Gtk.CellRendererText();
887 // set gobject values
890 // user defined functions
894 public class Xcls_TreeViewColumn22 : Object
896 public Gtk.TreeViewColumn el;
897 private Clones _this;
903 public Xcls_TreeViewColumn22(Clones _owner )
906 this.el = new Gtk.TreeViewColumn();
910 // set gobject values
911 this.el.title = "All Branches";
912 this.el.min_width = 50;
913 this.el.resizable = false;
914 var child_0 = new Xcls_CellRendererText23( _this );
916 this.el.pack_start ( child_0.el );
921 XObject.prototype.init.call(this);
922 this.el.add_attribute(this.items[0].el , 'markup', 2 );
927 // user defined functions
929 public class Xcls_CellRendererText23 : Object
931 public Gtk.CellRendererText el;
932 private Clones _this;
938 public Xcls_CellRendererText23(Clones _owner )
941 this.el = new Gtk.CellRendererText();
945 // set gobject values
948 // user defined functions
953 public class Xcls_TreeView24 : Object
955 public Gtk.TreeView el;
956 private Clones _this;
962 public Xcls_TreeView24(Clones _owner )
965 this.el = new Gtk.TreeView();
969 // set gobject values
970 var child_0 = new Xcls_ListStore25( _this );
974 // user defined functions
976 public class Xcls_ListStore25 : Object
978 public Gtk.ListStore el;
979 private Clones _this;
985 public Xcls_ListStore25(Clones _owner )
988 this.el = new Gtk.ListStore( 0, null );
992 // set gobject values
995 // user defined functions
1001 public class Xcls_ok_button : Object
1003 public Gtk.Button el;
1004 private Clones _this;
1010 public Xcls_ok_button(Clones _owner )
1013 _this.ok_button = this;
1014 this.el = new Gtk.Button();
1018 // set gobject values
1019 this.el.label = "Close";
1022 // user defined functions