Attribute changed old-javascript
[app.Builder.js] / old-javascript / Builder4 / EditProject.bjs
1 {
2     "id": "file-gtk-8",
3     "name": "EditProject",
4     "parent": "",
5     "title": false,
6     "path": "/home/alan/gitlive/app.Builder.js/Builder4/EditProject.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "destroy_event": " (self, event) => {\n  this.el.response(0);\n//     this.el.hide();\n    return false;\n}"
11             },
12             "border_width": 3,
13             "default_height": 500,
14             "default_width": 600,
15             "name": "EditProject",
16             "title": "Project Properties",
17             "xtype": "Dialog",
18             "|Project.Project?:show": "() {\n      \n\n    //[ 'xtype'  ].forEach(function(k) {\n    //    _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);\n    //});\n\t// shouild set path..\n    _this.model.loadData();\n    this.el.show_all();\n    \n    var err_dialog = StandardErrorDialog.singleton();\n\n    var id = -1;\n    while (id < 0) {\n         id =  this.el.run();\n         if (id < 1) {\n                this.el.hide();\n                return null;\n        }\n\n         \n          if (_this.xtype.getValue().length < 1) {\n               \n                err_dialog.show(_this.el,\"You have to set Project type\");             \n                id = -1;\n                continue;\n            }\n            if (_this.dir.el.get_filename().length < 1) {\n \n                err_dialog.show(_this.el,\"You have to select a folder\");             \n                id = -1;\n                continue;\n            }\n           \n    }\n    \n    this.el.hide();\n    \n    \n    \n \n    var fn = _this.dir.el.get_filename();\n    print(\"add %s\\n\" , fn);\n    \n    var project = Project.Project.factory(_this.xtype.getValue(), fn);\n    project.save();\n    Project.projects.set(project.name,project);\n    \n    //var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);\n    \n    return project;\n\n    \n    //this.success = c.success;\n}\n",
19             "|deletable": "true",
20             "|modal": "true",
21             "|xns": "Gtk",
22             "items": [
23                 {
24                     "|homogeneous": "false",
25                     "xtype": "VBox",
26                     "|pack": " get_content_area().add \n \n",
27                     "|xns": "Gtk",
28                     "items": [
29                         {
30                             "|homogeneous": "false",
31                             "pack": "pack_start,false,true,3",
32                             "xtype": "HBox",
33                             "|xns": "Gtk",
34                             "items": [
35                                 {
36                                     "|xns": "Gtk",
37                                     "xtype": "Label",
38                                     "pack": "pack_start,false,true,3",
39                                     "label": "Project type :"
40                                 },
41                                 {
42                                     "id": "xtype",
43                                     "pack": "pack_end,true,true,3",
44                                     "xtype": "ComboBox",
45                                     "|init": " this.el.add_attribute(_this.cellrender.el , \"markup\", 1 );  \n \n",
46                                     "|setValue": " (v)    {\n        var el = this.el;\n        el.set_active(-1);\n        \n        for (var i =0;i < this.data.length; i++ ) {\n            if (v == this.data.nth_datA(i)) {\n                el.set_active(ix);\n                return false;\n            }\n        }\n    }",
47                                     "|string:getValue": " () {\n     var ix = this.el.get_active();\n        if (ix < 0 ) {\n            return \"\";\n        }\n        switch(ix) {\n            case 0:\n                return \"Roo\";\n            case 1:\n                return \"Gtk\";\n        }\n        return \"\";\n}\n",
48                                     "|xns": "Gtk",
49                                     "items": [
50                                         {
51                                             "id": "cellrender",
52                                             "pack": "pack_start,true",
53                                             "xtype": "CellRendererText",
54                                             "|xns": "Gtk"
55                                         },
56                                         {
57                                             "|columns": "typeof(string),typeof(string)",
58                                             "id": "model",
59                                             "n_columns": 2,
60                                             "pack": "set_model",
61                                             "xtype": "ListStore",
62                                             "|void:loadData": "  ( ) {\n        this.el.clear();\n                      \n        Gtk.TreeIter iter;\n                \n        el.append(out iter);\n        \n        el.set_value(iter, 0, \"Roo\");\n        el.set_value(iter, 1, \"Roo Project\");\n         el.append(out iter);\n        \n        el.set_value(iter, 0, \"Gtk\");\n        el.set_value(iter, 1, \"Gtk Project\");\n         \n              \n                                     \n}\n",
63                                             "|xns": "Gtk"
64                                         }
65                                     ]
66                                 }
67                             ]
68                         },
69                         {
70                             "|create_folders": "false",
71                             "id": "dir",
72                             "pack": "pack_end,true,true,5",
73                             "xtype": "FileChooserWidget",
74                             "|action": "Gtk.FileChooserAction.SELECT_FOLDER",
75                             "|select_multiple": "false",
76                             "|xns": "Gtk"
77                         }
78                     ]
79                 },
80                 {
81                     "label": "OK",
82                     "pack": "add_action_widget,1",
83                     "xtype": "Button",
84                     "|xns": "Gtk"
85                 },
86                 {
87                     "|xns": "Gtk",
88                     "xtype": "Button",
89                     "pack": "add_action_widget,0",
90                     "label": "Cancel"
91                 }
92             ]
93         }
94     ],
95     "permname": "",
96     "modOrder": ""
97 }