edward0429 / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

Rename .pde files to .ino on save, not open. #634

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, when you open an old sketch, all files with a .pde extension are 
renamed to .ino.  Instead, we should modify the compiler to handle sketches 
with .pde files and do the rename when saving a sketch, not opening one.  

Original issue reported on code.google.com by dmel...@gmail.com on 9 Sep 2011 at 3:37

GoogleCodeExporter commented 9 years ago
Ok finally i did it:

https://github.com/cmaglie/Arduino/commit/5d97d467c817d4e9b4c185d337d1d2e151ee10
a5

this one is a little bit complex, there are lots of details to take into 
account.
some notes:

1) the file now is renamed using the SketchCode method renameTo(), this has two 
advantadges: the file is really renamed (and not copied) and the tab on the UI 
are updated.

2) on save a dialog box with a list of file that will be renamed appears

3) There were a bug in saving: if you close the IDE without saving your changes 
before a dialog appears asking if you want to save. If you click "YES" but for 
some reason the saving fails the window is closed anyway, losing your changes. 
This was fixed also.

4) Testing needed.

Tomorrow i can do another round with this issue.

Original comment by c.mag...@bug.st on 9 Sep 2011 at 11:26

GoogleCodeExporter commented 9 years ago
This looks close!

Let's get rid of the dialog box asking if you really want to rename the file.  
Especially since your only other option is to throw away any changes you've 
made to the sketch, it doesn't really seem to make sense.  

It's weird that the tabs show the .pde extension.  Can we hide that extension 
as well as the .ino one?  Since people might not have even known that .pde was 
the file extension, I'm not sure that showing it helps any (e.g. in terms of 
pointing out that their sketch uses the old extension).  So I think it's 
probably best just to hide it.

That's just a quick review; I'll do more thorough testing on Monday (I hope).

Original comment by dmel...@gmail.com on 10 Sep 2011 at 11:28

GoogleCodeExporter commented 9 years ago
Ok, done both the changes: you can easily revert if you change your mind after 
other testing.

https://github.com/cmaglie/Arduino/commit/131f7898b62d766757f78c1503e815837a0441
a2

Original comment by c.mag...@bug.st on 11 Sep 2011 at 9:48

GoogleCodeExporter commented 9 years ago
Thanks!  I merged this and am marking this issue as fixed, although there are 
still some small bugs.  I'll open new issues for those.  

https://github.com/arduino/Arduino/commit/f77de7e8c02babab3714f108903a4b177024eb
82

Original comment by dmel...@gmail.com on 12 Sep 2011 at 7:20