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          "gint margin" : 3,
80          "$ xns" : "Gtk"
81         },
82         {
83          "* pack" : "pack_start,false,false,0",
84          "xtype" : "HBox",
85          "gboolean expand" : false,
86          "$ xns" : "Gtk",
87          "$ homogeneous" : false,
88          "items" : [
89           {
90            "label" : "HTML template file",
91            "xtype" : "Label",
92            "* pack" : "pack_start,false,false,0",
93            "$ xns" : "Gtk"
94           },
95           {
96            "id" : "base_template",
97            "xtype" : "Entry",
98            "* pack" : "add",
99            "$ xns" : "Gtk"
100           }
101          ]
102         },
103         {
104          "* pack" : "pack_start,false,false,0",
105          "xtype" : "HBox",
106          "gboolean expand" : false,
107          "$ xns" : "Gtk",
108          "$ homogeneous" : false,
109          "items" : [
110           {
111            "label" : "root URL",
112            "xtype" : "Label",
113            "* pack" : "pack_start,false,false,0",
114            "$ xns" : "Gtk"
115           },
116           {
117            "id" : "rootURL",
118            "xtype" : "Entry",
119            "* pack" : "add",
120            "$ xns" : "Gtk"
121           }
122          ]
123         },
124         {
125          "label" : "HTML To insert at end of <HEAD>",
126          "xtype" : "Label",
127          "* pack" : "pack_start,false,false,0",
128          "$ xns" : "Gtk"
129         },
130         {
131          "* pack" : "pack_start,true,true,0",
132          "xtype" : "ScrolledWindow",
133          "$ xns" : "Gtk",
134          "items" : [
135           {
136            "listeners" : {
137             "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}"
138            },
139            "id" : "view",
140            "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(9000);\n    this.el.override_font(description);",
141            "xtype" : "View",
142            "* pack" : "add",
143            "$ xns" : "GtkSource"
144           }
145          ]
146         }
147        ]
148       },
149       {
150        "* pack" : "append_page,_this.label_database.el",
151        "xtype" : "VBox",
152        "gboolean homogeneous" : false,
153        "$ xns" : "Gtk",
154        "items" : [
155         {
156          "label" : "Type (eg. MySQL or PostgreSQL)",
157          "xalign" : 0,
158          "* pack" : "pack_start,false,false,0",
159          "xtype" : "Label",
160          "$ xns" : "Gtk"
161         },
162         {
163          "id" : "database_DBTYPE",
164          "* pack" : "pack_start,false,false,0",
165          "xtype" : "Entry",
166          "$ xns" : "Gtk"
167         },
168         {
169          "label" : "Name",
170          "xalign" : 0,
171          "* pack" : "pack_start,false,false,0",
172          "xtype" : "Label",
173          "$ xns" : "Gtk"
174         },
175         {
176          "id" : "database_DBTYPE",
177          "xtype" : "Entry",
178          "* pack" : "pack_start,false,false,0",
179          "$ xns" : "Gtk"
180         },
181         {
182          "label" : "Username",
183          "xalign" : 0,
184          "* pack" : "pack_start,false,false,0",
185          "xtype" : "Label",
186          "$ xns" : "Gtk"
187         },
188         {
189          "id" : "database_DBUSERNAME",
190          "* pack" : "pack_start,false,false,0",
191          "xtype" : "Entry",
192          "$ xns" : "Gtk"
193         },
194         {
195          "label" : "Password",
196          "xalign" : 0,
197          "* pack" : "pack_start,false,false,0",
198          "xtype" : "Label",
199          "$ xns" : "Gtk"
200         },
201         {
202          "id" : "database_DBPASSWORD",
203          "xtype" : "Entry",
204          "* pack" : "pack_start,false,false,0",
205          "$ xns" : "Gtk"
206         },
207         {
208          "* pack" : "pack_start,false,false,0",
209          "xtype" : "Button",
210          "$ xns" : "Gtk",
211          "utf8 label" : "Check Connection"
212         }
213        ]
214       }
215      ]
216     }
217    ]
218   }
219  ]
220 }