3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
10 console = imports.console;
11 XObject = imports.XObject.XObject;
15 destroy_event : function (self, event) {
19 response : function (self, id) {
25 if (typeof(this.get('bug').getValue()) != 'object') {
32 //var val = this.get('bug').getValue();
39 title : "Manage Clones",
48 /*[ 'xtype' ].forEach(function(k) {
49 _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
56 this.get('/reposStore').load();
58 //this.get('/ok_button').el.set_sensitive(false);
60 // block until we return.
61 var run_ret = this.el.run();
65 print("RUN RETURN : " + run_ret);
67 //print(JSON.stringify(this.get('bug').getValue()));
68 // return this.get('bug').getValue();
69 //this.success = c.success;
74 pack : function(p,e) {
75 p.el.get_content_area().pack_start(e.el,true,true,0)
80 pack : "pack_start,false,true",
85 clicked : function (self) {
100 clicked : function (self) {
109 label : "Add Branch",
115 clicked : function (self) {
119 var Merger = imports.Merger.Merger;
124 Merger.repo = new Repo('/home/alan/gitlive/roojs1');
132 label : "Run Merger",
138 clicked : function (self) {
147 label : "Switch Branch",
153 clicked : function (self) {
168 xtype: Gtk.ScrolledWindow,
170 XObject.prototype.init.call(this);
171 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
177 cursor_changed : function (self) {
178 // SEE SELECTION.CHANGED
183 if (this.el.get_selection().count_selected_rows() < 1) {
184 //nothing? - clea it?
188 var model = this.get('/changedFilesStore');
190 var s = this.el.get_selection();
192 s.selected_foreach(function(model,p,iter) {
194 files.push( model.get_value(iter, 0).value.get_string());
197 this.get('/patchview').showDiff(files);
198 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
199 //print("OUT?" + value);// id..
200 // load the list in the right grid..
209 XObject.prototype.init.call(this);
210 var description = new Pango.FontDescription.c_new();
211 description.set_size(10000);
212 this.el.modify_font(description);
214 this.selection = this.el.get_selection();
215 this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);
219 this.selection.signal['changed'].connect(function() {
220 _this.listeners.cursor_changed.apply(
227 xtype: Gtk.ListStore,
231 XObject.prototype.init.call(this);
232 this.el.set_column_types ( 7, [
233 GObject.TYPE_STRING, // repo
234 GObject.TYPE_STRING, // current branch
235 GObject.TYPE_STRING, // all branch
236 GObject.TYPE_STRING, // updated
237 GObject.TYPE_BOOLEAN, // auto-commit
238 GObject.TYPE_BOOLEAN, // auto-push
239 GObject.TYPE_BOOLEAN // active
244 //this.insert(citer,iter,0);
245 print("getting list");
246 var tr = imports.Scm.Repo.Repo.list();
249 for(var i =0 ; i < tr.length; i++) {
254 //print(JSON.stringify(ret,null,4));
257 this.el.set_value(ret.iter, 0, '' + tr[i].repopath.split('/').pop() );
258 this.el.set_value(ret.iter, 1, '' + tr[i].currentBranch );
259 this.el.set_value(ret.iter, 2, '' + tr[i].branches.map(
260 function(e) { return e.name;
263 this.el.set_value(ret.iter, 3, '' + 'tbc' );
264 this.el.set_value(ret.iter, 4, tr[i].autocommit() );
265 this.el.set_value(ret.iter, 5, tr[i].autopush() );
266 this.el.set_value(ret.iter, 6, true );
272 xtype: Gtk.TreeViewColumn,
274 pack : "append_column",
275 title : "Auto Commit",
277 XObject.prototype.init.call(this);
278 this.el.add_attribute(this.items[0].el , 'active', 4 );
279 this.items[0].el.set_activatable(true);
284 xtype: Gtk.CellRendererToggle,
286 toggled : function (self, path) {
288 var store = this.get('/reposStore');
289 store.el.get_iter_from_string(ret, path);
291 var value = store.el.get_value(ret.iter,4).value.get_boolean();
293 //print(JSON.stringify(value));
294 store.el.set_value(ret.iter,4, !value);
299 mode : Gtk.CellRendererMode.ACTIVATABLE
304 xtype: Gtk.TreeViewColumn,
306 pack : "append_column",
309 XObject.prototype.init.call(this);
310 this.el.add_attribute(this.items[0].el , 'active', 5 );
311 this.items[0].el.set_activatable(true);
315 xtype: Gtk.CellRendererToggle,
317 toggled : function (self, path) {
319 var store = this.get('/reposStore');
320 store.el.get_iter_from_string(ret, path);
322 var value = store.el.get_value(ret.iter,5).value.get_boolean();
324 //print(JSON.stringify(value));
325 store.el.set_value(ret.iter,5, !value);
330 mode : Gtk.CellRendererMode.ACTIVATABLE
335 xtype: Gtk.TreeViewColumn,
337 pack : "append_column",
341 XObject.prototype.init.call(this);
342 this.el.add_attribute(this.items[0].el , 'markup', 0 );
347 xtype: Gtk.CellRendererText,
353 xtype: Gtk.TreeViewColumn,
355 pack : "append_column",
356 title : "Current Branch",
358 XObject.prototype.init.call(this);
359 this.el.add_attribute(this.items[0].el , 'markup', 1 );
364 xtype: Gtk.CellRendererText,
370 xtype: Gtk.TreeViewColumn,
372 pack : "append_column",
373 title : "Last updated",
375 XObject.prototype.init.call(this);
376 this.el.add_attribute(this.items[0].el , 'markup', 3 );
381 xtype: Gtk.CellRendererText,
387 xtype: Gtk.TreeViewColumn,
389 pack : "append_column",
391 title : "All Branches",
393 XObject.prototype.init.call(this);
394 this.el.add_attribute(this.items[0].el , 'markup', 2 );
399 xtype: Gtk.CellRendererText,
411 xtype: Gtk.ListStore,
423 pack : "add_action_widget,0"
429 pack : "add_action_widget,1"
434 XObject.cache['/Clones'] = Clones;