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