V1.4 - A nasty surprise for the unsuspecting

  • SquareLine Studio version: 1.4
  • Operating system: MacOS
  • Target hardware: N/A

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’ve gone back to V1.4 to give it a second try.

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.

Thanks for your reply and thoughts.

1 Like

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.


Not sure I get every details of what you mean. Could you please rephrase it?

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.

Hermit, did you see the issue?

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.