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_cr_autocommit cr_autocommit;
20 public Xcls_tv_autopush tv_autopush;
21 public Xcls_cr_autopush cr_autopush;
22 public Xcls_tv_repo tv_repo;
23 public Xcls_tv_current_branch tv_current_branch;
24 public Xcls_tv_last_updated tv_last_updated;
25 public Xcls_tv_all_branches tv_all_branches;
26 public Xcls_ok_button ok_button;
34 this.el = new Gtk.Dialog();
39 this.el.title = "Manage Clones";
40 this.el.border_width = 3;
41 this.el.default_height = 500;
42 this.el.default_width = 600;
43 this.el.deletable = true;
45 var child_0 = new Xcls_Clones( _this );
47 this.el.get_content_area().add ( child_0.el );
48 var child_1 = new Xcls_ok_button( _this );
50 this.el.add_action_widget ( child_1.el , 1 );
53 this.el.delete_event.connect( (self, event) => {
58 this.el.response.connect( (self, response_id) => {
65 // user defined functions
69 this.el.set_deletable(false);
72 // this.get('/reposStore').load();
74 //this.get('/ok_button').el.set_sensitive(false);
76 // block until we return.
77 // var run_ret = this.el.run();
78 // if (run_ret < 1 ) {
81 // print("RUN RETURN : " + run_ret);
83 //print(JSON.stringify(this.get('bug').getValue()));
84 // return this.get('bug').getValue();
85 //this.success = c.success;
87 public class Xcls_Clones : Object
96 public Xcls_Clones(Clones _owner )
100 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
104 // set gobject values
105 var child_0 = new Xcls_Box3( _this );
107 this.el.pack_start ( child_0.el , false,false,0 );
108 var child_1 = new Xcls_ScrolledWindow9( _this );
110 this.el.pack_end ( child_1.el , true,true,0 );
113 // user defined functions
115 public class Xcls_Box3 : Object
118 private Clones _this;
124 public Xcls_Box3(Clones _owner )
127 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
131 // set gobject values
132 var child_0 = new Xcls_Button4( _this );
134 this.el.add ( child_0.el );
135 var child_1 = new Xcls_Button5( _this );
137 this.el.add ( child_1.el );
138 var child_2 = new Xcls_Button6( _this );
140 this.el.add ( child_2.el );
141 var child_3 = new Xcls_Button7( _this );
143 this.el.add ( child_3.el );
144 var child_4 = new Xcls_Button8( _this );
146 this.el.add ( child_4.el );
149 // user defined functions
151 public class Xcls_Button4 : Object
153 public Gtk.Button el;
154 private Clones _this;
160 public Xcls_Button4(Clones _owner )
163 this.el = new Gtk.Button();
167 // set gobject values
168 this.el.label = "Remotes / Clones";
171 this.el.clicked.connect( () => {
173 /* var rv = this.get('/reposView');
174 var rs = this.get('/reposStore');
175 if (rv.el.get_selection().count_selected_rows() != 1) {
180 var Remotes = imports.Remotes.Remotes;
184 var s = rv.el.get_selection();
186 s.selected_foreach(function(model,p,iter) {
188 path = model.get_value(iter, 6).value.get_string();
193 rs.repos.forEach(function(r) {
194 if (r.repopath == path) {
201 Remotes.el.set_transient_for(Clones.el);
202 Clones.el.set_title("Manage Clones - " + repo.repopath);
204 Clones.el.set_title("Manage Clones");
216 // user defined functions
219 public class Xcls_Button5 : Object
221 public Gtk.Button el;
222 private Clones _this;
228 public Xcls_Button5(Clones _owner )
231 this.el = new Gtk.Button();
235 // set gobject values
236 this.el.label = "Branches";
239 this.el.clicked.connect( () => {
241 var rv = this.get('/reposView');
242 var rs = this.get('/reposStore');
243 if (rv.el.get_selection().count_selected_rows() != 1) {
248 var Branches = imports.Branches.Branches;
252 var s = rv.el.get_selection();
254 s.selected_foreach(function(model,p,iter) {
256 path = model.get_value(iter, 6).value.get_string();
261 rs.repos.forEach(function(r) {
262 if (r.repopath == path) {
268 Branches.repo = repo;
269 Branches.el.set_transient_for(Clones.el);
270 Clones.el.set_title("Manage Clones - " + repo.repopath);
272 Clones.el.set_title("Manage Clones");
285 // user defined functions
288 public class Xcls_Button6 : Object
290 public Gtk.Button el;
291 private Clones _this;
297 public Xcls_Button6(Clones _owner )
300 this.el = new Gtk.Button();
304 // set gobject values
305 this.el.label = "Merge";
308 this.el.clicked.connect( () => {
310 var rv = this.get('/reposView');
311 var rs = this.get('/reposStore');
312 if (rv.el.get_selection().count_selected_rows() != 1) {
317 var Merger = imports.Merger.Merger;
321 var s = rv.el.get_selection();
323 s.selected_foreach(function(model,p,iter) {
325 path = model.get_value(iter, 6).value.get_string();
330 rs.repos.forEach(function(r) {
331 if (r.repopath == path) {
338 Merger.el.set_transient_for(Clones.el);
339 Clones.el.set_title("Manage Clones - " + repo.repopath);
341 Clones.el.set_title("Manage Clones");
355 // user defined functions
358 public class Xcls_Button7 : Object
360 public Gtk.Button el;
361 private Clones _this;
367 public Xcls_Button7(Clones _owner )
370 this.el = new Gtk.Button();
374 // set gobject values
375 this.el.label = "Switch Branch";
378 this.el.clicked.connect( () => {
388 // user defined functions
391 public class Xcls_Button8 : Object
393 public Gtk.Button el;
394 private Clones _this;
400 public Xcls_Button8(Clones _owner )
403 this.el = new Gtk.Button();
407 // set gobject values
408 this.el.label = "Pull";
411 this.el.clicked.connect( () => {
421 // user defined functions
425 public class Xcls_ScrolledWindow9 : Object
427 public Gtk.ScrolledWindow el;
428 private Clones _this;
434 public Xcls_ScrolledWindow9(Clones _owner )
437 this.el = new Gtk.ScrolledWindow( null, null );
441 // set gobject values
442 this.el.shadow_type = Gtk.ShadowType.IN;
443 var child_0 = new Xcls_reposView( _this );
445 this.el.add ( child_0.el );
446 var child_1 = new Xcls_TreeView24( _this );
453 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
457 // user defined functions
459 public class Xcls_reposView : Object
461 public Gtk.TreeView el;
462 private Clones _this;
468 public Xcls_reposView(Clones _owner )
471 _this.reposView = this;
472 this.el = new Gtk.TreeView();
476 // set gobject values
477 var child_0 = new Xcls_reposStore( _this );
479 this.el.set_model ( child_0.el );
480 var child_1 = new Xcls_tv_autocommit( _this );
482 this.el.append_column ( child_1.el );
483 var child_2 = new Xcls_tv_autopush( _this );
485 this.el.append_column ( child_2.el );
486 var child_3 = new Xcls_tv_repo( _this );
488 this.el.append_column ( child_3.el );
489 var child_4 = new Xcls_tv_current_branch( _this );
491 this.el.append_column ( child_4.el );
492 var child_5 = new Xcls_tv_last_updated( _this );
494 this.el.append_column ( child_5.el );
495 var child_6 = new Xcls_tv_all_branches( _this );
497 this.el.append_column ( child_6.el );
502 var selection = this.el.get_selection();
503 selection.set_mode( Gtk.SelectionMode.SINGLE);
506 var description = new Pango.FontDescription();
507 description.set_size(10000);
508 this.el.override_font(description);
512 this.el.cursor_changed.connect( () => {
513 // SEE SELECTION.CHANGED
518 if (this.el.get_selection().count_selected_rows() < 1) {
519 //nothing? - clea it?
523 var model = this.get('/changedFilesStore');
525 var s = this.el.get_selection();
527 s.selected_foreach(function(model,p,iter) {
529 files.push( model.get_value(iter, 0).value.get_string());
532 this.get('/patchview').showDiff(files);
533 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
534 //print("OUT?" + value);// id..
535 // load the list in the right grid..
542 // user defined functions
544 public class Xcls_reposStore : Object
546 public Gtk.ListStore el;
547 private Clones _this;
553 public Xcls_reposStore(Clones _owner )
556 _this.reposStore = this;
557 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
558 typeof(string), // 1 current branch
559 typeof(string), // 2 all branch
560 typeof(string), // 3 updated
561 typeof(bool), // 4 auto commit
562 typeof(bool), // 5 auto push
563 typeof(string) // 7 repopath
564 typeof(string) // 8 color highlighting? );
568 // set gobject values
571 // user defined functions
574 public class Xcls_tv_autocommit : Object
576 public Gtk.TreeViewColumn el;
577 private Clones _this;
583 public Xcls_tv_autocommit(Clones _owner )
586 _this.tv_autocommit = this;
587 this.el = new Gtk.TreeViewColumn();
591 // set gobject values
592 this.el.title = "Auto Commit";
593 this.el.min_width = 50;
594 var child_0 = new Xcls_cr_autocommit( _this );
596 this.el.pack_start ( child_0.el , false );
600 // this.items[0].el.set_activatable(true);
601 this.el.add_attribute(_this.keyrender.el , "active", 4 );
604 // user defined functions
606 public class Xcls_cr_autocommit : Object
608 public Gtk.CellRendererToggle el;
609 private Clones _this;
615 public Xcls_cr_autocommit(Clones _owner )
618 _this.cr_autocommit = this;
619 this.el = new Gtk.CellRendererToggle();
623 // set gobject values
624 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
627 this.el.toggled.connect( (self, path) => {
629 var store = this.get('/reposStore');
630 store.el.get_iter_from_string(ret, path);
632 var value = store.el.get_value(ret.iter,4).value.get_boolean();
634 //print(JSON.stringify(value));
635 store.el.set_value(ret.iter,4, !value);
637 var path = store.el.get_value(ret.iter, 6).value.get_string();
638 var repo = imports.Scm.Repo.Repo.get(path);
639 repo.autocommit(!value);
646 // user defined functions
650 public class Xcls_tv_autopush : Object
652 public Gtk.TreeViewColumn el;
653 private Clones _this;
659 public Xcls_tv_autopush(Clones _owner )
662 _this.tv_autopush = this;
663 this.el = new Gtk.TreeViewColumn();
667 // set gobject values
668 this.el.title = "Auto Push";
669 this.el.min_width = 50;
670 var child_0 = new Xcls_cr_autopush( _this );
672 this.el.pack_start ( child_0.el );
676 this.el.add_attribute(this.items[0].el , 'active', 5 );
677 // this.items[0].el.set_activatable(true);
680 // user defined functions
682 public class Xcls_cr_autopush : Object
684 public Gtk.CellRendererToggle el;
685 private Clones _this;
691 public Xcls_cr_autopush(Clones _owner )
694 _this.cr_autopush = this;
695 this.el = new Gtk.CellRendererToggle();
699 // set gobject values
700 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
703 this.el.toggled.connect( function (self, path) {
705 var store = this.get('/reposStore');
706 store.el.get_iter_from_string(ret, path);
708 var value = store.el.get_value(ret.iter,5).value.get_boolean();
710 //print(JSON.stringify(value));
711 store.el.set_value(ret.iter,5, !value);
712 var path = store.el.get_value(ret.iter, 6).value.get_string();
713 var repo = imports.Scm.Repo.Repo.get(path);
714 repo.autopush(!value);
719 // user defined functions
723 public class Xcls_tv_repo : Object
725 public Gtk.TreeViewColumn el;
726 private Clones _this;
732 public Xcls_tv_repo(Clones _owner )
735 _this.tv_repo = this;
736 this.el = new Gtk.TreeViewColumn();
740 // set gobject values
741 this.el.title = "Repo";
742 this.el.min_width = 200;
743 this.el.resizable = true;
744 var child_0 = new Xcls_CellRendererText17( _this );
746 this.el.pack_start ( child_0.el );
751 XObject.prototype.init.call(this);
752 this.el.add_attribute(this.items[0].el , 'markup', 0 );
757 // user defined functions
759 public class Xcls_CellRendererText17 : Object
761 public Gtk.CellRendererText el;
762 private Clones _this;
768 public Xcls_CellRendererText17(Clones _owner )
771 this.el = new Gtk.CellRendererText();
775 // set gobject values
778 // user defined functions
782 public class Xcls_tv_current_branch : Object
784 public Gtk.TreeViewColumn el;
785 private Clones _this;
791 public Xcls_tv_current_branch(Clones _owner )
794 _this.tv_current_branch = this;
795 this.el = new Gtk.TreeViewColumn();
799 // set gobject values
800 this.el.title = "Current Branch";
801 this.el.min_width = 50;
802 var child_0 = new Xcls_CellRendererText19( _this );
804 this.el.pack_start ( child_0.el );
809 XObject.prototype.init.call(this);
810 this.el.add_attribute(this.items[0].el , 'markup', 1 );
811 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
816 // user defined functions
818 public class Xcls_CellRendererText19 : Object
820 public Gtk.CellRendererText el;
821 private Clones _this;
827 public Xcls_CellRendererText19(Clones _owner )
830 this.el = new Gtk.CellRendererText();
834 // set gobject values
837 // user defined functions
841 public class Xcls_tv_last_updated : Object
843 public Gtk.TreeViewColumn el;
844 private Clones _this;
850 public Xcls_tv_last_updated(Clones _owner )
853 _this.tv_last_updated = this;
854 this.el = new Gtk.TreeViewColumn();
858 // set gobject values
859 this.el.title = "Last updated";
860 this.el.min_width = 50;
861 var child_0 = new Xcls_CellRendererText21( _this );
863 this.el.pack_start ( child_0.el );
868 XObject.prototype.init.call(this);
869 this.el.add_attribute(this.items[0].el , 'markup', 3 );
874 // user defined functions
876 public class Xcls_CellRendererText21 : Object
878 public Gtk.CellRendererText el;
879 private Clones _this;
885 public Xcls_CellRendererText21(Clones _owner )
888 this.el = new Gtk.CellRendererText();
892 // set gobject values
895 // user defined functions
899 public class Xcls_tv_all_branches : Object
901 public Gtk.TreeViewColumn el;
902 private Clones _this;
908 public Xcls_tv_all_branches(Clones _owner )
911 _this.tv_all_branches = this;
912 this.el = new Gtk.TreeViewColumn();
916 // set gobject values
917 this.el.title = "All Branches";
918 this.el.min_width = 50;
919 this.el.resizable = false;
920 var child_0 = new Xcls_CellRendererText23( _this );
922 this.el.pack_start ( child_0.el );
927 XObject.prototype.init.call(this);
928 this.el.add_attribute(this.items[0].el , 'markup', 2 );
933 // user defined functions
935 public class Xcls_CellRendererText23 : Object
937 public Gtk.CellRendererText el;
938 private Clones _this;
944 public Xcls_CellRendererText23(Clones _owner )
947 this.el = new Gtk.CellRendererText();
951 // set gobject values
954 // user defined functions
959 public class Xcls_TreeView24 : Object
961 public Gtk.TreeView el;
962 private Clones _this;
968 public Xcls_TreeView24(Clones _owner )
971 this.el = new Gtk.TreeView();
975 // set gobject values
976 var child_0 = new Xcls_ListStore25( _this );
980 // user defined functions
982 public class Xcls_ListStore25 : Object
984 public Gtk.ListStore el;
985 private Clones _this;
991 public Xcls_ListStore25(Clones _owner )
994 this.el = new Gtk.ListStore( 0, null );
998 // set gobject values
1001 // user defined functions
1007 public class Xcls_ok_button : Object
1009 public Gtk.Button el;
1010 private Clones _this;
1016 public Xcls_ok_button(Clones _owner )
1019 _this.ok_button = this;
1020 this.el = new Gtk.Button();
1024 // set gobject values
1025 this.el.label = "Close";
1028 // user defined functions