src/Builder4/ProjectSettings.bjs
[app.Builder.js] / src / Builder4 / ProjectSettings.bjs
1 {
2  "name" : "ProjectSettings",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/ProjectSettings.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "items" : [
9   {
10    "@ void buttonPressed" : "(string btn)",
11    "id" : "ProjectSettings",
12    "| void show" : " (Project.Project project) {\n    _this.project = project;\n    _this.path.el.label = project.firstPath();\n    // get the active project.\n     var lm = Gtk.SourceLanguageManager.get_default();\n                \n    ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(\n    \n        lm.get_language(\"html\"));\n  \n    //print (project.fn);\n    //project.runhtml = project.runhtml || '';\n    _this.view.el.get_buffer().set_text(project.runhtml);\n    \n       \n    _this.rootURL.el.set_text( _this.project.rootURL );\n    _this.base_template.el.set_text(_this.project.base_template);    \n   \n    \n    //this.el.show_all();\n}\n",
13    "# Project.Project project" : "",
14    "xtype" : "VBox",
15    "| void save" : "()\n{\n   var buf =    _this.view.el.get_buffer();\n   Gtk.TextIter s;\n     Gtk.TextIter e;\n    buf.get_start_iter(out s);\n    buf.get_end_iter(out e);\n      _this.project.runhtml = buf.get_text(s,e,true);\n      \n    _this.project.rootURL = _this.rootURL.el.get_text();\n    _this.project.base_template = _this.base_template.el.get_text();    \n    \n    \n}",
16    "$ xns" : "Gtk",
17    "border_width" : 5,
18    "$ homogeneous" : false,
19    "items" : [
20     {
21      "* pack" : "pack_start,true,true,0",
22      "xtype" : "Notebook",
23      "$ xns" : "Gtk",
24      "items" : [
25       {
26        "id" : "label_global",
27        "xtype" : "Label",
28        "* pack" : false,
29        "$ xns" : "Gtk",
30        "utf8 label" : "Global"
31       },
32       {
33        "id" : "label_database",
34        "* pack" : false,
35        "xtype" : "Label",
36        "$ xns" : "Gtk",
37        "utf8 label" : "Database"
38       },
39       {
40        "* pack" : "append_page,_this.label_global.el",
41        "xtype" : "VBox",
42        "$ xns" : "Gtk"
43       },
44       {
45        "* pack" : "pack_start,false,false,0",
46        "xtype" : "HBox",
47        "gboolean expand" : false,
48        "$ xns" : "Gtk",
49        "$ homogeneous" : true,
50        "gboolean vexpand" : false,
51        "items" : [
52         {
53          "listeners" : {
54           "button_press_event" : "() => {\n    _this.save();\n          \n    _this.buttonPressed(\"apply\");\n        return false;\n}"
55          },
56          "label" : "Apply",
57          "* pack" : "add",
58          "xtype" : "Button",
59          "$ xns" : "Gtk"
60         },
61         {
62          "listeners" : {
63           "button_press_event" : "() => {\n       _this.save();\n          \n    _this.buttonPressed(\"save\");\n        return false;\n}"
64          },
65          "label" : "Save",
66          "* pack" : "add",
67          "xtype" : "Button",
68          "$ xns" : "Gtk"
69         }
70        ]
71       }
72      ]
73     },
74     {
75      "* pack" : "pack_start,false,false,0",
76      "xtype" : "HBox",
77      "gboolean expand" : false,
78      "$ xns" : "Gtk",
79      "$ homogeneous" : true,
80      "gboolean vexpand" : false,
81      "items" : [
82       {
83        "listeners" : {
84         "button_press_event" : "() => {\n    _this.save();\n          \n    _this.buttonPressed(\"apply\");\n        return false;\n}"
85        },
86        "label" : "Apply",
87        "xtype" : "Button",
88        "* pack" : "add",
89        "$ xns" : "Gtk"
90       },
91       {
92        "listeners" : {
93         "button_press_event" : "() => {\n       _this.save();\n          \n    _this.buttonPressed(\"save\");\n        return false;\n}"
94        },
95        "label" : "Save",
96        "xtype" : "Button",
97        "* pack" : "add",
98        "$ xns" : "Gtk"
99       }
100      ]
101     },
102     {
103      "label" : "filename",
104      "id" : "path",
105      "xalign" : 0,
106      "* pack" : "pack_start,false,false,0",
107      "xtype" : "Label",
108      "$ xns" : "Gtk"
109     },
110     {
111      "label" : "HTML To insert at end of <HEAD>",
112      "* pack" : "pack_start,false,false,0",
113      "xtype" : "Label",
114      "$ xns" : "Gtk"
115     },
116     {
117      "* pack" : "pack_start,false,false,0",
118      "xtype" : "HBox",
119      "gboolean expand" : false,
120      "$ xns" : "Gtk",
121      "$ homogeneous" : false,
122      "items" : [
123       {
124        "label" : "HTML template file",
125        "xtype" : "Label",
126        "* pack" : "pack_start,false,false,0",
127        "$ xns" : "Gtk"
128       },
129       {
130        "id" : "base_template",
131        "xtype" : "Entry",
132        "* pack" : "add",
133        "$ xns" : "Gtk"
134       }
135      ]
136     },
137     {
138      "* pack" : "pack_start,false,false,0",
139      "xtype" : "HBox",
140      "gboolean expand" : false,
141      "$ xns" : "Gtk",
142      "$ homogeneous" : false,
143      "items" : [
144       {
145        "label" : "root URL",
146        "xtype" : "Label",
147        "* pack" : "pack_start,false,false,0",
148        "$ xns" : "Gtk"
149       },
150       {
151        "id" : "rootURL",
152        "xtype" : "Entry",
153        "* pack" : "add",
154        "$ xns" : "Gtk"
155       }
156      ]
157     },
158     {
159      "* pack" : "pack_start,true,true,0",
160      "xtype" : "ScrolledWindow",
161      "$ xns" : "Gtk",
162      "items" : [
163       {
164        "listeners" : {
165         "key_release_event" : " ( event) =>{\n    if (event.keyval != 115) {\n        return false;\n         \n    }\n    if   ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {\n        return false;\n    }\n     var buf =    this.el.get_buffer();\n    Gtk.TextIter s;\n    Gtk.TextIter e;\n    buf.get_start_iter(out s);\n    buf.get_end_iter(out e);\n    _this.project.runhtml = buf.get_text(s,e,true);\n    \n          \n    _this.buttonPressed(\"save\");\n     \n    return false;\n         \n}"
166        },
167        "id" : "view",
168        "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(9000);\n    this.el.override_font(description);",
169        "xtype" : "View",
170        "* pack" : "add",
171        "$ xns" : "GtkSource"
172       }
173      ]
174     }
175    ]
176   }
177  ]
178 }