1 static Xcls_PopoverFileDetails _PopoverFileDetails;
3 public class Xcls_PopoverFileDetails : Object
6 private Xcls_PopoverFileDetails _this;
8 public static Xcls_PopoverFileDetails singleton()
10 if (_PopoverFileDetails == null) {
11 _PopoverFileDetails= new Xcls_PopoverFileDetails();
13 return _PopoverFileDetails;
15 public Xcls_grid grid;
16 public Xcls_filetypelbl filetypelbl;
17 public Xcls_filetype filetype;
18 public Xcls_ftdbcellrenderer ftdbcellrenderer;
19 public Xcls_ftdbmodel ftdbmodel;
20 public Xcls_name name;
21 public Xcls_title title;
22 public Xcls_region region;
23 public Xcls_parent parent;
24 public Xcls_permname permname;
25 public Xcls_modOrder modOrder;
26 public Xcls_build_module build_module;
27 public Xcls_dbcellrenderer dbcellrenderer;
28 public Xcls_dbmodel dbmodel;
30 public Xcls_dircellrenderer dircellrenderer;
31 public Xcls_dirmodel dirmodel;
32 public Xcls_path path;
33 public Xcls_save_btn save_btn;
36 public bool new_window;
37 public signal void success (Project.Project pr, JsRender.JsRender file);
38 public JsRender.JsRender file;
39 public Project.Project project;
40 public Xcls_MainWindow mainwindow;
44 public Xcls_PopoverFileDetails()
47 this.el = new Gtk.Popover( null );
50 this.new_window = true;
52 this.mainwindow = null;
56 this.el.border_width = 0;
58 this.el.position = Gtk.PositionType.RIGHT;
59 var child_0 = new Xcls_Box2( _this );
61 this.el.add ( child_0.el );
64 this.el.closed.connect( () => {
70 this.el.hide.connect( ( ) => {
79 // user defined functions
80 public void show (JsRender.JsRender c, Gtk.Widget btn, bool new_window)
82 this.project = c.project;
84 this.new_window = new_window;
89 _this.path.el.set_text(c.path);
90 _this.name.el.set_text(c.name);
91 _this.title.el.set_text(c.title);
92 _this.parent.el.set_text(c.parent);
93 _this.region.el.set_text(c.region);
94 _this.modOrder.el.set_text(c.modOrder);
95 _this.permname.el.set_text(c.permname);
104 var ar = new Gee.ArrayList<string>();
105 _this.dbmodel.loadData(ar,"");
106 // load the modules... if relivant..
107 if (this.project.xtype == "Gtk") {
108 var p = (Project.Gtk)c.project;
109 var cg = p.compilegroups;
111 var iter = cg.map_iterator();
113 var key = iter.get_key();
114 if (key == "_default_") {
119 _this.dbmodel.loadData(ar, c.build_module);
125 //console.log('show all');
126 this.el.set_modal(true);
127 this.el.set_relative_to(btn);
129 this.el.set_position(Gtk.PositionType.TOP);
132 this.mainwindow.el.get_size(out w, out h);
133 this.el.set_size_request( 550, h);
138 print("SHOWALL - POPIP\n");
140 this.name.el.grab_focus();
144 if (c.path.length > 0) {
145 this.save_btn.el.set_label("Save");
146 _this.filetype.el.hide();
147 _this.filetypelbl.el.hide();
148 _this.filetype.showhide(true); // as we only work on bjs files currently
150 this.save_btn.el.set_label("Create");
151 _this.ftdbmodel.loadData("bjs"); // fixme - need to determine type..
152 _this.filetype.el.show();
153 _this.filetypelbl.el.show();
157 //this.success = c.success;
161 public void updateFileFromEntry () {
163 _this.file.title = _this.title.el.get_text();
164 _this.file.region = _this.region.el.get_text();
165 _this.file.parent = _this.parent.el.get_text();
166 _this.file.permname = _this.permname.el.get_text();
167 _this.file.modOrder = _this.modOrder.el.get_text();
169 if (_this.file.name.length > 0 && _this.file.name != _this.name.el.get_text()) {
170 _this.file.renameTo(_this.name.el.get_text());
172 // store the module...
173 _this.file.build_module = "";
175 if (_this.build_module.el.get_active_iter (out iter)) {
177 this.dbmodel.el.get_value (iter, 0, out vfname);
178 if (((string)vfname).length > 0) {
179 _this.file.build_module = (string)vfname;
188 public class Xcls_Box2 : Object
191 private Xcls_PopoverFileDetails _this;
197 public Xcls_Box2(Xcls_PopoverFileDetails _owner )
200 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
204 // set gobject values
205 this.el.homogeneous = false;
206 var child_0 = new Xcls_HeaderBar3( _this );
208 this.el.pack_start ( child_0.el , false,true,0 );
209 var child_1 = new Xcls_grid( _this );
211 this.el.pack_start ( child_1.el , false,false,4 );
212 var child_2 = new Xcls_ButtonBox31( _this );
214 this.el.add ( child_2.el );
217 // user defined functions
219 public class Xcls_HeaderBar3 : Object
221 public Gtk.HeaderBar el;
222 private Xcls_PopoverFileDetails _this;
228 public Xcls_HeaderBar3(Xcls_PopoverFileDetails _owner )
231 this.el = new Gtk.HeaderBar();
235 // set gobject values
236 this.el.title = "Add / Edit File";
239 // user defined functions
242 public class Xcls_grid : Object
245 private Xcls_PopoverFileDetails _this;
251 public Xcls_grid(Xcls_PopoverFileDetails _owner )
255 this.el = new Gtk.Grid();
259 // set gobject values
260 this.el.margin_right = 4;
261 this.el.margin_left = 4;
262 this.el.row_spacing = 2;
263 var child_0 = new Xcls_filetypelbl( _this );
265 this.el.attach ( child_0.el , 0,0,1,1 );
266 var child_1 = new Xcls_filetype( _this );
268 this.el.attach ( child_1.el , 1,0,1,1 );
269 var child_2 = new Xcls_Label9( _this );
271 this.el.attach ( child_2.el , 0,1,1,1 );
272 var child_3 = new Xcls_name( _this );
274 this.el.attach ( child_3.el , 1,1,1,1 );
275 var child_4 = new Xcls_Label11( _this );
277 this.el.attach ( child_4.el , 0,2,1,1 );
278 var child_5 = new Xcls_title( _this );
280 this.el.attach ( child_5.el , 1,2,1,1 );
281 var child_6 = new Xcls_Label13( _this );
283 this.el.attach ( child_6.el , 0,3,1,1 );
284 var child_7 = new Xcls_region( _this );
286 this.el.attach ( child_7.el , 1,3,1,1 );
287 var child_8 = new Xcls_Label15( _this );
289 this.el.attach ( child_8.el , 0,4,1,1 );
290 var child_9 = new Xcls_parent( _this );
292 this.el.attach ( child_9.el , 1,4,1,1 );
293 var child_10 = new Xcls_Label17( _this );
295 this.el.attach ( child_10.el , 0,5,1,1 );
296 var child_11 = new Xcls_permname( _this );
298 this.el.attach ( child_11.el , 1,5,1,1 );
299 var child_12 = new Xcls_Label19( _this );
301 this.el.attach ( child_12.el , 0,6,1,1 );
302 var child_13 = new Xcls_modOrder( _this );
304 this.el.attach ( child_13.el , 1,6,1,1 );
305 var child_14 = new Xcls_Label21( _this );
307 this.el.attach ( child_14.el , 0,7,1,1 );
308 var child_15 = new Xcls_build_module( _this );
310 this.el.attach ( child_15.el , 1,7,1,1 );
311 var child_16 = new Xcls_Label25( _this );
313 this.el.attach ( child_16.el , 0,8,1,1 );
314 var child_17 = new Xcls_dir( _this );
316 this.el.attach ( child_17.el , 1,8,1,1 );
317 var child_18 = new Xcls_Label29( _this );
319 this.el.attach ( child_18.el , 0,9,1,1 );
320 var child_19 = new Xcls_path( _this );
322 this.el.attach ( child_19.el , 1,9,1,1 );
325 // user defined functions
327 public class Xcls_filetypelbl : Object
330 private Xcls_PopoverFileDetails _this;
336 public Xcls_filetypelbl(Xcls_PopoverFileDetails _owner )
339 _this.filetypelbl = this;
340 this.el = new Gtk.Label( "File type" );
344 // set gobject values
345 this.el.justify = Gtk.Justification.RIGHT;
346 this.el.xalign = 0.900000f;
349 // user defined functions
352 public class Xcls_filetype : Object
354 public Gtk.ComboBox el;
355 private Xcls_PopoverFileDetails _this;
361 public Xcls_filetype(Xcls_PopoverFileDetails _owner )
364 _this.filetype = this;
365 this.el = new Gtk.ComboBox();
369 // set gobject values
370 var child_0 = new Xcls_ftdbcellrenderer( _this );
372 this.el.pack_start ( child_0.el , true );
373 var child_1 = new Xcls_ftdbmodel( _this );
375 this.el.set_model ( child_1.el );
379 this.el.add_attribute(_this.ftdbcellrenderer.el , "markup", 1 );
382 this.el.changed.connect( () => {
385 if (this.el.get_active_iter(out iter)) {
387 _this.ftdbmodel.el.get_value (iter, 0, out vfname);
388 is_bjs = ((string)vfname) == "bjs";
392 // directory is only available for non-bjs
393 this.showhide(is_bjs);
399 // user defined functions
400 public void showhide (bool is_bjs) {
403 if (_this.project.xtype != "Roo") {
407 for (var i = 2; i < 9;i++) {
408 var el = _this.grid.el.get_child_at(0,i);
410 var showhide= is_bjs;
412 showhide = !showhide;
420 el = _this.grid.el.get_child_at(1,i);
427 // load up the directories
428 //??? why can we not create bjs files in other directories??
429 //if (!is_bjs && _this.file.path.length < 1) {
431 _this.dirmodel.loadData();
439 public class Xcls_ftdbcellrenderer : Object
441 public Gtk.CellRendererText el;
442 private Xcls_PopoverFileDetails _this;
448 public Xcls_ftdbcellrenderer(Xcls_PopoverFileDetails _owner )
451 _this.ftdbcellrenderer = this;
452 this.el = new Gtk.CellRendererText();
456 // set gobject values
459 // user defined functions
462 public class Xcls_ftdbmodel : Object
464 public Gtk.ListStore el;
465 private Xcls_PopoverFileDetails _this;
471 public Xcls_ftdbmodel(Xcls_PopoverFileDetails _owner )
474 _this.ftdbmodel = this;
475 this.el = new Gtk.ListStore.newv( { typeof(string),typeof(string) } );
479 // set gobject values
482 // user defined functions
483 public void loadData (string cur) {
488 /// el.append(out iter);
491 // el.set_value(iter, 0, "");
492 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
497 el.set_value(iter, 0, "bjs");
498 el.set_value(iter, 1, "User Interface File (bjs)");
499 _this.filetype.el.set_active_iter(iter);
503 el.set_value(iter, 0, "vala");
504 el.set_value(iter, 1, "Vala");
506 _this.filetype.el.set_active_iter(iter);
513 el.set_value(iter, 0, "js");
514 el.set_value(iter, 1, "Javascript");
517 _this.filetype.el.set_active_iter(iter);
522 el.set_value(iter, 0, "css");
523 el.set_value(iter, 1, "CSS");
526 _this.filetype.el.set_active_iter(iter);
533 public class Xcls_Label9 : Object
536 private Xcls_PopoverFileDetails _this;
542 public Xcls_Label9(Xcls_PopoverFileDetails _owner )
545 this.el = new Gtk.Label( "Component Name" );
549 // set gobject values
550 this.el.justify = Gtk.Justification.RIGHT;
551 this.el.xalign = 0.900000f;
554 // user defined functions
557 public class Xcls_name : Object
560 private Xcls_PopoverFileDetails _this;
566 public Xcls_name(Xcls_PopoverFileDetails _owner )
570 this.el = new Gtk.Entry();
574 // set gobject values
575 this.el.visible = true;
578 // user defined functions
581 public class Xcls_Label11 : Object
584 private Xcls_PopoverFileDetails _this;
590 public Xcls_Label11(Xcls_PopoverFileDetails _owner )
593 this.el = new Gtk.Label( "Title" );
597 // set gobject values
598 this.el.justify = Gtk.Justification.RIGHT;
599 this.el.xalign = 0.900000f;
600 this.el.visible = true;
603 // user defined functions
606 public class Xcls_title : Object
609 private Xcls_PopoverFileDetails _this;
615 public Xcls_title(Xcls_PopoverFileDetails _owner )
619 this.el = new Gtk.Entry();
623 // set gobject values
624 this.el.visible = true;
627 // user defined functions
630 public class Xcls_Label13 : Object
633 private Xcls_PopoverFileDetails _this;
639 public Xcls_Label13(Xcls_PopoverFileDetails _owner )
642 this.el = new Gtk.Label( "Region" );
646 // set gobject values
647 this.el.justify = Gtk.Justification.RIGHT;
648 this.el.xalign = 0.900000f;
649 this.el.tooltip_text = "center, north, south, east, west";
650 this.el.visible = true;
653 // user defined functions
656 public class Xcls_region : Object
659 private Xcls_PopoverFileDetails _this;
665 public Xcls_region(Xcls_PopoverFileDetails _owner )
669 this.el = new Gtk.Entry();
673 // set gobject values
674 this.el.visible = true;
677 // user defined functions
680 public class Xcls_Label15 : Object
683 private Xcls_PopoverFileDetails _this;
689 public Xcls_Label15(Xcls_PopoverFileDetails _owner )
692 this.el = new Gtk.Label( "Parent Name" );
696 // set gobject values
697 this.el.justify = Gtk.Justification.RIGHT;
698 this.el.xalign = 0.900000f;
699 this.el.visible = true;
702 // user defined functions
705 public class Xcls_parent : Object
708 private Xcls_PopoverFileDetails _this;
714 public Xcls_parent(Xcls_PopoverFileDetails _owner )
718 this.el = new Gtk.Entry();
722 // set gobject values
723 this.el.visible = true;
726 // user defined functions
729 public class Xcls_Label17 : Object
732 private Xcls_PopoverFileDetails _this;
738 public Xcls_Label17(Xcls_PopoverFileDetails _owner )
741 this.el = new Gtk.Label( "Permission Name" );
745 // set gobject values
746 this.el.justify = Gtk.Justification.RIGHT;
747 this.el.xalign = 0.900000f;
748 this.el.visible = true;
751 // user defined functions
754 public class Xcls_permname : Object
757 private Xcls_PopoverFileDetails _this;
763 public Xcls_permname(Xcls_PopoverFileDetails _owner )
766 _this.permname = this;
767 this.el = new Gtk.Entry();
771 // set gobject values
772 this.el.visible = true;
775 // user defined functions
778 public class Xcls_Label19 : Object
781 private Xcls_PopoverFileDetails _this;
787 public Xcls_Label19(Xcls_PopoverFileDetails _owner )
790 this.el = new Gtk.Label( "Order (for tabs)" );
794 // set gobject values
795 this.el.justify = Gtk.Justification.RIGHT;
796 this.el.xalign = 0.900000f;
797 this.el.visible = true;
800 // user defined functions
803 public class Xcls_modOrder : Object
806 private Xcls_PopoverFileDetails _this;
812 public Xcls_modOrder(Xcls_PopoverFileDetails _owner )
815 _this.modOrder = this;
816 this.el = new Gtk.Entry();
820 // set gobject values
821 this.el.visible = true;
824 // user defined functions
827 public class Xcls_Label21 : Object
830 private Xcls_PopoverFileDetails _this;
836 public Xcls_Label21(Xcls_PopoverFileDetails _owner )
839 this.el = new Gtk.Label( "Module to build (Vala only)" );
843 // set gobject values
844 this.el.justify = Gtk.Justification.RIGHT;
845 this.el.xalign = 0.900000f;
846 this.el.visible = true;
849 // user defined functions
852 public class Xcls_build_module : Object
854 public Gtk.ComboBox el;
855 private Xcls_PopoverFileDetails _this;
861 public Xcls_build_module(Xcls_PopoverFileDetails _owner )
864 _this.build_module = this;
865 this.el = new Gtk.ComboBox();
869 // set gobject values
870 var child_0 = new Xcls_dbcellrenderer( _this );
872 this.el.pack_start ( child_0.el , true );
873 var child_1 = new Xcls_dbmodel( _this );
875 this.el.set_model ( child_1.el );
879 this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
882 // user defined functions
884 public class Xcls_dbcellrenderer : Object
886 public Gtk.CellRendererText el;
887 private Xcls_PopoverFileDetails _this;
893 public Xcls_dbcellrenderer(Xcls_PopoverFileDetails _owner )
896 _this.dbcellrenderer = this;
897 this.el = new Gtk.CellRendererText();
901 // set gobject values
904 // user defined functions
907 public class Xcls_dbmodel : Object
909 public Gtk.ListStore el;
910 private Xcls_PopoverFileDetails _this;
916 public Xcls_dbmodel(Xcls_PopoverFileDetails _owner )
919 _this.dbmodel = this;
920 this.el = new Gtk.ListStore.newv( { typeof(string),typeof(string) } );
924 // set gobject values
927 // user defined functions
928 public void loadData (Gee.ArrayList<string> data, string cur) {
933 /// el.append(out iter);
936 // el.set_value(iter, 0, "");
937 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
942 el.set_value(iter, 0, "");
943 el.set_value(iter, 1, "-- select a module --");
944 _this.build_module.el.set_active_iter(iter);
946 for (var i = 0; i < data.size;i++) {
951 el.set_value(iter, 0, data.get(i));
952 el.set_value(iter, 1, data.get(i));
954 if (data.get(i) == cur) {
955 _this.build_module.el.set_active_iter(iter);
959 this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
965 public class Xcls_Label25 : Object
968 private Xcls_PopoverFileDetails _this;
974 public Xcls_Label25(Xcls_PopoverFileDetails _owner )
977 this.el = new Gtk.Label( "Directory" );
981 // set gobject values
982 this.el.justify = Gtk.Justification.RIGHT;
983 this.el.xalign = 0.900000f;
984 this.el.visible = true;
987 // user defined functions
990 public class Xcls_dir : Object
992 public Gtk.ComboBox el;
993 private Xcls_PopoverFileDetails _this;
999 public Xcls_dir(Xcls_PopoverFileDetails _owner )
1003 this.el = new Gtk.ComboBox();
1007 // set gobject values
1008 var child_0 = new Xcls_dircellrenderer( _this );
1010 this.el.pack_start ( child_0.el , true );
1011 var child_1 = new Xcls_dirmodel( _this );
1013 this.el.set_model ( child_1.el );
1017 this.el.add_attribute(_this.dircellrenderer.el , "markup", 1 );
1020 // user defined functions
1022 public class Xcls_dircellrenderer : Object
1024 public Gtk.CellRendererText el;
1025 private Xcls_PopoverFileDetails _this;
1031 public Xcls_dircellrenderer(Xcls_PopoverFileDetails _owner )
1034 _this.dircellrenderer = this;
1035 this.el = new Gtk.CellRendererText();
1039 // set gobject values
1042 // user defined functions
1045 public class Xcls_dirmodel : Object
1047 public Gtk.ListStore el;
1048 private Xcls_PopoverFileDetails _this;
1054 public Xcls_dirmodel(Xcls_PopoverFileDetails _owner )
1057 _this.dirmodel = this;
1058 this.el = new Gtk.ListStore.newv( { typeof(string),typeof(string) } );
1062 // set gobject values
1065 // user defined functions
1066 public void loadData () {
1072 if (!(_this.project is Project.Gtk)) {
1075 var sd = ((Project.Gtk)_this.project).sourcedirs();
1080 /// el.append(out iter);
1083 // el.set_value(iter, 0, "");
1084 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
1086 // el.append(out iter);
1089 // el.set_value(iter, 0, "");
1090 // el.set_value(iter, 1, "-- select a directoyr --");
1091 //_this.build_module.el.set_active_iter(iter);
1093 for (var i = 0; i < sd.length;i++) {
1096 el.append(out iter);
1098 el.set_value(iter, 0, sd[i]);
1099 el.set_value(iter, 1, sd[i]);
1101 //if (data.get(i) == cur) {
1102 // _this.build_module.el.set_active_iter(iter);
1106 // this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
1112 public class Xcls_Label29 : Object
1114 public Gtk.Label el;
1115 private Xcls_PopoverFileDetails _this;
1122 public Xcls_Label29(Xcls_PopoverFileDetails _owner )
1125 this.el = new Gtk.Label( "Full path" );
1130 // set gobject values
1131 this.el.justify = Gtk.Justification.RIGHT;
1132 this.el.xalign = 0.900000f;
1133 this.el.visible = true;
1136 // user defined functions
1139 public class Xcls_path : Object
1141 public Gtk.Entry el;
1142 private Xcls_PopoverFileDetails _this;
1149 public Xcls_path(Xcls_PopoverFileDetails _owner )
1153 this.el = new Gtk.Entry();
1158 // set gobject values
1159 this.el.editable = false;
1160 this.el.visible = true;
1163 // user defined functions
1167 public class Xcls_ButtonBox31 : Object
1169 public Gtk.ButtonBox el;
1170 private Xcls_PopoverFileDetails _this;
1176 public Xcls_ButtonBox31(Xcls_PopoverFileDetails _owner )
1179 this.el = new Gtk.ButtonBox( Gtk.Orientation.HORIZONTAL );
1183 // set gobject values
1184 this.el.margin_right = 4;
1185 this.el.margin_left = 4;
1186 this.el.margin_bottom = 4;
1187 this.el.margin_top = 4;
1188 var child_0 = new Xcls_Button32( _this );
1190 this.el.add ( child_0.el );
1191 var child_1 = new Xcls_save_btn( _this );
1193 this.el.add ( child_1.el );
1196 // user defined functions
1198 public class Xcls_Button32 : Object
1200 public Gtk.Button el;
1201 private Xcls_PopoverFileDetails _this;
1207 public Xcls_Button32(Xcls_PopoverFileDetails _owner )
1210 this.el = new Gtk.Button();
1214 // set gobject values
1215 this.el.label = "Cancel";
1218 this.el.clicked.connect( () => {
1225 // user defined functions
1228 public class Xcls_save_btn : Object
1230 public Gtk.Button el;
1231 private Xcls_PopoverFileDetails _this;
1237 public Xcls_save_btn(Xcls_PopoverFileDetails _owner )
1240 _this.save_btn = this;
1241 this.el = new Gtk.Button();
1245 // set gobject values
1246 this.el.label = "Save";
1249 this.el.clicked.connect( ( ) => {
1254 if (_this.name.el.get_text().length < 1) {
1255 Xcls_StandardErrorDialog.singleton().show(
1256 _this.mainwindow.el,
1257 "You have to set Component name "
1262 // what does this do?
1264 var isNew = _this.file.name.length > 0 ? false : true;
1266 if (!isNew && this.file.name != _this.name.el.get_text()) {
1267 Xcls_StandardErrorDialog.singleton().show(
1269 "Sorry changing names does not work yet. "
1278 // FIXME - this may be more complicated...
1279 //for (var i in this.def) {
1280 // this.file[i] = this.get(i).el.get_text();
1285 _this.updateFileFromEntry();
1286 } catch( JsRender.Error.RENAME_FILE_EXISTS er) {
1287 Xcls_StandardErrorDialog.singleton().show(
1288 _this.mainwindow.el,
1289 "The name you used already exists "
1301 // ---------------- NEW FILES...
1304 if (!_this.filetype.el.get_active_iter(out iter)) {
1305 // should not happen...
1306 // so we are jut going to return without
1307 Xcls_StandardErrorDialog.singleton().show(
1308 _this.mainwindow.el,
1309 "You must select a file type. "
1316 var fn = _this.name.el.get_text();
1319 _this.ftdbmodel.el.get_value (iter, 0, out ftypename);
1320 var ext = ((string)ftypename);
1321 var dir = _this.project.firstPath();
1324 if (!_this.dir.el.get_active_iter(out iter)) {
1325 // should not happen...
1326 // so we are jut going to return without
1327 Xcls_StandardErrorDialog.singleton().show(
1328 _this.mainwindow.el,
1329 "You must select a directory "
1334 _this.dirmodel.el.get_value (iter, 0, out vdir);
1338 var targetfile = dir + "/" + fn;
1340 // strip the file type off the end..
1343 var rx = new GLib.Regex("\\." + ext + "$",GLib.RegexCompileFlags.CASELESS);
1344 targetfile = rx.replace(targetfile, targetfile.length, 0, "");
1346 if (GLib.FileUtils.test(targetfile + "." + ext, GLib.FileTest.EXISTS)) {
1347 Xcls_StandardErrorDialog.singleton().show(
1348 _this.mainwindow.el,
1349 "That file already exists"
1354 var f = JsRender.JsRender.factory(
1355 ext == "bjs" ? _this.file.project.xtype : "PlainFile",
1357 targetfile + "." + ext);
1363 _this.updateFileFromEntry();
1364 _this.file.loaded = true;
1367 _this.file.project.addFile(_this.file);
1375 // hopefull this will work with bjs files..
1377 _this.success(_this.project, _this.file);
1382 // user defined functions