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