Fix #5662 - Gitlive - create a tracking branch
[gitlive] / old_seed_version / FixBug.bjs
1 {
2     "id": "file-gtk-4",
3     "name": "FixBug",
4     "parent": "",
5     "title": false,
6     "path": "/home/alan/gitlive/gitlive/FixBug.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "destroy_event": "function (self, event) {\n     this.el.hide();\n                return false;\n}",
11                 "show": "function (self) {\nprint(\"ON SHOW!\");\n\n    this.el.fullscreen();\n    this.el.grab_focus();\n    this.el.set_keep_above(true);\n    \n    this.get('/today-vew').load();\n    \n}"
12             },
13             "border_width": 3,
14             "default_height": 400,
15             "default_width": 1200,
16             "title": "Select Active Bug",
17             "xtype": "Window",
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    \n    this.el.show_all();\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 false;\n    //    }\n    //    print(\"RUN RETURN : \" + run_ret);\n    \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                     "pack": "add",
25                     "xtype": "VBox",
26                     "|xns": "Gtk",
27                     "items": [
28                         {
29                             "pack": "pack_start,false,true,3",
30                             "xtype": "HBox",
31                             "|xns": "Gtk",
32                             "items": [
33                                 {
34                                     "label": "On this project:",
35                                     "xtype": "Label",
36                                     "|xns": "Gtk"
37                                 },
38                                 {
39                                     "listeners": {
40                                         "changed": "function (self) {\n    print(\"store: active id = \" + this.el.get_active_id());\n    this.get('/ticket-store').reload();\n    \n    \n}"
41                                     },
42                                     "id": "project-select",
43                                     "xtype": "ComboBox",
44                                     "|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     var t = this;\n    imports.Projects.Projects.fetch(  function(res) { \n         t.load(res);\n    });\n}\n",
45                                     "|load": "function(tr) {\n      this.model.el.clear();\n      this.raw_data = tr;                     \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           \n            this.model.el.set_value(ret.iter, 0, '' + tr[i].code + \" - \" + tr[i].name );\n            this.model.el.set_value(ret.iter, 1, '' + tr[i].id  );\n     \n            \n        }     \n        \n}\n",
46                                     "|xns": "Gtk",
47                                     "items": [
48                                         {
49                                             "*prop": "model",
50                                             "id": "project-store",
51                                             "xtype": "ListStore",
52                                             "|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",
53                                             "|xns": "Gtk"
54                                         }
55                                     ]
56                                 },
57                                 {
58                                     "listeners": {
59                                         "button_press_event": "function (self, event) {\n \n    FixBug.el.hide();\n}"
60                                     },
61                                     "height_request": 90,
62                                     "label": "Not working on Project",
63                                     "pack": "add",
64                                     "xtype": "Button",
65                                     "|xns": "Gtk"
66                                 },
67                                 {
68                                     "listeners": {
69                                         "button_press_event": "function (self, event) {\n\n   FixBug.el.hide();\n}"
70                                     },
71                                     "id": "ok_button",
72                                     "label": "Working on Selected Ticket",
73                                     "pack": "add",
74                                     "xtype": "Button",
75                                     "|xns": "Gtk"
76                                 }
77                             ]
78                         },
79                         {
80                             "pack": "pack_end,true,true,3",
81                             "xtype": "HPaned",
82                             "|xns": "Gtk",
83                             "items": [
84                                 {
85                                     "pack": "add",
86                                     "width_request": 400,
87                                     "xtype": "VBox",
88                                     "|xns": "Gtk",
89                                     "items": [
90                                         {
91                                             "pack": "pack_start,false,true,3",
92                                             "xtype": "HBox",
93                                             "|xns": "Gtk",
94                                             "items": [
95                                                 {
96                                                     "listeners": {
97                                                         "key_release_event": "function (self, event) {\n    if (event.key.keyval == Gdk.KEY_Return) {;\n        // same code as button press..\n         var active_id = this.get('/project-select').el.get_active();\n     \n        var project_id = this.get('/project-select').raw_data[active_id].id;\n        \n        var str = this.get('/search-entry').el.get_text();\n        \n        print(str);\n        \n        var _t = this;\n        \n        imports.Tasks.Tasks.query({\n            project_id : project_id,\n            'query[filter]' : 'me',\n            'query[search]' : str\n        }, function(res) { \n           // print(JSON.stringify(res,null,4));\n            _t.get('/ticket-store').loadData(res);\n        });\n    }\n    return true;\n}"
98                                                     },
99                                                     "id": "search-entry",
100                                                     "pack": "pack_start,true,true,3",
101                                                     "xtype": "Entry",
102                                                     "|xns": "Gtk"
103                                                 },
104                                                 {
105                                                     "listeners": {
106                                                         "clicked": "function (self) {\n    var active_id = this.get('/project-select').el.get_active();\n     \n    var project_id = this.get('/project-select').raw_data[active_id].id;\n    \n    var str = this.get('/search-entry').el.get_text();\n    \n    print(str);\n    \n    var _t = this;\n    \n    imports.Tasks.Tasks.query({\n        project_id : project_id,\n        'query[filter]' : 'me',\n        'query[search]' : str\n    }, function(res) { \n       // print(JSON.stringify(res,null,4));\n        _t.get('/ticket-store').loadData(res);\n    });\n}"
107                                                     },
108                                                     "label": "Search",
109                                                     "pack": "pack_end,false,true,3",
110                                                     "xtype": "Button",
111                                                     "|use_stock": "true",
112                                                     "|xns": "Gtk"
113                                                 }
114                                             ]
115                                         },
116                                         {
117                                             "pack": "pack_end,true,true,3",
118                                             "xtype": "ScrolledWindow",
119                                             "|shadow_type": "Gtk.ShadowType.IN",
120                                             "|xns": "Gtk",
121                                             "items": [
122                                                 {
123                                                     "listeners": {
124                                                         "cursor_changed": "function (self) {\n    \n    var ret = {};\n    this.selection.get_selected(ret);\n\n    // var val = \"\";\n    var value = ''+ret.model.get_value(ret.iter, 0).value.get_string();\n    \n    print(value);\n    var rec = false;\n    this.get('/ticket-store').data.forEach( function(e) {\n        if (e.id == value) {\n            rec = e;\n            return  false;\n        }\n    });\n    // update the text box with the ticket data..\n    this.get('/view').show(rec);\n    //print(rec);\n\n}"
125                                                     },
126                                                     "id": "ticket-view",
127                                                     "pack": "add",
128                                                     "xtype": "TreeView",
129                                                     "|can_focus": "true",
130                                                     "|fixed_height_mode": "false",
131                                                     "|headers_visible": "false",
132                                                     "|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.SINGLE);\n    var _t = this;\n\n    // is this really needed??\n    this.selection.signal['changed'].connect(function() {\n        print('selection changed');\n    \n\n    });\n\n}\n",
133                                                     "|xns": "Gtk",
134                                                     "items": [
135                                                         {
136                                                             "id": "ticket-store",
137                                                             "pack": "set_model",
138                                                             "xtype": "ListStore",
139                                                             "|columns": "  [\n        GObject.TYPE_STRING, // title \n        GObject.TYPE_STRING, // tip\n        GObject.TYPE_STRING // source..\n] ",
140                                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n\n    this.el.set_column_types ( 2, [\n        GObject.TYPE_STRING,  // real key\n        GObject.TYPE_STRING // real type\n        \n        \n    ] );\n\n\n    \n    // var t = this;\n    //imports.Projects.Projects.fetch(  function(res) { \n    //    t.loadData(res);\n   // });\n        \n                                \n}\n",
141                                                             "|loadData": "function (data) {\n        print(\"loading data\");\n    \n    \n    this.data = data;\n                          \n    var el = this.el;\n    this.el.clear();\n    data.forEach(function(p) {\n        var ret = {};\n        el.append(ret);\n       //print(\"ADD \" + p.name);\n         \n       var line =    '[' + p.status_name + '] <b>'   + \n             GLib.markup_escape_text(p.summary, p.summary.length)  + \"</b>\\n\"  +\n             '<span color=\"#666\">' + \n             GLib.markup_escape_text(p.description,p.description.length).split(\"\\n\").slice(0,3).join(\"\\n\") +\n             '</span>';\n         print(line);\n         \n        el.set_value(ret.iter, 0, p.id);\n        el.set_value(ret.iter, 1,   '<b>#' + p.id + '</b>' +  line );\n        \n    });\n              \n                                     \n}\n",
142                                                             "|reload": "function() {\n \n    var active_id = this.get('/project-select').el.get_active();\n     \n    var project_id = this.get('/project-select').raw_data[active_id].id;\n    \n    var _t = this;\n    \n    imports.Tasks.Tasks.query({\n        project_id : project_id,\n        'query[filter]' : 'me'\n    }, function(res) { \n        print(JSON.stringify(res,null,4));\n        _t.loadData(res);\n    });\n     \n    \n}\n",
143                                                             "|xns": "Gtk"
144                                                         },
145                                                         {
146                                                             "pack": "append_column",
147                                                             "xtype": "TreeViewColumn",
148                                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 1 );\n}\n",
149                                                             "|xns": "Gtk",
150                                                             "items": [
151                                                                 {
152                                                                     "pack": "pack_start",
153                                                                     "xtype": "CellRendererText",
154                                                                     "|xns": "Gtk"
155                                                                 }
156                                                             ]
157                                                         }
158                                                     ]
159                                                 }
160                                             ]
161                                         }
162                                     ]
163                                 },
164                                 {
165                                     "pack": "add",
166                                     "xtype": "HPaned",
167                                     "|xns": "Gtk",
168                                     "items": [
169                                         {
170                                             "pack": "pack1,true,true",
171                                             "xtype": "VBox",
172                                             "|xns": "Gtk",
173                                             "items": [
174                                                 {
175                                                     "pack": "pack_start,false,true,3",
176                                                     "xtype": "HBox",
177                                                     "|xns": "Gtk",
178                                                     "items": [
179                                                         {
180                                                             "label": "I am doing this:",
181                                                             "pack": "pack_start,false,true,3",
182                                                             "xtype": "Label",
183                                                             "|xns": "Gtk"
184                                                         },
185                                                         {
186                                                             "pack": "pack_start,true,true,3",
187                                                             "xtype": "Entry",
188                                                             "|xns": "Gtk"
189                                                         }
190                                                     ]
191                                                 },
192                                                 {
193                                                     "pack": "pack_start,false,true,3",
194                                                     "xtype": "HBox",
195                                                     "|xns": "Gtk",
196                                                     "items": [
197                                                         {
198                                                             "label": "Since:",
199                                                             "pack": "pack_start,false,true,3",
200                                                             "xtype": "Label",
201                                                             "|xns": "Gtk"
202                                                         },
203                                                         {
204                                                             "pack": "pack_start,false,false,3",
205                                                             "xtype": "Entry",
206                                                             "|width_request": 80,
207                                                             "|xns": "Gtk"
208                                                         },
209                                                         {
210                                                             "label": "Until",
211                                                             "pack": "pack_start,false,true,3",
212                                                             "xtype": "Label",
213                                                             "|xns": "Gtk"
214                                                         },
215                                                         {
216                                                             "pack": "pack_start,true,true,3",
217                                                             "xtype": "Entry",
218                                                             "|xns": "Gtk"
219                                                         }
220                                                     ]
221                                                 },
222                                                 {
223                                                     "|xns": "Gtk",
224                                                     "xtype": "ScrolledWindow",
225                                                     "pack": "add",
226                                                     "id": "RightEditor",
227                                                     "items": [
228                                                         {
229                                                             "id": "view",
230                                                             "indent_width": 4,
231                                                             "pack": "add",
232                                                             "xtype": "TextView",
233                                                             "|auto_indent": true,
234                                                             "|editable": "false",
235                                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    var description = Pango.font_description_from_string(\"monospace\");\n\n    description.set_size(8000);\n    this.el.modify_font(description);\n\n}\n",
236                                                             "|load": "function(str) {\n\n// show the help page for the active node..\n \n\n\n \n    this.el.get_buffer().set_text(str, str.length);\n \n    \n     var buf = this.el.get_buffer();\n     \n     \n    \n}",
237                                                             "|show": "function(p) {\n     var line =  [\n            'Status : ' +   p.status_name,\n            'ID : ' +   p.id,\n            '',\n            'Summary :  ' +  p.summary,\n             '' + \n             p.description,\n         ].join(\"\\n\")   ;\n         print(line);\n         \n         \n         // can not do rich text due to so many missing features..\n          this.el.get_buffer().set_text(line, line.length);\n \n}\n",
238                                                             "|show_line_numbers": true,
239                                                             "|xns": "Gtk",
240                                                             "items": [
241                                                                 {
242                                                                     "listeners": {
243                                                                         "changed": "function (self) {\n    /*\n    var s = new Gtk.TextIter();\n    var e = new Gtk.TextIter();\n    this.el.get_start_iter(s);\n    this.el.get_end_iter(e);\n    var str = this.el.get_text(s,e,true);\n    try {\n        Seed.check_syntax('var e = ' + str);\n    } catch (e) {\n        this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({\n            red: 0xFFFF, green: 0xCCCC , blue : 0xCCCC\n           }));\n        //print(\"SYNTAX ERROR IN EDITOR\");   \n        //print(e);\n        //console.dump(e);\n        return;\n    }\n    this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({\n            red: 0xFFFF, green: 0xFFFF , blue : 0xFFFF\n           }));\n    \n     this.get('/LeftPanel.model').changed(  str , false);\n     */\n}"
244                                                                     },
245                                                                     "pack": "set_buffer",
246                                                                     "xtype": "Buffer",
247                                                                     "|xns": "GtkSource"
248                                                                 }
249                                                             ]
250                                                         }
251                                                     ]
252                                                 }
253                                             ]
254                                         },
255                                         {
256                                             "pack": "pack2,false,false",
257                                             "width_request": 200,
258                                             "xtype": "VBox",
259                                             "|xns": "Gtk",
260                                             "items": [
261                                                 {
262                                                     "pack": "pack_start,false,true,3",
263                                                     "xtype": "HBox",
264                                                     "|xns": "Gtk",
265                                                     "items": [
266                                                         {
267                                                             "listeners": {
268                                                                 "clicked": "function (self) {\n \n}"
269                                                             },
270                                                             "label": "Next/Back",
271                                                             "pack": "pack_end,false,true,3",
272                                                             "xtype": "Button",
273                                                             "|use_stock": "true",
274                                                             "|xns": "Gtk"
275                                                         }
276                                                     ]
277                                                 },
278                                                 {
279                                                     "pack": "pack_end,true,true,3",
280                                                     "xtype": "ScrolledWindow",
281                                                     "|shadow_type": "Gtk.ShadowType.IN",
282                                                     "|xns": "Gtk",
283                                                     "items": [
284                                                         {
285                                                             "id": "today-view",
286                                                             "pack": "add",
287                                                             "xtype": "TreeView",
288                                                             "|can_focus": "true",
289                                                             "|fixed_height_mode": "true",
290                                                             "|headers_visible": "false",
291                                                             "|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.SINGLE);\n    var _t = this;\n\n    // is this really needed??\n    this.selection.signal['changed'].connect(function() {\n        print('selection changed');\n    \n\n    });\n\n}\n",
292                                                             "|xns": "Gtk",
293                                                             "items": [
294                                                                 {
295                                                                     "id": "today-store",
296                                                                     "pack": "set_model",
297                                                                     "xtype": "ListStore",
298                                                                     "|columns": "  [\n        GObject.TYPE_STRING, // title \n        GObject.TYPE_STRING, // tip\n        GObject.TYPE_STRING // source..\n] ",
299                                                                     "|init": "function() {\n    XObject.prototype.init.call(this);\n\n    this.el.set_column_types ( 2, [\n        GObject.TYPE_STRING,  // real key\n        GObject.TYPE_STRING // real type\n        \n        \n    ] );\n\n\n    \n    // var t = this;\n    //imports.Projects.Projects.fetch(  function(res) { \n    //    t.loadData(res);\n   // });\n        \n                                \n}\n",
300                                                                     "|loadData": "function (data) {\n        print(\"loading data\");\n                                    \n    var el = this.el;\n    this.el.clear();\n    data.forEach(function(p) {\n        var ret = {};\n        el.append(ret);\n       //print(\"ADD \" + p.name);\n         \n        el.set_value(ret.iter, 0, p.id);\n        el.set_value(ret.iter, 1,   '<b>#' + p.id + '</b>' + \n            '[' + p.status_name + '] <b>'   + p.summary  + \"</b>\\n\"  +\n             '<span color=\"#666\">' + p.description.split(\"\\n\").slice(0,3).join(\"\\n\") +\n             '</span>'\n             \n              );\n        \n    });\n              \n                                     \n}\n",
301                                                                     "|reload": "function() {\n \n    var active_id = this.get('/project-select').el.get_active();\n     \n    var project_id = this.get('/project-select').raw_data[active_id].id;\n    \n    var _t = this;\n     \n    var DT = imports.Date.Date;\n    \n    new imports.Request.Request( {\n       url : '/cash_invoice_entry',\n       params : {\n            'query[action_dt_from]' : (new DT()).format('Y-m-d'),\n             'query[action_dt_to]' : (new DT()).add(DT.DAY,1).format('Y-m-d'),\n            limit: 999,\n            'sort' : 'action_dt',\n            dir : 'ASC',\n            action : 'Hours'\n       },\n       \n       success : function(res) {\n           this.loadData();\n       },\n       scope : this\n        \n        \n    });\n     \n     \n    \n}\n",
302                                                                     "|xns": "Gtk"
303                                                                 },
304                                                                 {
305                                                                     "pack": "append_column",
306                                                                     "xtype": "TreeViewColumn",
307                                                                     "|sizing": "Gtk.TreeViewColumnSizing.FIXED",
308                                                                     "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 1 );\n}\n",
309                                                                     "|xns": "Gtk",
310                                                                     "items": [
311                                                                         {
312                                                                             "pack": "pack_start",
313                                                                             "xtype": "CellRendererText",
314                                                                             "|xns": "Gtk"
315                                                                         }
316                                                                     ]
317                                                                 }
318                                                             ]
319                                                         }
320                                                     ]
321                                                 }
322                                             ]
323                                         }
324                                     ]
325                                 }
326                             ]
327                         }
328                     ]
329                 }
330             ]
331         }
332     ],
333     "permname": "",
334     "modOrder": ""
335 }