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 );
665 this.el.add_attribute(this.items[0].el , 'active', 5 );
666 // this.items[0].el.set_activatable(true);
669 // user defined functions
671 public class Xcls_CellRendererToggle15 : Object
673 public Gtk.CellRendererToggle el;
674 private Clones _this;
680 public Xcls_CellRendererToggle15(Clones _owner )
683 this.el = new Gtk.CellRendererToggle();
687 // set gobject values
688 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
691 this.el.toggled.connect( function (self, path) {
693 var store = this.get('/reposStore');
694 store.el.get_iter_from_string(ret, path);
696 var value = store.el.get_value(ret.iter,5).value.get_boolean();
698 //print(JSON.stringify(value));
699 store.el.set_value(ret.iter,5, !value);
700 var path = store.el.get_value(ret.iter, 6).value.get_string();
701 var repo = imports.Scm.Repo.Repo.get(path);
702 repo.autopush(!value);
707 // user defined functions
711 public class Xcls_TreeViewColumn16 : Object
713 public Gtk.TreeViewColumn el;
714 private Clones _this;
720 public Xcls_TreeViewColumn16(Clones _owner )
723 this.el = new Gtk.TreeViewColumn();
727 // set gobject values
728 this.el.title = "Repo";
729 this.el.min_width = 200;
730 this.el.resizable = true;
731 var child_0 = new Xcls_CellRendererText17( _this );
733 this.el.pack_start ( child_0.el );
738 XObject.prototype.init.call(this);
739 this.el.add_attribute(this.items[0].el , 'markup', 0 );
744 // user defined functions
746 public class Xcls_CellRendererText17 : Object
748 public Gtk.CellRendererText el;
749 private Clones _this;
755 public Xcls_CellRendererText17(Clones _owner )
758 this.el = new Gtk.CellRendererText();
762 // set gobject values
765 // user defined functions
769 public class Xcls_TreeViewColumn18 : Object
771 public Gtk.TreeViewColumn el;
772 private Clones _this;
778 public Xcls_TreeViewColumn18(Clones _owner )
781 this.el = new Gtk.TreeViewColumn();
785 // set gobject values
786 this.el.title = "Current Branch";
787 this.el.min_width = 50;
788 var child_0 = new Xcls_CellRendererText19( _this );
790 this.el.pack_start ( child_0.el );
795 XObject.prototype.init.call(this);
796 this.el.add_attribute(this.items[0].el , 'markup', 1 );
797 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
802 // user defined functions
804 public class Xcls_CellRendererText19 : Object
806 public Gtk.CellRendererText el;
807 private Clones _this;
813 public Xcls_CellRendererText19(Clones _owner )
816 this.el = new Gtk.CellRendererText();
820 // set gobject values
823 // user defined functions
827 public class Xcls_TreeViewColumn20 : Object
829 public Gtk.TreeViewColumn el;
830 private Clones _this;
836 public Xcls_TreeViewColumn20(Clones _owner )
839 this.el = new Gtk.TreeViewColumn();
843 // set gobject values
844 this.el.title = "Last updated";
845 this.el.min_width = 50;
846 var child_0 = new Xcls_CellRendererText21( _this );
848 this.el.pack_start ( child_0.el );
853 XObject.prototype.init.call(this);
854 this.el.add_attribute(this.items[0].el , 'markup', 3 );
859 // user defined functions
861 public class Xcls_CellRendererText21 : Object
863 public Gtk.CellRendererText el;
864 private Clones _this;
870 public Xcls_CellRendererText21(Clones _owner )
873 this.el = new Gtk.CellRendererText();
877 // set gobject values
880 // user defined functions
884 public class Xcls_TreeViewColumn22 : Object
886 public Gtk.TreeViewColumn el;
887 private Clones _this;
893 public Xcls_TreeViewColumn22(Clones _owner )
896 this.el = new Gtk.TreeViewColumn();
900 // set gobject values
901 this.el.title = "All Branches";
902 this.el.min_width = 50;
903 this.el.resizable = false;
904 var child_0 = new Xcls_CellRendererText23( _this );
906 this.el.pack_start ( child_0.el );
911 XObject.prototype.init.call(this);
912 this.el.add_attribute(this.items[0].el , 'markup', 2 );
917 // user defined functions
919 public class Xcls_CellRendererText23 : Object
921 public Gtk.CellRendererText el;
922 private Clones _this;
928 public Xcls_CellRendererText23(Clones _owner )
931 this.el = new Gtk.CellRendererText();
935 // set gobject values
938 // user defined functions
943 public class Xcls_TreeView24 : Object
945 public Gtk.TreeView el;
946 private Clones _this;
952 public Xcls_TreeView24(Clones _owner )
955 this.el = new Gtk.TreeView();
959 // set gobject values
960 var child_0 = new Xcls_ListStore25( _this );
964 // user defined functions
966 public class Xcls_ListStore25 : Object
968 public Gtk.ListStore el;
969 private Clones _this;
975 public Xcls_ListStore25(Clones _owner )
978 this.el = new Gtk.ListStore( 0, null );
982 // set gobject values
985 // user defined functions
991 public class Xcls_ok_button : Object
993 public Gtk.Button el;
994 private Clones _this;
1000 public Xcls_ok_button(Clones _owner )
1003 _this.ok_button = this;
1004 this.el = new Gtk.Button();
1008 // set gobject values
1009 this.el.label = "Close";
1012 // user defined functions