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();
49 this.get('/remotesStore').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 = Remotes.repo.remotes();
173 for(var i =0 ; i < tr.length; i++) {
178 //print(JSON.stringify(ret,null,4));
181 this.el.set_value(ret.iter, 0, '' + tr[i].name );
182 this.el.set_value(ret.iter, 1, '' + tr[i].url );
183 this.el.set_value(ret.iter, 2, '' + tr[i].type );
190 xtype: Gtk.TreeViewColumn,
192 pack : "append_column",
196 XObject.prototype.init.call(this);
197 this.el.add_attribute(this.items[0].el , 'markup', 0 );
202 xtype: Gtk.CellRendererText,
208 xtype: Gtk.TreeViewColumn,
210 pack : "append_column",
214 XObject.prototype.init.call(this);
215 this.el.add_attribute(this.items[0].el , 'markup', 2 );
220 xtype: Gtk.CellRendererText,
226 xtype: Gtk.TreeViewColumn,
228 pack : "append_column",
231 XObject.prototype.init.call(this);
232 this.el.add_attribute(this.items[0].el , 'markup', 1 );
237 xtype: Gtk.CellRendererText,
249 xtype: Gtk.ListStore,
261 pack : "add_action_widget,0"
267 pack : "add_action_widget,1"
272 XObject.cache['/Remotes'] = Remotes;