KeyWorksRW / wxUiEditor

RAD tool used to create and maintain wxWidgets UI elements.
Apache License 2.0
63 stars 7 forks source link

Fix problems with base_file containing a directory #1371

Closed Randalphwa closed 8 months ago

Randalphwa commented 8 months ago

This PR adds a new function to the ProjectHandler class that retrieves the full path to the output file for the specified form and language. This also eliminates a duplicate single-level folder. E.g., given a project output file called generate and a form base_file called generate/my_form this will remove the duplicate generate folder. The upside is that this will fix the most common error where the folder portion was entered by hand even though it wasn't needed. It will, however, prevent the user from specifying nested folders containing the same name (i.e., generate/generate/my_form won't work if project output directory is set to generate/).

The second part of this PR adds a isGenerating() to App and uses that in FileCodeWriter::WriteFile() to determine whether or not to ask the user permission to create a directory that was specified, but doesn't exist. This allows the code writer to create a missing directory as long as code generation is running from the command line.

See #1366