resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / PopoverFileDetails.vala
index fd7697c..9bfab0a 100644 (file)
@@ -1217,16 +1217,26 @@ public class Xcls_PopoverFileDetails : Object
                // ---------------- NEW FILES...
                Gtk.TreeIter iter;
             
+               if (!_this.filetype.el.get_active_iter(out iter)) {
+                       // should not happen...
+                       // so we are jut going to return without 
+                       StandardErrorDialog.show(
+                       _this.mainwindow.el,
+                       "You must select a file type. "
+                   );
+                   return;
+                        
+               }
+               
+               
                var fn = _this.name.el.get_text();
                
                Value ftypename;
                _this.ftdbmodel.el.get_value (iter, 0, out ftypename);
                var ext = ((string)ftypename);
-               
-               if (ext == "bjs") {
-               
-                       var dir = _this.project.firstPath();   // fixme.. should be based on a pulldown?
-               } else {
+               var dir = _this.project.firstPath(); 
+               if (ext != "bjs") {
+                
                        if (!_this.dir.el.get_active_iter(out iter)) {
                                // should not happen...
                                // so we are jut going to return without 
@@ -1236,23 +1246,15 @@ public class Xcls_PopoverFileDetails : Object
                                );
                                return;
                        }
-                       
+                       Value vdir;
+                       _this.dirmodel.el.get_value (iter, 0, out vdir);
+                       dir = (string)vdir;
                }
                
                var targetfile = dir + "/" + fn;
                
                // strip the file type off the end..
                
-               if (!_this.filetype.el.get_active_iter(out iter)) {
-                       // should not happen...
-                       // so we are jut going to return without 
-                       StandardErrorDialog.show(
-                       _this.mainwindow.el,
-                       "You must select a file type. "
-                   );
-                   return;
-                        
-               }
                
                 var rx = new GLib.Regex("\\." + ext + "$",GLib.RegexCompileFlags.CASELESS);
                 targetfile = rx.replace(targetfile, targetfile.length, 0, "");