2 "build_module" : "builder",
3 "gen_extended" : false,
6 "# JsRender.Node data" : "",
7 "# Project.Project project" : "",
10 "@ void complete" : "(string result)",
11 "default_height" : 200,
12 "default_width" : 400,
16 "* pack" : " get_content_area().append",
17 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
36 "* pack" : "add_action_widget,0",
42 "* pack" : "add_action_widget,1",
50 " \tif (response_id < 1) {",
52 " this.complete(\"\");",
55 " var name = _this.name.el.get_text();",
56 " if (name.length < 1) {",
57 " Xcls_StandardErrorDialog.singleton().show(",
59 " \"You must give the template a name. \"",
63 " if (!Regex.match_simple (\"^[A-Za-z][A-Za-z0-9.]+$\", name) )",
65 " Xcls_StandardErrorDialog.singleton().show(",
66 " _this.el.transient_for,",
67 " \"Template Name must contain only letters dots\"",
72 " var targetfile = project.path + \"/templates/\" + name + \".bjs\";",
75 " if (GLib.FileUtils.test(targetfile, GLib.FileTest.EXISTS)) {",
76 "\t Xcls_StandardErrorDialog.singleton().show(",
77 "\t _this.el.transient_for,",
78 "\t \"That file already exists\"",
82 "\tJsRender.JsRender f;",
84 "\t f = JsRender.JsRender.factory(",
85 "\t\t\t project.xtype , ",
88 "\t} catch (JsRender.Error e) {",
89 "\t\tXcls_StandardErrorDialog.singleton().show(",
90 "\t _this.el.transient_for,",
91 "\t \"Error creating file\"",
97 " f.tree = _this.data.deepClone();",
99 " project.addFile(f);",
100 " // now we save it..",
102 " this.complete(name);",
111 " (Gtk.Window parent, Project.Project project, JsRender.Node data) {",
114 " this.el.set_transient_for(parent);",
115 " this.el.modal = true;",
117 " this.data = data;",
118 " this.project = project;",
119 " this.name.el.set_text(\"\");",
129 "name" : "DialogSaveModule"