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,false,false,0",
22      "xtype" : "HBox",
23      "gboolean expand" : false,
24      "$ xns" : "Gtk",
25      "$ homogeneous" : true,
26      "gboolean vexpand" : false,
27      "items" : [
28       {
29        "listeners" : {
30         "button_press_event" : "() => {\n    _this.save();\n          \n    _this.buttonPressed(\"apply\");\n        return false;\n}"
31        },
32        "label" : "Apply",
33        "* pack" : "add",
34        "xtype" : "Button",
35        "$ xns" : "Gtk"
36       },
37       {
38        "listeners" : {
39         "button_press_event" : "() => {\n       _this.save();\n          \n    _this.buttonPressed(\"save\");\n        return false;\n}"
40        },
41        "label" : "Save",
42        "* pack" : "add",
43        "xtype" : "Button",
44        "$ xns" : "Gtk"
45       }
46      ]
47     },
48     {
49      "* pack" : "pack_end,true,true,0",
50      "xtype" : "Notebook",
51      "$ xns" : "Gtk",
52      "items" : [
53       {
54        "id" : "label_global",
55        "xtype" : "Label",
56        "* pack" : false,
57        "$ xns" : "Gtk",
58        "utf8 label" : "Global"
59       },
60       {
61        "id" : "label_database",
62        "* pack" : false,
63        "xtype" : "Label",
64        "$ xns" : "Gtk",
65        "utf8 label" : "Database"
66       },
67       {
68        "* pack" : "append_page,_this.label_global.el",
69        "xtype" : "VBox",
70        "gboolean homogeneous" : false,
71        "$ xns" : "Gtk",
72        "items" : [
73         {
74          "label" : "filename",
75          "id" : "path",
76          "xalign" : 0,
77          "* pack" : "pack_start,false,false,0",
78          "xtype" : "Label",
79          "$ xns" : "Gtk"
80         },
81         {
82          "* pack" : "pack_start,false,false,0",
83          "xtype" : "HBox",
84          "gboolean expand" : false,
85          "$ xns" : "Gtk",
86          "$ homogeneous" : false,
87          "items" : [
88           {
89            "label" : "HTML template file",
90            "xtype" : "Label",
91            "* pack" : "pack_start,false,false,0",
92            "$ xns" : "Gtk"
93           },
94           {
95            "id" : "base_template",
96            "xtype" : "Entry",
97            "* pack" : "add",
98            "$ xns" : "Gtk"
99           }
100          ]
101         },
102         {
103          "* pack" : "pack_start,false,false,0",
104          "xtype" : "HBox",
105          "gboolean expand" : false,
106          "$ xns" : "Gtk",
107          "$ homogeneous" : false,
108          "items" : [
109           {
110            "label" : "root URL",
111            "xtype" : "Label",
112            "* pack" : "pack_start,false,false,0",
113            "$ xns" : "Gtk"
114           },
115           {
116            "id" : "rootURL",
117            "xtype" : "Entry",
118            "* pack" : "add",
119            "$ xns" : "Gtk"
120           }
121          ]
122         },
123         {
124          "label" : "HTML To insert at end of <HEAD>",
125          "xtype" : "Label",
126          "* pack" : "pack_start,false,false,0",
127          "$ xns" : "Gtk"
128         },
129         {
130          "* pack" : "pack_start,true,true,0",
131          "xtype" : "ScrolledWindow",
132          "$ xns" : "Gtk",
133          "items" : [
134           {
135            "listeners" : {
136             "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}"
137            },
138            "id" : "view",
139            "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(9000);\n    this.el.override_font(description);",
140            "xtype" : "View",
141            "* pack" : "add",
142            "$ xns" : "GtkSource"
143           }
144          ]
145         }
146        ]
147       },
148       {
149        "* pack" : "append_page,_this.label_database.el",
150        "xtype" : "VBox",
151        "gboolean homogeneous" : false,
152        "$ xns" : "Gtk",
153        "items" : [
154         {
155          "label" : "Type (eg. MySQL or PostgreSQL)",
156          "xalign" : 0,
157          "* pack" : "pack_start,false,false,0",
158          "xtype" : "Label",
159          "$ xns" : "Gtk"
160         },
161         {
162          "id" : "database_DBTYPE",
163          "* pack" : "pack_start,false,false,0",
164          "xtype" : "Entry",
165          "$ xns" : "Gtk"
166         },
167         {
168          "label" : "Name",
169          "xalign" : 0,
170          "* pack" : "pack_start,false,false,0",
171          "xtype" : "Label",
172          "$ xns" : "Gtk"
173         },
174         {
175          "id" : "database_DBTYPE",
176          "xtype" : "Entry",
177          "* pack" : "pack_start,false,false,0",
178          "$ xns" : "Gtk"
179         },
180         {
181          "label" : "Username",
182          "xalign" : 0,
183          "* pack" : "pack_start,false,false,0",
184          "xtype" : "Label",
185          "$ xns" : "Gtk"
186         },
187         {
188          "id" : "database_DBUSERNAME",
189          "* pack" : "pack_start,false,false,0",
190          "xtype" : "Entry",
191          "$ xns" : "Gtk"
192         },
193         {
194          "label" : "Password",
195          "xalign" : 0,
196          "* pack" : "pack_start,false,false,0",
197          "xtype" : "Label",
198          "$ xns" : "Gtk"
199         },
200         {
201          "id" : "database_DBPASSWORD",
202          "xtype" : "Entry",
203          "* pack" : "pack_start,false,false,0",
204          "$ xns" : "Gtk"
205         },
206         {
207          "* pack" : "pack_start,false,false,0",
208          "xtype" : "Button",
209          "$ xns" : "Gtk",
210          "utf8 label" : "Check Connection"
211         }
212        ]
213       }
214      ]
215     }
216    ]
217   }
218  ]
219 }