Fix #5560 - Gitlive - branching wip
[gitlive] / old_seed_version / RemoteEdit.bjs
1 {
2     "id": "file-gtk-5",
3     "name": "RemoteEdit",
4     "parent": "",
5     "title": false,
6     "path": "/home/alan/gitlive/gitlive/RemoteEdit.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "destroy_event": "function (self, event) {\n     this.el.hide();\n                return false;\n}",
11                 "response": "function (self, id) {\n  // hide\n     //if (id < 1) {\n        this.el.hide();\n        return;\n    //}\n    if (typeof(this.get('bug').getValue()) != 'object') {\n        print(\"ERROR\");\n        return;\n    }\n \n    this.el.hide();\n        \n    //var val = this.get('bug').getValue();\n     //   Seed.print(val);\n}"
12             },
13             " modal": true,
14             "border_width": 3,
15             "default_height": 150,
16             "default_width": 500,
17             "title": "Remotes",
18             "xtype": "Dialog",
19             "|deletable": true,
20             "|modal": true,
21             "|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",
22             "|xns": "Gtk",
23             "items": [
24                 {
25                     "xtype": "VBox",
26                     "|pack": " function(p,e) {\n        p.el.get_content_area().pack_start(e.el,true,true,10);\n    }\n",
27                     "|xns": "Gtk",
28                     "items": [
29                         {
30                             "pack": "pack_start,false,true,10",
31                             "xtype": "HBox",
32                             "|xns": "Gtk",
33                             "items": [
34                                 {
35                                     "label": "URL :",
36                                     "pack": "pack_start,false,false,10",
37                                     "width_request": 50,
38                                     "xtype": "Label",
39                                     "|xns": "Gtk"
40                                 },
41                                 {
42                                     "listeners": {
43                                         "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}"
44                                     },
45                                     "id": "remoteURL",
46                                     "xtype": "ComboBox",
47                                     "|init": "function() {\n    this.el = new Gtk.ComboBox.with_entry();\n    \n    \n    this.model  = new XObject(this.model);\n    this.model.init();\n    this.el.set_model(this.model.el);\n    this.el.set_entry_text_column (0);\n     XObject.prototype.init.call(this);\n    \n}\n",
48                                     "|load": "function(tr)\n{\n    //this.insert(citer,iter,0);\n    this.model.el.clear();\n    \n    var master = false;\n    var working = false;\n    \n    for(var i =0 ; i < tr.length; i++) {\n        var ret = {  };\n        this.model.el.append(ret);\n        //print(JSON.stringify(ret,null,4));\n        if (tr[i].name == 'master') {\n            master = i;\n        }\n        if (tr[i].name == 'working') {\n            working = i;\n        }          \n        this.model.el.set_value(ret.iter, 0, '' + tr[i].name );\n        this.model.el.set_value(ret.iter, 1, '' + tr[i].rev  );\n \n        \n    }     \n    if (master !== false) {\n        this.el.set_active(master);\n    }\n    if (working !== false) {\n        this.el.set_active(working);\n    }\n    \n}",
49                                     "|xns": "Gtk",
50                                     "items": [
51                                         {
52                                             "*prop": "model",
53                                             "xtype": "ListStore",
54                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.set_column_types ( 3, [\n           GObject.TYPE_STRING, // file  \n          GObject.TYPE_STRING, // added\n          GObject.TYPE_STRING, // removed\n      ] );\n}\n",
55                                             "|xns": "Gtk"
56                                         }
57                                     ]
58                                 }
59                             ]
60                         },
61                         {
62                             "pack": "pack_start,false,true,10",
63                             "xtype": "HBox",
64                             "|xns": "Gtk",
65                             "items": [
66                                 {
67                                     "label": "Name : ",
68                                     "pack": "pack_start,false,false,10",
69                                     "width_request": 50,
70                                     "xalign": 1,
71                                     "xtype": "Label",
72                                     "|xns": "Gtk"
73                                 },
74                                 {
75                                     "id": "remoteName",
76                                     "xtype": "Entry",
77                                     "|xns": "Gtk"
78                                 }
79                             ]
80                         }
81                     ]
82                 },
83                 {
84                     "label": "Cancel",
85                     "pack": "add_action_widget,0",
86                     "xtype": "Button",
87                     "|xns": "Gtk",
88                     "listeners": {}
89                 },
90                 {
91                     "id": "ok_button",
92                     "label": "Add",
93                     "pack": "add_action_widget,1",
94                     "xtype": "Button",
95                     "|xns": "Gtk"
96                 }
97             ]
98         }
99     ],
100     "permname": "",
101     "modOrder": "0"
102 }