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 ( 7, [
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
232 GObject.TYPE_BOOLEAN // active
237 //this.insert(citer,iter,0);
238 print("getting list");
239 var tr = imports.Scm.Repo.Repo.list();
242 for(var i =0 ; i < tr.length; i++) {
247 //print(JSON.stringify(ret,null,4));
250 this.el.set_value(ret.iter, 0, '' + tr[i].repopath.split('/').pop() );
251 this.el.set_value(ret.iter, 1, '' + tr[i].currentBranch );
252 this.el.set_value(ret.iter, 2, '' + tr[i].branches.map(
253 function(e) { return e.name;
256 this.el.set_value(ret.iter, 3, '' + 'tbc' );
257 this.el.set_value(ret.iter, 4, tr[i].autocommit() );
258 this.el.set_value(ret.iter, 5, tr[i].autopush() );
259 this.el.set_value(ret.iter, 6, true );
265 xtype: Gtk.TreeViewColumn,
267 pack : "append_column",
268 title : "Auto Commit",
270 XObject.prototype.init.call(this);
271 this.el.add_attribute(this.items[0].el , 'active', 4 );
272 this.items[0].el.set_activatable(true);
277 xtype: Gtk.CellRendererToggle,
279 mode : Gtk.CellRendererMode.ACTIVATABLE
284 xtype: Gtk.TreeViewColumn,
286 pack : "append_column",
289 XObject.prototype.init.call(this);
290 this.el.add_attribute(this.items[0].el , 'active', 5 );
291 this.el.add_attribute(this.items[0].el , 'activatable', 6 );
295 xtype: Gtk.CellRendererToggle,
297 mode : Gtk.CellRendererMode.ACTIVATABLE
302 xtype: Gtk.TreeViewColumn,
304 pack : "append_column",
308 XObject.prototype.init.call(this);
309 this.el.add_attribute(this.items[0].el , 'markup', 0 );
314 xtype: Gtk.CellRendererText,
320 xtype: Gtk.TreeViewColumn,
322 pack : "append_column",
323 title : "Current Branch",
325 XObject.prototype.init.call(this);
326 this.el.add_attribute(this.items[0].el , 'markup', 1 );
331 xtype: Gtk.CellRendererText,
337 xtype: Gtk.TreeViewColumn,
339 pack : "append_column",
340 title : "Last updated",
342 XObject.prototype.init.call(this);
343 this.el.add_attribute(this.items[0].el , 'markup', 3 );
348 xtype: Gtk.CellRendererText,
354 xtype: Gtk.TreeViewColumn,
356 pack : "append_column",
358 title : "All Branches",
360 XObject.prototype.init.call(this);
361 this.el.add_attribute(this.items[0].el , 'markup', 2 );
366 xtype: Gtk.CellRendererText,
378 xtype: Gtk.ListStore,
390 pack : "add_action_widget,0"
396 pack : "add_action_widget,1"
401 XObject.cache['/Clones'] = Clones;