Clones.bjs
[gitlive] / Clones.bjs
1 {
2     "id": "file-gtk-3",
3     "name": "Clones",
4     "parent": "",
5     "title": false,
6     "path": "/home/alan/gitlive/gitlive/Clones.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             "border_width": 3,
14             "default_height": 700,
15             "default_width": 800,
16             "title": "Manage Clones",
17             "xtype": "Dialog",
18             "|deletable": true,
19             "|modal": true,
20             "|show": "function(c) {\n    \n    if (!this.el) {\n        this.init();\n    }\n    var _this = this;\n    /*[ 'xtype'  ].forEach(function(k) {\n        _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);\n    });\n\t// shouild set path..\n    */\n \n    this.el.show_all();\n    // load clones..\n    \n    //this.get('/ok_button').el.set_sensitive(false);\n    \n    // block until we return.\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    //print(JSON.stringify(this.get('bug').getValue()));\n   // return this.get('bug').getValue();\n    //this.success = c.success;\n}\n",
21             "|xns": "Gtk",
22             "items": [
23                 {
24                     "xtype": "VBox",
25                     "|pack": " function(p,e) {\n        p.el.get_content_area().pack_start(e.el,true,true,0)\n    }\n",
26                     "|xns": "Gtk",
27                     "items": [
28                         {
29                             "pack": "pack_start,false,true",
30                             "xtype": "HBox",
31                             "|xns": "Gtk",
32                             "items": [
33                                 {
34                                     "listeners": {
35                                         "clicked": "function (self) {\n    \n    \n \n       \n    \n    \n}"
36                                     },
37                                     "label": "Add Clone",
38                                     "pack": "add",
39                                     "xtype": "Button",
40                                     "|xns": "Gtk"
41                                 },
42                                 {
43                                     "listeners": {
44                                         "clicked": "function (self) {\n    \n    \n \n       \n    \n    \n}"
45                                     },
46                                     "label": "Add Branch",
47                                     "pack": "add",
48                                     "xtype": "Button",
49                                     "|xns": "Gtk"
50                                 },
51                                 {
52                                     "listeners": {
53                                         "clicked": "function (self) {\n    var Merger =     imports.Merger.Merger;\n    Merger.repo = new Repo('/home/alan/gitlive/roojs1');\n    Merger.show();\n\n       \n    \n    \n}"
54                                     },
55                                     "label": "Run Merger",
56                                     "pack": "add",
57                                     "xtype": "Button",
58                                     "|xns": "Gtk"
59                                 },
60                                 {
61                                     "listeners": {
62                                         "clicked": "function (self) {\n    \n    \n \n       \n    \n    \n}"
63                                     },
64                                     "label": "Switch Branch",
65                                     "pack": "add",
66                                     "xtype": "Button",
67                                     "|xns": "Gtk"
68                                 }
69                             ]
70                         },
71                         {
72                             "pack": "pack_end,true,true,0",
73                             "position": 400,
74                             "xtype": "VPaned",
75                             "|xns": "Gtk",
76                             "items": [
77                                 {
78                                     "pack": "add",
79                                     "position": 200,
80                                     "xtype": "HPaned",
81                                     "|xns": "Gtk",
82                                     "items": [
83                                         {
84                                             "xtype": "ScrolledWindow",
85                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n      this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)\n}\n",
86                                             "|xns": "Gtk",
87                                             "items": [
88                                                 {
89                                                     "listeners": {
90                                                         "cursor_changed": "function (self) {\n  // SEE SELECTION.CHANGED\n    if (this.el.get_selection().count_selected_rows() < 1) {\n        //nothing? - clea it?\n        return;\n    }\n        var ret = {};         \n    var model = this.get('/changedFilesStore');\n\n     var s = this.el.get_selection();\n     var files = [];\n    s.selected_foreach(function(model,p,iter) {\n    \n       files.push( model.get_value(iter, 0).value.get_string());\n     \n    });\n    this.get('/patchview').showDiff(files); \n    //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();\n     //print(\"OUT?\" + value);// id..\n    // load the list in the right grid..\n     \n    return true;\n\n}"
91                                                     },
92                                                     "id": "changedFilesView",
93                                                     "pack": "add",
94                                                     "xtype": "TreeView",
95                                                     "|init": "function() {\n    XObject.prototype.init.call(this);\n        var description = new Pango.FontDescription.c_new();\n   description.set_size(8000);\n     this.el.modify_font(description);\n\n     this.selection = this.el.get_selection();\n      this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);\n    var _this = this;\n  this.selection.signal['changed'].connect(function() {\n     _this.listeners.cursor_changed.apply(\n          _this, [ _this, '']\n       );\n             });\n  }\n",
96                                                     "|xns": "Gtk",
97                                                     "items": [
98                                                         {
99                                                             "id": "changedFilesStore",
100                                                             "pack": "set_model",
101                                                             "xtype": "ListStore",
102                                                             "|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",
103                                                             "|load": "function(tr)\n{\n    //this.insert(citer,iter,0);\n    this.el.clear();\n    for(var i =0 ; i < tr.length; i++) {\n        var ret = {  };\n       \n        this.el.append(ret);\n        \n        //print(JSON.stringify(ret,null,4));\n         \n          \n        this.el.set_value(ret.iter, 0, ''  +  tr[i].filename );\n        this.el.set_value(ret.iter, 1, '' + tr[i].added  );\n        this.el.set_value(ret.iter, 2, '' + tr[i].removed  );\n \n        \n    }     \n}",
104                                                             "|xns": "Gtk"
105                                                         },
106                                                         {
107                                                             "resizable": true,
108                                                             "min_width": 200,
109                                                             "pack": "append_column",
110                                                             "title": "Filename",
111                                                             "xtype": "TreeViewColumn",
112                                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 0 );\n\n}\n",
113                                                             "|xns": "Gtk",
114                                                             "items": [
115                                                                 {
116                                                                     "pack": "pack_start",
117                                                                     "xtype": "CellRendererText",
118                                                                     "|xns": "Gtk"
119                                                                 }
120                                                             ]
121                                                         },
122                                                         {
123                                                             "min_width": 50,
124                                                             "pack": "append_column",
125                                                             "title": "Added",
126                                                             "xtype": "TreeViewColumn",
127                                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 1 );\n\n}\n",
128                                                             "|xns": "Gtk",
129                                                             "items": [
130                                                                 {
131                                                                     "pack": "pack_start",
132                                                                     "xtype": "CellRendererText",
133                                                                     "|xns": "Gtk"
134                                                                 }
135                                                             ]
136                                                         },
137                                                         {
138                                                             "min_width": 50,
139                                                             "pack": "append_column",
140                                                             "title": "Removed",
141                                                             "xtype": "TreeViewColumn",
142                                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 2 );\n\n}\n",
143                                                             "|xns": "Gtk",
144                                                             "items": [
145                                                                 {
146                                                                     "pack": "pack_start",
147                                                                     "xtype": "CellRendererText",
148                                                                     "|xns": "Gtk"
149                                                                 }
150                                                             ]
151                                                         }
152                                                     ]
153                                                 },
154                                                 {
155                                                     "|xns": "Gtk",
156                                                     "xtype": "TreeView",
157                                                     "pack": false,
158                                                     "items": [
159                                                         {
160                                                             "|xns": "Gtk",
161                                                             "xtype": "ListStore",
162                                                             "pack": false
163                                                         }
164                                                     ]
165                                                 }
166                                             ]
167                                         }
168                                     ]
169                                 },
170                                 {
171                                     "xtype": "VBox",
172                                     "|xns": "Gtk",
173                                     "items": [
174                                         {
175                                             "pack": "pack_start,false,false,0",
176                                             "xtype": "HBox",
177                                             "|xns": "Gtk",
178                                             "items": [
179                                                 {
180                                                     "label": "Commit diff (no merge)",
181                                                     "xtype": "Button",
182                                                     "|xns": "Gtk"
183                                                 },
184                                                 {
185                                                     "label": "Commit diff (merge after)",
186                                                     "xtype": "Button",
187                                                     "|xns": "Gtk"
188                                                 }
189                                             ]
190                                         },
191                                         {
192                                             "pack": "pack_end,true,true,0",
193                                             "xtype": "ScrolledWindow",
194                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n      this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)\n}\n",
195                                             "|xns": "Gtk",
196                                             "items": [
197                                                 {
198                                                     "id": "patchview",
199                                                     "pack": "add",
200                                                     "xtype": "WebView",
201                                                     "|showDiff": "function(files) {\n    \n     var Repo = imports.Scm.Git.Repo.Repo;\n    \n    \n    \n    var repo = new Repo({ repopath : '/home/alan/gitlive/roojs1' });\n \n \n    var diff = repo.diff(files, 'github', 'master');\n    \n   // remove..\n    var s  = \"document.body.textContent='';var pre  = document.createElement('pre'); document.body.appendChild(pre);\";\n    s += \"pre.textContent =  \" +\n             JSON.stringify(repo.lastCmd + \"\\n\") + '+  ' + \n           JSON.stringify(diff) + \";\";\n    print(s);\n        \n    this.el.execute_script(s);\n        \n        \n    \n    \n    \n}\n",
202                                                     "|xns": "WebKit"
203                                                 }
204                                             ]
205                                         }
206                                     ]
207                                 }
208                             ]
209                         },
210                         {
211                             "xtype": "ScrolledWindow",
212                             "|init": "function() {\n    XObject.prototype.init.call(this);\n      this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)\n}\n",
213                             "|xns": "Gtk",
214                             "pack": false,
215                             "items": [
216                                 {
217                                     "listeners": {
218                                         "cursor_changed": "function (self) {\n  // SEE SELECTION.CHANGED\n    if (this.el.get_selection().count_selected_rows() < 1) {\n        //nothing? - clea it?\n        return;\n    }\n        var ret = {};         \n    var model = this.get('/changedFilesStore');\n\n     var s = this.el.get_selection();\n     var files = [];\n    s.selected_foreach(function(model,p,iter) {\n    \n       files.push( model.get_value(iter, 0).value.get_string());\n     \n    });\n    this.get('/patchview').showDiff(files); \n    //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();\n     //print(\"OUT?\" + value);// id..\n    // load the list in the right grid..\n     \n    return true;\n\n}"
219                                     },
220                                     "id": "changedFilesView",
221                                     "pack": "add",
222                                     "xtype": "TreeView",
223                                     "|init": "function() {\n    XObject.prototype.init.call(this);\n        var description = new Pango.FontDescription.c_new();\n   description.set_size(8000);\n     this.el.modify_font(description);\n\n     this.selection = this.el.get_selection();\n      this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);\n    var _this = this;\n  this.selection.signal['changed'].connect(function() {\n     _this.listeners.cursor_changed.apply(\n          _this, [ _this, '']\n       );\n             });\n  }\n",
224                                     "|xns": "Gtk",
225                                     "items": [
226                                         {
227                                             "id": "changedFilesStore",
228                                             "pack": "set_model",
229                                             "xtype": "ListStore",
230                                             "|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",
231                                             "|load": "function(tr)\n{\n    //this.insert(citer,iter,0);\n    this.el.clear();\n    for(var i =0 ; i < tr.length; i++) {\n        var ret = {  };\n       \n        this.el.append(ret);\n        \n        //print(JSON.stringify(ret,null,4));\n         \n          \n        this.el.set_value(ret.iter, 0, ''  +  tr[i].filename );\n        this.el.set_value(ret.iter, 1, '' + tr[i].added  );\n        this.el.set_value(ret.iter, 2, '' + tr[i].removed  );\n \n        \n    }     \n}",
232                                             "|xns": "Gtk"
233                                         },
234                                         {
235                                             "resizable": true,
236                                             "min_width": 200,
237                                             "pack": "append_column",
238                                             "title": "Filename",
239                                             "xtype": "TreeViewColumn",
240                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 0 );\n\n}\n",
241                                             "|xns": "Gtk",
242                                             "items": [
243                                                 {
244                                                     "pack": "pack_start",
245                                                     "xtype": "CellRendererText",
246                                                     "|xns": "Gtk"
247                                                 }
248                                             ]
249                                         },
250                                         {
251                                             "min_width": 50,
252                                             "pack": "append_column",
253                                             "title": "Added",
254                                             "xtype": "TreeViewColumn",
255                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 1 );\n\n}\n",
256                                             "|xns": "Gtk",
257                                             "items": [
258                                                 {
259                                                     "pack": "pack_start",
260                                                     "xtype": "CellRendererText",
261                                                     "|xns": "Gtk"
262                                                 }
263                                             ]
264                                         },
265                                         {
266                                             "min_width": 50,
267                                             "pack": "append_column",
268                                             "title": "Removed",
269                                             "xtype": "TreeViewColumn",
270                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 2 );\n\n}\n",
271                                             "|xns": "Gtk",
272                                             "items": [
273                                                 {
274                                                     "pack": "pack_start",
275                                                     "xtype": "CellRendererText",
276                                                     "|xns": "Gtk"
277                                                 }
278                                             ]
279                                         }
280                                     ]
281                                 },
282                                 {
283                                     "|xns": "Gtk",
284                                     "xtype": "TreeView",
285                                     "pack": false,
286                                     "items": [
287                                         {
288                                             "|xns": "Gtk",
289                                             "xtype": "ListStore",
290                                             "pack": false
291                                         }
292                                     ]
293                                 }
294                             ]
295                         }
296                     ]
297                 },
298                 {
299                     "label": "Cancel",
300                     "pack": "add_action_widget,0",
301                     "xtype": "Button",
302                     "|xns": "Gtk",
303                     "listeners": {}
304                 },
305                 {
306                     "id": "ok_button",
307                     "label": "OK",
308                     "pack": "add_action_widget,1",
309                     "xtype": "Button",
310                     "|xns": "Gtk"
311                 }
312             ]
313         }
314     ],
315     "permname": "",
316     "modOrder": "0"
317 }