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_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_Clones( _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_Clones : Object
99 public Xcls_Clones(Clones _owner )
103 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
107 // set gobject values
108 var child_0 = new Xcls_Box3( _this );
110 this.el.pack_start ( child_0.el , false,false,0 );
111 var child_1 = new Xcls_ScrolledWindow9( _this );
113 this.el.pack_end ( child_1.el , true,true,0 );
116 // user defined functions
118 public class Xcls_Box3 : Object
121 private Clones _this;
127 public Xcls_Box3(Clones _owner )
130 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
134 // set gobject values
135 var child_0 = new Xcls_Button4( _this );
137 this.el.add ( child_0.el );
138 var child_1 = new Xcls_Button5( _this );
140 this.el.add ( child_1.el );
141 var child_2 = new Xcls_Button6( _this );
143 this.el.add ( child_2.el );
144 var child_3 = new Xcls_Button7( _this );
146 this.el.add ( child_3.el );
147 var child_4 = new Xcls_Button8( _this );
149 this.el.add ( child_4.el );
152 // user defined functions
154 public class Xcls_Button4 : Object
156 public Gtk.Button el;
157 private Clones _this;
163 public Xcls_Button4(Clones _owner )
166 this.el = new Gtk.Button();
170 // set gobject values
171 this.el.label = "Remotes / Clones";
174 this.el.clicked.connect( () => {
176 /* var rv = this.get('/reposView');
177 var rs = this.get('/reposStore');
178 if (rv.el.get_selection().count_selected_rows() != 1) {
183 var Remotes = imports.Remotes.Remotes;
187 var s = rv.el.get_selection();
189 s.selected_foreach(function(model,p,iter) {
191 path = model.get_value(iter, 6).value.get_string();
196 rs.repos.forEach(function(r) {
197 if (r.repopath == path) {
204 Remotes.el.set_transient_for(Clones.el);
205 Clones.el.set_title("Manage Clones - " + repo.repopath);
207 Clones.el.set_title("Manage Clones");
219 // user defined functions
222 public class Xcls_Button5 : Object
224 public Gtk.Button el;
225 private Clones _this;
231 public Xcls_Button5(Clones _owner )
234 this.el = new Gtk.Button();
238 // set gobject values
239 this.el.label = "Branches";
242 this.el.clicked.connect( () => {
244 var rv = this.get('/reposView');
245 var rs = this.get('/reposStore');
246 if (rv.el.get_selection().count_selected_rows() != 1) {
251 var Branches = imports.Branches.Branches;
255 var s = rv.el.get_selection();
257 s.selected_foreach(function(model,p,iter) {
259 path = model.get_value(iter, 6).value.get_string();
264 rs.repos.forEach(function(r) {
265 if (r.repopath == path) {
271 Branches.repo = repo;
272 Branches.el.set_transient_for(Clones.el);
273 Clones.el.set_title("Manage Clones - " + repo.repopath);
275 Clones.el.set_title("Manage Clones");
288 // user defined functions
291 public class Xcls_Button6 : Object
293 public Gtk.Button el;
294 private Clones _this;
300 public Xcls_Button6(Clones _owner )
303 this.el = new Gtk.Button();
307 // set gobject values
308 this.el.label = "Merge";
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_Button7 : Object
363 public Gtk.Button el;
364 private Clones _this;
370 public Xcls_Button7(Clones _owner )
373 this.el = new Gtk.Button();
377 // set gobject values
378 this.el.label = "Switch Branch";
381 this.el.clicked.connect( () => {
391 // user defined functions
394 public class Xcls_Button8 : Object
396 public Gtk.Button el;
397 private Clones _this;
403 public Xcls_Button8(Clones _owner )
406 this.el = new Gtk.Button();
410 // set gobject values
411 this.el.label = "Pull";
414 this.el.clicked.connect( () => {
424 // user defined functions
428 public class Xcls_ScrolledWindow9 : Object
430 public Gtk.ScrolledWindow el;
431 private Clones _this;
437 public Xcls_ScrolledWindow9(Clones _owner )
440 this.el = new Gtk.ScrolledWindow( null, null );
444 // set gobject values
445 this.el.shadow_type = Gtk.ShadowType.IN;
446 var child_0 = new Xcls_reposView( _this );
448 this.el.add ( child_0.el );
449 var child_1 = new Xcls_TreeView24( _this );
456 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
460 // user defined functions
462 public class Xcls_reposView : Object
464 public Gtk.TreeView el;
465 private Clones _this;
471 public Xcls_reposView(Clones _owner )
474 _this.reposView = this;
475 this.el = new Gtk.TreeView();
479 // set gobject values
480 var child_0 = new Xcls_reposStore( _this );
482 this.el.set_model ( child_0.el );
483 var child_1 = new Xcls_tv_autocommit( _this );
485 this.el.append_column ( child_1.el );
486 var child_2 = new Xcls_tv_autopush( _this );
488 this.el.append_column ( child_2.el );
489 var child_3 = new Xcls_tv_repo( _this );
491 this.el.append_column ( child_3.el );
492 var child_4 = new Xcls_tv_current_branch( _this );
494 this.el.append_column ( child_4.el );
495 var child_5 = new Xcls_tv_last_updated( _this );
497 this.el.append_column ( child_5.el );
498 var child_6 = new Xcls_tv_all_branches( _this );
500 this.el.append_column ( child_6.el );
505 var selection = this.el.get_selection();
506 selection.set_mode( Gtk.SelectionMode.SINGLE);
509 var description = new Pango.FontDescription();
510 description.set_size(10000);
511 this.el.override_font(description);
515 this.el.cursor_changed.connect( () => {
516 // SEE SELECTION.CHANGED
521 if (this.el.get_selection().count_selected_rows() < 1) {
522 //nothing? - clea it?
526 var model = this.get('/changedFilesStore');
528 var s = this.el.get_selection();
530 s.selected_foreach(function(model,p,iter) {
532 files.push( model.get_value(iter, 0).value.get_string());
535 this.get('/patchview').showDiff(files);
536 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
537 //print("OUT?" + value);// id..
538 // load the list in the right grid..
545 // user defined functions
547 public class Xcls_reposStore : Object
549 public Gtk.ListStore el;
550 private Clones _this;
556 public Xcls_reposStore(Clones _owner )
559 _this.reposStore = this;
560 this.el = new Gtk.ListStore( 0, typeof(string), // 0 repo
561 typeof(string), // 1 current branch
562 typeof(string), // 2 all branch
563 typeof(string), // 3 updated
564 typeof(bool), // 4 auto commit
565 typeof(bool), // 5 auto push
566 typeof(string) // 7 repopath
567 typeof(string) // 8 color highlighting? );
571 // set gobject values
574 // user defined functions
577 public class Xcls_tv_autocommit : Object
579 public Gtk.TreeViewColumn el;
580 private Clones _this;
586 public Xcls_tv_autocommit(Clones _owner )
589 _this.tv_autocommit = this;
590 this.el = new Gtk.TreeViewColumn();
594 // set gobject values
595 this.el.title = "Auto Commit";
596 this.el.min_width = 50;
597 var child_0 = new Xcls_cr_autocommit( _this );
599 this.el.pack_start ( child_0.el , false );
603 // this.items[0].el.set_activatable(true);
604 this.el.add_attribute(_this.keyrender.el , "active", 4 );
607 // user defined functions
609 public class Xcls_cr_autocommit : Object
611 public Gtk.CellRendererToggle el;
612 private Clones _this;
618 public Xcls_cr_autocommit(Clones _owner )
621 _this.cr_autocommit = this;
622 this.el = new Gtk.CellRendererToggle();
626 // set gobject values
627 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
630 this.el.toggled.connect( (self, path) => {
632 var store = this.get('/reposStore');
633 store.el.get_iter_from_string(ret, path);
635 var value = store.el.get_value(ret.iter,4).value.get_boolean();
637 //print(JSON.stringify(value));
638 store.el.set_value(ret.iter,4, !value);
640 var path = store.el.get_value(ret.iter, 6).value.get_string();
641 var repo = imports.Scm.Repo.Repo.get(path);
642 repo.autocommit(!value);
649 // user defined functions
653 public class Xcls_tv_autopush : Object
655 public Gtk.TreeViewColumn el;
656 private Clones _this;
662 public Xcls_tv_autopush(Clones _owner )
665 _this.tv_autopush = this;
666 this.el = new Gtk.TreeViewColumn();
670 // set gobject values
671 this.el.title = "Auto Push";
672 this.el.min_width = 50;
673 var child_0 = new Xcls_cr_autopush( _this );
675 this.el.pack_start ( child_0.el );
679 this.el.add_attribute(this.items[0].el , 'active', 5 );
680 // this.items[0].el.set_activatable(true);
683 // user defined functions
685 public class Xcls_cr_autopush : Object
687 public Gtk.CellRendererToggle el;
688 private Clones _this;
694 public Xcls_cr_autopush(Clones _owner )
697 _this.cr_autopush = this;
698 this.el = new Gtk.CellRendererToggle();
702 // set gobject values
703 this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
706 this.el.toggled.connect( function (self, path) {
708 var store = this.get('/reposStore');
709 store.el.get_iter_from_string(ret, path);
711 var value = store.el.get_value(ret.iter,5).value.get_boolean();
713 //print(JSON.stringify(value));
714 store.el.set_value(ret.iter,5, !value);
715 var path = store.el.get_value(ret.iter, 6).value.get_string();
716 var repo = imports.Scm.Repo.Repo.get(path);
717 repo.autopush(!value);
722 // user defined functions
726 public class Xcls_tv_repo : Object
728 public Gtk.TreeViewColumn el;
729 private Clones _this;
735 public Xcls_tv_repo(Clones _owner )
738 _this.tv_repo = this;
739 this.el = new Gtk.TreeViewColumn();
743 // set gobject values
744 this.el.title = "Repo";
745 this.el.min_width = 200;
746 this.el.resizable = true;
747 var child_0 = new Xcls_cr_repo( _this );
749 this.el.pack_start ( child_0.el );
754 XObject.prototype.init.call(this);
755 this.el.add_attribute(this.items[0].el , 'markup', 0 );
760 // user defined functions
762 public class Xcls_cr_repo : Object
764 public Gtk.CellRendererText el;
765 private Clones _this;
771 public Xcls_cr_repo(Clones _owner )
774 _this.cr_repo = this;
775 this.el = new Gtk.CellRendererText();
779 // set gobject values
782 // user defined functions
786 public class Xcls_tv_current_branch : Object
788 public Gtk.TreeViewColumn el;
789 private Clones _this;
795 public Xcls_tv_current_branch(Clones _owner )
798 _this.tv_current_branch = this;
799 this.el = new Gtk.TreeViewColumn();
803 // set gobject values
804 this.el.title = "Current Branch";
805 this.el.min_width = 50;
806 var child_0 = new Xcls_cr_current_branch( _this );
808 this.el.pack_start ( child_0.el );
813 XObject.prototype.init.call(this);
814 this.el.add_attribute(this.items[0].el , 'markup', 1 );
815 this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
820 // user defined functions
822 public class Xcls_cr_current_branch : Object
824 public Gtk.CellRendererText el;
825 private Clones _this;
831 public Xcls_cr_current_branch(Clones _owner )
834 _this.cr_current_branch = this;
835 this.el = new Gtk.CellRendererText();
839 // set gobject values
842 // user defined functions
846 public class Xcls_tv_last_updated : Object
848 public Gtk.TreeViewColumn el;
849 private Clones _this;
855 public Xcls_tv_last_updated(Clones _owner )
858 _this.tv_last_updated = this;
859 this.el = new Gtk.TreeViewColumn();
863 // set gobject values
864 this.el.title = "Last updated";
865 this.el.min_width = 50;
866 var child_0 = new Xcls_cr_last_updated( _this );
868 this.el.pack_start ( child_0.el );
873 XObject.prototype.init.call(this);
874 this.el.add_attribute(this.items[0].el , 'markup', 3 );
879 // user defined functions
881 public class Xcls_cr_last_updated : Object
883 public Gtk.CellRendererText el;
884 private Clones _this;
890 public Xcls_cr_last_updated(Clones _owner )
893 _this.cr_last_updated = this;
894 this.el = new Gtk.CellRendererText();
898 // set gobject values
901 // user defined functions
905 public class Xcls_tv_all_branches : Object
907 public Gtk.TreeViewColumn el;
908 private Clones _this;
914 public Xcls_tv_all_branches(Clones _owner )
917 _this.tv_all_branches = this;
918 this.el = new Gtk.TreeViewColumn();
922 // set gobject values
923 this.el.title = "All Branches";
924 this.el.min_width = 50;
925 this.el.resizable = false;
926 var child_0 = new Xcls_CellRendererText23( _this );
928 this.el.pack_start ( child_0.el );
933 XObject.prototype.init.call(this);
934 this.el.add_attribute(this.items[0].el , 'markup', 2 );
939 // user defined functions
941 public class Xcls_CellRendererText23 : Object
943 public Gtk.CellRendererText el;
944 private Clones _this;
950 public Xcls_CellRendererText23(Clones _owner )
953 this.el = new Gtk.CellRendererText();
957 // set gobject values
960 // user defined functions
965 public class Xcls_TreeView24 : Object
967 public Gtk.TreeView el;
968 private Clones _this;
974 public Xcls_TreeView24(Clones _owner )
977 this.el = new Gtk.TreeView();
981 // set gobject values
982 var child_0 = new Xcls_ListStore25( _this );
986 // user defined functions
988 public class Xcls_ListStore25 : Object
990 public Gtk.ListStore el;
991 private Clones _this;
997 public Xcls_ListStore25(Clones _owner )
1000 this.el = new Gtk.ListStore( 0, null );
1004 // set gobject values
1007 // user defined functions
1013 public class Xcls_ok_button : Object
1015 public Gtk.Button el;
1016 private Clones _this;
1022 public Xcls_ok_button(Clones _owner )
1025 _this.ok_button = this;
1026 this.el = new Gtk.Button();
1030 // set gobject values
1031 this.el.label = "Close";
1034 // user defined functions