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();
42 this.el.title = "Manage Clones";
43 this.el.border_width = 3;
44 this.el.default_height = 500;
45 this.el.default_width = 600;
46 this.el.deletable = true;
48 var child_0 = new Xcls_Box2( _this );
50 this.el.get_content_area().add ( child_0.el );
51 var child_1 = new Xcls_ok_button( _this );
53 this.el.add_action_widget ( child_1.el , 1 );
56 this.el.delete_event.connect( (self, event) => {
61 this.el.response.connect( (self, response_id) => {
68 // user defined functions
72 this.el.set_deletable(false);
75 // this.get('/reposStore').load();
77 //this.get('/ok_button').el.set_sensitive(false);
79 // block until we return.
80 // var run_ret = this.el.run();
81 // if (run_ret < 1 ) {
84 // print("RUN RETURN : " + run_ret);
86 //print(JSON.stringify(this.get('bug').getValue()));
87 // return this.get('bug').getValue();
88 //this.success = c.success;
90 public class Xcls_Box2 : Object
99 public Xcls_Box2(Clones _owner )
102 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
106 // set gobject values
107 var child_0 = new Xcls_Box3( _this );
109 this.el.pack_start ( child_0.el , false,false,0 );
110 var child_1 = new Xcls_ScrolledWindow9( _this );
112 this.el.pack_end ( child_1.el , false,false,0 );
115 // user defined functions
117 public class Xcls_Box3 : Object
120 private Clones _this;
126 public Xcls_Box3(Clones _owner )
129 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
133 // set gobject values
134 var child_0 = new Xcls_Button4( _this );
136 this.el.add ( child_0.el );
137 var child_1 = new Xcls_Button5( _this );
139 this.el.add ( child_1.el );
140 var child_2 = new Xcls_Button6( _this );
142 this.el.add ( child_2.el );
143 var child_3 = new Xcls_Button7( _this );
145 this.el.add ( child_3.el );
146 var child_4 = new Xcls_Button8( _this );
148 this.el.add ( child_4.el );
151 // user defined functions
153 public class Xcls_Button4 : Object
155 public Gtk.Button el;
156 private Clones _this;
162 public Xcls_Button4(Clones _owner )
165 this.el = new Gtk.Button();
169 // set gobject values
170 this.el.label = "Remotes / Clones";
173 this.el.clicked.connect( () => {
175 /* var rv = this.get('/reposView');
176 var rs = this.get('/reposStore');
177 if (rv.el.get_selection().count_selected_rows() != 1) {
182 var Remotes = imports.Remotes.Remotes;
186 var s = rv.el.get_selection();
188 s.selected_foreach(function(model,p,iter) {
190 path = model.get_value(iter, 6).value.get_string();
195 rs.repos.forEach(function(r) {
196 if (r.repopath == path) {
203 Remotes.el.set_transient_for(Clones.el);
204 Clones.el.set_title("Manage Clones - " + repo.repopath);
206 Clones.el.set_title("Manage Clones");
218 // user defined functions
221 public class Xcls_Button5 : Object
223 public Gtk.Button el;
224 private Clones _this;
230 public Xcls_Button5(Clones _owner )
233 this.el = new Gtk.Button();
237 // set gobject values
238 this.el.label = "Branches";
241 this.el.clicked.connect( () => {
243 var rv = this.get('/reposView');
244 var rs = this.get('/reposStore');
245 if (rv.el.get_selection().count_selected_rows() != 1) {
250 var Branches = imports.Branches.Branches;
254 var s = rv.el.get_selection();
256 s.selected_foreach(function(model,p,iter) {
258 path = model.get_value(iter, 6).value.get_string();
263 rs.repos.forEach(function(r) {
264 if (r.repopath == path) {
270 Branches.repo = repo;
271 Branches.el.set_transient_for(Clones.el);
272 Clones.el.set_title("Manage Clones - " + repo.repopath);
274 Clones.el.set_title("Manage Clones");
287 // user defined functions
290 public class Xcls_Button6 : Object
292 public Gtk.Button el;
293 private Clones _this;
299 public Xcls_Button6(Clones _owner )
302 this.el = new Gtk.Button();
306 // set gobject values
307 this.el.label = "Merge";
310 this.el.clicked.connect( () => {
312 var rv = this.get('/reposView');
313 var rs = this.get('/reposStore');
314 if (rv.el.get_selection().count_selected_rows() != 1) {
319 var Merger = imports.Merger.Merger;
323 var s = rv.el.get_selection();
325 s.selected_foreach(function(model,p,iter) {
327 path = model.get_value(iter, 6).value.get_string();
332 rs.repos.forEach(function(r) {
333 if (r.repopath == path) {
340 Merger.el.set_transient_for(Clones.el);
341 Clones.el.set_title("Manage Clones - " + repo.repopath);
343 Clones.el.set_title("Manage Clones");
357 // user defined functions
360 public class Xcls_Button7 : Object
362 public Gtk.Button el;
363 private Clones _this;
369 public Xcls_Button7(Clones _owner )
372 this.el = new Gtk.Button();
376 // set gobject values
377 this.el.label = "Switch Branch";
380 this.el.clicked.connect( () => {
390 // user defined functions
393 public class Xcls_Button8 : Object
395 public Gtk.Button el;
396 private Clones _this;
402 public Xcls_Button8(Clones _owner )
405 this.el = new Gtk.Button();
409 // set gobject values
410 this.el.label = "Pull";
413 this.el.clicked.connect( () => {
423 // user defined functions
427 public class Xcls_ScrolledWindow9 : Object
429 public Gtk.ScrolledWindow el;
430 private Clones _this;
436 public Xcls_ScrolledWindow9(Clones _owner )
439 this.el = new Gtk.ScrolledWindow( null, null );
443 // set gobject values
444 this.el.expand = true;
445 this.el.shadow_type = Gtk.ShadowType.IN;
446 var child_0 = new Xcls_reposView( _this );
448 this.el.add ( child_0.el );
454 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
458 // user defined functions
460 public class Xcls_reposView : Object
462 public Gtk.TreeView el;
463 private Clones _this;
469 public Xcls_reposView(Clones _owner )
472 _this.reposView = this;
473 this.el = new Gtk.TreeView();
477 // set gobject values
478 var child_0 = new Xcls_reposStore( _this );
480 this.el.set_model ( child_0.el );
481 var child_1 = new Xcls_tv_autocommit( _this );
483 this.el.append_column ( child_1.el );
484 var child_2 = new Xcls_tv_autopush( _this );
486 this.el.append_column ( child_2.el );
487 var child_3 = new Xcls_tv_repo( _this );
489 this.el.append_column ( child_3.el );
490 var child_4 = new Xcls_tv_current_branch( _this );
492 this.el.append_column ( child_4.el );
493 var child_5 = new Xcls_tv_last_updated( _this );
495 this.el.append_column ( child_5.el );
496 var child_6 = new Xcls_tv_all_branches( _this );
498 this.el.append_column ( child_6.el );
503 var selection = this.el.get_selection();
504 selection.set_mode( Gtk.SelectionMode.SINGLE);
507 var description = new Pango.FontDescription();
508 description.set_size(10000);
509 this.el.override_font(description);
513 this.el.cursor_changed.connect( () => {
514 // SEE SELECTION.CHANGED
519 if (this.el.get_selection().count_selected_rows() < 1) {
520 //nothing? - clea it?
524 var model = this.get('/changedFilesStore');
526 var s = this.el.get_selection();
528 s.selected_foreach(function(model,p,iter) {
530 files.push( model.get_value(iter, 0).value.get_string());
533 this.get('/patchview').showDiff(files);
534 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
535 //print("OUT?" + value);// id..
536 // load the list in the right grid..
543 // user defined functions
545 public class Xcls_reposStore : Object
547 public Gtk.ListStore el;
548 private Clones _this;
554 public Xcls_reposStore(Clones _owner )
557 _this.reposStore = this;
558 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
559 typeof(string), // 1 current branch
560 typeof(string), // 2 all branch
561 typeof(string), // 3 updated
562 typeof(bool), // 4 auto commit
563 typeof(bool), // 5 auto push
564 typeof(string), // 7 repopath
565 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 , false );
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( (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 , false );
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 , false );
807 this.el.add_attribute(_this.cr_current_branch.el , "markup", 1 );
808 this.el.add_attribute(_this.cr_current_branch.el, "cell-background", 7 );
811 // user defined functions
813 public class Xcls_cr_current_branch : Object
815 public Gtk.CellRendererText el;
816 private Clones _this;
822 public Xcls_cr_current_branch(Clones _owner )
825 _this.cr_current_branch = this;
826 this.el = new Gtk.CellRendererText();
830 // set gobject values
833 // user defined functions
837 public class Xcls_tv_last_updated : Object
839 public Gtk.TreeViewColumn el;
840 private Clones _this;
846 public Xcls_tv_last_updated(Clones _owner )
849 _this.tv_last_updated = this;
850 this.el = new Gtk.TreeViewColumn();
854 // set gobject values
855 this.el.title = "Last updated";
856 this.el.min_width = 50;
857 var child_0 = new Xcls_cr_last_updated( _this );
859 this.el.pack_start ( child_0.el , false );
863 this.el.add_attribute(_this.cr_last_updated.el , "markup", 3 );
866 // user defined functions
868 public class Xcls_cr_last_updated : Object
870 public Gtk.CellRendererText el;
871 private Clones _this;
877 public Xcls_cr_last_updated(Clones _owner )
880 _this.cr_last_updated = this;
881 this.el = new Gtk.CellRendererText();
885 // set gobject values
888 // user defined functions
892 public class Xcls_tv_all_branches : Object
894 public Gtk.TreeViewColumn el;
895 private Clones _this;
901 public Xcls_tv_all_branches(Clones _owner )
904 _this.tv_all_branches = this;
905 this.el = new Gtk.TreeViewColumn();
909 // set gobject values
910 this.el.title = "All Branches";
911 this.el.min_width = 50;
912 this.el.resizable = false;
913 var child_0 = new Xcls_cr_all_branches( _this );
915 this.el.pack_start ( child_0.el , false );
919 this.el.add_attribute(_this.cr_all_branches.el , "markup", 2 );
922 // user defined functions
924 public class Xcls_cr_all_branches : Object
926 public Gtk.CellRendererText el;
927 private Clones _this;
933 public Xcls_cr_all_branches(Clones _owner )
936 _this.cr_all_branches = this;
937 this.el = new Gtk.CellRendererText();
941 // set gobject values
944 // user defined functions
951 public class Xcls_ok_button : Object
953 public Gtk.Button el;
954 private Clones _this;
960 public Xcls_ok_button(Clones _owner )
963 _this.ok_button = this;
964 this.el = new Gtk.Button();
968 // set gobject values
969 this.el.label = "Close";
972 // user defined functions