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.function(p ( child_0.el , e) {
40 p.el.get_content_area().pack_start(e.el,true,true,0)
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
61 public void show () => {
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.VBox( true, 0 );
100 var child_0 = new Xcls_HBox3( _this );
102 this.el.pack_start ( child_0.el , false,true );
103 var child_1 = new Xcls_ScrolledWindow9( _this );
107 // user defined functions
109 public class Xcls_HBox3 : Object
112 private Clones _this;
118 public Xcls_HBox3(Clones _owner )
121 this.el = new Gtk.HBox( true, 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( function (self) {
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");
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( function (self) {
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 = "Run Merger";
303 this.el.clicked.connect( function (self) {
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");
354 // user defined functions
357 public class Xcls_Button7 : Object
359 public Gtk.Button el;
360 private Clones _this;
366 public Xcls_Button7(Clones _owner )
369 this.el = new Gtk.Button();
373 // set gobject values
374 this.el.label = "Switch Branch";
377 this.el.clicked.connect( function (self) {
387 // user defined functions
390 public class Xcls_Button8 : Object
392 public Gtk.Button el;
393 private Clones _this;
399 public Xcls_Button8(Clones _owner )
402 this.el = new Gtk.Button();
406 // set gobject values
407 this.el.label = "Pull";
410 this.el.clicked.connect( function (self) {
420 // user defined functions
424 public class Xcls_ScrolledWindow9 : Object
426 public Gtk.ScrolledWindow el;
427 private Clones _this;
433 public Xcls_ScrolledWindow9(Clones _owner )
436 this.el = new Gtk.ScrolledWindow( null, null );
440 // set gobject values
441 var child_0 = new Xcls_reposView( _this );
443 this.el.add ( child_0.el );
444 var child_1 = new Xcls_TreeView24( _this );
450 XObject.prototype.init.call(this);
451 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
455 // user defined functions
457 public class Xcls_reposView : Object
459 public Gtk.TreeView el;
460 private Clones _this;
466 public Xcls_reposView(Clones _owner )
469 _this.reposView = this;
470 this.el = new Gtk.TreeView();
474 // set gobject values
475 var child_0 = new Xcls_reposStore( _this );
477 this.el.set_model ( child_0.el );
478 var child_1 = new Xcls_TreeViewColumn12( _this );
480 this.el.append_column ( child_1.el );
481 var child_2 = new Xcls_TreeViewColumn14( _this );
483 this.el.append_column ( child_2.el );
484 var child_3 = new Xcls_TreeViewColumn16( _this );
486 this.el.append_column ( child_3.el );
487 var child_4 = new Xcls_TreeViewColumn18( _this );
489 this.el.append_column ( child_4.el );
490 var child_5 = new Xcls_TreeViewColumn20( _this );
492 this.el.append_column ( child_5.el );
493 var child_6 = new Xcls_TreeViewColumn22( _this );
495 this.el.append_column ( child_6.el );
500 XObject.prototype.init.call(this);
501 var description = new Pango.FontDescription.c_new();
502 description.set_size(10000);
503 this.el.modify_font(description);
505 this.selection = this.el.get_selection();
506 this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);
510 this.selection.signal['changed'].connect(function() {
511 _this.listeners.cursor_changed.apply(
518 this.el.cursor_changed.connect( function (self) {
519 // SEE SELECTION.CHANGED
524 if (this.el.get_selection().count_selected_rows() < 1) {
525 //nothing? - clea it?
529 var model = this.get('/changedFilesStore');
531 var s = this.el.get_selection();
533 s.selected_foreach(function(model,p,iter) {
535 files.push( model.get_value(iter, 0).value.get_string());
538 this.get('/patchview').showDiff(files);
539 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
540 //print("OUT?" + value);// id..
541 // load the list in the right grid..
548 // user defined functions
550 public class Xcls_reposStore : Object
552 public Gtk.ListStore el;
553 private Clones _this;
559 public Xcls_reposStore(Clones _owner )
562 _this.reposStore = this;
563 this.el = new Gtk.ListStore( 0, null );
567 // set gobject values
572 XObject.prototype.init.call(this);
573 this.el.set_column_types ( 8, [
574 GObject.TYPE_STRING, // repo
575 GObject.TYPE_STRING, // current branch
576 GObject.TYPE_STRING, // all branch
577 GObject.TYPE_STRING, // updated
578 GObject.TYPE_BOOLEAN, // auto-commit
579 GObject.TYPE_BOOLEAN, // auto-push
580 GObject.TYPE_STRING, // repopath
581 GObject.TYPE_STRING // color highighling
586 // user defined functions
589 public class Xcls_TreeViewColumn12 : Object
591 public Gtk.TreeViewColumn el;
592 private Clones _this;
598 public Xcls_TreeViewColumn12(Clones _owner )
601 this.el = new Gtk.TreeViewColumn();
605 // set gobject values
606 this.el.title = "Auto Commit";
607 this.el.min_width = 50;
608 var child_0 = new Xcls_CellRendererToggle13( _this );
610 this.el.pack_start ( child_0.el );
615 XObject.prototype.init.call(this);
616 this.el.add_attribute(this.items[0].el , 'active', 4 );
617 this.items[0].el.set_activatable(true);
622 // user defined functions
624 public class Xcls_CellRendererToggle13 : Object
626 public Gtk.CellRendererToggle el;
627 private Clones _this;
633 public Xcls_CellRendererToggle13(Clones _owner )
636 this.el = new Gtk.CellRendererToggle();
640 // set gobject values
641 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
644 this.el.toggled.connect( function (self, path) {
646 var store = this.get('/reposStore');
647 store.el.get_iter_from_string(ret, path);
649 var value = store.el.get_value(ret.iter,4).value.get_boolean();
651 //print(JSON.stringify(value));
652 store.el.set_value(ret.iter,4, !value);
654 var path = store.el.get_value(ret.iter, 6).value.get_string();
655 var repo = imports.Scm.Repo.Repo.get(path);
656 repo.autocommit(!value);
663 // user defined functions
667 public class Xcls_TreeViewColumn14 : Object
669 public Gtk.TreeViewColumn el;
670 private Clones _this;
676 public Xcls_TreeViewColumn14(Clones _owner )
679 this.el = new Gtk.TreeViewColumn();
683 // set gobject values
684 this.el.title = "Auto Push";
685 this.el.min_width = 50;
686 var child_0 = new Xcls_CellRendererToggle15( _this );
688 this.el.pack_start ( child_0.el );
693 XObject.prototype.init.call(this);
694 this.el.add_attribute(this.items[0].el , 'active', 5 );
695 this.items[0].el.set_activatable(true);
699 // user defined functions
701 public class Xcls_CellRendererToggle15 : Object
703 public Gtk.CellRendererToggle el;
704 private Clones _this;
710 public Xcls_CellRendererToggle15(Clones _owner )
713 this.el = new Gtk.CellRendererToggle();
717 // set gobject values
718 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
721 this.el.toggled.connect( function (self, path) {
723 var store = this.get('/reposStore');
724 store.el.get_iter_from_string(ret, path);
726 var value = store.el.get_value(ret.iter,5).value.get_boolean();
728 //print(JSON.stringify(value));
729 store.el.set_value(ret.iter,5, !value);
730 var path = store.el.get_value(ret.iter, 6).value.get_string();
731 var repo = imports.Scm.Repo.Repo.get(path);
732 repo.autopush(!value);
737 // user defined functions
741 public class Xcls_TreeViewColumn16 : Object
743 public Gtk.TreeViewColumn el;
744 private Clones _this;
750 public Xcls_TreeViewColumn16(Clones _owner )
753 this.el = new Gtk.TreeViewColumn();
757 // set gobject values
758 this.el.title = "Repo";
759 this.el.min_width = 200;
760 this.el.resizable = true;
761 var child_0 = new Xcls_CellRendererText17( _this );
763 this.el.pack_start ( child_0.el );
768 XObject.prototype.init.call(this);
769 this.el.add_attribute(this.items[0].el , 'markup', 0 );
774 // user defined functions
776 public class Xcls_CellRendererText17 : Object
778 public Gtk.CellRendererText el;
779 private Clones _this;
785 public Xcls_CellRendererText17(Clones _owner )
788 this.el = new Gtk.CellRendererText();
792 // set gobject values
795 // user defined functions
799 public class Xcls_TreeViewColumn18 : Object
801 public Gtk.TreeViewColumn el;
802 private Clones _this;
808 public Xcls_TreeViewColumn18(Clones _owner )
811 this.el = new Gtk.TreeViewColumn();
815 // set gobject values
816 this.el.title = "Current Branch";
817 this.el.min_width = 50;
818 var child_0 = new Xcls_CellRendererText19( _this );
820 this.el.pack_start ( child_0.el );
825 XObject.prototype.init.call(this);
826 this.el.add_attribute(this.items[0].el , 'markup', 1 );
827 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
832 // user defined functions
834 public class Xcls_CellRendererText19 : Object
836 public Gtk.CellRendererText el;
837 private Clones _this;
843 public Xcls_CellRendererText19(Clones _owner )
846 this.el = new Gtk.CellRendererText();
850 // set gobject values
853 // user defined functions
857 public class Xcls_TreeViewColumn20 : Object
859 public Gtk.TreeViewColumn el;
860 private Clones _this;
866 public Xcls_TreeViewColumn20(Clones _owner )
869 this.el = new Gtk.TreeViewColumn();
873 // set gobject values
874 this.el.title = "Last updated";
875 this.el.min_width = 50;
876 var child_0 = new Xcls_CellRendererText21( _this );
878 this.el.pack_start ( child_0.el );
883 XObject.prototype.init.call(this);
884 this.el.add_attribute(this.items[0].el , 'markup', 3 );
889 // user defined functions
891 public class Xcls_CellRendererText21 : Object
893 public Gtk.CellRendererText el;
894 private Clones _this;
900 public Xcls_CellRendererText21(Clones _owner )
903 this.el = new Gtk.CellRendererText();
907 // set gobject values
910 // user defined functions
914 public class Xcls_TreeViewColumn22 : Object
916 public Gtk.TreeViewColumn el;
917 private Clones _this;
923 public Xcls_TreeViewColumn22(Clones _owner )
926 this.el = new Gtk.TreeViewColumn();
930 // set gobject values
931 this.el.title = "All Branches";
932 this.el.min_width = 50;
933 this.el.resizable = false;
934 var child_0 = new Xcls_CellRendererText23( _this );
936 this.el.pack_start ( child_0.el );
941 XObject.prototype.init.call(this);
942 this.el.add_attribute(this.items[0].el , 'markup', 2 );
947 // user defined functions
949 public class Xcls_CellRendererText23 : Object
951 public Gtk.CellRendererText el;
952 private Clones _this;
958 public Xcls_CellRendererText23(Clones _owner )
961 this.el = new Gtk.CellRendererText();
965 // set gobject values
968 // user defined functions
973 public class Xcls_TreeView24 : Object
975 public Gtk.TreeView el;
976 private Clones _this;
982 public Xcls_TreeView24(Clones _owner )
985 this.el = new Gtk.TreeView();
989 // set gobject values
990 var child_0 = new Xcls_ListStore25( _this );
994 // user defined functions
996 public class Xcls_ListStore25 : Object
998 public Gtk.ListStore el;
999 private Clones _this;
1005 public Xcls_ListStore25(Clones _owner )
1008 this.el = new Gtk.ListStore( 0, null );
1012 // set gobject values
1015 // user defined functions
1021 public class Xcls_ok_button : Object
1023 public Gtk.Button el;
1024 private Clones _this;
1030 public Xcls_ok_button(Clones _owner )
1033 _this.ok_button = this;
1034 this.el = new Gtk.Button();
1038 // set gobject values
1039 this.el.label = "Close";
1042 // user defined functions