eried / Arduino

open-source electronics prototyping platform - enhanced release for Windows
http://arduino.cc/forum/index.php/topic,118440.0.html
Other
10 stars 2 forks source link

User definable starting template #10

Closed Sembazuru closed 10 years ago

Sembazuru commented 11 years ago

First mentioned (that I saw) in forum reply#491 http://forum.arduino.cc/index.php?topic=118440.msg1257835#msg1257835

I was thinking of requesting the same thing. I'd like to have the IDE load a user supplied file as the new sketch template. If the user supplied file doesn't exist then use the hard-coded template. I know this can be fudged by having a sketch that one uses as their template, but it would be nice to have it automagic.

eried commented 11 years ago

Any suggestion for the path? I was thinking on using a example file, like 0. Startup sketches / Default.ino ....

Sembazuru commented 11 years ago

Well, I'm not sure if it should be just a simple .ino file that it loads from somewhere, or a full sketch folder that it loads from somewhere. (Using a full sketch folder allows loading multiple tabs as the default starting point for advanced users.) As far as locations, I can think of two valid possibilities: Either in the configured sketch folder, or in the preferences folder (i.e. where idesettings_v104.txt resides). Hiding it in the preferences folder could be taken as more annoying to update. But, really, how often would one want to change this? It should be an intentional action to update it, instead of accidental as might happen in the sketches folder.

eried commented 11 years ago

Yes I know, I was thinking just to not break the current directory schema a lot, or just to place the template where it makes sense. Right now the template is the same of one of the arduino samples, so it makes sense to have a "live" example that can be modified. But it might be a bit confusing

Sembazuru commented 11 years ago

I agree that having it a "live" example might be a bit confusing. That is why I was suggesting the preferences path. It's out of the way, but still an existing path that the IDE knows about. Stretching the scope of a preferences setting to include the default sketch doesn't seem to me that far of a stretch. I will, however, stand by not having it in the distribution path, for the same reasons that one shouldn't install user/3d-party libraries in the distribution path...

Almost seems to be a question of what type of support you want to provide to this. Help pointing people to the correct location for changing the default sketch in the preference folder, or helping people who break this by some how fudging up the default in the sketch folder. Choice of evils. ;-)

I wonder if the forum thread would be a good place to get multiple points of view (or if that would just muddy the already murky waters)...

eried commented 10 years ago

I added this as a new "Example" https://github.com/eried/Arduino/commit/fc526ac7288ea7f24aa9b489292604d446a41aa4

If is not present, it loads the default one :)