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;
12 Branches=new 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();
49 this.get('/branchStore').load();
52 var run_ret = this.el.run();
56 print("RUN RETURN : " + run_ret);
63 pack : function(p,e) {
64 p.el.get_content_area().pack_start(e.el,true,true,0)
69 pack : "pack_start,false,true",
74 clicked : function (self) {
77 var RemoteEdit= imports.RemoteEdit.RemoteEdit
78 RemoteEdit.repo = Remotes.repo;
79 RemoteEdit.el.set_transient_for(Remotes.el);
81 var res = RemoteEdit.show();
84 Remotes.repo.remotes(res);
87 this.get('/remotesStore').load();
98 xtype: Gtk.ScrolledWindow,
100 XObject.prototype.init.call(this);
101 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
107 cursor_changed : function (self)
111 // SEE SELECTION.CHANGED
112 if (this.el.get_selection().count_selected_rows() < 1) {
113 //nothing? - clea it?
117 var model = this.get('/changedFilesStore');
119 var s = this.el.get_selection();
121 s.selected_foreach(function(model,p,iter) {
123 files.push( model.get_value(iter, 0).value.get_string());
126 this.get('/patchview').showDiff(files);
127 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
128 //print("OUT?" + value);// id..
129 // load the list in the right grid..
138 XObject.prototype.init.call(this);
139 var description = new Pango.FontDescription.c_new();
140 description.set_size(8000);
141 this.el.modify_font(description);
143 this.selection = this.el.get_selection();
144 this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);
146 this.selection.signal['changed'].connect(function() {
147 _this.listeners.cursor_changed.apply(
154 xtype: Gtk.ListStore,
158 XObject.prototype.init.call(this);
159 this.el.set_column_types ( 3, [
160 GObject.TYPE_STRING, // file
161 GObject.TYPE_STRING, // added
162 GObject.TYPE_STRING, // removed
167 //this.insert(citer,iter,0);
170 var tr = Branches.repo.getBranches();
173 for(var i =0 ; i < tr.length; i++) {
178 //print(JSON.stringify(ret,null,4));
179 var lastrev = tr[i].lastrev;
180 var remoterev = tr[i].remoterev;
182 var lastrev = lastrev.length ? lastrev : remoterev;
184 if (lastrev != remoterev) {
185 lastrev = "Out of sync: remote=" + remoterev + ", local=" + lastrev;
190 this.el.set_value(ret.iter, 0, '' + tr[i].name );
191 this.el.set_value(ret.iter, 1, '' + tr[i].remote );
192 this.el.set_value(ret.iter, 2, '' + lastrev );
199 xtype: Gtk.TreeViewColumn,
201 pack : "append_column",
205 XObject.prototype.init.call(this);
206 this.el.add_attribute(this.items[0].el , 'markup', 0 );
211 xtype: Gtk.CellRendererText,
217 xtype: Gtk.TreeViewColumn,
219 pack : "append_column",
223 XObject.prototype.init.call(this);
224 this.el.add_attribute(this.items[0].el , 'markup', 1 );
229 xtype: Gtk.CellRendererText,
235 xtype: Gtk.TreeViewColumn,
237 pack : "append_column",
240 XObject.prototype.init.call(this);
241 this.el.add_attribute(this.items[0].el , 'markup', 2 );
246 xtype: Gtk.CellRendererText,
258 xtype: Gtk.ListStore,
270 pack : "add_action_widget,0"
276 pack : "add_action_widget,1"
281 XObject.cache['/Branches'] = Branches;