Projucer saving files/project


#1

I’m not quite getting how the projucer manages saving files or exactly when it rebuilds the makefile (linux makefile project)

I eventually realised that when you save while viewing a code file it only saves that code file, not rebuilds the project, and when you save from the exporterpane it may not have saved all the individual files.

I have has some very odd behavior where I get an error in a make referring to a line in a file of code that has been changed and saved already - possibly even after a make clean.

what does save all do? does it save all code files or does it save the whole project and rebuild the makefile or what?

is there a definitive guide to what is saved in what context?


#2

If you save via the cmd/ctrl + S keyboard shortcut then what gets saved depends on what has keyboard focus - if you are editing a file and the code editor has focus then only the open file will be saved, otherwise the project will be saved. I tend to always use the “Save project” menu item when I want to save the project to be safe.

When you save the project, the Builds and JuceLibraryCode folder contents will be regenerated and changes to the .jucer file will be saved. However you are right about modifications to the open files not being saved when this command is invoked so I’ve just pushed a change to develop that will also save all the open files when saving a project; it should be on develop in a few minutes.


#3

OK thanks for the clarification. So what does that save all function do? Saves all code files or regenerate the project as well? Does it also depend on focus?


#4

The “Save all” menu command will save all the open documents, it will not regenerate the project regardless of key focus.


#5

thanks, it sounds like the change you have made will be more intuitive behaviour. As it is there are two saves from different focus points required to make a code change and compile.

I guess editing code in the projucer is not the intended use but I find I do it often for small corrections.

Could there be a visual indication of unsaved file / unsaved project in some way? Visual feedback avoids confusion.


#6

Yes I think that would be a useful addition, I’ll add it to the backlog.


#7

awesome! I’m glad to be the canary for easily-confused.


#8

This is now on the develop branch with this commit. If you pull and re-compile the Projucer, modified files will be marked with an asterisk in the Projucer’s file tree.


#9

Regarding the ctrl/cmd + s for saving files or the project depending on the keyboard focus…
Would it not be better to have a separate shortcut for these two actions? Maybe ctrl + alt + s for saving projects.
And for the save all option - that name suggests the action saves everything that can possibly be saved so should save all documents and the project. If the desired action is to keep it as saving all documents then maybe renaming this to ‘Save All Documents’ would be a better choice?