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
58 public void show () => {
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_HBox3( _this );
99 this.el.pack_start ( child_0.el , false,true );
100 var child_1 = new Xcls_ScrolledWindow9( _this );
104 // user defined functions
106 public class Xcls_HBox3 : Object
109 private Clones _this;
115 public Xcls_HBox3(Clones _owner )
118 this.el = new Gtk.HBox( true, 0 );
122 // set gobject values
123 var child_0 = new Xcls_Button4( _this );
125 this.el.add ( child_0.el );
126 var child_1 = new Xcls_Button5( _this );
128 this.el.add ( child_1.el );
129 var child_2 = new Xcls_Button6( _this );
131 this.el.add ( child_2.el );
132 var child_3 = new Xcls_Button7( _this );
134 this.el.add ( child_3.el );
135 var child_4 = new Xcls_Button8( _this );
137 this.el.add ( child_4.el );
140 // user defined functions
142 public class Xcls_Button4 : Object
144 public Gtk.Button el;
145 private Clones _this;
151 public Xcls_Button4(Clones _owner )
154 this.el = new Gtk.Button();
158 // set gobject values
159 this.el.label = "Remotes / Clones";
162 this.el.clicked.connect( () => {
164 /* var rv = this.get('/reposView');
165 var rs = this.get('/reposStore');
166 if (rv.el.get_selection().count_selected_rows() != 1) {
171 var Remotes = imports.Remotes.Remotes;
175 var s = rv.el.get_selection();
177 s.selected_foreach(function(model,p,iter) {
179 path = model.get_value(iter, 6).value.get_string();
184 rs.repos.forEach(function(r) {
185 if (r.repopath == path) {
192 Remotes.el.set_transient_for(Clones.el);
193 Clones.el.set_title("Manage Clones - " + repo.repopath);
195 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");
351 // user defined functions
354 public class Xcls_Button7 : Object
356 public Gtk.Button el;
357 private Clones _this;
363 public Xcls_Button7(Clones _owner )
366 this.el = new Gtk.Button();
370 // set gobject values
371 this.el.label = "Switch Branch";
374 this.el.clicked.connect( () => {
384 // user defined functions
387 public class Xcls_Button8 : Object
389 public Gtk.Button el;
390 private Clones _this;
396 public Xcls_Button8(Clones _owner )
399 this.el = new Gtk.Button();
403 // set gobject values
404 this.el.label = "Pull";
407 this.el.clicked.connect( () => {
417 // user defined functions
421 public class Xcls_ScrolledWindow9 : Object
423 public Gtk.ScrolledWindow el;
424 private Clones _this;
430 public Xcls_ScrolledWindow9(Clones _owner )
433 this.el = new Gtk.ScrolledWindow( null, null );
437 // set gobject values
438 var child_0 = new Xcls_reposView( _this );
440 this.el.add ( child_0.el );
441 var child_1 = new Xcls_TreeView24( _this );
447 XObject.prototype.init.call(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_TreeViewColumn12( _this );
477 this.el.append_column ( child_1.el );
478 var child_2 = new Xcls_TreeViewColumn14( _this );
480 this.el.append_column ( child_2.el );
481 var child_3 = new Xcls_TreeViewColumn16( _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 XObject.prototype.init.call(this);
498 var description = new Pango.FontDescription.c_new();
499 description.set_size(10000);
500 this.el.modify_font(description);
502 this.selection = this.el.get_selection();
503 this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);
507 this.selection.signal['changed'].connect(function() {
508 _this.listeners.cursor_changed.apply(
515 this.el.cursor_changed.connect( function (self) {
516 // SEE SELECTION.CHANGED
521 if (this.el.get_selection().count_selected_rows() < 1) {
522 //nothing? - clea it?
526 var model = this.get('/changedFilesStore');
528 var s = this.el.get_selection();
530 s.selected_foreach(function(model,p,iter) {
532 files.push( model.get_value(iter, 0).value.get_string());
535 this.get('/patchview').showDiff(files);
536 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
537 //print("OUT?" + value);// id..
538 // load the list in the right grid..
545 // user defined functions
547 public class Xcls_reposStore : Object
549 public Gtk.ListStore el;
550 private Clones _this;
556 public Xcls_reposStore(Clones _owner )
559 _this.reposStore = this;
560 this.el = new Gtk.ListStore( 0, null );
564 // set gobject values
569 XObject.prototype.init.call(this);
570 this.el.set_column_types ( 8, [
571 GObject.TYPE_STRING, // repo
572 GObject.TYPE_STRING, // current branch
573 GObject.TYPE_STRING, // all branch
574 GObject.TYPE_STRING, // updated
575 GObject.TYPE_BOOLEAN, // auto-commit
576 GObject.TYPE_BOOLEAN, // auto-push
577 GObject.TYPE_STRING, // repopath
578 GObject.TYPE_STRING // color highighling
583 // user defined functions
586 public class Xcls_TreeViewColumn12 : Object
588 public Gtk.TreeViewColumn el;
589 private Clones _this;
595 public Xcls_TreeViewColumn12(Clones _owner )
598 this.el = new Gtk.TreeViewColumn();
602 // set gobject values
603 this.el.title = "Auto Commit";
604 this.el.min_width = 50;
605 var child_0 = new Xcls_CellRendererToggle13( _this );
607 this.el.pack_start ( child_0.el );
612 XObject.prototype.init.call(this);
613 this.el.add_attribute(this.items[0].el , 'active', 4 );
614 this.items[0].el.set_activatable(true);
619 // user defined functions
621 public class Xcls_CellRendererToggle13 : Object
623 public Gtk.CellRendererToggle el;
624 private Clones _this;
630 public Xcls_CellRendererToggle13(Clones _owner )
633 this.el = new Gtk.CellRendererToggle();
637 // set gobject values
638 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
641 this.el.toggled.connect( function (self, path) {
643 var store = this.get('/reposStore');
644 store.el.get_iter_from_string(ret, path);
646 var value = store.el.get_value(ret.iter,4).value.get_boolean();
648 //print(JSON.stringify(value));
649 store.el.set_value(ret.iter,4, !value);
651 var path = store.el.get_value(ret.iter, 6).value.get_string();
652 var repo = imports.Scm.Repo.Repo.get(path);
653 repo.autocommit(!value);
660 // user defined functions
664 public class Xcls_TreeViewColumn14 : Object
666 public Gtk.TreeViewColumn el;
667 private Clones _this;
673 public Xcls_TreeViewColumn14(Clones _owner )
676 this.el = new Gtk.TreeViewColumn();
680 // set gobject values
681 this.el.title = "Auto Push";
682 this.el.min_width = 50;
683 var child_0 = new Xcls_CellRendererToggle15( _this );
685 this.el.pack_start ( child_0.el );
690 XObject.prototype.init.call(this);
691 this.el.add_attribute(this.items[0].el , 'active', 5 );
692 this.items[0].el.set_activatable(true);
696 // user defined functions
698 public class Xcls_CellRendererToggle15 : Object
700 public Gtk.CellRendererToggle el;
701 private Clones _this;
707 public Xcls_CellRendererToggle15(Clones _owner )
710 this.el = new Gtk.CellRendererToggle();
714 // set gobject values
715 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
718 this.el.toggled.connect( function (self, path) {
720 var store = this.get('/reposStore');
721 store.el.get_iter_from_string(ret, path);
723 var value = store.el.get_value(ret.iter,5).value.get_boolean();
725 //print(JSON.stringify(value));
726 store.el.set_value(ret.iter,5, !value);
727 var path = store.el.get_value(ret.iter, 6).value.get_string();
728 var repo = imports.Scm.Repo.Repo.get(path);
729 repo.autopush(!value);
734 // user defined functions
738 public class Xcls_TreeViewColumn16 : Object
740 public Gtk.TreeViewColumn el;
741 private Clones _this;
747 public Xcls_TreeViewColumn16(Clones _owner )
750 this.el = new Gtk.TreeViewColumn();
754 // set gobject values
755 this.el.title = "Repo";
756 this.el.min_width = 200;
757 this.el.resizable = true;
758 var child_0 = new Xcls_CellRendererText17( _this );
760 this.el.pack_start ( child_0.el );
765 XObject.prototype.init.call(this);
766 this.el.add_attribute(this.items[0].el , 'markup', 0 );
771 // user defined functions
773 public class Xcls_CellRendererText17 : Object
775 public Gtk.CellRendererText el;
776 private Clones _this;
782 public Xcls_CellRendererText17(Clones _owner )
785 this.el = new Gtk.CellRendererText();
789 // set gobject values
792 // user defined functions
796 public class Xcls_TreeViewColumn18 : Object
798 public Gtk.TreeViewColumn el;
799 private Clones _this;
805 public Xcls_TreeViewColumn18(Clones _owner )
808 this.el = new Gtk.TreeViewColumn();
812 // set gobject values
813 this.el.title = "Current Branch";
814 this.el.min_width = 50;
815 var child_0 = new Xcls_CellRendererText19( _this );
817 this.el.pack_start ( child_0.el );
822 XObject.prototype.init.call(this);
823 this.el.add_attribute(this.items[0].el , 'markup', 1 );
824 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
829 // user defined functions
831 public class Xcls_CellRendererText19 : Object
833 public Gtk.CellRendererText el;
834 private Clones _this;
840 public Xcls_CellRendererText19(Clones _owner )
843 this.el = new Gtk.CellRendererText();
847 // set gobject values
850 // user defined functions
854 public class Xcls_TreeViewColumn20 : Object
856 public Gtk.TreeViewColumn el;
857 private Clones _this;
863 public Xcls_TreeViewColumn20(Clones _owner )
866 this.el = new Gtk.TreeViewColumn();
870 // set gobject values
871 this.el.title = "Last updated";
872 this.el.min_width = 50;
873 var child_0 = new Xcls_CellRendererText21( _this );
875 this.el.pack_start ( child_0.el );
880 XObject.prototype.init.call(this);
881 this.el.add_attribute(this.items[0].el , 'markup', 3 );
886 // user defined functions
888 public class Xcls_CellRendererText21 : Object
890 public Gtk.CellRendererText el;
891 private Clones _this;
897 public Xcls_CellRendererText21(Clones _owner )
900 this.el = new Gtk.CellRendererText();
904 // set gobject values
907 // user defined functions
911 public class Xcls_TreeViewColumn22 : Object
913 public Gtk.TreeViewColumn el;
914 private Clones _this;
920 public Xcls_TreeViewColumn22(Clones _owner )
923 this.el = new Gtk.TreeViewColumn();
927 // set gobject values
928 this.el.title = "All Branches";
929 this.el.min_width = 50;
930 this.el.resizable = false;
931 var child_0 = new Xcls_CellRendererText23( _this );
933 this.el.pack_start ( child_0.el );
938 XObject.prototype.init.call(this);
939 this.el.add_attribute(this.items[0].el , 'markup', 2 );
944 // user defined functions
946 public class Xcls_CellRendererText23 : Object
948 public Gtk.CellRendererText el;
949 private Clones _this;
955 public Xcls_CellRendererText23(Clones _owner )
958 this.el = new Gtk.CellRendererText();
962 // set gobject values
965 // user defined functions
970 public class Xcls_TreeView24 : Object
972 public Gtk.TreeView el;
973 private Clones _this;
979 public Xcls_TreeView24(Clones _owner )
982 this.el = new Gtk.TreeView();
986 // set gobject values
987 var child_0 = new Xcls_ListStore25( _this );
991 // user defined functions
993 public class Xcls_ListStore25 : Object
995 public Gtk.ListStore el;
996 private Clones _this;
1002 public Xcls_ListStore25(Clones _owner )
1005 this.el = new Gtk.ListStore( 0, null );
1009 // set gobject values
1012 // user defined functions
1018 public class Xcls_ok_button : Object
1020 public Gtk.Button el;
1021 private Clones _this;
1027 public Xcls_ok_button(Clones _owner )
1030 _this.ok_button = this;
1031 this.el = new Gtk.Button();
1035 // set gobject values
1036 this.el.label = "Close";
1039 // user defined functions