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": 500,
15             "default_width": 600,
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        this.get('/reposStore').load();\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                                     "listeners": {
71                                         "clicked": "function (self) {\n    \n    \n \n       \n    \n    \n}"
72                                     },
73                                     "label": "Pull",
74                                     "pack": "add",
75                                     "xtype": "Button",
76                                     "|xns": "Gtk"
77                                 }
78                             ]
79                         },
80                         {
81                             "xtype": "ScrolledWindow",
82                             "|init": "function() {\n    XObject.prototype.init.call(this);\n      this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)\n}\n",
83                             "|xns": "Gtk",
84                             "items": [
85                                 {
86                                     "listeners": {
87                                         "cursor_changed": "function (self) {\n  // SEE SELECTION.CHANGED\n  \n  \n  return;\n  \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}"
88                                     },
89                                     "id": "reposView",
90                                     "pack": "add",
91                                     "xtype": "TreeView",
92                                     "|init": "function() {\n    XObject.prototype.init.call(this);\n        var description = new Pango.FontDescription.c_new();\n   description.set_size(10000);\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    \n    \n  this.selection.signal['changed'].connect(function() {\n     _this.listeners.cursor_changed.apply(\n          _this, [ _this, '']\n       );\n             });\n  }\n",
93                                     "|xns": "Gtk",
94                                     "items": [
95                                         {
96                                             "id": "reposStore",
97                                             "pack": "set_model",
98                                             "xtype": "ListStore",
99                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.set_column_types ( 7, [\n       GObject.TYPE_STRING, // repo  \n      GObject.TYPE_STRING, // current branch\n      GObject.TYPE_STRING, // all branch      \n      GObject.TYPE_STRING, // updated\n       GObject.TYPE_BOOLEAN, // auto-commit\n        GObject.TYPE_BOOLEAN, // auto-push\n           GObject.TYPE_BOOLEAN // active\n  ] );\n}\n",
100                                             "|load": "function()\n{\n    //this.insert(citer,iter,0);\n    print(\"getting list\");\n    var tr = imports.Scm.Repo.Repo.list();\n    \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         tr[i].getBranches();\n          \n        this.el.set_value(ret.iter, 0, '' +  tr[i].repopath.split('/').pop() );\n        this.el.set_value(ret.iter, 1, '' + tr[i].currentBranch   );\n        this.el.set_value(ret.iter, 2, '' + tr[i].branches.map(\n                        function(e) { return e.name; \n                    }).join(', ') \n         );\n        this.el.set_value(ret.iter, 3, '' + 'tbc' );        \n        this.el.set_value(ret.iter, 4, tr[i].autocommit() );                \n        this.el.set_value(ret.iter, 5, tr[i].autopush() );                        \n        this.el.set_value(ret.iter, 6, true );      \n        \n    }     \n}",
101                                             "|xns": "Gtk"
102                                         },
103                                         {
104                                             "clickable": true,
105                                             "min_width": 50,
106                                             "pack": "append_column",
107                                             "title": "Auto Commit",
108                                             "xtype": "TreeViewColumn",
109                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'active', 4 );\n    this.el.add_attribute(this.items[0].el , 'activatable', 6 );\n\n}\n",
110                                             "|xns": "Gtk",
111                                             "items": [
112                                                 {
113                                                     "activatable": true,
114                                                     "pack": "pack_start",
115                                                     "xtype": "CellRendererToggle",
116                                                     "|xns": "Gtk"
117                                                 }
118                                             ]
119                                         },
120                                         {
121                                             "min_width": 50,
122                                             "pack": "append_column",
123                                             "title": "Auto Push",
124                                             "xtype": "TreeViewColumn",
125                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'active', 5 );\n    this.el.add_attribute(this.items[0].el , 'activatable', 6 );\n}\n",
126                                             "|xns": "Gtk",
127                                             "items": [
128                                                 {
129                                                     "activatable": true,
130                                                     "pack": "pack_start",
131                                                     "xtype": "CellRendererToggle",
132                                                     "|xns": "Gtk"
133                                                 }
134                                             ]
135                                         },
136                                         {
137                                             "min_width": 200,
138                                             "pack": "append_column",
139                                             "resizable": true,
140                                             "title": "Repo",
141                                             "xtype": "TreeViewColumn",
142                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 0 );\n\n}\n",
143                                             "|xns": "Gtk",
144                                             "items": [
145                                                 {
146                                                     "pack": "pack_start",
147                                                     "xtype": "CellRendererText",
148                                                     "|xns": "Gtk"
149                                                 }
150                                             ]
151                                         },
152                                         {
153                                             "min_width": 50,
154                                             "pack": "append_column",
155                                             "title": "Current Branch",
156                                             "xtype": "TreeViewColumn",
157                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 1 );\n\n}\n",
158                                             "|xns": "Gtk",
159                                             "items": [
160                                                 {
161                                                     "pack": "pack_start",
162                                                     "xtype": "CellRendererText",
163                                                     "|xns": "Gtk"
164                                                 }
165                                             ]
166                                         },
167                                         {
168                                             "min_width": 50,
169                                             "pack": "append_column",
170                                             "title": "Last updated",
171                                             "xtype": "TreeViewColumn",
172                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 3 );\n\n}\n",
173                                             "|xns": "Gtk",
174                                             "items": [
175                                                 {
176                                                     "pack": "pack_start",
177                                                     "xtype": "CellRendererText",
178                                                     "|xns": "Gtk"
179                                                 }
180                                             ]
181                                         },
182                                         {
183                                             "min_width": 50,
184                                             "pack": "append_column",
185                                             "resizable": false,
186                                             "title": "All Branches",
187                                             "xtype": "TreeViewColumn",
188                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 2 );\n\n}\n",
189                                             "|xns": "Gtk",
190                                             "items": [
191                                                 {
192                                                     "pack": "pack_start",
193                                                     "xtype": "CellRendererText",
194                                                     "|xns": "Gtk"
195                                                 }
196                                             ]
197                                         }
198                                     ]
199                                 },
200                                 {
201                                     "|xns": "Gtk",
202                                     "xtype": "TreeView",
203                                     "pack": false,
204                                     "items": [
205                                         {
206                                             "|xns": "Gtk",
207                                             "xtype": "ListStore",
208                                             "pack": false
209                                         }
210                                     ]
211                                 }
212                             ]
213                         }
214                     ]
215                 },
216                 {
217                     "label": "Cancel",
218                     "pack": "add_action_widget,0",
219                     "xtype": "Button",
220                     "|xns": "Gtk",
221                     "listeners": {}
222                 },
223                 {
224                     "id": "ok_button",
225                     "label": "OK",
226                     "pack": "add_action_widget,1",
227                     "xtype": "Button",
228                     "|xns": "Gtk"
229                 }
230             ]
231         }
232     ],
233     "permname": "",
234     "modOrder": "0"
235 }