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_ok_button ok_button;
26 this.el = new Gtk.Dialog();
31 this.el.title = "Manage Clones";
32 this.el.border_width = 3;
33 this.el.default_height = 500;
34 this.el.default_width = 600;
35 this.el.deletable = true;
37 var child_0 = new Xcls_Clones( _this );
39 this.el.get_content_area().add ( child_0.el );
40 var child_1 = new Xcls_ok_button( _this );
42 this.el.add_action_widget ( child_1.el , 1 );
45 this.el.delete_event.connect( (self, event) => {
50 this.el.response.connect( (self, response_id) => {
57 // user defined functions
61 this.el.set_deletable(false);
64 // this.get('/reposStore').load();
66 //this.get('/ok_button').el.set_sensitive(false);
68 // block until we return.
69 // var run_ret = this.el.run();
70 // if (run_ret < 1 ) {
73 // print("RUN RETURN : " + run_ret);
75 //print(JSON.stringify(this.get('bug').getValue()));
76 // return this.get('bug').getValue();
77 //this.success = c.success;
79 public class Xcls_Clones : Object
88 public Xcls_Clones(Clones _owner )
92 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
97 var child_0 = new Xcls_Box3( _this );
99 this.el.pack_start ( child_0.el , false,false,0 );
100 var child_1 = new Xcls_ScrolledWindow9( _this );
102 this.el.pack_end ( child_1.el , true,true,0 );
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.shadow_type = Gtk.ShadowType.IN;
435 var child_0 = new Xcls_reposView( _this );
437 this.el.add ( child_0.el );
438 var child_1 = new Xcls_TreeView24( _this );
445 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
449 // user defined functions
451 public class Xcls_reposView : Object
453 public Gtk.TreeView el;
454 private Clones _this;
460 public Xcls_reposView(Clones _owner )
463 _this.reposView = this;
464 this.el = new Gtk.TreeView();
468 // set gobject values
469 var child_0 = new Xcls_reposStore( _this );
471 this.el.set_model ( child_0.el );
472 var child_1 = new Xcls_TreeViewColumn12( _this );
474 this.el.append_column ( child_1.el );
475 var child_2 = new Xcls_TreeViewColumn14( _this );
477 this.el.append_column ( child_2.el );
478 var child_3 = new Xcls_TreeViewColumn16( _this );
480 this.el.append_column ( child_3.el );
481 var child_4 = new Xcls_TreeViewColumn18( _this );
483 this.el.append_column ( child_4.el );
484 var child_5 = new Xcls_TreeViewColumn20( _this );
486 this.el.append_column ( child_5.el );
487 var child_6 = new Xcls_TreeViewColumn22( _this );
489 this.el.append_column ( child_6.el );
494 var selection = this.el.get_selection();
495 selection.set_mode( Gtk.SelectionMode.SINGLE);
498 var description = new Pango.FontDescription();
499 description.set_size(10000);
500 this.el.override_font(description);
504 this.el.cursor_changed.connect( () => {
505 // SEE SELECTION.CHANGED
510 if (this.el.get_selection().count_selected_rows() < 1) {
511 //nothing? - clea it?
515 var model = this.get('/changedFilesStore');
517 var s = this.el.get_selection();
519 s.selected_foreach(function(model,p,iter) {
521 files.push( model.get_value(iter, 0).value.get_string());
524 this.get('/patchview').showDiff(files);
525 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
526 //print("OUT?" + value);// id..
527 // load the list in the right grid..
534 // user defined functions
536 public class Xcls_reposStore : Object
538 public Gtk.ListStore el;
539 private Clones _this;
545 public Xcls_reposStore(Clones _owner )
548 _this.reposStore = this;
549 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
550 typeof(string), // 1 current branch
551 typeof(string), // 2 all branch
552 typeof(string), // 3 updated
553 typeof(bool), // 4 auto commit
554 typeof(bool), // 5 auto push
555 typeof(string) // 7 repopath
556 typeof(string) // 8 color highlighting? );
560 // set gobject values
563 // user defined functions
566 public class Xcls_TreeViewColumn12 : Object
568 public Gtk.TreeViewColumn el;
569 private Clones _this;
575 public Xcls_TreeViewColumn12(Clones _owner )
578 this.el = new Gtk.TreeViewColumn();
582 // set gobject values
583 this.el.title = "Auto Commit";
584 this.el.min_width = 50;
585 var child_0 = new Xcls_CellRendererToggle13( _this );
587 this.el.pack_start ( child_0.el , false );
591 // this.items[0].el.set_activatable(true);
592 this.el.add_attribute(_this.keyrender.el , "active", 4 );
595 // user defined functions
597 public class Xcls_CellRendererToggle13 : Object
599 public Gtk.CellRendererToggle el;
600 private Clones _this;
606 public Xcls_CellRendererToggle13(Clones _owner )
609 this.el = new Gtk.CellRendererToggle();
613 // set gobject values
614 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
617 this.el.toggled.connect( (self, path) => {
619 var store = this.get('/reposStore');
620 store.el.get_iter_from_string(ret, path);
622 var value = store.el.get_value(ret.iter,4).value.get_boolean();
624 //print(JSON.stringify(value));
625 store.el.set_value(ret.iter,4, !value);
627 var path = store.el.get_value(ret.iter, 6).value.get_string();
628 var repo = imports.Scm.Repo.Repo.get(path);
629 repo.autocommit(!value);
636 // user defined functions
640 public class Xcls_TreeViewColumn14 : Object
642 public Gtk.TreeViewColumn el;
643 private Clones _this;
649 public Xcls_TreeViewColumn14(Clones _owner )
652 this.el = new Gtk.TreeViewColumn();
656 // set gobject values
657 this.el.title = "Auto Push";
658 this.el.min_width = 50;
659 var child_0 = new Xcls_CellRendererToggle15( _this );
661 this.el.pack_start ( child_0.el );
666 XObject.prototype.init.call(this);
667 this.el.add_attribute(this.items[0].el , 'active', 5 );
668 this.items[0].el.set_activatable(true);
672 // user defined functions
674 public class Xcls_CellRendererToggle15 : Object
676 public Gtk.CellRendererToggle el;
677 private Clones _this;
683 public Xcls_CellRendererToggle15(Clones _owner )
686 this.el = new Gtk.CellRendererToggle();
690 // set gobject values
691 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
694 this.el.toggled.connect( function (self, path) {
696 var store = this.get('/reposStore');
697 store.el.get_iter_from_string(ret, path);
699 var value = store.el.get_value(ret.iter,5).value.get_boolean();
701 //print(JSON.stringify(value));
702 store.el.set_value(ret.iter,5, !value);
703 var path = store.el.get_value(ret.iter, 6).value.get_string();
704 var repo = imports.Scm.Repo.Repo.get(path);
705 repo.autopush(!value);
710 // user defined functions
714 public class Xcls_TreeViewColumn16 : Object
716 public Gtk.TreeViewColumn el;
717 private Clones _this;
723 public Xcls_TreeViewColumn16(Clones _owner )
726 this.el = new Gtk.TreeViewColumn();
730 // set gobject values
731 this.el.title = "Repo";
732 this.el.min_width = 200;
733 this.el.resizable = true;
734 var child_0 = new Xcls_CellRendererText17( _this );
736 this.el.pack_start ( child_0.el );
741 XObject.prototype.init.call(this);
742 this.el.add_attribute(this.items[0].el , 'markup', 0 );
747 // user defined functions
749 public class Xcls_CellRendererText17 : Object
751 public Gtk.CellRendererText el;
752 private Clones _this;
758 public Xcls_CellRendererText17(Clones _owner )
761 this.el = new Gtk.CellRendererText();
765 // set gobject values
768 // user defined functions
772 public class Xcls_TreeViewColumn18 : Object
774 public Gtk.TreeViewColumn el;
775 private Clones _this;
781 public Xcls_TreeViewColumn18(Clones _owner )
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_CellRendererText19( _this );
793 this.el.pack_start ( child_0.el );
798 XObject.prototype.init.call(this);
799 this.el.add_attribute(this.items[0].el , 'markup', 1 );
800 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
805 // user defined functions
807 public class Xcls_CellRendererText19 : Object
809 public Gtk.CellRendererText el;
810 private Clones _this;
816 public Xcls_CellRendererText19(Clones _owner )
819 this.el = new Gtk.CellRendererText();
823 // set gobject values
826 // user defined functions
830 public class Xcls_TreeViewColumn20 : Object
832 public Gtk.TreeViewColumn el;
833 private Clones _this;
839 public Xcls_TreeViewColumn20(Clones _owner )
842 this.el = new Gtk.TreeViewColumn();
846 // set gobject values
847 this.el.title = "Last updated";
848 this.el.min_width = 50;
849 var child_0 = new Xcls_CellRendererText21( _this );
851 this.el.pack_start ( child_0.el );
856 XObject.prototype.init.call(this);
857 this.el.add_attribute(this.items[0].el , 'markup', 3 );
862 // user defined functions
864 public class Xcls_CellRendererText21 : Object
866 public Gtk.CellRendererText el;
867 private Clones _this;
873 public Xcls_CellRendererText21(Clones _owner )
876 this.el = new Gtk.CellRendererText();
880 // set gobject values
883 // user defined functions
887 public class Xcls_TreeViewColumn22 : Object
889 public Gtk.TreeViewColumn el;
890 private Clones _this;
896 public Xcls_TreeViewColumn22(Clones _owner )
899 this.el = new Gtk.TreeViewColumn();
903 // set gobject values
904 this.el.title = "All Branches";
905 this.el.min_width = 50;
906 this.el.resizable = false;
907 var child_0 = new Xcls_CellRendererText23( _this );
909 this.el.pack_start ( child_0.el );
914 XObject.prototype.init.call(this);
915 this.el.add_attribute(this.items[0].el , 'markup', 2 );
920 // user defined functions
922 public class Xcls_CellRendererText23 : Object
924 public Gtk.CellRendererText el;
925 private Clones _this;
931 public Xcls_CellRendererText23(Clones _owner )
934 this.el = new Gtk.CellRendererText();
938 // set gobject values
941 // user defined functions
946 public class Xcls_TreeView24 : Object
948 public Gtk.TreeView el;
949 private Clones _this;
955 public Xcls_TreeView24(Clones _owner )
958 this.el = new Gtk.TreeView();
962 // set gobject values
963 var child_0 = new Xcls_ListStore25( _this );
967 // user defined functions
969 public class Xcls_ListStore25 : Object
971 public Gtk.ListStore el;
972 private Clones _this;
978 public Xcls_ListStore25(Clones _owner )
981 this.el = new Gtk.ListStore( 0, null );
985 // set gobject values
988 // user defined functions
994 public class Xcls_ok_button : Object
996 public Gtk.Button el;
997 private Clones _this;
1003 public Xcls_ok_button(Clones _owner )
1006 _this.ok_button = this;
1007 this.el = new Gtk.Button();
1011 // set gobject values
1012 this.el.label = "Close";
1015 // user defined functions