Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default file extension missing #838

Closed
telephon opened this issue May 6, 2013 · 4 comments
Closed

default file extension missing #838

telephon opened this issue May 6, 2013 · 4 comments

Comments

@telephon
Copy link
Member

telephon commented May 6, 2013

When saving a new file, no file type extension is added unless one specifically selects one. If this happens, one has to manually rename the file, close the old one, and reopen the new one.

I think .scd should be the default.

@jleben
Copy link
Member

jleben commented May 6, 2013

We used to employ mechanisms to provide "scd" as default extension offered by native file-save dialogs, but sadly, they do not work reliably across platforms and cause other issues (see for example #615).

We could add the extension in our code, after the dialog is closed, but that raises complications if the file with the added extension already exists, as the dialog's own "file already exists" warning would not be used, and the file would be overwritten without a warning. We could then implement such a warning on our own, but it would always look a bit different than the native dialog's own warning, and hence inconsistent.

Alternatively, there might be a chance that we can intercept the click on the native dialog's OK button, and modify the filename before the dialog continues its processing, so as to trigger the dialog's own warning.

@muellmusik
Copy link
Contributor

Sensible behaviour would be to display the default extension explicitly and let the user modify if desired, I think. Adding it implicitly seems like bad form. This may be a case where a little platform specific code would be appropriate.

@jleben
Copy link
Member

jleben commented May 6, 2013

The issue #615 was caused by the lack of a way to select default extension in a native dialog without enforcing only that extension. Yes, some platform-specific code might help, although I'm not sure we can tap into native objects instantiated by the Qt framework. Maybe we should instantiate native dialogs with our own native code to begin with.

@telephon
Copy link
Member Author

telephon commented May 6, 2013

on OS X it may be enough to append the string ".scd" to the file name if it doesn't contain a period char?

@jleben jleben closed this as completed in 5e1d376 Jun 21, 2013
jleben added a commit that referenced this issue Jun 21, 2013
[fixes #838]

Since this bypasses the native file selection dialog's check for
file existence, we implement our own check whether the file with
the added extension exists, and warn the user in that case.
sofakid pushed a commit to sofakid/supercollider that referenced this issue Apr 6, 2015
[fixes supercollider#838]

Since this bypasses the native file selection dialog's check for
file existence, we implement our own check whether the file with
the added extension exists, and warn the user in that case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants