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) {
116 var Merger = imports.Merger.Merger;
117 Merger.repo = new Repo('/home/alan/gitlive/roojs1');
125 label : "Run Merger",
131 clicked : function (self) {
140 label : "Switch Branch",
146 clicked : function (self) {
161 xtype: Gtk.ScrolledWindow,
163 XObject.prototype.init.call(this);
164 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
170 cursor_changed : function (self) {
171 // SEE SELECTION.CHANGED
176 if (this.el.get_selection().count_selected_rows() < 1) {
177 //nothing? - clea it?
181 var model = this.get('/changedFilesStore');
183 var s = this.el.get_selection();
185 s.selected_foreach(function(model,p,iter) {
187 files.push( model.get_value(iter, 0).value.get_string());
190 this.get('/patchview').showDiff(files);
191 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
192 //print("OUT?" + value);// id..
193 // load the list in the right grid..
202 XObject.prototype.init.call(this);
203 var description = new Pango.FontDescription.c_new();
204 description.set_size(10000);
205 this.el.modify_font(description);
207 this.selection = this.el.get_selection();
208 this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);
212 this.selection.signal['changed'].connect(function() {
213 _this.listeners.cursor_changed.apply(
220 xtype: Gtk.ListStore,
224 XObject.prototype.init.call(this);
225 this.el.set_column_types ( 3, [
226 GObject.TYPE_STRING, // repo
227 GObject.TYPE_STRING, // current branch
228 GObject.TYPE_STRING, // all branch
229 GObject.TYPE_STRING, // updated
230 GObject.TYPE_BOOLEAN, // auto-commit
231 GObject.TYPE_BOOLEAN // auto-push
236 //this.insert(citer,iter,0);
237 print("getting list");
238 var tr = imports.Scm.Repo.Repo.list();
241 for(var i =0 ; i < tr.length; i++) {
246 //print(JSON.stringify(ret,null,4));
249 this.el.set_value(ret.iter, 0, '' + tr[i].repopath.split('/').pop() );
250 this.el.set_value(ret.iter, 1, '' + tr[i].currentBranch );
251 this.el.set_value(ret.iter, 2, '' + tr[i].branches.map(
252 function(e) { return e.name;
255 this.el.set_value(ret.iter, 3, '' + 'tbc' );
256 this.el.set_value(ret.iter, 4, tr[i].autocommit() );
257 this.el.set_value(ret.iter, 5, tr[i].autopush() );
264 xtype: Gtk.TreeViewColumn,
266 pack : "append_column",
267 title : "Auto Commit",
269 XObject.prototype.init.call(this);
270 this.el.add_attribute(this.items[0].el , 'active', 4 );
275 xtype: Gtk.CellRendererToggle,
281 xtype: Gtk.TreeViewColumn,
283 pack : "append_column",
287 XObject.prototype.init.call(this);
288 this.el.add_attribute(this.items[0].el , 'markup', 0 );
293 xtype: Gtk.CellRendererText,
299 xtype: Gtk.TreeViewColumn,
301 pack : "append_column",
302 title : "Current Branch",
304 XObject.prototype.init.call(this);
305 this.el.add_attribute(this.items[0].el , 'markup', 1 );
310 xtype: Gtk.CellRendererText,
316 xtype: Gtk.TreeViewColumn,
319 pack : "append_column",
320 title : "All Branches",
322 XObject.prototype.init.call(this);
323 this.el.add_attribute(this.items[0].el , 'markup', 2 );
328 xtype: Gtk.CellRendererText,
334 xtype: Gtk.TreeViewColumn,
336 pack : "append_column",
337 title : "Last updated",
339 XObject.prototype.init.call(this);
340 this.el.add_attribute(this.items[0].el , 'markup', 3 );
345 xtype: Gtk.CellRendererText,
351 xtype: Gtk.TreeViewColumn,
353 pack : "append_column",
354 title : "Auto Commit",
356 XObject.prototype.init.call(this);
357 this.el.add_attribute(this.items[0].el , 'active', 4 );
362 xtype: Gtk.CellRendererToggle,
368 xtype: Gtk.TreeViewColumn,
370 pack : "append_column",
373 XObject.prototype.init.call(this);
374 this.el.add_attribute(this.items[0].el , 'active', 5 );
379 xtype: Gtk.CellRendererToggle,
391 xtype: Gtk.ListStore,
403 pack : "add_action_widget,0"
409 pack : "add_action_widget,1"
414 XObject.cache['/Clones'] = Clones;