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 RemoteEdit=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('/remotesStore').load();
50 this.get('/remoteURL').el.get_child().set_text('');
51 this.get('/remoteName').el.set_text('');
56 var run_ret = this.el.run();
61 url : this.get('/remoteURL').el.get_child().get_text(),
62 name : this.get('/remoteName').el.get_text()
73 pack : function(p,e) {
74 p.el.get_content_area().pack_start(e.el,true,true,10);
79 pack : "pack_start,false,true,10",
84 pack : "pack_start,false,false,10",
90 changed : function (self) {
91 var val = this.el.get_child().get_text();
92 print(JSON.stringify(val));
97 var name = this.get('/remoteName').el.get_text();
102 var val = imports.Scm.Git.Repo.Repo.parseURL(val);
103 if ((typeof(val.host) != 'undefined') && val.host.length) {
105 // need to add github owner...
106 if (host.match(/github.com$/)) {
107 host += '.' + val.path.split('/').shift();
111 this.get('/remoteName').el.set_text(host);
119 this.el = new Gtk.ComboBox.with_entry();
122 this.model = new XObject(this.model);
124 this.el.set_model(this.model.el);
125 this.el.set_entry_text_column (0);
126 XObject.prototype.init.call(this);
131 //this.insert(citer,iter,0);
132 this.model.el.clear();
137 for(var i =0 ; i < tr.length; i++) {
139 this.model.el.append(ret);
140 //print(JSON.stringify(ret,null,4));
141 if (tr[i].name == 'master') {
144 if (tr[i].name == 'working') {
147 this.model.el.set_value(ret.iter, 0, '' + tr[i].name );
148 this.model.el.set_value(ret.iter, 1, '' + tr[i].rev );
152 if (master !== false) {
153 this.el.set_active(master);
155 if (working !== false) {
156 this.el.set_active(working);
161 xtype: Gtk.ListStore,
163 XObject.prototype.init.call(this);
164 this.el.set_column_types ( 3, [
165 GObject.TYPE_STRING, // file
166 GObject.TYPE_STRING, // added
167 GObject.TYPE_STRING, // removed
176 pack : "pack_start,false,true,10",
181 pack : "pack_start,false,false,10",
196 pack : "add_action_widget,0"
202 pack : "add_action_widget,1"
207 XObject.cache['/RemoteEdit'] = RemoteEdit;