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_cr_repo cr_repo;
24 public Xcls_tv_current_branch tv_current_branch;
25 public Xcls_cr_current_branch cr_current_branch;
26 public Xcls_tv_last_updated tv_last_updated;
27 public Xcls_cr_last_updated cr_last_updated;
28 public Xcls_tv_all_branches tv_all_branches;
29 public Xcls_cr_all_branches cr_all_branches;
30 public Xcls_ok_button ok_button;
38 this.el = new Gtk.Dialog();
43 this.el.title = "Manage Clones";
44 this.el.border_width = 3;
45 this.el.default_height = 500;
46 this.el.default_width = 600;
47 this.el.deletable = true;
49 var child_0 = new Xcls_Clones( _this );
51 this.el.get_content_area().add ( child_0.el );
52 var child_1 = new Xcls_ok_button( _this );
54 this.el.add_action_widget ( child_1.el , 1 );
57 this.el.delete_event.connect( (self, event) => {
62 this.el.response.connect( (self, response_id) => {
69 // user defined functions
73 this.el.set_deletable(false);
76 // this.get('/reposStore').load();
78 //this.get('/ok_button').el.set_sensitive(false);
80 // block until we return.
81 // var run_ret = this.el.run();
82 // if (run_ret < 1 ) {
85 // print("RUN RETURN : " + run_ret);
87 //print(JSON.stringify(this.get('bug').getValue()));
88 // return this.get('bug').getValue();
89 //this.success = c.success;
91 public class Xcls_Clones : Object
100 public Xcls_Clones(Clones _owner )
104 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
108 // set gobject values
109 var child_0 = new Xcls_Box3( _this );
111 this.el.pack_start ( child_0.el , false,false,0 );
112 var child_1 = new Xcls_ScrolledWindow9( _this );
114 this.el.pack_end ( child_1.el , true,true,0 );
117 // user defined functions
119 public class Xcls_Box3 : Object
122 private Clones _this;
128 public Xcls_Box3(Clones _owner )
131 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
135 // set gobject values
136 var child_0 = new Xcls_Button4( _this );
138 this.el.add ( child_0.el );
139 var child_1 = new Xcls_Button5( _this );
141 this.el.add ( child_1.el );
142 var child_2 = new Xcls_Button6( _this );
144 this.el.add ( child_2.el );
145 var child_3 = new Xcls_Button7( _this );
147 this.el.add ( child_3.el );
148 var child_4 = new Xcls_Button8( _this );
150 this.el.add ( child_4.el );
153 // user defined functions
155 public class Xcls_Button4 : Object
157 public Gtk.Button el;
158 private Clones _this;
164 public Xcls_Button4(Clones _owner )
167 this.el = new Gtk.Button();
171 // set gobject values
172 this.el.label = "Remotes / Clones";
175 this.el.clicked.connect( () => {
177 /* var rv = this.get('/reposView');
178 var rs = this.get('/reposStore');
179 if (rv.el.get_selection().count_selected_rows() != 1) {
184 var Remotes = imports.Remotes.Remotes;
188 var s = rv.el.get_selection();
190 s.selected_foreach(function(model,p,iter) {
192 path = model.get_value(iter, 6).value.get_string();
197 rs.repos.forEach(function(r) {
198 if (r.repopath == path) {
205 Remotes.el.set_transient_for(Clones.el);
206 Clones.el.set_title("Manage Clones - " + repo.repopath);
208 Clones.el.set_title("Manage Clones");
220 // user defined functions
223 public class Xcls_Button5 : Object
225 public Gtk.Button el;
226 private Clones _this;
232 public Xcls_Button5(Clones _owner )
235 this.el = new Gtk.Button();
239 // set gobject values
240 this.el.label = "Branches";
243 this.el.clicked.connect( () => {
245 var rv = this.get('/reposView');
246 var rs = this.get('/reposStore');
247 if (rv.el.get_selection().count_selected_rows() != 1) {
252 var Branches = imports.Branches.Branches;
256 var s = rv.el.get_selection();
258 s.selected_foreach(function(model,p,iter) {
260 path = model.get_value(iter, 6).value.get_string();
265 rs.repos.forEach(function(r) {
266 if (r.repopath == path) {
272 Branches.repo = repo;
273 Branches.el.set_transient_for(Clones.el);
274 Clones.el.set_title("Manage Clones - " + repo.repopath);
276 Clones.el.set_title("Manage Clones");
289 // user defined functions
292 public class Xcls_Button6 : Object
294 public Gtk.Button el;
295 private Clones _this;
301 public Xcls_Button6(Clones _owner )
304 this.el = new Gtk.Button();
308 // set gobject values
309 this.el.label = "Merge";
312 this.el.clicked.connect( () => {
314 var rv = this.get('/reposView');
315 var rs = this.get('/reposStore');
316 if (rv.el.get_selection().count_selected_rows() != 1) {
321 var Merger = imports.Merger.Merger;
325 var s = rv.el.get_selection();
327 s.selected_foreach(function(model,p,iter) {
329 path = model.get_value(iter, 6).value.get_string();
334 rs.repos.forEach(function(r) {
335 if (r.repopath == path) {
342 Merger.el.set_transient_for(Clones.el);
343 Clones.el.set_title("Manage Clones - " + repo.repopath);
345 Clones.el.set_title("Manage Clones");
359 // user defined functions
362 public class Xcls_Button7 : Object
364 public Gtk.Button el;
365 private Clones _this;
371 public Xcls_Button7(Clones _owner )
374 this.el = new Gtk.Button();
378 // set gobject values
379 this.el.label = "Switch Branch";
382 this.el.clicked.connect( () => {
392 // user defined functions
395 public class Xcls_Button8 : Object
397 public Gtk.Button el;
398 private Clones _this;
404 public Xcls_Button8(Clones _owner )
407 this.el = new Gtk.Button();
411 // set gobject values
412 this.el.label = "Pull";
415 this.el.clicked.connect( () => {
425 // user defined functions
429 public class Xcls_ScrolledWindow9 : Object
431 public Gtk.ScrolledWindow el;
432 private Clones _this;
438 public Xcls_ScrolledWindow9(Clones _owner )
441 this.el = new Gtk.ScrolledWindow( null, null );
445 // set gobject values
446 this.el.shadow_type = Gtk.ShadowType.IN;
447 var child_0 = new Xcls_reposView( _this );
449 this.el.add ( child_0.el );
455 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
459 // user defined functions
461 public class Xcls_reposView : Object
463 public Gtk.TreeView el;
464 private Clones _this;
470 public Xcls_reposView(Clones _owner )
473 _this.reposView = this;
474 this.el = new Gtk.TreeView();
478 // set gobject values
479 var child_0 = new Xcls_reposStore( _this );
481 this.el.set_model ( child_0.el );
482 var child_1 = new Xcls_tv_autocommit( _this );
484 this.el.append_column ( child_1.el );
485 var child_2 = new Xcls_tv_autopush( _this );
487 this.el.append_column ( child_2.el );
488 var child_3 = new Xcls_tv_repo( _this );
490 this.el.append_column ( child_3.el );
491 var child_4 = new Xcls_tv_current_branch( _this );
493 this.el.append_column ( child_4.el );
494 var child_5 = new Xcls_tv_last_updated( _this );
496 this.el.append_column ( child_5.el );
497 var child_6 = new Xcls_tv_all_branches( _this );
499 this.el.append_column ( child_6.el );
504 var selection = this.el.get_selection();
505 selection.set_mode( Gtk.SelectionMode.SINGLE);
508 var description = new Pango.FontDescription();
509 description.set_size(10000);
510 this.el.override_font(description);
514 this.el.cursor_changed.connect( () => {
515 // SEE SELECTION.CHANGED
520 if (this.el.get_selection().count_selected_rows() < 1) {
521 //nothing? - clea it?
525 var model = this.get('/changedFilesStore');
527 var s = this.el.get_selection();
529 s.selected_foreach(function(model,p,iter) {
531 files.push( model.get_value(iter, 0).value.get_string());
534 this.get('/patchview').showDiff(files);
535 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
536 //print("OUT?" + value);// id..
537 // load the list in the right grid..
544 // user defined functions
546 public class Xcls_reposStore : Object
548 public Gtk.ListStore el;
549 private Clones _this;
555 public Xcls_reposStore(Clones _owner )
558 _this.reposStore = this;
559 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
560 typeof(string), // 1 current branch
561 typeof(string), // 2 all branch
562 typeof(string), // 3 updated
563 typeof(bool), // 4 auto commit
564 typeof(bool), // 5 auto push
565 typeof(string) // 7 repopath
566 typeof(string) // 8 color highlighting? );
570 // set gobject values
573 // user defined functions
576 public class Xcls_tv_autocommit : Object
578 public Gtk.TreeViewColumn el;
579 private Clones _this;
585 public Xcls_tv_autocommit(Clones _owner )
588 _this.tv_autocommit = this;
589 this.el = new Gtk.TreeViewColumn();
593 // set gobject values
594 this.el.title = "Auto Commit";
595 this.el.min_width = 50;
596 var child_0 = new Xcls_cr_autocommit( _this );
598 this.el.pack_start ( child_0.el , false );
602 // this.items[0].el.set_activatable(true);
603 this.el.add_attribute(_this.cr_autocommit.el , "active", 4 );
606 // user defined functions
608 public class Xcls_cr_autocommit : Object
610 public Gtk.CellRendererToggle el;
611 private Clones _this;
617 public Xcls_cr_autocommit(Clones _owner )
620 _this.cr_autocommit = this;
621 this.el = new Gtk.CellRendererToggle();
625 // set gobject values
626 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
629 this.el.toggled.connect( (self, path) => {
631 var store = this.get('/reposStore');
632 store.el.get_iter_from_string(ret, path);
634 var value = store.el.get_value(ret.iter,4).value.get_boolean();
636 //print(JSON.stringify(value));
637 store.el.set_value(ret.iter,4, !value);
639 var path = store.el.get_value(ret.iter, 6).value.get_string();
640 var repo = imports.Scm.Repo.Repo.get(path);
641 repo.autocommit(!value);
648 // user defined functions
652 public class Xcls_tv_autopush : Object
654 public Gtk.TreeViewColumn el;
655 private Clones _this;
661 public Xcls_tv_autopush(Clones _owner )
664 _this.tv_autopush = this;
665 this.el = new Gtk.TreeViewColumn();
669 // set gobject values
670 this.el.title = "Auto Push";
671 this.el.min_width = 50;
672 var child_0 = new Xcls_cr_autopush( _this );
674 this.el.pack_start ( child_0.el );
678 this.el.add_attribute(_this.cr_autopush.el , 'active', 5 );
679 // this.items[0].el.set_activatable(true);
682 // user defined functions
684 public class Xcls_cr_autopush : Object
686 public Gtk.CellRendererToggle el;
687 private Clones _this;
693 public Xcls_cr_autopush(Clones _owner )
696 _this.cr_autopush = this;
697 this.el = new Gtk.CellRendererToggle();
701 // set gobject values
702 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
705 this.el.toggled.connect( function (self, path) {
707 var store = this.get('/reposStore');
708 store.el.get_iter_from_string(ret, path);
710 var value = store.el.get_value(ret.iter,5).value.get_boolean();
712 //print(JSON.stringify(value));
713 store.el.set_value(ret.iter,5, !value);
714 var path = store.el.get_value(ret.iter, 6).value.get_string();
715 var repo = imports.Scm.Repo.Repo.get(path);
716 repo.autopush(!value);
721 // user defined functions
725 public class Xcls_tv_repo : Object
727 public Gtk.TreeViewColumn el;
728 private Clones _this;
734 public Xcls_tv_repo(Clones _owner )
737 _this.tv_repo = this;
738 this.el = new Gtk.TreeViewColumn();
742 // set gobject values
743 this.el.title = "Repo";
744 this.el.min_width = 200;
745 this.el.resizable = true;
746 var child_0 = new Xcls_cr_repo( _this );
748 this.el.pack_start ( child_0.el );
752 this.el.add_attribute(_this.cr_repo.el , 'markup', 0 );
755 // user defined functions
757 public class Xcls_cr_repo : Object
759 public Gtk.CellRendererText el;
760 private Clones _this;
766 public Xcls_cr_repo(Clones _owner )
769 _this.cr_repo = this;
770 this.el = new Gtk.CellRendererText();
774 // set gobject values
777 // user defined functions
781 public class Xcls_tv_current_branch : Object
783 public Gtk.TreeViewColumn el;
784 private Clones _this;
790 public Xcls_tv_current_branch(Clones _owner )
793 _this.tv_current_branch = this;
794 this.el = new Gtk.TreeViewColumn();
798 // set gobject values
799 this.el.title = "Current Branch";
800 this.el.min_width = 50;
801 var child_0 = new Xcls_cr_current_branch( _this );
803 this.el.pack_start ( child_0.el );
808 XObject.prototype.init.call(this);
809 this.el.add_attribute(_this.cr_current_branch.el , 'markup', 1 );
810 this.el.add_attribute(_this.cr_current_branch.el, 'cell-background', 7 );
815 // user defined functions
817 public class Xcls_cr_current_branch : Object
819 public Gtk.CellRendererText el;
820 private Clones _this;
826 public Xcls_cr_current_branch(Clones _owner )
829 _this.cr_current_branch = this;
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_cr_last_updated( _this );
863 this.el.pack_start ( child_0.el );
867 this.el.add_attribute(_this.cr_last_updated.el , 'markup', 3 );
870 // user defined functions
872 public class Xcls_cr_last_updated : Object
874 public Gtk.CellRendererText el;
875 private Clones _this;
881 public Xcls_cr_last_updated(Clones _owner )
884 _this.cr_last_updated = this;
885 this.el = new Gtk.CellRendererText();
889 // set gobject values
892 // user defined functions
896 public class Xcls_tv_all_branches : Object
898 public Gtk.TreeViewColumn el;
899 private Clones _this;
905 public Xcls_tv_all_branches(Clones _owner )
908 _this.tv_all_branches = this;
909 this.el = new Gtk.TreeViewColumn();
913 // set gobject values
914 this.el.title = "All Branches";
915 this.el.min_width = 50;
916 this.el.resizable = false;
917 var child_0 = new Xcls_cr_all_branches( _this );
919 this.el.pack_start ( child_0.el );
923 this.el.add_attribute(_this.cr_all_branches.el , 'markup', 2 );
926 // user defined functions
928 public class Xcls_cr_all_branches : Object
930 public Gtk.CellRendererText el;
931 private Clones _this;
937 public Xcls_cr_all_branches(Clones _owner )
940 _this.cr_all_branches = this;
941 this.el = new Gtk.CellRendererText();
945 // set gobject values
948 // user defined functions
955 public class Xcls_ok_button : Object
957 public Gtk.Button el;
958 private Clones _this;
964 public Xcls_ok_button(Clones _owner )
967 _this.ok_button = this;
968 this.el = new Gtk.Button();
972 // set gobject values
973 this.el.label = "Close";
976 // user defined functions