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 var child_1 = new Xcls_Box4( _this );
101 this.el.pack_start ( child_1.el , false,false,0 );
102 var child_2 = new Xcls_ScrolledWindow10( _this );
104 this.el.pack_end ( child_2.el , true,true,0 );
107 // user defined functions
109 public class Xcls_Box3 : Object
112 private Clones _this;
118 public Xcls_Box3(Clones _owner )
121 this.el = new Gtk.Box();
126 // user defined functions
129 public class Xcls_Box4 : Object
132 private Clones _this;
138 public Xcls_Box4(Clones _owner )
141 this.el = new Gtk.Box();
144 var child_0 = new Xcls_Button5( _this );
146 this.el.add ( child_0.el );
147 var child_1 = new Xcls_Button6( _this );
149 this.el.add ( child_1.el );
150 var child_2 = new Xcls_Button7( _this );
152 this.el.add ( child_2.el );
153 var child_3 = new Xcls_Button8( _this );
155 this.el.add ( child_3.el );
156 var child_4 = new Xcls_Button9( _this );
158 this.el.add ( child_4.el );
161 // user defined functions
163 public class Xcls_Button5 : Object
165 public Gtk.Button el;
166 private Clones _this;
172 public Xcls_Button5(Clones _owner )
175 this.el = new Gtk.Button();
180 this.el.clicked.connect( () => {
182 /* var rv = this.get('/reposView');
183 var rs = this.get('/reposStore');
184 if (rv.el.get_selection().count_selected_rows() != 1) {
189 var Remotes = imports.Remotes.Remotes;
193 var s = rv.el.get_selection();
195 s.selected_foreach(function(model,p,iter) {
197 path = model.get_value(iter, 6).value.get_string();
202 rs.repos.forEach(function(r) {
203 if (r.repopath == path) {
210 Remotes.el.set_transient_for(Clones.el);
211 Clones.el.set_title("Manage Clones - " + repo.repopath);
213 Clones.el.set_title("Manage Clones");
225 // user defined functions
228 public class Xcls_Button6 : Object
230 public Gtk.Button el;
231 private Clones _this;
237 public Xcls_Button6(Clones _owner )
240 this.el = new Gtk.Button();
245 this.el.clicked.connect( () => {
247 var rv = this.get('/reposView');
248 var rs = this.get('/reposStore');
249 if (rv.el.get_selection().count_selected_rows() != 1) {
254 var Branches = imports.Branches.Branches;
258 var s = rv.el.get_selection();
260 s.selected_foreach(function(model,p,iter) {
262 path = model.get_value(iter, 6).value.get_string();
267 rs.repos.forEach(function(r) {
268 if (r.repopath == path) {
274 Branches.repo = repo;
275 Branches.el.set_transient_for(Clones.el);
276 Clones.el.set_title("Manage Clones - " + repo.repopath);
278 Clones.el.set_title("Manage Clones");
291 // user defined functions
294 public class Xcls_Button7 : Object
296 public Gtk.Button el;
297 private Clones _this;
303 public Xcls_Button7(Clones _owner )
306 this.el = new Gtk.Button();
311 this.el.clicked.connect( () => {
313 var rv = this.get('/reposView');
314 var rs = this.get('/reposStore');
315 if (rv.el.get_selection().count_selected_rows() != 1) {
320 var Merger = imports.Merger.Merger;
324 var s = rv.el.get_selection();
326 s.selected_foreach(function(model,p,iter) {
328 path = model.get_value(iter, 6).value.get_string();
333 rs.repos.forEach(function(r) {
334 if (r.repopath == path) {
341 Merger.el.set_transient_for(Clones.el);
342 Clones.el.set_title("Manage Clones - " + repo.repopath);
344 Clones.el.set_title("Manage Clones");
358 // user defined functions
361 public class Xcls_Button8 : Object
363 public Gtk.Button el;
364 private Clones _this;
370 public Xcls_Button8(Clones _owner )
373 this.el = new Gtk.Button();
378 this.el.clicked.connect( () => {
388 // user defined functions
391 public class Xcls_Button9 : Object
393 public Gtk.Button el;
394 private Clones _this;
400 public Xcls_Button9(Clones _owner )
403 this.el = new Gtk.Button();
408 this.el.clicked.connect( () => {
418 // user defined functions
422 public class Xcls_ScrolledWindow10 : Object
424 public Gtk.ScrolledWindow el;
425 private Clones _this;
431 public Xcls_ScrolledWindow10(Clones _owner )
434 this.el = new Gtk.ScrolledWindow();
437 var child_0 = new Xcls_reposView( _this );
439 this.el.add ( child_0.el );
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();
467 var child_0 = new Xcls_reposStore( _this );
469 this.el.set_model ( child_0.el );
470 var child_1 = new Xcls_tv_autocommit( _this );
472 this.el.append_column ( child_1.el );
473 var child_2 = new Xcls_tv_autopush( _this );
475 this.el.append_column ( child_2.el );
476 var child_3 = new Xcls_tv_repo( _this );
478 this.el.append_column ( child_3.el );
479 var child_4 = new Xcls_tv_current_branch( _this );
481 this.el.append_column ( child_4.el );
482 var child_5 = new Xcls_tv_last_updated( _this );
484 this.el.append_column ( child_5.el );
485 var child_6 = new Xcls_tv_all_branches( _this );
487 this.el.append_column ( child_6.el );
492 var selection = this.el.get_selection();
493 selection.set_mode( Gtk.SelectionMode.SINGLE);
496 var description = new Pango.FontDescription();
497 description.set_size(10000);
498 this.el.override_font(description);
502 this.el.cursor_changed.connect( () => {
503 // SEE SELECTION.CHANGED
508 if (this.el.get_selection().count_selected_rows() < 1) {
509 //nothing? - clea it?
513 var model = this.get('/changedFilesStore');
515 var s = this.el.get_selection();
517 s.selected_foreach(function(model,p,iter) {
519 files.push( model.get_value(iter, 0).value.get_string());
522 this.get('/patchview').showDiff(files);
523 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
524 //print("OUT?" + value);// id..
525 // load the list in the right grid..
532 // user defined functions
534 public class Xcls_reposStore : Object
536 public Gtk.ListStore el;
537 private Clones _this;
543 public Xcls_reposStore(Clones _owner )
546 _this.reposStore = this;
547 this.el = new Gtk.ListStore();
552 // user defined functions
555 public class Xcls_tv_autocommit : Object
557 public Gtk.TreeViewColumn el;
558 private Clones _this;
564 public Xcls_tv_autocommit(Clones _owner )
567 _this.tv_autocommit = this;
568 this.el = new Gtk.TreeViewColumn();
571 var child_0 = new Xcls_cr_autocommit( _this );
573 this.el.pack_start ( child_0.el , false );
577 // this.items[0].el.set_activatable(true);
578 this.el.add_attribute(_this.cr_autocommit.el , "active", 4 );
581 // user defined functions
583 public class Xcls_cr_autocommit : Object
585 public Gtk.CellRendererToggle el;
586 private Clones _this;
592 public Xcls_cr_autocommit(Clones _owner )
595 _this.cr_autocommit = this;
596 this.el = new Gtk.CellRendererToggle();
601 this.el.toggled.connect( (self, path) => {
603 var store = this.get('/reposStore');
604 store.el.get_iter_from_string(ret, path);
606 var value = store.el.get_value(ret.iter,4).value.get_boolean();
608 //print(JSON.stringify(value));
609 store.el.set_value(ret.iter,4, !value);
611 var path = store.el.get_value(ret.iter, 6).value.get_string();
612 var repo = imports.Scm.Repo.Repo.get(path);
613 repo.autocommit(!value);
620 // user defined functions
624 public class Xcls_tv_autopush : Object
626 public Gtk.TreeViewColumn el;
627 private Clones _this;
633 public Xcls_tv_autopush(Clones _owner )
636 _this.tv_autopush = this;
637 this.el = new Gtk.TreeViewColumn();
640 var child_0 = new Xcls_cr_autopush( _this );
642 this.el.pack_start ( child_0.el , false );
646 this.el.add_attribute(_this.cr_autopush.el , "active", 5 );
647 // this.items[0].el.set_activatable(true);
650 // user defined functions
652 public class Xcls_cr_autopush : Object
654 public Gtk.CellRendererToggle el;
655 private Clones _this;
661 public Xcls_cr_autopush(Clones _owner )
664 _this.cr_autopush = this;
665 this.el = new Gtk.CellRendererToggle();
670 this.el.toggled.connect( (self, path) => {
672 var store = this.get('/reposStore');
673 store.el.get_iter_from_string(ret, path);
675 var value = store.el.get_value(ret.iter,5).value.get_boolean();
677 //print(JSON.stringify(value));
678 store.el.set_value(ret.iter,5, !value);
679 var path = store.el.get_value(ret.iter, 6).value.get_string();
680 var repo = imports.Scm.Repo.Repo.get(path);
681 repo.autopush(!value);
686 // user defined functions
690 public class Xcls_tv_repo : Object
692 public Gtk.TreeViewColumn el;
693 private Clones _this;
699 public Xcls_tv_repo(Clones _owner )
702 _this.tv_repo = this;
703 this.el = new Gtk.TreeViewColumn();
706 var child_0 = new Xcls_cr_repo( _this );
708 this.el.pack_start ( child_0.el , false );
712 this.el.add_attribute(_this.cr_repo.el , "markup", 0 );
715 // user defined functions
717 public class Xcls_cr_repo : Object
719 public Gtk.CellRendererText el;
720 private Clones _this;
726 public Xcls_cr_repo(Clones _owner )
729 _this.cr_repo = this;
730 this.el = new Gtk.CellRendererText();
735 // user defined functions
739 public class Xcls_tv_current_branch : Object
741 public Gtk.TreeViewColumn el;
742 private Clones _this;
748 public Xcls_tv_current_branch(Clones _owner )
751 _this.tv_current_branch = this;
752 this.el = new Gtk.TreeViewColumn();
755 var child_0 = new Xcls_cr_current_branch( _this );
757 this.el.pack_start ( child_0.el , false );
761 this.el.add_attribute(_this.cr_current_branch.el , "markup", 1 );
762 this.el.add_attribute(_this.cr_current_branch.el, "cell-background", 7 );
765 // user defined functions
767 public class Xcls_cr_current_branch : Object
769 public Gtk.CellRendererText el;
770 private Clones _this;
776 public Xcls_cr_current_branch(Clones _owner )
779 _this.cr_current_branch = this;
780 this.el = new Gtk.CellRendererText();
785 // user defined functions
789 public class Xcls_tv_last_updated : Object
791 public Gtk.TreeViewColumn el;
792 private Clones _this;
798 public Xcls_tv_last_updated(Clones _owner )
801 _this.tv_last_updated = this;
802 this.el = new Gtk.TreeViewColumn();
805 var child_0 = new Xcls_cr_last_updated( _this );
807 this.el.pack_start ( child_0.el , false );
811 this.el.add_attribute(_this.cr_last_updated.el , "markup", 3 );
814 // user defined functions
816 public class Xcls_cr_last_updated : Object
818 public Gtk.CellRendererText el;
819 private Clones _this;
825 public Xcls_cr_last_updated(Clones _owner )
828 _this.cr_last_updated = this;
829 this.el = new Gtk.CellRendererText();
834 // user defined functions
838 public class Xcls_tv_all_branches : Object
840 public Gtk.TreeViewColumn el;
841 private Clones _this;
847 public Xcls_tv_all_branches(Clones _owner )
850 _this.tv_all_branches = this;
851 this.el = new Gtk.TreeViewColumn();
854 var child_0 = new Xcls_cr_all_branches( _this );
856 this.el.pack_start ( child_0.el , false );
860 this.el.add_attribute(_this.cr_all_branches.el , "markup", 2 );
863 // user defined functions
865 public class Xcls_cr_all_branches : Object
867 public Gtk.CellRendererText el;
868 private Clones _this;
874 public Xcls_cr_all_branches(Clones _owner )
877 _this.cr_all_branches = this;
878 this.el = new Gtk.CellRendererText();
883 // user defined functions
890 public class Xcls_ok_button : Object
892 public Gtk.Button el;
893 private Clones _this;
899 public Xcls_ok_button(Clones _owner )
902 _this.ok_button = this;
903 this.el = new Gtk.Button();
908 // user defined functions