ccrma / miniAudicle

miniAudicle: integrated development + performance environment for the ChucK programming language
https://chuck.stanford.edu/
GNU General Public License v2.0
65 stars 9 forks source link

fix issue 25: change file extension on format select #34

Closed leanne63 closed 7 years ago

leanne63 commented 7 years ago

Added IBAction for the mAExportAs.xib buttons. When clicked, the extension on the savePanel filename is changed as follows:

mADocumentExporter is using the exportAs... values, rather than the actual filename extension, to determine the export file extension. Therefore, upon saving, the filename extension is changed back to .wav (as expected by mADocumentExporter).

Also upon saving, if no other formats have been selected, exportAsWAV is set to YES. If other formats have been selected, this is left as is. Again, this is because mADocumentExporter is using the exportAs... values, rather than the actual filename extension, to determine the export file extension.

Added property for mAExportAsViewController connection to miniAudicleDocument savePanel so can retrieve the save panel's setAllowedFileTypes method.

spencersalazar commented 7 years ago

Thanks a ton Leanne! This is great. A couple of comments-

leanne63 commented 7 years ago

I'll make those changes and post an update, Spencer.

leanne63 commented 7 years ago
  • if you export once, select something besides or in addition to WAV, and then export a second time, the file path shows ".wav" again instead of .*

The filename now displays the correct extension upon first export and all successive exports.

  • .<error> is a little confusing to me, I think its better to just display nothing (no extension, just the basename) and maybe disable the export button if possible

If no selections exist, the filename (or the default "untitled") is present without any extension. The panel also displays a message noting that format(s) must be selected. The Export button is disabled until at least one selection is made.

Note: An attributed string can't be used for the message text, so the text color and appearance is just plain black. However, the way the message pops up makes it apparent to the user that something must be done, with the text explaining what that is (select formats).

Ah, also note: I noticed the previous code was using spaces, while my code had tabs. To make everything consistent, I switched the tabs to spaces in Xcode for those files I edited.

spencersalazar commented 7 years ago

Awesome thanks again! This is great. I fixed a couple of things before merging-