resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / EditProject.bjs
1 {
2  "name" : "EditProject",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/EditProject.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "build_module" : "builder",
9  "items" : [
10   {
11    "listeners" : {
12     "destroy_event" : "(self, event) => {\n\tthis.el.response(0);\n//     this.el.hide();\n    return false;\n}"
13    },
14    "default_width" : 600,
15    "$ deletable" : true,
16    "title" : "Project Properties",
17    "xtype" : "Dialog",
18    "default_height" : 500,
19    "| 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",
20    "$ modal" : true,
21    "$ xns" : "Gtk",
22    "border_width" : 3,
23    "name" : "EditProject",
24    "items" : [
25     {
26      "bool expand" : true,
27      "xtype" : "Box",
28      "$ pack" : " get_content_area().add \n \n",
29      "$ xns" : "Gtk",
30      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
31      "$ homogeneous" : false,
32      "items" : [
33       {
34        "xtype" : "Box",
35        "* pack" : "pack_start,false,true,3",
36        "$ xns" : "Gtk",
37        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
38        "$ homogeneous" : false,
39        "items" : [
40         {
41          "label" : "Project type :",
42          "xtype" : "Label",
43          "* pack" : "pack_start,false,true,3",
44          "$ xns" : "Gtk"
45         },
46         {
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          "id" : "xtype",
49          "* init" : " this.el.add_attribute(_this.cellrender.el , \"markup\", 1 );  \n  ",
50          "xtype" : "ComboBox",
51          "* pack" : "pack_end,true,true,3",
52          "$ xns" : "Gtk",
53          "items" : [
54           {
55            "id" : "cellrender",
56            "* pack" : "pack_start,true",
57            "xtype" : "CellRendererText",
58            "$ xns" : "Gtk"
59           },
60           {
61            "id" : "model",
62            "xtype" : "ListStore",
63            "* pack" : "set_model",
64            "$ columns" : "typeof(string),typeof(string)",
65            "n_columns" : 2,
66            "$ xns" : "Gtk",
67            "| 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"
68           }
69          ]
70         }
71        ]
72       },
73       {
74        "$ create_folders" : false,
75        "id" : "dir",
76        "$ action" : "Gtk.FileChooserAction.SELECT_FOLDER",
77        "bool expand" : true,
78        "* pack" : "pack_end,true,true,5",
79        "xtype" : "FileChooserWidget",
80        "$ xns" : "Gtk",
81        "$ select_multiple" : false
82       }
83      ]
84     },
85     {
86      "label" : "OK",
87      "* pack" : "add_action_widget,1",
88      "xtype" : "Button",
89      "$ xns" : "Gtk"
90     },
91     {
92      "label" : "Cancel",
93      "xtype" : "Button",
94      "* pack" : "add_action_widget,0",
95      "$ xns" : "Gtk"
96     }
97    ]
98   }
99  ]
100 }