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