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();
83 Remotes.repo.remotes(res);
96 xtype: Gtk.ScrolledWindow,
98 XObject.prototype.init.call(this);
99 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
105 cursor_changed : function (self)
109 // SEE SELECTION.CHANGED
110 if (this.el.get_selection().count_selected_rows() < 1) {
111 //nothing? - clea it?
115 var model = this.get('/changedFilesStore');
117 var s = this.el.get_selection();
119 s.selected_foreach(function(model,p,iter) {
121 files.push( model.get_value(iter, 0).value.get_string());
124 this.get('/patchview').showDiff(files);
125 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
126 //print("OUT?" + value);// id..
127 // load the list in the right grid..
136 XObject.prototype.init.call(this);
137 var description = new Pango.FontDescription.c_new();
138 description.set_size(8000);
139 this.el.modify_font(description);
141 this.selection = this.el.get_selection();
142 this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);
144 this.selection.signal['changed'].connect(function() {
145 _this.listeners.cursor_changed.apply(
152 xtype: Gtk.ListStore,
156 XObject.prototype.init.call(this);
157 this.el.set_column_types ( 3, [
158 GObject.TYPE_STRING, // file
159 GObject.TYPE_STRING, // added
160 GObject.TYPE_STRING, // removed
165 //this.insert(citer,iter,0);
168 var tr = Remotes.repo.remotes();
171 for(var i =0 ; i < tr.length; i++) {
176 //print(JSON.stringify(ret,null,4));
179 this.el.set_value(ret.iter, 0, '' + tr[i].name );
180 this.el.set_value(ret.iter, 1, '' + tr[i].url );
181 this.el.set_value(ret.iter, 2, '' + tr[i].type );
188 xtype: Gtk.TreeViewColumn,
190 pack : "append_column",
194 XObject.prototype.init.call(this);
195 this.el.add_attribute(this.items[0].el , 'markup', 0 );
200 xtype: Gtk.CellRendererText,
206 xtype: Gtk.TreeViewColumn,
208 pack : "append_column",
212 XObject.prototype.init.call(this);
213 this.el.add_attribute(this.items[0].el , 'markup', 2 );
218 xtype: Gtk.CellRendererText,
224 xtype: Gtk.TreeViewColumn,
226 pack : "append_column",
229 XObject.prototype.init.call(this);
230 this.el.add_attribute(this.items[0].el , 'markup', 1 );
235 xtype: Gtk.CellRendererText,
247 xtype: Gtk.ListStore,
259 pack : "add_action_widget,0"
265 pack : "add_action_widget,1"
270 XObject.cache['/Remotes'] = Remotes;