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