Adding Files in ProJucer: Option to Automatically Include Main JUCE Header


#1

It could be convenient if, when creating a new .cpp / .h (or both), that there would be an option somewhere to tick that would automatically insert the main JUCE header into the appropriate file. 9 times out of 10, my new file(s) needs this header anyway, however, maybe I’m the odd one out, in which case, this will seem like a silly request.

I know that it has been said that no extra work will be put into new features of PJ, so I have no issue trying to look at the code and trying to figure it out myself (since the common thing on this forum is to do it yourself and submit for approval), however, I don’t want to even dig into it unless I know it would be something that wouldnt get shut down, and most definitely, it wouldn’t be as efficient as it could be if one of the devs did it.

Also, if I missed that this is a current feature already, please let me know, because I must’ve missed it / it isn’t happening on my end.


#2

From my perspecitve I would find it more of an inconvenience having the Projucer ask me if I want to add the JUCE header every time I create a file, especially in larger projects where the include structure is such that you don’t need that line in every file that you create and instead have a single file that includes all the other related files and at the top includes the JUCE header. However, I’m happy to be persuaded if a lot of other people would find this a useful feature.

One thing I would like to clarify though is that we definitely ARE working on features of the Projucer - perhaps you misinterpreted posts where we’ve said that we’re not working on improving legacy Projucer features such as the GUI editor.


#3

I suppose from my perspective, I wasn’t thinking of having it be a pop-up that occurred each time you created a new file, but a setting somewhere in the PJ, that when set, would include it every time, without even asking. So after you ticked a setting somewhere where called “include JUCE header in new files” it would happen every time and wouldn’t ask you each time. Now, let’s say you forgot that that setting was checked, and you create a new file and the header gets automatically included. All you would have to do is manually erase it… which I think is less inconvenient than the current situation of having to manually insert it every time you need it, which for me, is more times than not (erasing is easier than having to type it in or find it elsewhere in the session to copy and paste).

Might even be handy to have a couple of custom path text boxes somewhere near the proposed tick box for including the JUCE header where a user could type in their own headers, that maybe they use all the time, that could also always be included in the creation of new files, but this isn’t as important to me, just another idea.

I do think this would be convenient, but if not many others feel the same, I understand not pursuing it. Thanks for reading anyway.


#4

Also, you are correct, I did forget that I had read that the GUI editor was the item that wasn’t going to be supported, but for some reason forgot and applied it to the whole PJ. My mistake.


#5

It would be better if the projucer let you specify custom templates … I’d like to get rid of all those //======= lines :slight_smile:


#6

Interesting… could be like a text editor where you could just put all the items you want to be included in every new file… or something.