3 public class Clones : Object
8 public static Clones singleton()
10 if (_Clones == null) {
11 _Clones= new Clones();
15 public Xcls_reposView reposView;
16 public Xcls_reposStore reposStore;
17 public Xcls_tv_autocommit tv_autocommit;
18 public Xcls_cr_autocommit cr_autocommit;
19 public Xcls_tv_autopush tv_autopush;
20 public Xcls_cr_autopush cr_autopush;
21 public Xcls_tv_repo tv_repo;
22 public Xcls_cr_repo cr_repo;
23 public Xcls_tv_current_branch tv_current_branch;
24 public Xcls_cr_current_branch cr_current_branch;
25 public Xcls_tv_last_updated tv_last_updated;
26 public Xcls_cr_last_updated cr_last_updated;
27 public Xcls_tv_all_branches tv_all_branches;
28 public Xcls_cr_all_branches cr_all_branches;
29 public Xcls_ok_button ok_button;
37 this.el = new Gtk.Dialog();
40 var child_0 = new Xcls_Box2( _this );
42 this.el.get_content_area().add ( child_0.el );
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
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_Box2 : Object
91 public Xcls_Box2(Clones _owner )
94 this.el = new Gtk.Box();
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();
122 var child_0 = new Xcls_Button4( _this );
124 this.el.add ( child_0.el );
125 var child_1 = new Xcls_Button5( _this );
127 this.el.add ( child_1.el );
128 var child_2 = new Xcls_Button6( _this );
130 this.el.add ( child_2.el );
131 var child_3 = new Xcls_Button7( _this );
133 this.el.add ( child_3.el );
134 var child_4 = new Xcls_Button8( _this );
136 this.el.add ( child_4.el );
139 // user defined functions
141 public class Xcls_Button4 : Object
143 public Gtk.Button el;
144 private Clones _this;
150 public Xcls_Button4(Clones _owner )
153 this.el = new Gtk.Button();
158 this.el.clicked.connect( () => {
160 /* var rv = this.get('/reposView');
161 var rs = this.get('/reposStore');
162 if (rv.el.get_selection().count_selected_rows() != 1) {
167 var Remotes = imports.Remotes.Remotes;
171 var s = rv.el.get_selection();
173 s.selected_foreach(function(model,p,iter) {
175 path = model.get_value(iter, 6).value.get_string();
180 rs.repos.forEach(function(r) {
181 if (r.repopath == path) {
188 Remotes.el.set_transient_for(Clones.el);
189 Clones.el.set_title("Manage Clones - " + repo.repopath);
191 Clones.el.set_title("Manage Clones");
203 // user defined functions
206 public class Xcls_Button5 : Object
208 public Gtk.Button el;
209 private Clones _this;
215 public Xcls_Button5(Clones _owner )
218 this.el = new Gtk.Button();
223 this.el.clicked.connect( () => {
225 var rv = this.get('/reposView');
226 var rs = this.get('/reposStore');
227 if (rv.el.get_selection().count_selected_rows() != 1) {
232 var Branches = imports.Branches.Branches;
236 var s = rv.el.get_selection();
238 s.selected_foreach(function(model,p,iter) {
240 path = model.get_value(iter, 6).value.get_string();
245 rs.repos.forEach(function(r) {
246 if (r.repopath == path) {
252 Branches.repo = repo;
253 Branches.el.set_transient_for(Clones.el);
254 Clones.el.set_title("Manage Clones - " + repo.repopath);
256 Clones.el.set_title("Manage Clones");
269 // user defined functions
272 public class Xcls_Button6 : Object
274 public Gtk.Button el;
275 private Clones _this;
281 public Xcls_Button6(Clones _owner )
284 this.el = new Gtk.Button();
289 this.el.clicked.connect( () => {
291 var rv = this.get('/reposView');
292 var rs = this.get('/reposStore');
293 if (rv.el.get_selection().count_selected_rows() != 1) {
298 var Merger = imports.Merger.Merger;
302 var s = rv.el.get_selection();
304 s.selected_foreach(function(model,p,iter) {
306 path = model.get_value(iter, 6).value.get_string();
311 rs.repos.forEach(function(r) {
312 if (r.repopath == path) {
319 Merger.el.set_transient_for(Clones.el);
320 Clones.el.set_title("Manage Clones - " + repo.repopath);
322 Clones.el.set_title("Manage Clones");
336 // user defined functions
339 public class Xcls_Button7 : Object
341 public Gtk.Button el;
342 private Clones _this;
348 public Xcls_Button7(Clones _owner )
351 this.el = new Gtk.Button();
356 this.el.clicked.connect( () => {
366 // user defined functions
369 public class Xcls_Button8 : Object
371 public Gtk.Button el;
372 private Clones _this;
378 public Xcls_Button8(Clones _owner )
381 this.el = new Gtk.Button();
386 this.el.clicked.connect( () => {
396 // user defined functions
400 public class Xcls_ScrolledWindow9 : Object
402 public Gtk.ScrolledWindow el;
403 private Clones _this;
409 public Xcls_ScrolledWindow9(Clones _owner )
412 this.el = new Gtk.ScrolledWindow();
415 var child_0 = new Xcls_reposView( _this );
417 this.el.add ( child_0.el );
423 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
427 // user defined functions
429 public class Xcls_reposView : Object
431 public Gtk.TreeView el;
432 private Clones _this;
438 public Xcls_reposView(Clones _owner )
441 _this.reposView = this;
442 this.el = new Gtk.TreeView();
445 var child_0 = new Xcls_reposStore( _this );
447 this.el.set_model ( child_0.el );
448 var child_1 = new Xcls_tv_autocommit( _this );
450 this.el.append_column ( child_1.el );
451 var child_2 = new Xcls_tv_autopush( _this );
453 this.el.append_column ( child_2.el );
454 var child_3 = new Xcls_tv_repo( _this );
456 this.el.append_column ( child_3.el );
457 var child_4 = new Xcls_tv_current_branch( _this );
459 this.el.append_column ( child_4.el );
460 var child_5 = new Xcls_tv_last_updated( _this );
462 this.el.append_column ( child_5.el );
463 var child_6 = new Xcls_tv_all_branches( _this );
465 this.el.append_column ( child_6.el );
470 var selection = this.el.get_selection();
471 selection.set_mode( Gtk.SelectionMode.SINGLE);
474 var description = new Pango.FontDescription();
475 description.set_size(10000);
476 this.el.override_font(description);
480 this.el.cursor_changed.connect( () => {
481 // SEE SELECTION.CHANGED
486 if (this.el.get_selection().count_selected_rows() < 1) {
487 //nothing? - clea it?
491 var model = this.get('/changedFilesStore');
493 var s = this.el.get_selection();
495 s.selected_foreach(function(model,p,iter) {
497 files.push( model.get_value(iter, 0).value.get_string());
500 this.get('/patchview').showDiff(files);
501 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
502 //print("OUT?" + value);// id..
503 // load the list in the right grid..
510 // user defined functions
512 public class Xcls_reposStore : Object
514 public Gtk.ListStore el;
515 private Clones _this;
521 public Xcls_reposStore(Clones _owner )
524 _this.reposStore = this;
525 this.el = new Gtk.ListStore();
530 // user defined functions
533 public class Xcls_tv_autocommit : Object
535 public Gtk.TreeViewColumn el;
536 private Clones _this;
542 public Xcls_tv_autocommit(Clones _owner )
545 _this.tv_autocommit = this;
546 this.el = new Gtk.TreeViewColumn();
549 var child_0 = new Xcls_cr_autocommit( _this );
551 this.el.pack_start ( child_0.el , false );
555 // this.items[0].el.set_activatable(true);
556 this.el.add_attribute(_this.cr_autocommit.el , "active", 4 );
559 // user defined functions
561 public class Xcls_cr_autocommit : Object
563 public Gtk.CellRendererToggle el;
564 private Clones _this;
570 public Xcls_cr_autocommit(Clones _owner )
573 _this.cr_autocommit = this;
574 this.el = new Gtk.CellRendererToggle();
579 this.el.toggled.connect( (self, path) => {
581 var store = this.get('/reposStore');
582 store.el.get_iter_from_string(ret, path);
584 var value = store.el.get_value(ret.iter,4).value.get_boolean();
586 //print(JSON.stringify(value));
587 store.el.set_value(ret.iter,4, !value);
589 var path = store.el.get_value(ret.iter, 6).value.get_string();
590 var repo = imports.Scm.Repo.Repo.get(path);
591 repo.autocommit(!value);
598 // user defined functions
602 public class Xcls_tv_autopush : Object
604 public Gtk.TreeViewColumn el;
605 private Clones _this;
611 public Xcls_tv_autopush(Clones _owner )
614 _this.tv_autopush = this;
615 this.el = new Gtk.TreeViewColumn();
618 var child_0 = new Xcls_cr_autopush( _this );
620 this.el.pack_start ( child_0.el , false );
624 this.el.add_attribute(_this.cr_autopush.el , "active", 5 );
625 // this.items[0].el.set_activatable(true);
628 // user defined functions
630 public class Xcls_cr_autopush : Object
632 public Gtk.CellRendererToggle el;
633 private Clones _this;
639 public Xcls_cr_autopush(Clones _owner )
642 _this.cr_autopush = this;
643 this.el = new Gtk.CellRendererToggle();
648 this.el.toggled.connect( (self, path) => {
650 var store = this.get('/reposStore');
651 store.el.get_iter_from_string(ret, path);
653 var value = store.el.get_value(ret.iter,5).value.get_boolean();
655 //print(JSON.stringify(value));
656 store.el.set_value(ret.iter,5, !value);
657 var path = store.el.get_value(ret.iter, 6).value.get_string();
658 var repo = imports.Scm.Repo.Repo.get(path);
659 repo.autopush(!value);
664 // user defined functions
668 public class Xcls_tv_repo : Object
670 public Gtk.TreeViewColumn el;
671 private Clones _this;
677 public Xcls_tv_repo(Clones _owner )
680 _this.tv_repo = this;
681 this.el = new Gtk.TreeViewColumn();
684 var child_0 = new Xcls_cr_repo( _this );
686 this.el.pack_start ( child_0.el , false );
690 this.el.add_attribute(_this.cr_repo.el , "markup", 0 );
693 // user defined functions
695 public class Xcls_cr_repo : Object
697 public Gtk.CellRendererText el;
698 private Clones _this;
704 public Xcls_cr_repo(Clones _owner )
707 _this.cr_repo = this;
708 this.el = new Gtk.CellRendererText();
713 // user defined functions
717 public class Xcls_tv_current_branch : Object
719 public Gtk.TreeViewColumn el;
720 private Clones _this;
726 public Xcls_tv_current_branch(Clones _owner )
729 _this.tv_current_branch = this;
730 this.el = new Gtk.TreeViewColumn();
733 var child_0 = new Xcls_cr_current_branch( _this );
735 this.el.pack_start ( child_0.el , false );
739 this.el.add_attribute(_this.cr_current_branch.el , "markup", 1 );
740 this.el.add_attribute(_this.cr_current_branch.el, "cell-background", 7 );
743 // user defined functions
745 public class Xcls_cr_current_branch : Object
747 public Gtk.CellRendererText el;
748 private Clones _this;
754 public Xcls_cr_current_branch(Clones _owner )
757 _this.cr_current_branch = this;
758 this.el = new Gtk.CellRendererText();
763 // user defined functions
767 public class Xcls_tv_last_updated : Object
769 public Gtk.TreeViewColumn el;
770 private Clones _this;
776 public Xcls_tv_last_updated(Clones _owner )
779 _this.tv_last_updated = this;
780 this.el = new Gtk.TreeViewColumn();
783 var child_0 = new Xcls_cr_last_updated( _this );
785 this.el.pack_start ( child_0.el , false );
789 this.el.add_attribute(_this.cr_last_updated.el , "markup", 3 );
792 // user defined functions
794 public class Xcls_cr_last_updated : Object
796 public Gtk.CellRendererText el;
797 private Clones _this;
803 public Xcls_cr_last_updated(Clones _owner )
806 _this.cr_last_updated = this;
807 this.el = new Gtk.CellRendererText();
812 // user defined functions
816 public class Xcls_tv_all_branches : Object
818 public Gtk.TreeViewColumn el;
819 private Clones _this;
825 public Xcls_tv_all_branches(Clones _owner )
828 _this.tv_all_branches = this;
829 this.el = new Gtk.TreeViewColumn();
832 var child_0 = new Xcls_cr_all_branches( _this );
834 this.el.pack_start ( child_0.el , false );
838 this.el.add_attribute(_this.cr_all_branches.el , "markup", 2 );
841 // user defined functions
843 public class Xcls_cr_all_branches : Object
845 public Gtk.CellRendererText el;
846 private Clones _this;
852 public Xcls_cr_all_branches(Clones _owner )
855 _this.cr_all_branches = this;
856 this.el = new Gtk.CellRendererText();
861 // user defined functions
868 public class Xcls_ok_button : Object
870 public Gtk.Button el;
871 private Clones _this;
877 public Xcls_ok_button(Clones _owner )
880 _this.ok_button = this;
881 this.el = new Gtk.Button();
886 // user defined functions