Like many, I have always exported the UI files directly into the sketch folder where the main .ino sketch lives. This makes it easy to update the UI, export and then immediately do a compile in the Arduino IDE.
But in an attempt to clean up old files, SLS 1.4 deletes every file in the export directory before exporting the new files. What a surprise when I modifiied code in my main sketch, only to find the new sketch wiped out when I subsequently exported the UI from SLS.
One way around this is to always export the UI files to another directory and then copy the files into the main sketch folder. An unwelcomed extra step in the workflow.
The other way is the revert to SLS v1.3.4. That is what I am choosing to do for now.
Good to know itās more convenient for you and others to have the exported UI files of āuiā folder directly in the sketch folder. But yes, SquareLine Studio 1.4.0 now deletes the contents of the UI folder selectively (leaving e.g. ui_events.c) before exporting the UI to ensure there are no residues left which could cause compile errors (I see your comments in the corresponding topic: SLS exports a deleted screen and breaks compilation ). The UI files are in the āuiā folder for a reason, not to coincide with your project files using them. Probably thereās a way to determine for sure which files are residues of deleted screens/etc. and which are your own code, but in SquareLine Studio there doesnāt seem to be a handling for this scenario currently. Anyway, thanks for the feedback, this feature request gives a material for further discussions.
I think that having it export into a separate directory probably isnāt a bad idea after all. While this is an extra step in my former workflow, I can see certain advantages now.
Hi, in 1.3.4 when check the option dont export āCall functions export fileā the ui_events.cpp, dont export. but dont delete it, on 1.4.0 delete the file, please can you recover the last export type on next version 1.4.1.
When Export UI Files, in Project settings, if option āCall functions export fileā is mark with ādont exportā, dont export file ui_event.cpp, but if exist, is deleted, this is the problem.
I reproduced what you mean. The ui_events.c/.cpp file gets deleted when you press āCreate Template Projectā menupoint, but not deleted when you press only āExport UI Filesā menupoint. I guess itās the intended operation in SquareLine Studio 1.4 because it now deletes unnecessary files or residues of previous exports (as it was requested several times.) Maybe a filter to check if it contains custom code, and not deleting if it is, would be more adequate working in your case. Iāll ask about this from the responsible staff.
This is also causing me problemsā¦ I think is nice to have the ui files in a seperate folder, it makes things more organised. But how would you include this folder in the main sketch? Iām getting errors when I compile the code, that I have āUndefined references to ā¦ā and I know is due to the seperate ui folder that I created.
Iām using Arduino IDE. I have also changed the ui.h file in the main sketch so it is pointing to the right location. But Iām still getting errors.
@subzero89ā¦
I have opted to do it the Neanderthal wayā¦ copy the newly generated UI files from the UI folder into the main sketch folder. One can always write a script to make it a one-click procedure.