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                                             "clickable": true,
122                                             "min_width": 50,
123                                             "pack": "append_column",
124                                             "title": "Auto Push",
125                                             "xtype": "TreeViewColumn",
126                                             "|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",
127                                             "|xns": "Gtk",
128                                             "items": [
129                                                 {
130                                                     "pack": "pack_start",
131                                                     "xtype": "CellRendererToggle",
132                                                     "|mode": "Gtk.CellRendererMode.ACTIVATABLE",
133                                                     "|xns": "Gtk"
134                                                 }
135                                             ]
136                                         },
137                                         {
138                                             "min_width": 200,
139                                             "pack": "append_column",
140                                             "resizable": true,
141                                             "title": "Repo",
142                                             "xtype": "TreeViewColumn",
143                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 0 );\n\n}\n",
144                                             "|xns": "Gtk",
145                                             "items": [
146                                                 {
147                                                     "pack": "pack_start",
148                                                     "xtype": "CellRendererText",
149                                                     "|xns": "Gtk"
150                                                 }
151                                             ]
152                                         },
153                                         {
154                                             "min_width": 50,
155                                             "pack": "append_column",
156                                             "title": "Current Branch",
157                                             "xtype": "TreeViewColumn",
158                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 1 );\n\n}\n",
159                                             "|xns": "Gtk",
160                                             "items": [
161                                                 {
162                                                     "pack": "pack_start",
163                                                     "xtype": "CellRendererText",
164                                                     "|xns": "Gtk"
165                                                 }
166                                             ]
167                                         },
168                                         {
169                                             "min_width": 50,
170                                             "pack": "append_column",
171                                             "title": "Last updated",
172                                             "xtype": "TreeViewColumn",
173                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 3 );\n\n}\n",
174                                             "|xns": "Gtk",
175                                             "items": [
176                                                 {
177                                                     "pack": "pack_start",
178                                                     "xtype": "CellRendererText",
179                                                     "|xns": "Gtk"
180                                                 }
181                                             ]
182                                         },
183                                         {
184                                             "min_width": 50,
185                                             "pack": "append_column",
186                                             "resizable": false,
187                                             "title": "All Branches",
188                                             "xtype": "TreeViewColumn",
189                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 2 );\n\n}\n",
190                                             "|xns": "Gtk",
191                                             "items": [
192                                                 {
193                                                     "pack": "pack_start",
194                                                     "xtype": "CellRendererText",
195                                                     "|xns": "Gtk"
196                                                 }
197                                             ]
198                                         }
199                                     ]
200                                 },
201                                 {
202                                     "|xns": "Gtk",
203                                     "xtype": "TreeView",
204                                     "pack": false,
205                                     "items": [
206                                         {
207                                             "|xns": "Gtk",
208                                             "xtype": "ListStore",
209                                             "pack": false
210                                         }
211                                     ]
212                                 }
213                             ]
214                         }
215                     ]
216                 },
217                 {
218                     "label": "Cancel",
219                     "pack": "add_action_widget,0",
220                     "xtype": "Button",
221                     "|xns": "Gtk",
222                     "listeners": {}
223                 },
224                 {
225                     "id": "ok_button",
226                     "label": "OK",
227                     "pack": "add_action_widget,1",
228                     "xtype": "Button",
229                     "|xns": "Gtk"
230                 }
231             ]
232         }
233     ],
234     "permname": "",
235     "modOrder": "0"
236 }