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