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        "gboolean homogeneous" : false,
43        "$ xns" : "Gtk"
44       },
45       {
46        "* pack" : "pack_start,false,false,0",
47        "xtype" : "HBox",
48        "gboolean expand" : false,
49        "$ xns" : "Gtk",
50        "$ homogeneous" : true,
51        "gboolean vexpand" : false,
52        "items" : [
53         {
54          "listeners" : {
55           "button_press_event" : "() => {\n    _this.save();\n          \n    _this.buttonPressed(\"apply\");\n        return false;\n}"
56          },
57          "label" : "Apply",
58          "* pack" : "add",
59          "xtype" : "Button",
60          "$ xns" : "Gtk"
61         },
62         {
63          "listeners" : {
64           "button_press_event" : "() => {\n       _this.save();\n          \n    _this.buttonPressed(\"save\");\n        return false;\n}"
65          },
66          "label" : "Save",
67          "* pack" : "add",
68          "xtype" : "Button",
69          "$ xns" : "Gtk"
70         }
71        ]
72       }
73      ]
74     },
75     {
76      "* pack" : "pack_start,false,false,0",
77      "xtype" : "HBox",
78      "gboolean expand" : false,
79      "$ xns" : "Gtk",
80      "$ homogeneous" : true,
81      "gboolean vexpand" : false,
82      "items" : [
83       {
84        "listeners" : {
85         "button_press_event" : "() => {\n    _this.save();\n          \n    _this.buttonPressed(\"apply\");\n        return false;\n}"
86        },
87        "label" : "Apply",
88        "xtype" : "Button",
89        "* pack" : "add",
90        "$ xns" : "Gtk"
91       },
92       {
93        "listeners" : {
94         "button_press_event" : "() => {\n       _this.save();\n          \n    _this.buttonPressed(\"save\");\n        return false;\n}"
95        },
96        "label" : "Save",
97        "xtype" : "Button",
98        "* pack" : "add",
99        "$ xns" : "Gtk"
100       }
101      ]
102     },
103     {
104      "label" : "filename",
105      "id" : "path",
106      "xalign" : 0,
107      "* pack" : "pack_start,false,false,0",
108      "xtype" : "Label",
109      "$ xns" : "Gtk"
110     },
111     {
112      "label" : "HTML To insert at end of <HEAD>",
113      "* pack" : "pack_start,false,false,0",
114      "xtype" : "Label",
115      "$ xns" : "Gtk"
116     },
117     {
118      "* pack" : "pack_start,false,false,0",
119      "xtype" : "HBox",
120      "gboolean expand" : false,
121      "$ xns" : "Gtk",
122      "$ homogeneous" : false,
123      "items" : [
124       {
125        "label" : "HTML template file",
126        "xtype" : "Label",
127        "* pack" : "pack_start,false,false,0",
128        "$ xns" : "Gtk"
129       },
130       {
131        "id" : "base_template",
132        "xtype" : "Entry",
133        "* pack" : "add",
134        "$ xns" : "Gtk"
135       }
136      ]
137     },
138     {
139      "* pack" : "pack_start,false,false,0",
140      "xtype" : "HBox",
141      "gboolean expand" : false,
142      "$ xns" : "Gtk",
143      "$ homogeneous" : false,
144      "items" : [
145       {
146        "label" : "root URL",
147        "xtype" : "Label",
148        "* pack" : "pack_start,false,false,0",
149        "$ xns" : "Gtk"
150       },
151       {
152        "id" : "rootURL",
153        "xtype" : "Entry",
154        "* pack" : "add",
155        "$ xns" : "Gtk"
156       }
157      ]
158     },
159     {
160      "* pack" : "pack_start,true,true,0",
161      "xtype" : "ScrolledWindow",
162      "$ xns" : "Gtk",
163      "items" : [
164       {
165        "listeners" : {
166         "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}"
167        },
168        "id" : "view",
169        "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(9000);\n    this.el.override_font(description);",
170        "xtype" : "View",
171        "* pack" : "add",
172        "$ xns" : "GtkSource"
173       }
174      ]
175     }
176    ]
177   }
178  ]
179 }