this.init();
}
var _this = this;
- this.get('/remotesStore').load();
+ //this.get('/remotesStore').load();
+ this.get('/remoteURL').el.get_child().set_text('');
+ this.get('/remoteName').el.set_text('');
+
+
this.el.show_all();
var run_ret = this.el.run();
if (run_ret < 1 ) {
- return "DONE";
+ return false;
}
- print("RUN RETURN : " + run_ret);
- return "DONE";
+ var ret= {
+ url : this.get('/remoteURL').el.get_child().get_text(),
+ name : this.get('/remoteName').el.get_text()
+ };
+
+ return ret;
+
+
},
items : [
p.el.get_content_area().pack_start(e.el,true,true,10);
},
items : [
- {
- xtype: Gtk.HBox,
- pack : "pack_start,false,true,10",
- items : [
- {
- xtype: Gtk.Label,
- label : "Name : ",
- pack : "pack_start,false,false,10",
- width_request : 50,
- xalign : 1
- },
- {
- xtype: Gtk.Entry,
- id : "remoteName"
- }
- ]
- },
{
xtype: Gtk.HBox,
pack : "pack_start,false,true,10",
listeners : {
changed : function (self) {
var val = this.el.get_child().get_text();
-
+ print(JSON.stringify(val));
if (!val.length) {
return;
}
return;
}
// fill in name
- imports.Scm.Git.Repo.Repo.parseURL(val);
+ var val = imports.Scm.Git.Repo.Repo.parseURL(val);
if ((typeof(val.host) != 'undefined') && val.host.length) {
- this.get('/remoteName').el.set_text(val.host);
+ var host = val.host;
+ // need to add github owner...
+ if (host.match(/github.com$/)) {
+ host += '.' + val.path.split('/').shift();
+ }
+
+
+ this.get('/remoteName').el.set_text(host);
}
}
}
]
+ },
+ {
+ xtype: Gtk.HBox,
+ pack : "pack_start,false,true,10",
+ items : [
+ {
+ xtype: Gtk.Label,
+ label : "Name : ",
+ pack : "pack_start,false,false,10",
+ width_request : 50,
+ xalign : 1
+ },
+ {
+ xtype: Gtk.Entry,
+ id : "remoteName"
+ }
+ ]
}
]
},