1 static NewBranch _NewBranch;
3 public class NewBranch : Object
6 private NewBranch _this;
8 public static NewBranch singleton()
10 if (_NewBranch == null) {
11 _NewBranch= new NewBranch();
15 public Xcls_ok_button ok_button;
23 this.el = new Gtk.Dialog();
28 this.el.title = "Manage Clones";
29 this.el.border_width = 3;
30 this.el.default_height = 500;
31 this.el.default_width = 800;
32 this.el.deletable = true;
34 var child_0 = new Xcls_Box2( _this );
36 this.el.get_content_area().add ( child_0.el );
37 var child_1 = new Xcls_ok_button( _this );
39 this.el.add_action_widget ( child_1.el , 1 );
42 this.el.delete_event.connect( (self, event) => {
47 this.el.response.connect( (self, response_id) => {
54 // user defined functions
58 this.el.set_deletable(false);
59 this.el.set_gravity(Gdk.Gravity.NORTH);
60 this.el.move(Gdk.Screen.width() / 2 ,0);
62 _this.reposStore.load();
64 // this.get('/reposStore').load();
66 //this.get('/ok_button').el.set_sensitive(false);
68 // block until we return.
69 // var run_ret = this.el.run();
70 // if (run_ret < 1 ) {
73 // print("RUN RETURN : " + run_ret);
75 //print(JSON.stringify(this.get('bug').getValue()));
76 // return this.get('bug').getValue();
77 //this.success = c.success;
79 public class Xcls_Box2 : Object
82 private NewBranch _this;
88 public Xcls_Box2(NewBranch _owner )
91 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
96 var child_0 = new Xcls_Box3( _this );
98 this.el.pack_start ( child_0.el , false,false,0 );
101 // user defined functions
103 public class Xcls_Box3 : Object
106 private NewBranch _this;
112 public Xcls_Box3(NewBranch _owner )
115 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
119 // set gobject values
120 var child_0 = new Xcls_Button4( _this );
122 this.el.add ( child_0.el );
123 var child_1 = new Xcls_Button5( _this );
125 this.el.add ( child_1.el );
126 var child_2 = new Xcls_Button6( _this );
128 this.el.add ( child_2.el );
129 var child_3 = new Xcls_Button7( _this );
131 this.el.add ( child_3.el );
134 // user defined functions
136 public class Xcls_Button4 : Object
138 public Gtk.Button el;
139 private NewBranch _this;
145 public Xcls_Button4(NewBranch _owner )
148 this.el = new Gtk.Button();
152 // set gobject values
153 this.el.label = "Branches";
156 this.el.clicked.connect( () => {
158 var rv = this.get('/reposView');
159 var rs = this.get('/reposStore');
160 if (rv.el.get_selection().count_selected_rows() != 1) {
165 var Branches = imports.Branches.Branches;
169 var s = rv.el.get_selection();
171 s.selected_foreach(function(model,p,iter) {
173 path = model.get_value(iter, 6).value.get_string();
178 rs.repos.forEach(function(r) {
179 if (r.repopath == path) {
185 Branches.repo = repo;
186 Branches.el.set_transient_for(Clones.el);
187 Clones.el.set_title("Manage Clones - " + repo.repopath);
189 Clones.el.set_title("Manage Clones");
202 // user defined functions
205 public class Xcls_Button5 : Object
207 public Gtk.Button el;
208 private NewBranch _this;
214 public Xcls_Button5(NewBranch _owner )
217 this.el = new Gtk.Button();
221 // set gobject values
222 this.el.label = "Merge";
225 this.el.clicked.connect( () => {
227 var rv = this.get('/reposView');
228 var rs = this.get('/reposStore');
229 if (rv.el.get_selection().count_selected_rows() != 1) {
234 var Merger = imports.Merger.Merger;
238 var s = rv.el.get_selection();
240 s.selected_foreach(function(model,p,iter) {
242 path = model.get_value(iter, 6).value.get_string();
247 rs.repos.forEach(function(r) {
248 if (r.repopath == path) {
255 Merger.el.set_transient_for(Clones.el);
256 Clones.el.set_title("Manage Clones - " + repo.repopath);
258 Clones.el.set_title("Manage Clones");
272 // user defined functions
275 public class Xcls_Button6 : Object
277 public Gtk.Button el;
278 private NewBranch _this;
284 public Xcls_Button6(NewBranch _owner )
287 this.el = new Gtk.Button();
291 // set gobject values
292 this.el.label = "Switch Branch";
295 this.el.clicked.connect( () => {
305 // user defined functions
308 public class Xcls_Button7 : Object
310 public Gtk.Button el;
311 private NewBranch _this;
317 public Xcls_Button7(NewBranch _owner )
320 this.el = new Gtk.Button();
324 // set gobject values
325 this.el.label = "Pull";
328 this.el.clicked.connect( () => {
338 // user defined functions
343 public class Xcls_ok_button : Object
345 public Gtk.Button el;
346 private NewBranch _this;
352 public Xcls_ok_button(NewBranch _owner )
355 _this.ok_button = this;
356 this.el = new Gtk.Button();
360 // set gobject values
361 this.el.expand = false;
362 this.el.label = "Close";
365 // user defined functions