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